pkgsrc-WIP-changes archive

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

sc-im: Different approach re. curses and libdl



Module Name:	pkgsrc-wip
Committed By:	Sijmen J. Mulder <ik%sjmulder.nl@localhost>
Pushed By:	sjmulder
Date:		Tue Dec 18 01:24:11 2018 +0100
Changeset:	3f494917aa5a6ec4c8602a8dc33e8a437b38b9ce

Modified Files:
	sc-im/Makefile
	sc-im/distinfo
	sc-im/patches/patch-src_Makefile

Log Message:
sc-im: Different approach re. curses and libdl

Same idea as with sysutils/nnn: patch src/Makefile to make curses and
libdl flags overridable and then do so with the values from buildlink.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=3f494917aa5a6ec4c8602a8dc33e8a437b38b9ce

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 sc-im/Makefile                   | 10 ++++---
 sc-im/distinfo                   |  2 +-
 sc-im/patches/patch-src_Makefile | 60 ++++++++++++++++++++++++++++++++--------
 3 files changed, 55 insertions(+), 17 deletions(-)

diffs:
diff --git a/sc-im/Makefile b/sc-im/Makefile
index 21afcea667..f0586343e4 100644
--- a/sc-im/Makefile
+++ b/sc-im/Makefile
@@ -17,12 +17,15 @@ INSTALL_DIRS=	src
 
 # pkg-config to avoid broken Makefile self-configuration
 USE_TOOLS+=	gmake pkg-config yacc
+USE_CURSES=	wide
 
 # gnuplot is invoked through the shell, no need to check at compile time
 CFLAGS+=	-DGNUPLOT
 
-# it appears that DL_LIBS isn't otherwise handled by DL_AUTO_VARS
-LDFLAGS+=	${DL_LIBS}
+MAKE_ENV+=	CFLAGS_CURSES=${BUILDLINK_CFLAGS.curses:Q}
+MAKE_ENV+=	LDLIBS_CURSES=${BUILDLINK_LDADD.curses:Q}
+MAKE_ENV+=	CFLAGS_DL=${BUILDLINK_CFLAGS.dl:Q}
+MAKE_ENV+=	LDLIBS_DL=${BUILDLINK_LDADD.dl:Q}
 
 # defaults to scim
 MAKE_FLAGS+=	name=sc-im
@@ -31,7 +34,6 @@ MAKE_FLAGS+=	MANDIR=${PREFIX}/${PKGMANDIR}/man1
 
 .include "options.mk"
 
-.include "../../devel/ncursesw/buildlink3.mk"
-DL_AUTO_VARS=	yes
+.include "../../mk/curses.buildlink3.mk"
 .include "../../mk/dlopen.buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/sc-im/distinfo b/sc-im/distinfo
index 66ca4c9b20..a4ceb010df 100644
--- a/sc-im/distinfo
+++ b/sc-im/distinfo
@@ -4,4 +4,4 @@ SHA1 (sc-im-0.7.0.tar.gz) = 1e8e2ad2f9042c304f57fefb320bb18e76edd398
 RMD160 (sc-im-0.7.0.tar.gz) = 6b13e1dfd46b57dd84d4458fb8bdb509b07d1f1e
 SHA512 (sc-im-0.7.0.tar.gz) = 47bc02d4b698c30a3144733216cfdf57daafb4115e5d49774104c4fedbd22f1ab7e491e1fc16683273c8c5e8820f6caf2389223c4789b9e3f777d57528b76f1b
 Size (sc-im-0.7.0.tar.gz) = 1109887 bytes
-SHA1 (patch-src_Makefile) = 4b0bf7b0e52e242b4c0c23697bd2937ef173779b
+SHA1 (patch-src_Makefile) = 846c4086fada3291301846fa7f03e02762e59d43
diff --git a/sc-im/patches/patch-src_Makefile b/sc-im/patches/patch-src_Makefile
index eed7b57452..3f0cca7a11 100644
--- a/sc-im/patches/patch-src_Makefile
+++ b/sc-im/patches/patch-src_Makefile
@@ -1,25 +1,61 @@
 $NetBSD$
 
-Remove hardcoded -ldl and fix permissions.
-
-Upstream PR for permissions:
-https://github.com/andmarti1424/sc-im/pull/305
+- Fix install permissions
+  https://github.com/andmarti1424/sc-im/pull/305
+- Make libdl and curses flags overridable
 
 --- src/Makefile
 +++ src/Makefile
-@@ -87,11 +87,6 @@ ifneq (, $(shell which gnuplot))
-   CFLAGS += -DGNUPLOT
- endif
+@@ -89,25 +89,27 @@ endif
  
--# dynamic linking (should not be used in FreeBSD
--ifneq ($(shell uname -s),FreeBSD)
+ # dynamic linking (should not be used in FreeBSD
+ ifneq ($(shell uname -s),FreeBSD)
 -  LDLIBS += -ldl
--endif
--
++  LDLIBS_DL ?= -ldl
+ endif
+ 
++LDLIBS += $(LDLIBS_DL)
++
  ifneq (, $(shell which pkg-config))
    # Any system with pkg-config
  
-@@ -141,8 +136,8 @@ install :
+   # NOTE: ncursesw (required)
+   ifeq ($(shell uname -s),Darwin)
+     # macOS' ncurses is built with wide-char support
+-    LDFLAGS += -lncurses
++    LDLIBS_CURSES ?= -lncurses
+   else ifneq ($(shell pkg-config --exists ncursesw || echo 'no'),no)
+-    CFLAGS += $(shell pkg-config --cflags ncursesw)
+-    LDLIBS += $(shell pkg-config --libs ncursesw)
++    CFLAGS_CURSES ?= $(shell pkg-config --cflags ncursesw)
++    LDLIBS_CURSES ?= $(shell pkg-config --libs ncursesw)
+   else ifneq ($(shell pkg-config --exists ncurses || echo 'no'),no)
+     # hopefully this includes wide character support then
+-    CFLAGS += $(shell pkg-config --cflags ncurses)
+-    LDLIBS += $(shell pkg-config --libs ncurses)
++    CFLAGS_CURSES ?= $(shell pkg-config --cflags ncurses)
++    LDLIBS_CURSES ?= $(shell pkg-config --libs ncurses)
+   else
+-    LDLIBS += -lncursesw
++    LDLIBS_CURSES ?= -lncursesw
+   endif
+ 
+   # NOTE: libxml and libzip are required for xlsx file import support
+@@ -128,9 +130,12 @@ else ifeq ($(shell uname -s),Darwin)
+   # macOS without pkg-config
+ 
+   # macOS' ncurses is built with wide-char support
+-  LDFLAGS += -lncurses
++  LDLIBS_CURSES += -lncurses
+ endif
+ 
++CFLAGS += $(CFLAGS_CURSES)
++LDLIBS += $(LDLIBS_CURSES)
++
+ OBJS = $(patsubst %.c, %.o, $(wildcard *.c) $(wildcard utils/*.c)) gram.o
+ 
+ .PHONY : all clean install docs man_install man_uninstall
+@@ -141,8 +146,8 @@ install :
  	install -d $(DESTDIR)$(prefix)/bin
  	install $(name) $(DESTDIR)$(prefix)/bin/$(name)
  	install -d $(DESTDIR)$(HELPDIR)


Home | Main Index | Thread Index | Old Index