summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authorpho <pho@pkgsrc.org>2021-04-29 05:09:08 +0000
committerpho <pho@pkgsrc.org>2021-04-29 05:09:08 +0000
commitca08b746f7572a6ae342cec86c1359d49f21e282 (patch)
treec86045429de06de32c2451db91733d06d4075b90 /lang
parent7500f2572daaf70bd7933bfc71133b47618f4674 (diff)
downloadpkgsrc-ca08b746f7572a6ae342cec86c1359d49f21e282.tar.gz
Eliminate use of @rpath and @loader_path on Darwin
They are essentially equivalent to $ORIGIN of ELF.
Diffstat (limited to 'lang')
-rw-r--r--lang/ghc88/Makefile4
-rw-r--r--lang/ghc88/distinfo6
-rw-r--r--lang/ghc88/patches/patch-rts_ghc.mk14
-rw-r--r--lang/ghc88/patches/patch-rules_build-package-way.mk14
-rw-r--r--lang/ghc88/patches/patch-rules_distdir-way-opts.mk20
5 files changed, 50 insertions, 8 deletions
diff --git a/lang/ghc88/Makefile b/lang/ghc88/Makefile
index d04242e9350..dbf6d5a41ee 100644
--- a/lang/ghc88/Makefile
+++ b/lang/ghc88/Makefile
@@ -1,10 +1,10 @@
-# $NetBSD: Makefile,v 1.18 2021/04/28 15:39:23 pho Exp $
+# $NetBSD: Makefile,v 1.19 2021/04/29 05:09:08 pho Exp $
# -----------------------------------------------------------------------------
# Package metadata
#
DISTNAME= ghc-8.8.4-src
PKGNAME= ${DISTNAME:S/-src$//}
-PKGREVISION= 3
+PKGREVISION= 4
CATEGORIES= lang
MASTER_SITES= https://downloads.haskell.org/~ghc/${PKGVERSION_NOREV}/
EXTRACT_SUFX= .tar.xz
diff --git a/lang/ghc88/distinfo b/lang/ghc88/distinfo
index 67fcca068eb..331c75055c0 100644
--- a/lang/ghc88/distinfo
+++ b/lang/ghc88/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.16 2021/04/28 15:39:23 pho Exp $
+$NetBSD: distinfo,v 1.17 2021/04/29 05:09:08 pho Exp $
SHA1 (ghc-8.4.4-boot-i386-unknown-freebsd.tar.xz) = 04981802730423aa12999e59679be198d540222a
RMD160 (ghc-8.4.4-boot-i386-unknown-freebsd.tar.xz) = f617e67f2c2f07c7211cb391a4bc2e7b304045e2
@@ -46,4 +46,6 @@ SHA1 (patch-libraries_unix_System_Posix_Files_Common.hsc) = 6efef280832d376915a8
SHA1 (patch-libraries_unix_System_Posix_Signals.hsc) = 49215dce493a6bbc440f91a3959e592f86fc779b
SHA1 (patch-libraries_unix_include_execvpe.h) = 67dd9720a71a6a55bbe2b50e61621ca60187ef00
SHA1 (patch-rts_StgCRun.c) = 121c7bd714725d5b14a3cbb03d81b1c769848824
-SHA1 (patch-rules_distdir-way-opts.mk) = 1430f03c2dfc3462a68002c76bfefcf38622429b
+SHA1 (patch-rts_ghc.mk) = 6e3daf71fb7e656131aa2aeeb0346c651520216a
+SHA1 (patch-rules_build-package-way.mk) = ec73df0bbc85e962f76a9068683879a1a1ba1815
+SHA1 (patch-rules_distdir-way-opts.mk) = a058c6428faf02ef94aab3336d2d2874f2726f4e
diff --git a/lang/ghc88/patches/patch-rts_ghc.mk b/lang/ghc88/patches/patch-rts_ghc.mk
new file mode 100644
index 00000000000..3e5b634c683
--- /dev/null
+++ b/lang/ghc88/patches/patch-rts_ghc.mk
@@ -0,0 +1,14 @@
+$NetBSD: patch-rts_ghc.mk,v 1.1 2021/04/29 05:09:08 pho Exp $
+
+This is for Darwin. See the patch to rules/distdir-way-opts.mk.
+
+--- rts/ghc.mk.orig 2021-04-29 03:14:20.000000000 +0000
++++ rts/ghc.mk
+@@ -251,6 +251,7 @@ endif
+ $$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) rts/dist/libs.depend $$(rts_dist_FFI_SO)
+ "$$(RM)" $$(RM_OPTS) $$@
+ "$$(rts_dist_HC)" -this-unit-id rts -shared -dynamic -dynload deploy \
++ -dylib-install-name $$(ghclibdir)/rts/$$(rts_$1_LIB_FILE) \
+ -no-auto-link-packages $$(LIBFFI_LIBS) `cat rts/dist/libs.depend` $$(rts_$1_OBJS) \
+ $$(rts_dist_$1_GHC_LD_OPTS) \
+ $$(rts_$1_DTRACE_OBJS) -o $$@
diff --git a/lang/ghc88/patches/patch-rules_build-package-way.mk b/lang/ghc88/patches/patch-rules_build-package-way.mk
new file mode 100644
index 00000000000..888c0beabd7
--- /dev/null
+++ b/lang/ghc88/patches/patch-rules_build-package-way.mk
@@ -0,0 +1,14 @@
+$NetBSD: patch-rules_build-package-way.mk,v 1.1 2021/04/29 05:09:08 pho Exp $
+
+This is for Darwin. See the patch to rules/distdir-way-opts.mk.
+
+--- rules/build-package-way.mk.orig 2021-04-28 17:51:42.000000000 +0000
++++ rules/build-package-way.mk
+@@ -64,6 +64,7 @@ else # ifneq "$$(TargetOS_CPP)" "mingw32
+ $$($1_$2_$3_LIB) : $$($1_$2_$3_ALL_OBJS) $$(ALL_RTS_LIBS) $$($1_$2_$3_DEPS_LIBS)
+ $$(call cmd,$1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) $$($1_$2_$3_GHC_LD_OPTS) $$($1_$2_$3_ALL_OBJS) \
+ -shared -dynamic -dynload deploy \
++ -dylib-install-name $$(ghclibdir)/$$($1_$2_COMPONENT_ID)/$$($1_$2_$3_LIB_FILE) \
+ $$(addprefix -l,$$($1_$2_EXTRA_LIBRARIES)) $$(addprefix -L,$$($1_$2_EXTRA_LIBDIRS)) \
+ -no-auto-link-packages \
+ -o $$@
diff --git a/lang/ghc88/patches/patch-rules_distdir-way-opts.mk b/lang/ghc88/patches/patch-rules_distdir-way-opts.mk
index e928c3e9971..5438eb160ee 100644
--- a/lang/ghc88/patches/patch-rules_distdir-way-opts.mk
+++ b/lang/ghc88/patches/patch-rules_distdir-way-opts.mk
@@ -1,10 +1,17 @@
-$NetBSD: patch-rules_distdir-way-opts.mk,v 1.3 2021/04/28 15:39:23 pho Exp $
+$NetBSD: patch-rules_distdir-way-opts.mk,v 1.4 2021/04/29 05:09:08 pho Exp $
-Use correct RPATHs.
+Use correct RPATHs. On ELF we replace "$ORIGIN/../{PACKAGE_ID}" with
+the final installation path.
+
+On Darwin library paths work differently. If an executable (or a
+library) A depends on a library B, the installation path of B is first
+embedded in B, and then the path propagates to A at the time when A is
+linked. So we remove -rpath to libraries here, and do the other half
+in rules/build-package-way.mk and rts/ghc.mk.
--- rules/distdir-way-opts.mk.orig 2020-07-08 16:43:04.000000000 +0000
+++ rules/distdir-way-opts.mk
-@@ -209,7 +209,7 @@ ifneq "$4" "0"
+@@ -209,11 +209,10 @@ ifneq "$4" "0"
ifeq "$$(TargetElf)" "YES"
$1_$2_$3_GHC_LD_OPTS += \
-fno-use-rpaths \
@@ -12,4 +19,9 @@ Use correct RPATHs.
+ $$(foreach d,$$($1_$2_TRANSITIVE_DEP_COMPONENT_IDS),-optl-Wl$$(comma)-rpath -optl-Wl$$(comma)$$(ghclibdir)/$$d)
else ifeq "$$(TargetOS_CPP)" "darwin"
$1_$2_$3_GHC_LD_OPTS += \
- -fno-use-rpaths \
+- -fno-use-rpaths \
+- $$(foreach d,$$($1_$2_TRANSITIVE_DEP_COMPONENT_IDS),-optl-Wl$$(comma)-rpath -optl-Wl$$(comma)'@loader_path/../$$d')
++ -fno-use-rpaths
+ endif
+ endif
+ endif