pkgsrc-WIP-changes archive

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

sc-im: Back to injecting *_CURSES, but now ncurses



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

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

Log Message:
sc-im: Back to injecting *_CURSES, but now ncurses

leot suggested removing the macOS workaround, going back to injecting
curses flags directly, but now using ncursesw/buildlink3.mk instead of
mk/curses.buildlink3.mk (since sc-im is imcompatbile with BSD curses).

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

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 | 43 ++++++++++++++++++++++++++++++++++++----
 3 files changed, 43 insertions(+), 12 deletions(-)

diffs:
diff --git a/sc-im/Makefile b/sc-im/Makefile
index 97c536533a..b87467bc92 100644
--- a/sc-im/Makefile
+++ b/sc-im/Makefile
@@ -17,10 +17,13 @@ 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
 
+MAKE_ENV+=	CFLAGS_CURSES=
+MAKE_ENV+=	LDLIBS_CURSES=-lncursesw
 MAKE_ENV+=	CFLAGS_DL=${BUILDLINK_CFLAGS.dl:Q}
 MAKE_ENV+=	LDLIBS_DL=${BUILDLINK_LDADD.dl:Q}
 
@@ -31,13 +34,6 @@ MAKE_FLAGS+=	MANDIR=${PREFIX}/${PKGMANDIR}/man1
 
 .include "options.mk"
 
-# doesn't work with NetBSD curses so explicitly link ncursesw.
-#
-# hardcodes -lncurses on macOS which is expected to have wide char
-# support, so use system ncurses there
-.if ${OPSYS} != "Darwin"
 .include "../../devel/ncursesw/buildlink3.mk"
-.endif
-
 .include "../../mk/dlopen.buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/sc-im/distinfo b/sc-im/distinfo
index 7b242297c8..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) = dab0df4504615dc4532178a0d43e60fc8a5c0a2e
+SHA1 (patch-src_Makefile) = 846c4086fada3291301846fa7f03e02762e59d43
diff --git a/sc-im/patches/patch-src_Makefile b/sc-im/patches/patch-src_Makefile
index 35ee69af2d..3f0cca7a11 100644
--- a/sc-im/patches/patch-src_Makefile
+++ b/sc-im/patches/patch-src_Makefile
@@ -2,11 +2,11 @@ $NetBSD$
 
 - Fix install permissions
   https://github.com/andmarti1424/sc-im/pull/305
-- Make libdl flags overridable
+- Make libdl and curses flags overridable
 
 --- src/Makefile
 +++ src/Makefile
-@@ -89,9 +89,12 @@ endif
+@@ -89,25 +89,27 @@ endif
  
  # dynamic linking (should not be used in FreeBSD
  ifneq ($(shell uname -s),FreeBSD)
@@ -14,13 +14,48 @@ $NetBSD$
 +  LDLIBS_DL ?= -ldl
  endif
  
-+CFLAGS += $(CFLAGS_DL)
 +LDLIBS += $(LDLIBS_DL)
 +
  ifneq (, $(shell which pkg-config))
    # Any system with pkg-config
  
-@@ -141,8 +144,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