pkgsrc-WIP-changes archive

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

sc-im: Replace -ldl BUILDLINK_TRANSFORM



Module Name:	pkgsrc-wip
Committed By:	Sijmen J. Mulder <ik%sjmulder.nl@localhost>
Pushed By:	sjmulder
Date:		Fri Dec 14 00:41:49 2018 +0100
Changeset:	8c0ad03874dfa93427842ac342bb3fe46be27109

Modified Files:
	sc-im/Makefile
	sc-im/distinfo
	sc-im/patches/patch-src_Makefile
Added Files:
	sc-im/hacks.mk

Log Message:
sc-im: Replace -ldl BUILDLINK_TRANSFORM

Use DL_AUTO instead. However, DL_LIBS doesn't seem to be added to
LDFLAGS or LDLIBS so do that manually.

This should be enough but on Debian stable DL_LIBS never gets the -ldl.
DL_LIBS is assigned from BUILDLINK_LIBS.ld, but it's BUILDLINK_LDADD.ld
that dlopen.builtin.mk assigns on my Debian stable test VM. Workaround
in hacks.mk.

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

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

diffstat:
 sc-im/Makefile                   |  7 ++++---
 sc-im/distinfo                   |  2 +-
 sc-im/hacks.mk                   |  9 +++++++++
 sc-im/patches/patch-src_Makefile | 22 +++++++++++++++++++---
 4 files changed, 33 insertions(+), 7 deletions(-)

diffs:
diff --git a/sc-im/Makefile b/sc-im/Makefile
index 3083725d81..21afcea667 100644
--- a/sc-im/Makefile
+++ b/sc-im/Makefile
@@ -21,16 +21,17 @@ USE_TOOLS+=	gmake pkg-config yacc
 # 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}
+
 # defaults to scim
 MAKE_FLAGS+=	name=sc-im
 MAKE_FLAGS+=	prefix=${PREFIX}
 MAKE_FLAGS+=	MANDIR=${PREFIX}/${PKGMANDIR}/man1
 
-# replace hardcoded -ldl with whatever dlopen.buildlink3.mk gives us
-BUILDLINK_TRANSFORM+=	opt:-ldl:${BUILDLINK_LDADD.dl:M*}
-
 .include "options.mk"
 
 .include "../../devel/ncursesw/buildlink3.mk"
+DL_AUTO_VARS=	yes
 .include "../../mk/dlopen.buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/sc-im/distinfo b/sc-im/distinfo
index 78e05cfa93..66ca4c9b20 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) = 07219cb8116066dbe3f4cb219640c1c5302831b1
+SHA1 (patch-src_Makefile) = 4b0bf7b0e52e242b4c0c23697bd2937ef173779b
diff --git a/sc-im/hacks.mk b/sc-im/hacks.mk
new file mode 100644
index 0000000000..b8ee5383cf
--- /dev/null
+++ b/sc-im/hacks.mk
@@ -0,0 +1,9 @@
+# $NetBSD$
+
+# On Debian the build fails due to missing -ldl even though
+# dlopen.buildlink3.mk is imported and USE_BUILTIN.dl resolves to 'yes'.
+#
+# It seems that DL_LIBS is populated from BUILDLINK_LIBS.dl but
+# dlopen.builtin.mk assigns BUILDLINK_DLADD.dl which never ends up in DL_LIBS.
+
+BUILDLINK_LIBS.dl+=	${BUILDLINK_LDADD.dl}
diff --git a/sc-im/patches/patch-src_Makefile b/sc-im/patches/patch-src_Makefile
index 19e2d5dbea..eed7b57452 100644
--- a/sc-im/patches/patch-src_Makefile
+++ b/sc-im/patches/patch-src_Makefile
@@ -1,9 +1,25 @@
-Upstream PR:
+$NetBSD$
+
+Remove hardcoded -ldl and fix permissions.
+
+Upstream PR for permissions:
 https://github.com/andmarti1424/sc-im/pull/305
 
---- src/Makefile.orig
+--- src/Makefile
 +++ src/Makefile
-@@ -141,8 +141,8 @@ install :
+@@ -87,11 +87,6 @@ ifneq (, $(shell which gnuplot))
+   CFLAGS += -DGNUPLOT
+ endif
+ 
+-# dynamic linking (should not be used in FreeBSD
+-ifneq ($(shell uname -s),FreeBSD)
+-  LDLIBS += -ldl
+-endif
+-
+ ifneq (, $(shell which pkg-config))
+   # Any system with pkg-config
+ 
+@@ -141,8 +136,8 @@ install :
  	install -d $(DESTDIR)$(prefix)/bin
  	install $(name) $(DESTDIR)$(prefix)/bin/$(name)
  	install -d $(DESTDIR)$(HELPDIR)


Home | Main Index | Thread Index | Old Index