NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lang/swi-prolog-lite : lighter still



Hello Kathe,

Kathe writes:
> can the swi-prolog-lite package be made even more lighter?
> i saw http://pkgsrc.se/lang/swi-prolog-lite and wondered
> if it's dependence on bash, gmp and readline can be removed.
> thanks.

Mmh, at least for bash I think that it was only needed because in
older versions probably `dotfiles/edit' was installed and needed
bash, but it doesn't seem no longer true for 6.6.6!

Regarding gmp and readline, probably it's a good idea to have them
by default but we can add PKG_OPTIONS so they can be disabled.

The attached patch should address that but I've only slighty tested
it!
(probably the part about `bash' is safe to commit, while the part
about options probably need a look to other swi-prolog packages as
well).
swi-prolog-lite: Avoid no longer needed bash and add `gmp' and `readline' options

- bash was used for `dotfiles/edit' script but the script seems no longer
  present in 6.6.6.
- Add `gmp' and `readline' PKG_OPTIONS, both enabled by default.
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/lang/swi-prolog-lite/Makefile,v
retrieving revision 1.25
diff -u -p -r1.25 Makefile
--- Makefile	18 Aug 2015 07:31:01 -0000	1.25
+++ Makefile	17 Apr 2018 10:09:00 -0000
@@ -1,6 +1,6 @@
 # $NetBSD: Makefile,v 1.25 2015/08/18 07:31:01 wiz Exp $
 
-PKGREVISION= 2
+PKGREVISION= 3
 .include "Makefile.common"
 
 PKGNAME=		swi-prolog-lite-${SWIPLVERS}
@@ -13,8 +13,7 @@ CONFIGURE_DIRS=		src
 
 CONFIGURE_ENV+=		PL=swi-prolog
 CONFIGURE_ENV+=		PLARCH=${MACHINE_GNU_PLATFORM}	# make PLIST consistent
-USE_TOOLS+=		gmake bash:run
-REPLACE_BASH+=		dotfiles/edit
+USE_TOOLS+=		gmake
 
 .include "../../mk/bsd.prefs.mk"
 
@@ -32,9 +31,9 @@ REPLACE_FILES.swipl+=	library/dialect/si
 
 TEST_TARGET=		check
 
+.include "options.mk"
+
 .include "../../devel/ncurses/buildlink3.mk"
 # uses rl_event_hook() interface
-.include "../../devel/readline/buildlink3.mk"
-.include "../../devel/gmp/buildlink3.mk"
 .include "../../mk/pthread.buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
Index: buildlink3.mk
===================================================================
RCS file: /cvsroot/pkgsrc/lang/swi-prolog-lite/buildlink3.mk,v
retrieving revision 1.12
diff -u -p -r1.12 buildlink3.mk
--- buildlink3.mk	18 Aug 2015 07:31:01 -0000	1.12
+++ buildlink3.mk	17 Apr 2018 10:09:00 -0000
@@ -9,9 +9,16 @@ BUILDLINK_API_DEPENDS.swi-prolog-lite+=	
 BUILDLINK_ABI_DEPENDS.swi-prolog-lite+=	swi-prolog-lite>=6.6.6nb2
 BUILDLINK_PKGSRCDIR.swi-prolog-lite?=	../../lang/swi-prolog-lite
 
+pkgbase := swi-prolog
+.include "../../mk/pkg-build-options.mk"
+
 .include "../../devel/ncurses/buildlink3.mk"
+.if !empty(PKG_BUILD_OPTIONS.swi-prolog:Mreadline)
 .include "../../devel/readline/buildlink3.mk"
+.endif
+#.if !empty(PKG_BUILD_OPTIONS.swi-prolog:Mgmp)
 #.include "../../devel/gmp/buildlink3.mk" ?
+#.endif
 .endif	# SWI_PROLOG_LITE_BUILDLINK3_MK
 
 BUILDLINK_TREE+=	-swi-prolog-lite
Index: options.mk
===================================================================
RCS file: options.mk
diff -N options.mk
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ options.mk	17 Apr 2018 10:09:00 -0000
@@ -0,0 +1,21 @@
+# $NetBSD$
+
+PKG_OPTIONS_VAR=		PKG_OPTIONS.swi-prolog
+PKG_SUPPORTED_OPTIONS=		gmp readline
+PKG_SUGGESTED_OPTIONS=		gmp readline
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Mgmp)
+CONFIGURE_ARGS+=	--with-gmp
+.include "../../devel/gmp/buildlink3.mk"
+.else
+CONFIGURE_ARGS+=	--without-gmp
+.endif
+
+.if !empty(PKG_OPTIONS:Mreadline)
+CONFIGURE_ARGS+=	--with-readline
+.include "../../devel/readline/buildlink3.mk"
+.else
+CONFIGURE_ARGS+=	--without-readline
+.endif


Home | Main Index | Thread Index | Old Index