ports/172427: [PATCH] polish/pl-gnugadu2: Converting port to new options framework
Michael Gmelin
freebsd at grem.de
Sun Oct 7 04:20:20 UTC 2012
>Number: 172427
>Category: ports
>Synopsis: [PATCH] polish/pl-gnugadu2: Converting port to new options framework
>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: Sun Oct 07 04:20:17 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator: Michael Gmelin
>Release: FreeBSD 9.0-RELEASE amd64
>Organization:
Grem Equity GmbH
>Environment:
System: FreeBSD bsd64.grem.de 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan 3 07:46:30 UTC
>Description:
The patch below converts the port to use the new options framework[1]
and converts the Makefile header to the new format[2].
The patch is to be applied using:
patch -p0 -E </path/to/patchfile
Note that this patch used the following paradigm to detect plugins:
"If dependency is available and WITHOUT option is not set, set WITH
option". Basically exploiting the WITH/WITHOUT misfeature to allow
users to forcibly turn off plugins. I worked around that by
introducing an AUTODETECT option that's on by default but can be
disabled, so users can manually select the exact set of options they
want.
Not sure if this is the best way to solve this issue, but at least this
way it should be clear to the user what's happening.
No attempts have been made to fix any potential issues the port might
have beyond this scope (e.g. ABI version specifications in LIB_DEPENDS).
See also:
1. http://lists.freebsd.org/pipermail/freebsd-ports/2012-October/078676.html
2. http://lists.freebsd.org/pipermail/freebsd-ports/2012-August/077801.html
Generated with FreeBSD Port Tools 0.99_6 (mode: change, diff: suffix)
>How-To-Repeat:
>Fix:
--- pl-gnugadu2-2.3.0_11.patch begins here ---
diff -ruN --exclude=CVS ../gnugadu2.orig/Makefile ./Makefile
--- ../gnugadu2.orig/Makefile 2012-10-07 02:36:21.095235145 +0200
+++ ./Makefile 2012-10-07 04:06:10.315224836 +0200
@@ -1,9 +1,5 @@
-# Ports collection makefile for: gnugadu2
-# Date created: 12 january 2004
-# Whom: smyru at heron.pl
-#
-# $FreeBSD: ports/polish/gnugadu2/Makefile,v 1.57 2012/06/01 05:23:26 dinoex Exp $
-#
+# Created by: smyru at heron.pl
+# $FreeBSD: $
PORTNAME= gnugadu2
PORTVERSION= 2.3.0
@@ -49,32 +45,41 @@
CPPFLAGS+= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib
-OPTIONS= TLEN "Enable Tlen.pl network plugin" off \
- JABBER "Enable Jabber loudmouth plugin" off \
- DBUS "Enable D-Bus plugin" off \
- DOCKLET "Enable fd.o docklet plugin" on \
- DOCKAPP "Enable WindowMaker dockapp plugin" off \
- GTKSPELL "Enable GTKSpell checker" off \
- XOSD "Enable On-Screen-Display messages" off \
- ARTS "Build with aRts sound server" off \
- ESOUND "Build with esound sound server" off
+OPTIONS_DEFINE= ARTS AUTODETECT DBUS DOCKAPP DOCKLET ESOUND \
+ GTKSPELL JABBER TLEN XOSD
+OPTIONS_DEFAULT=AUTODETECT DOCKLET
-.include <bsd.port.pre.mk>
+AUTODETECT_DESC=Autodetect plugins
+DOCKLET_DESC= Enable fd.o docklet plugin
+DOCKAPP_DESC= Enable WindowMaker dockapp plugin
+GTKSPELL_DESC= Enable GTKSpell checker
+TLEN_DESC= Enable Tlen.pl network plugin
+XOSD_DESC= Enable On-Screen-Display messages
-.if (${HAVE_GNOME:Mesound}!="") && !defined(WITHOUT_ESOUND)
-WITH_ESOUND= yes
-.endif
+#.if ${${HAVE_GNOME:Mesound}!="" && empty(PORT_OPTIONS:MESOUND)
-# does not work with newer dbus versions
-.if exists(${LOCALBASE}/lib/libdbus-1.so) && !defined(WITHOUT_DBUS)
-WITH_DBUS= yes
-.endif
+.include <bsd.port.pre.mk> # can't change this untile HAVE_GNOME has been fixed
-.if exists(${LOCALBASE}/lib/libgtkspell.so) && !defined(WITHOUT_GTKSPELL)
-WITH_GTKSPELL= yes
+.if ${PORT_OPTIONS:MAUTODETECT}
+#detect arts
+.if exists(${LOCALBASE}/lib/libartsc.so) && !${PORT_OPTIONS:MARTS}
+PORT_OPTIONS+= ARTS
+.endif
+#detect dbus - only works with old versions
+.if exists(${LOCALBASE}/lib/libdbus-1.so) && !${PORT_OPTIONS:MDBUS}
+PORT_OPTIONS+= DBUS
+.endif
+#detect esound
+.if ${HAVE_GNOME:Mesound}!="" && !${PORT_OPTIONS:MESOUND}
+PORT_OPTIONS+= ESOUND
+.endif
+#detect gtkspell
+.if exists(${LOCALBASE}/lib/libgtkspell.so) && !${PORT_OPTIONS:MGTKSPELL}
+PORT_OPTIONS+= GTKSPELL
+.endif
.endif
-.if defined(WITH_TLEN)
+.if ${PORT_OPTIONS:MTLEN}
LIB_DEPENDS+= tlen.1:${PORTSDIR}/polish/libtlen
CONFIGURE_ARGS+= --with-tlen
PLIST_SUB+= TLEN:=""
@@ -83,7 +88,7 @@
PLIST_SUB+= TLEN:="@comment "
.endif
-.if defined(WITH_JABBER)
+.if ${PORT_OPTIONS:MJABBER}
LIB_DEPENDS+= loudmouth-1.0:${PORTSDIR}/net-im/loudmouth
CONFIGURE_ARGS+= --with-jabber
PLIST_SUB+= JABBER:=""
@@ -92,7 +97,7 @@
PLIST_SUB+= JABBER:="@comment "
.endif
-.if defined(WITHOUT_DOCKLET)
+.if !${PORT_OPTIONS:MDOCKLET}
CONFIGURE_ARGS+= --without-docklet-system-tray
PLIST_SUB+= DOCKLET:="@comment "
.else
@@ -100,7 +105,7 @@
PLIST_SUB+= DOCKLET:=""
.endif
-.if defined(WITH_DOCKAPP)
+.if ${PORT_OPTIONS:MDOCKAPP}
CONFIGURE_ARGS+= --with-docklet_dockapp
PLIST_SUB+= DOCKAPP:=""
.else
@@ -108,14 +113,14 @@
PLIST_SUB+= DOCKAPP:="@comment "
.endif
-.if defined(WITH_GTKSPELL)
+.if ${PORT_OPTIONS:MGTKSPELL}
LIB_DEPENDS+= gtkspell.0:${PORTSDIR}/textproc/gtkspell
CONFIGURE_ARGS+= --with-gtkspell
.else
CONFIGURE_ARGS+= --without-gtkspell
.endif
-.if defined(WITH_DBUS)
+.if ${PORT_OPTIONS:MDBUS}
LIB_DEPENDS+= dbus-1.3:${PORTSDIR}/devel/dbus
CONFIGURE_ARGS+= --with-dbus \
--with-dbus-dir=${PREFIX}/share/dbus-1/services
@@ -125,7 +130,7 @@
PLIST_SUB+= DBUS:="@comment "
.endif
-.if defined(WITH_ESOUND)
+.if ${PORT_OPTIONS:MESOUND}
PKGNAMESUFFIX= -esound
USE_GNOME+= esound
CONFIGURE_ARGS+= --with-esd
@@ -135,7 +140,7 @@
PLIST_SUB+= ESOUND:="@comment "
.endif
-.if defined(WITH_ARTS)
+.if ${PORT_OPTIONS:MARTS}
LIB_DEPENDS+= artsc.0:${PORTSDIR}/audio/arts
CONFIGURE_ARGS+= --with-arts
PLIST_SUB+= ARTS:=""
@@ -144,7 +149,7 @@
PLIST_SUB+= ARTS:="@comment "
.endif
-.if defined(WITH_XOSD)
+.if ${PORT_OPTIONS:MXOSD}
LIB_DEPENDS+= xosd.4:${PORTSDIR}/misc/xosd
CONFIGURE_ARGS+= --with-xosd
PLIST_SUB+= XOSD:=""
--- pl-gnugadu2-2.3.0_11.patch ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list