pkgsrc-Users archive

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

[PATCH] rlwrap: make python optional



Hello!

So rlwrap is only a small utility and probably shouldn't depend on
both Python and Perl. I think both of these dependencies are just for
optional filter plugins.

I've only included the -python option because I've only tested
building on a system without Python. It works.

Should I add -perl too?

I'm not sure that --enable-python is correct. It's not in the
./configure and I think it just picks up on the system automatically.
What should that be, or how should I ascertain?

And should all the option stuff go inside options.mk?

---
 misc/rlwrap/Makefile   |  4 +++-
 misc/rlwrap/options.mk | 10 +++++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/misc/rlwrap/Makefile b/misc/rlwrap/Makefile
index 27fa4e081..016a4b43e 100644
--- a/misc/rlwrap/Makefile
+++ b/misc/rlwrap/Makefile
@@ -33,12 +33,15 @@ REPLACE_PERL+=	filters/simple_macro
 REPLACE_PERL+=	filters/template
 REPLACE_PERL+=	filters/unbackspace
 
+.if !empty(PKG_OPTIONS:Mpython)
 REPLACE_PYTHON+=	filters/*.py
 REPLACE_PYTHON+=	filters/dissect_prompt
 REPLACE_PYTHON+=	filters/handle_sigwinch
 REPLACE_PYTHON+=	filters/makefilter
 
 PYTHON_VERSIONS_INCOMPATIBLE=	27
+.include "../../lang/python/application.mk"
+.endif
 
 TEST_TARGET=		check
 
@@ -54,6 +57,5 @@ post-install:
 
 BUILDLINK_API_DEPENDS.readline+=readline>=4.2
 .include "../../devel/readline/buildlink3.mk"
-.include "../../lang/python/application.mk"
 .include "../../mk/curses.buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/misc/rlwrap/options.mk b/misc/rlwrap/options.mk
index 7f5744259..cb716a071 100644
--- a/misc/rlwrap/options.mk
+++ b/misc/rlwrap/options.mk
@@ -1,7 +1,7 @@
 # $NetBSD: options.mk,v 1.2 2015/06/06 17:11:43 youri Exp $
 #
 PKG_OPTIONS_VAR=	PKG_OPTIONS.rlwrap
-PKG_SUPPORTED_OPTIONS=	debug
+PKG_SUPPORTED_OPTIONS=	debug python
 PKG_SUGGESTED_OPTIONS=	# empty
 
 .include "../../mk/bsd.options.mk"
@@ -13,3 +13,11 @@ PKG_SUGGESTED_OPTIONS=	# empty
 .if !empty(PKG_OPTIONS:Mdebug)
 CONFIGURE_ARGS+=	--enable-debug
 .endif
+
+###
+### python option
+###
+
+.if !empty(PKG_OPTIONS:Mppython)
+CONFIGURE_ARGS+=	--enable-python
+.endif
-- 
2.47.1



Home | Main Index | Thread Index | Old Index