Hi ports team !
I use the port "net/stable/mldonkey" on a server connected to internet. I need
no X11 packages. For that, i send to you a patch so that it is possible to
build a package mldonkey with the flavor "no_x11".
MLDonkey is a net appliance and it is too bad to install X11 (>40Mb).
I've updated the mldonkey package on -current. I've
updated the Makefile and the pkg/PLIST. I've added the fragment
PFRAG.no-no_x11.
You can find the diff (-uNpr) attached at this email.
I've tried on -current with a
# patch -up1 < diff/mldonkey-no_x11.patch
in the /usr/ports/net/mldonkey/stable directory.
I compile either
# make package (with X11), or
# env FLAVOR=no_x11 make package (w/o X11).
Please be kind it's my first patch :)
Best regards,
Patrick AUGE
diff -uNrp orig/Makefile new/Makefile
--- orig/Makefile Fri Nov 2 05:23:50 2007
+++ new/Makefile Sun May 4 20:05:06 2008
@@ -8,8 +8,7 @@ PERMIT_PACKAGE_FTP= Yes
PERMIT_PACKAGE_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
-WANTLIB= X11 Xext Xi c glib gmodule iconv intl m z pthread \
- freetype png jpeg charset stdc++ fontconfig
+WANTLIB= c m pthread stdc++ z
CONFIGURE_STYLE= autoconf no-autoheader
AUTOCONF_DIR= ${WRKSRC}/config
AUTOCONF_VERSION= 2.61
@@ -22,22 +21,34 @@ MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=mldonkey/}
DISTNAME= mldonkey-2.9.1
EXTRACT_SUFX= .tar.bz2
-CONFIGURE_ARGS+=--enable-gui=newgui1
CONFIGURE_ENV+= CPPFLAGS='-I${LOCALBASE}/include/libpng -I${LOCALBASE}/include -I${X11BASE}/include'
CONFIGURE_ENV+= LDFLAGS='-L${LOCALBASE}/lib -L${X11BASE}/lib'
-USE_X11= Yes
USE_GMAKE= Yes
MODULES= lang/ocaml
-BUILD_DEPENDS= ::x11/lablgtk
-LIB_DEPENDS= gdk.>=1,gtk.>=1::x11/gtk+ \
- bz2::archivers/bzip2 \
- gd::graphics/gd \
+LIB_DEPENDS= bz2::archivers/bzip2 \
magic::devel/libmagic
FAKE_FLAGS= MODOCAML_NATIVE=${MODOCAML_NATIVE}
NO_REGRESS= Yes
+FLAVORS= no_x11
+FLAVOR?=
+
+.if ${FLAVOR:L:Mno_x11}
+CONFIGURE_ENV+= CPPFLAGS='-I${LOCALBASE}/include'
+CONFIGURE_ARGS+=--disable-gd
+.else
+WANTLIB += X11 Xext Xi charset fontconfig freetype glib gmodule \
+ iconv intl jpeg png
+CONFIGURE_ENV+= CPPFLAGS='-I${LOCALBASE}/include/libpng -I${LOCALBASE}/include -I${X11BASE}/include'
+CONFIGURE_ARGS+=--enable-gui=newgui1
+USE_X11= Yes
+BUILD_DEPENDS= ::x11/lablgtk
+LIB_DEPENDS+= gdk.>=1,gtk.>=1::x11/gtk+ \
+ gd::graphics/gd
+.endif
+
post-install:
mkdir -p ${PREFIX}/share/mldonkey
cp -R ${WRKDIST}/distrib ${PREFIX}/share/mldonkey
@@ -46,7 +57,11 @@ post-install:
.include <bsd.port.mk>
.if ${MODOCAML_NATIVE:L} == "yes"
+. if ${FLAVOR:L:Mno_x11}
+strip_binaries=cd ${PREFIX}/bin && strip mlnet
+. else
strip_binaries=cd ${PREFIX}/bin && strip mlnet mlgui mlnet+gui
+. endif
.else
strip_binaries=:
.endif
diff -uNrp orig/pkg/PFRAG.no-no_x11 new/pkg/PFRAG.no-no_x11
--- orig/pkg/PFRAG.no-no_x11 Thu Jan 1 01:00:00 1970
+++ new/pkg/PFRAG.no-no_x11 Sun May 4 00:15:52 2008
@@ -0,0 +1,9 @@
[EMAIL PROTECTED] $OpenBSD: PFRAG.no-no_x11,v 1.0 2008/05/03 21:40:47 Auge Exp $
+bin/mlbt+gui
+bin/mldc+gui
+bin/mldonkey+gui
+bin/mldonkey_gui
+bin/mlgnut+gui
+bin/mlgui
+bin/mlnet+gui
+bin/mlslsk+gui
diff -uNrp orig/pkg/PLIST new/pkg/PLIST
--- orig/pkg/PLIST Thu Aug 2 06:37:20 2007
+++ new/pkg/PLIST Sun May 4 00:34:06 2008
@@ -1,18 +1,11 @@
@comment $OpenBSD: PLIST,v 1.9 2007/07/29 22:13:15 rui Exp $
+!%%no_x11%%
bin/mlbt
-bin/mlbt+gui
bin/mldc
-bin/mldc+gui
bin/mldonkey
-bin/mldonkey+gui
-bin/mldonkey_gui
bin/mlgnut
-bin/mlgnut+gui
-bin/mlgui
bin/mlnet
-bin/mlnet+gui
bin/mlslsk
-bin/mlslsk+gui
share/mldonkey/
share/mldonkey/distrib/
share/mldonkey/distrib/Authors.txt