Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Nov 2009 14:11:37 GMT
From:      Jase Thew <freebsd@beardz.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        miwi@FreeBSD.org
Subject:   ports/140603: [PATCH] irc/weechat: update port options / patch weechat bugs
Message-ID:  <200911161411.nAGEBbQd092429@svr03-bazerka.btshosting.co.uk>
Resent-Message-ID: <200911161430.nAGEU5xI087805@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         140603
>Category:       ports
>Synopsis:       [PATCH] irc/weechat: update port options / patch weechat bugs
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 16 14:30:04 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Jase Thew
>Release:        FreeBSD 6.4-STABLE amd64
>Organization:
>Environment:
System: FreeBSD beastie.beardz.net 6.4-STABLE FreeBSD 6.4-STABLE #0: Sat Oct  3 02:52:57 BST
>Description:

* Add TCL plugin option.
* Add build documentation option.
* Fix incorrect logic for NLS option.
* Remove broken tag from Ruby option.
* Update option conditionals to be more readable

* Remove mandatory dependancies on Ruby, Perl and gettext, add them to
  corresponding options as optional dependancies instead.

* Add missing .pl NLS message catalog to plist.

* Patch configure.in to allow location of tcl configuration to be specified.
  (submitted upstream as patch #6976)
* Patch configure.in to prevent compilation errors/failures with custom
  cflags. (submitted upstream as patch #6977)
* Patch src/plugins/scripts/script.c to handle basename(3) correctly. This
  fixes script_action_install / script_search_by_full_name methods used by
  weeget.py. (submitted upstream as patch #6980 and committed.)

Added file(s):
- files/patch-configure.in
- files/patch-src-plugins-scripts-script_c

Port maintainer (miwi@FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.99
>How-To-Repeat:
>Fix:

--- weechat-0.3.0_1.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/irc/weechat.orig/Makefile /usr/ports/irc/weechat/Makefile
--- /usr/ports/irc/weechat.orig/Makefile	2009-09-09 14:33:00.000000000 +0100
+++ /usr/ports/irc/weechat/Makefile	2009-11-12 20:32:37.000000000 +0000
@@ -7,6 +7,7 @@
 
 PORTNAME=	weechat
 PORTVERSION=	0.3.0
+PORTREVISION=	1
 CATEGORIES=	irc
 MASTER_SITES=	http://weechat.org/files/src/
 
@@ -18,47 +19,50 @@
 USE_AUTOTOOLS=	autoconf:262
 USE_LDCONFIG=	yes
 GNU_CONFIGURE=	yes
-CONFIGURE_ARGS=	--disable-lua --disable-doc
+CONFIGURE_ARGS=	--disable-lua
 CONFIGURE_ENV=	CPPFLAGS="${CPPFLAGS} ${PTHREAD_CFLAGS} -I${LOCALBASE}/include"\
 		LDFLAGS="${LDFLAGS} ${PTHREAD_LIBS} -L${LOCALBASE}/lib"
-USE_PYTHON=	yes
-USE_RUBY=	yes
-USE_GETTEXT=	yes
 WANT_GNOME=	yes
 USE_GNOME=	gnomehack
+WANT_PERL=	yes
 
-OPTIONS=	RUBY "Ruby scripting support." off \
-		PYTHON "Python scripting support." off \
-		PERL "Perl scripting support." off \
-		CHARSET "Charset support." on \
-		DEBUG "Debugging." off \
-		ASPELL "Spell checking." off \
-		GNUTLS "GNU TLS." off \
-		NLS "NLS support" on
+OPTIONS=	RUBY		"Ruby scripting support."	Off	\
+		PYTHON		"Python scripting support."	Off	\
+		PERL		"Perl scripting support."	Off	\
+		TCL		"TCL scripting support."	Off	\
+		CHARSET		"Charset support."		On	\
+		DEBUG		"Debugging."			Off	\
+		ASPELL		"Spell checking."		Off	\
+		GNUTLS		"GNU TLS."			Off	\
+		NLS		"NLS support."			On	\
+		DOCUMENTATION	"Build documentation."		Off
 
-.include <bsd.port.pre.mk>
+.include <bsd.port.options.mk>
 
-.if !defined(WITHOUT_DEBUG)
+.if defined(WITH_DEBUG)
 CONFIGURE_ARGS+=	--with-debug=2
 .else
 CONFIGURE_ARGS+=	--with-debug=0
 .endif
 
-.if !defined(WITHOUT_CHARSET)
+.if defined(WITHOUT_CHARSET)
 CONFIGURE_ARGS+=	--disable-charset
 PLIST_SUB+=	CHARSET="@comment "
 .else
+CONFIGURE_ARGS+=	--enable-charset
 PLIST_SUB+=	CHARSET=""
 .endif
 
-.if !defined(WITHOUT_NLS)
+.if defined(WITHOUT_NLS)
 CONFIGURE_ARGS+=	--disable-nls
 PLIST_SUB+=	NLS="@comment "
 .else
+CONFIGURE_ARGS+=	--enable-nls
+USE_GETTEXT=	yes
 PLIST_SUB+=	NLS=""
 .endif
 
-.if !defined(WITHOUT_ASPELL)
+.if defined(WITH_ASPELL)
 CONFIGURE_ARGS+=	--enable-aspell
 BUILD_DEPENDS+=	aspell:${PORTSDIR}/textproc/aspell
 PLIST_SUB+=	ASPELL=""
@@ -67,31 +71,33 @@
 PLIST_SUB+=	ASPELL="@comment "
 .endif
 
-.if !defined(WITHOUT_PYTHON)
+.if defined(WITH_PYTHON)
 CONFIGURE_ARGS+=	--enable-python
+USE_PYTHON=	yes
 PLIST_SUB+=	PYTHON=""
 .else
 CONFIGURE_ARGS+=	--disable-python
 PLIST_SUB+=	PYTHON="@comment "
 .endif
 
-.if !defined(WITHOUT_RUBY)
-BROKEN=		Ruby support is broken
+.if defined(WITH_RUBY)
+.include "${PORTSDIR}/Mk/bsd.ruby.mk"
 CONFIGURE_ARGS+=	--enable-ruby
+USE_RUBY=	yes
 PLIST_SUB+=	RUBY=""
 .else
 CONFIGURE_ARGS+=	--disable-ruby
 PLIST_SUB+=	RUBY="@comment "
 .endif
 
-.if !defined(WITHOUT_GNUTLS)
+.if defined(WITH_GNUTLS)
 CONFIGURE_ARGS+=	--enable-gnutls
 LIB_DEPENDS+=	gnutls.40:${PORTSDIR}/security/gnutls
 .else
 CONFIGURE_ARGS+=	--disable-gnutls
 .endif
 
-.if !defined(WITHOUT_PERL)
+.if defined(WITH_PERL)
 CONFIGURE_ARGS+=	--enable-perl
 USE_PERL5=	yes
 PLIST_SUB+=	PERL=""
@@ -100,7 +106,29 @@
 PLIST_SUB+=	PERL="@comment "
 .endif
 
+.if defined(WITH_TCL)
+USE_TCL=	83+
+.include "${PORTSDIR}/Mk/bsd.tcl.mk"
+CONFIGURE_ARGS+=	--enable-tcl
+CONFIGURE_ARGS+=	--with-tclconfig=${LOCALBASE}/lib/tcl${TCL_VER}
+PLIST_SUB+=	TCL=""
+.else
+CONFIGURE_ARGS+=	--disable-tcl
+PLIST_SUB+=	TCL="@comment "
+.endif
+
+.if defined(WITH_DOCUMENTATION)
+CONFIGURE_ARGS+=	--enable-doc
+BUILD_DEPENDS+=	asciidoc:${PORTSDIR}/textproc/asciidoc
+BUILD_DEPENDS+=	source-highlight:${PORTSDIR}/textproc/source-highlight
+PLIST_SUB+=	DOCUMENTATION=""
+MAN1=		weechat-curses.1
+.else
+CONFIGURE_ARGS+=	--disable-doc
+PLIST_SUB+=	DOCUMENTATION="@comment "
+.endif
+
 post-patch:
 	@${REINPLACE_CMD} -e 's|2.61|2.62|g' ${WRKSRC}/aclocal.m4
 
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff -ruN --exclude=CVS /usr/ports/irc/weechat.orig/files/patch-configure.in /usr/ports/irc/weechat/files/patch-configure.in
--- /usr/ports/irc/weechat.orig/files/patch-configure.in	1970-01-01 01:00:00.000000000 +0100
+++ /usr/ports/irc/weechat/files/patch-configure.in	2009-11-12 14:46:56.000000000 +0000
@@ -0,0 +1,29 @@
+--- configure.in.orig	2009-09-06 08:01:26.000000000 +0000
++++ configure.in	2009-11-12 14:46:30.000000000 +0000
+@@ -137,6 +137,7 @@
+ AC_ARG_WITH(lua-inc,        [  --with-lua-inc=DIR,     lua include files are in DIR (default=autodetect)],lua_inc=$withval,lua_inc='')
+ AC_ARG_WITH(lua-lib,        [  --with-lua-lib=DIR,     lua library files are in DIR (default=autodetect)],lua_lib=$withval,lua_lib='')
+ AC_ARG_WITH(lua-suffix,     [  --with-lua-suffix=ARG   lua is suffixed with ARG (default=autodetect)],lua_suffix=$withval,lua_suffix='')
++AC_ARG_WITH(tclconfig,      [  --with-tclconfig=DIR    directory containing tcl configuration (tclConfig.sh)],tclconfig=$withval,tclconfig='')
+ AC_ARG_ENABLE(doc,          [  --disable-doc           turn off documentation (default=built)],enable_doc=$enableval,enable_doc=yes)
+ AC_ARG_WITH(debug,          [  --with-debug            debugging: 0=no debug, 1=debug compilation (default=1)],debug=$withval,debug=1)
+ 
+@@ -682,6 +683,9 @@
+     AC_MSG_CHECKING(for tclConfig.sh)
+     tcl_found="no"
+     tcl_dirs="/lib /usr/lib /usr/tcl/lib /usr/lib/tcl8.5 /usr/lib/tcl8.4 /usr/lib/tcl8.3 /usr/local/lib /usr/local/tcl-8.5/lib /usr/local/tcl-8.4/lib /usr/local/tcl-8.3/lib /usr/local/tcl/lib /opt/lib"
++    if test "x$tclconfig" != "x" ; then
++        tcl_dirs="$tclconfig $tcl_dirs"
++    fi
+     for tcl_dir in $tcl_dirs ; do
+         if test -f ${tcl_dir}/tclConfig.sh ; then
+             . ${tcl_dir}/tclConfig.sh
+@@ -870,7 +874,7 @@
+     AC_MSG_RESULT(no)
+ fi
+ 
+-CFLAGS=`echo $CFLAGS | sed 's/ -g //g'`
++CFLAGS=`echo $CFLAGS | sed 's/ -g / /g'`
+ CFLAGS=`echo $CFLAGS | sed 's/^-g //g'`
+ CFLAGS=`echo $CFLAGS | sed 's/ -g$//g'`
+ CFLAGS=`echo $CFLAGS | sed 's/^-g$//g'`
diff -ruN --exclude=CVS /usr/ports/irc/weechat.orig/files/patch-src-plugins-scripts-script_c /usr/ports/irc/weechat/files/patch-src-plugins-scripts-script_c
--- /usr/ports/irc/weechat.orig/files/patch-src-plugins-scripts-script_c	1970-01-01 01:00:00.000000000 +0100
+++ /usr/ports/irc/weechat/files/patch-src-plugins-scripts-script_c	2009-11-16 12:09:08.000000000 +0000
@@ -0,0 +1,168 @@
+--- src/plugins/scripts/script.c.orig	2009-09-04 08:25:47.000000000 +0000
++++ src/plugins/scripts/script.c	2009-11-16 12:08:54.000000000 +0000
+@@ -439,24 +439,15 @@
+ script_search_by_full_name (struct t_plugin_script *scripts,
+                             const char *full_name)
+ {
+-    char *full_name_copy, *base_name;
++    char *base_name;
+     struct t_plugin_script *ptr_script;
+     
+-    full_name_copy = strdup (full_name);
+-    
+-    if (full_name_copy)
++    for (ptr_script = scripts; ptr_script;
++         ptr_script = ptr_script->next_script)
+     {
+-        for (ptr_script = scripts; ptr_script;
+-             ptr_script = ptr_script->next_script)
+-        {
+-            base_name = basename (ptr_script->filename);
+-            if (strcmp (base_name, full_name) == 0)
+-            {
+-                free (full_name_copy);
+-                return ptr_script;
+-            }
+-        }
+-        free (full_name_copy);
++        base_name = basename (ptr_script->filename);
++        if (strcmp (base_name, full_name) == 0)
++            return ptr_script;
+     }
+     
+     /* script not found */
+@@ -915,7 +906,8 @@
+                        int (*script_load)(const char *filename),
+                        char **list)
+ {
+-    char **argv, *name, *base_name, *new_path, *autoload_path, *symlink_path;
++    char **argv, *name, *ptr_base_name, *base_name, *new_path, *autoload_path;
++    char *symlink_path;
+     const char *dir_home, *dir_separator;
+     int argc, i, length;
+     struct t_plugin_script *ptr_script;
+@@ -930,67 +922,71 @@
+                 name = strdup (argv[i]);
+                 if (name)
+                 {
+-                    base_name = basename (name);
+-                    
+-                    /* unload script, if script is loaded */
+-                    ptr_script = script_search_by_full_name (scripts, base_name);
+-                    if (ptr_script)
+-                        (*script_unload) (ptr_script);
++                    ptr_base_name = basename (name);
++                    base_name = strdup (ptr_base_name);
++                    if (base_name)
++                    {
++                        /* unload script, if script is loaded */
++                        ptr_script = script_search_by_full_name (scripts, base_name);
++                        if (ptr_script)
++                            (*script_unload) (ptr_script);
+                     
+-                    /* remove script file(s) */
+-                    script_remove_file (weechat_plugin, base_name, 0);
++                        /* remove script file(s) */
++                        script_remove_file (weechat_plugin, base_name, 0);
+                     
+-                    /* move file from install dir to language dir */
+-                    dir_home = weechat_info_get ("weechat_dir", "");
+-                    length = strlen (dir_home) + strlen (weechat_plugin->name) +
+-                        strlen (base_name) + 16;
+-                    new_path = malloc (length);
+-                    if (new_path)
+-                    {
+-                        snprintf (new_path, length, "%s/%s/%s",
+-                                  dir_home, weechat_plugin->name, base_name);
+-                        if (rename (name, new_path) == 0)
++                        /* move file from install dir to language dir */
++                        dir_home = weechat_info_get ("weechat_dir", "");
++                        length = strlen (dir_home) + strlen (weechat_plugin->name) +
++                            strlen (base_name) + 16;
++                        new_path = malloc (length);
++                        if (new_path)
+                         {
+-                            /* make link in autoload dir */
+-                            length = strlen (dir_home) +
+-                                strlen (weechat_plugin->name) + 8 +
+-                                strlen (base_name) + 16;
+-                            autoload_path = malloc (length);
+-                            if (autoload_path)
++                            snprintf (new_path, length, "%s/%s/%s",
++                                      dir_home, weechat_plugin->name, base_name);
++                            if (rename (name, new_path) == 0)
+                             {
+-                                snprintf (autoload_path, length,
+-                                          "%s/%s/autoload/%s",
+-                                          dir_home, weechat_plugin->name,
+-                                          base_name);
+-                                dir_separator = weechat_info_get ("dir_separator", "");
+-                                length = 2 + strlen (dir_separator) +
+-                                    strlen (base_name) + 1;
+-                                symlink_path = malloc (length);
+-                                if (symlink_path)
++                                /* make link in autoload dir */
++                                length = strlen (dir_home) +
++                                    strlen (weechat_plugin->name) + 8 +
++                                    strlen (base_name) + 16;
++                                autoload_path = malloc (length);
++                                if (autoload_path)
+                                 {
+-                                    snprintf (symlink_path, length, "..%s%s",
+-                                              dir_separator, base_name);
+-                                    symlink (symlink_path, autoload_path);
+-                                    free (symlink_path);
+-                                }
++                                    snprintf (autoload_path, length,
++                                              "%s/%s/autoload/%s",
++                                              dir_home, weechat_plugin->name,
++                                              base_name);
++                                    dir_separator = weechat_info_get ("dir_separator", "");
++                                    length = 2 + strlen (dir_separator) +
++                                        strlen (base_name) + 1;
++                                    symlink_path = malloc (length);
++                                    if (symlink_path)
++                                    {
++                                        snprintf (symlink_path, length, "..%s%s",
++                                                  dir_separator, base_name);
++                                        symlink (symlink_path, autoload_path);
++                                        free (symlink_path);
++                                    }
+                                 free (autoload_path);
+-                            }
++                                }
+                             
+-                            /* load script */
+-                            (*script_load) (new_path);
+-                        }
+-                        else
+-                        {
+-                            weechat_printf (NULL,
+-                                            _("%s%s: failed to move script %s "
+-                                              "to %s (%s)"),
+-                                            weechat_prefix ("error"),
+-                                            weechat_plugin->name,
+-                                            name,
+-                                            new_path,
+-                                            strerror (errno));
++                                /* load script */
++                                (*script_load) (new_path);
++                            }
++                            else
++                            {
++                                weechat_printf (NULL,
++                                                _("%s%s: failed to move script %s "
++                                                  "to %s (%s)"),
++                                                weechat_prefix ("error"),
++                                                weechat_plugin->name,
++                                                name,
++                                                new_path,
++                                                strerror (errno));
++                            }
++                            free (new_path);
+                         }
+-                        free (new_path);
++                        free (base_name);
+                     }
+                     free (name);
+                 }
diff -ruN --exclude=CVS /usr/ports/irc/weechat.orig/pkg-plist /usr/ports/irc/weechat/pkg-plist
--- /usr/ports/irc/weechat.orig/pkg-plist	2009-09-09 14:33:00.000000000 +0100
+++ /usr/ports/irc/weechat/pkg-plist	2009-11-16 10:20:31.000000000 +0000
@@ -24,25 +24,51 @@
 lib/weechat/plugins/logger.la
 lib/weechat/plugins/logger.so
 lib/weechat/plugins/logger.so.0
-%%NLS%%share/locale/de/LC_MESSAGES/weechat.mo
-%%NLS%%share/locale/es/LC_MESSAGES/weechat.mo
-%%NLS%%share/locale/fr/LC_MESSAGES/weechat.mo
-%%NLS%%share/locale/hu/LC_MESSAGES/weechat.mo
-%%NLS%%share/locale/ru/LC_MESSAGES/weechat.mo
-%%NLS%%share/locale/cs/LC_MESSAGES/weechat.mo
-%%PYTHON%%lib/weechat/plugins/python.a
-%%PYTHON%%lib/weechat/plugins/python.la
-%%PYTHON%%lib/weechat/plugins/python.so
-%%PYTHON%%lib/weechat/plugins/python.so.0
 %%PERL%%lib/weechat/plugins/perl.a
 %%PERL%%lib/weechat/plugins/perl.la
 %%PERL%%lib/weechat/plugins/perl.so
 %%PERL%%lib/weechat/plugins/perl.so.0
+%%PYTHON%%lib/weechat/plugins/python.a
+%%PYTHON%%lib/weechat/plugins/python.la
+%%PYTHON%%lib/weechat/plugins/python.so
+%%PYTHON%%lib/weechat/plugins/python.so.0
+%%RUBY%%lib/weechat/plugins/ruby.a
+%%RUBY%%lib/weechat/plugins/ruby.la
+%%RUBY%%lib/weechat/plugins/ruby.so
+%%RUBY%%lib/weechat/plugins/ruby.so.0
+%%TCL%%lib/weechat/plugins/tcl.so.0
+%%TCL%%lib/weechat/plugins/tcl.so
+%%TCL%%lib/weechat/plugins/tcl.la
+%%TCL%%lib/weechat/plugins/tcl.a
 lib/weechat/plugins/xfer.a
 lib/weechat/plugins/xfer.la
 lib/weechat/plugins/xfer.so
 lib/weechat/plugins/xfer.so.0
 libdata/pkgconfig/weechat.pc
+%%DOCUMENTATION%%share/doc/weechat/weechat_faq.en.html
+%%DOCUMENTATION%%share/doc/weechat/weechat_plugin_api.en.html
+%%DOCUMENTATION%%share/doc/weechat/weechat_quickstart.en.html
+%%DOCUMENTATION%%share/doc/weechat/weechat_scripting.en.html
+%%DOCUMENTATION%%share/doc/weechat/weechat_tester.en.html
+%%DOCUMENTATION%%share/doc/weechat/weechat_user.en.html
+%%DOCUMENTATION%%share/doc/weechat/weechat_faq.fr.html
+%%DOCUMENTATION%%share/doc/weechat/weechat_plugin_api.fr.html
+%%DOCUMENTATION%%share/doc/weechat/weechat_quickstart.fr.html
+%%DOCUMENTATION%%share/doc/weechat/weechat_scripting.fr.html
+%%DOCUMENTATION%%share/doc/weechat/weechat_tester.fr.html
+%%DOCUMENTATION%%share/doc/weechat/weechat_user.fr.html
+%%DOCUMENTATION%%share/doc/weechat/weechat_faq.pl.html
+%%DOCUMENTATION%%share/doc/weechat/weechat_quickstart.pl.html
+%%DOCUMENTATION%%share/doc/weechat/weechat_tester.pl.html
+%%DOCUMENTATION%%share/doc/weechat/weechat_quickstart.de.html
+%%NLS%%share/locale/de/LC_MESSAGES/weechat.mo
+%%NLS%%share/locale/es/LC_MESSAGES/weechat.mo
+%%NLS%%share/locale/fr/LC_MESSAGES/weechat.mo
+%%NLS%%share/locale/hu/LC_MESSAGES/weechat.mo
+%%NLS%%share/locale/ru/LC_MESSAGES/weechat.mo
+%%NLS%%share/locale/cs/LC_MESSAGES/weechat.mo
+%%NLS%%share/locale/pl/LC_MESSAGES/weechat.mo
 @dirrmtry lib/weechat/plugins
 @dirrmtry lib/weechat
+@dirrmtry share/doc/weechat
 @dirrm include/weechat
--- weechat-0.3.0_1.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200911161411.nAGEBbQd092429>