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

2018-04-18 Thread Kathe
> From bounces-netbsd-users-owner-kathe=sdf@netbsd.org Tue Apr 17 11:03:13 
> 2018
> From: Leonardo Taccari <l...@netbsd.org>
> To: netbsd-users@netbsd.org
> Subject: Re: lang/swi-prolog-lite : lighter still
> Comments: In-reply-to Leonardo Taccari <l...@netbsd.org>
>message dated "Tue, 17 Apr 2018 12:20:57 +0200."
> Content-ID: <28503.1523962952.1@boh>
> Sender: netbsd-users-ow...@netbsd.org
>
> Leonardo Taccari writes:
> > [...]
> > 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!
> > [...]
>
> Whoops, sorry, I am wrong, at least library/prolog_pack.pl needs
> bash.
>

checked, library/prolog_pack.pl is swipl's package manager.
doesn't look like it's necessary in lite mode.
thanks for looking into swipl per my request. :)


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

2018-04-17 Thread Leonardo Taccari
Leonardo Taccari writes:
> [...]
> 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!
> [...]

Whoops, sorry, I am wrong, at least library/prolog_pack.pl needs
bash.


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

2018-04-17 Thread Leonardo Taccari
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 -	1.25
+++ Makefile	17 Apr 2018 10:09:00 -
@@ -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 -	1.12
+++ buildlink3.mk	17 Apr 2018 10:09:00 -
@@ -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 -
+++ options.mk	17 Apr 2018 10:09:00 -
@@ -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


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

2018-04-17 Thread Kathe
neither do i have the skills, nor the knowledge. :(

> From bounces-netbsd-users-owner-kathe=sdf@netbsd.org Tue Apr 17 09:39:49 
> 2018
> From: Benny Siegert <bsieg...@gmail.com>
> Subject: Re: lang/swi-prolog-lite : lighter still
> To: ka...@sdf.org
> Cc: netbsd-users@netbsd.org
> Sender: netbsd-users-ow...@netbsd.org
>
> Would you be willing to submit a patch and send a PR?
>
> On Tue, Apr 17, 2018 at 10:05 AM Kathe <ka...@sdf.org> wrote:
>
> > 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.
>
>
>
> --
> Benny
>


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

2018-04-17 Thread Benny Siegert
Would you be willing to submit a patch and send a PR?

On Tue, Apr 17, 2018 at 10:05 AM Kathe  wrote:

> 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.



--
Benny


lang/swi-prolog-lite : lighter still

2018-04-17 Thread Kathe
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.