pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/lang/ghc810 Port the $ORIGIN removal patch from ghc88



details:   https://anonhg.NetBSD.org/pkgsrc/rev/daf77ce8541c
branches:  trunk
changeset: 451762:daf77ce8541c
user:      pho <pho%pkgsrc.org@localhost>
date:      Sat May 01 04:43:57 2021 +0000

description:
Port the $ORIGIN removal patch from ghc88

diffstat:

 lang/ghc810/DESCR                                    |   5 ++-
 lang/ghc810/Makefile                                 |  22 ++--------------
 lang/ghc810/bootstrap.mk                             |   4 +-
 lang/ghc810/buildlink3.mk                            |   4 +-
 lang/ghc810/distinfo                                 |   6 +++-
 lang/ghc810/patches/patch-ghc.mk                     |  16 +++++++++++
 lang/ghc810/patches/patch-rts_ghc.mk                 |  14 ++++++++++
 lang/ghc810/patches/patch-rules_build-package-way.mk |  14 ++++++++++
 lang/ghc810/patches/patch-rules_distdir-way-opts.mk  |  27 ++++++++++++++++++++
 9 files changed, 87 insertions(+), 25 deletions(-)

diffs (206 lines):

diff -r ebc331fa6352 -r daf77ce8541c lang/ghc810/DESCR
--- a/lang/ghc810/DESCR Sat May 01 03:54:14 2021 +0000
+++ b/lang/ghc810/DESCR Sat May 01 04:43:57 2021 +0000
@@ -9,4 +9,7 @@
 generational garbage collector, a space and time profiler, and a
 comprehensive set of libraries.
 
-This package provides the 8.10.x release series.
+This package provides the 8.10.x release series which have been
+superseded by GHC 9.0.x (lang/ghc90). There is basically no reason why
+one would want to use this anymore, as GHC 9 can also be bootstrapped
+using GHC 8.8.
diff -r ebc331fa6352 -r daf77ce8541c lang/ghc810/Makefile
--- a/lang/ghc810/Makefile      Sat May 01 03:54:14 2021 +0000
+++ b/lang/ghc810/Makefile      Sat May 01 04:43:57 2021 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.3 2021/04/27 13:55:25 pho Exp $
+# $NetBSD: Makefile,v 1.4 2021/05/01 04:43:57 pho Exp $
 # -----------------------------------------------------------------------------
 # Package metadata
 #
 DISTNAME=      ghc-8.10.4-src
-PKGREVISION=   1
+PKGREVISION=   2
 PKGNAME=       ${DISTNAME:S/-src$//}
 CATEGORIES=    lang
 MASTER_SITES=  https://downloads.haskell.org/~ghc/${PKGVERSION_NOREV}/
@@ -202,22 +202,6 @@
 # There is an unused script which don't pass the portability test.
 CHECK_PORTABILITY_SKIP+=       distrib/prep-bin-dist-mingw
 
-# Dynamically linked Haskell executables and libraries have rpaths to
-# dependent Haskell libraries, but the problem is that they are
-# specified with $ORIGIN, which isn't currently supported by
-# ../../mk/check/check-shlibs-elf.awk nor
-# mk/pkgformat/pkg/metadata.mk.
-#
-# This means we need to disable the entire CHECK_SHLIBS machinery
-# because otherwise the resulting binary package would contain
-# REQUIRES lines with $ORIGIN wrongly expanded by ldd(1).
-#
-# Note that arguments like "-Wl,-rpath,$ORIGIN/.." are usually dropped
-# by the "cleanup" phase of wrappers. This is not the case in GHC
-# because GHC uses @file syntax while linking objects, and our
-# wrappers does nothing about it.
-CHECK_SHLIBS_SUPPORTED=        no
-
 # ghc57207_0.s: failed to add inputs for merge: Resource temporarily unavailable
 CTF_FILES_SKIP+=               */libHS*-ghc${PKGVERSION_NOREV}.*
 
@@ -242,7 +226,7 @@
 # In a sandboxed build environment, we have to reach over to the
 # installed libraries themselves, since the symlinks compat80 adds
 # to the /usr tree can't be applied.
-ALL_ENV+=      LD_LIBRARY_PATH=${PREFIX}/emul/netbsd/usr/lib:${WRKDIR}/lib:${FILESDIR}
+ALL_ENV+=      LD_LIBRARY_PATH=${PREFIX}/emul/netbsd/usr/lib:${WRKDIR}/lib
 .endif
 
 .include "../../converters/libiconv/buildlink3.mk"
diff -r ebc331fa6352 -r daf77ce8541c lang/ghc810/bootstrap.mk
--- a/lang/ghc810/bootstrap.mk  Sat May 01 03:54:14 2021 +0000
+++ b/lang/ghc810/bootstrap.mk  Sat May 01 04:43:57 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bootstrap.mk,v 1.1 2021/02/09 13:16:24 ryoon Exp $
+# $NetBSD: bootstrap.mk,v 1.2 2021/05/01 04:43:57 pho Exp $
 # -----------------------------------------------------------------------------
 # Select a bindist of bootstrapping compiler on a per-platform basis.
 #
@@ -54,7 +54,7 @@
 BOOT_VERSION:= 8.8.4
 BOOT_ARCHIVE:= ghc-${BOOT_VERSION}-boot-x86_64-unknown-netbsd.tar.xz
 DISTFILES:=    ${DISTFILES} ${BOOT_ARCHIVE} # Available in LOCAL_PORTS
-.  if !empty(MACHINE_PLATFORM:MNetBSD-9.99*-x86_64) || make(distinfo) || make (makesum) || make(mdi)
+.  if !empty(MACHINE_PLATFORM:MNetBSD-9.99.*-x86_64) || make(distinfo) || make (makesum) || make(mdi)
 DISTFILES+=    netbsd-9.0-amd64-libterminfo.tar.gz
 EXTRACT_ONLY+= netbsd-9.0-amd64-libterminfo.tar.gz
 .  endif
diff -r ebc331fa6352 -r daf77ce8541c lang/ghc810/buildlink3.mk
--- a/lang/ghc810/buildlink3.mk Sat May 01 03:54:14 2021 +0000
+++ b/lang/ghc810/buildlink3.mk Sat May 01 04:43:57 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.2 2021/02/25 10:36:52 nia Exp $
+# $NetBSD: buildlink3.mk,v 1.3 2021/05/01 04:43:57 pho Exp $
 
 BUILDLINK_TREE+=       ghc
 
@@ -7,7 +7,7 @@
 
 BUILDLINK_API_DEPENDS.ghc+=    ghc>=8.10<8.11
 BUILDLINK_ABI_DEPENDS.ghc+=    ghc>=8.10<8.11
-BUILDLINK_PKGSRCDIR.ghc?=      ../../lang/ghc88
+BUILDLINK_PKGSRCDIR.ghc?=      ../../lang/ghc810
 
 .include "../../converters/libiconv/buildlink3.mk"
 .include "../../devel/libffi/buildlink3.mk"
diff -r ebc331fa6352 -r daf77ce8541c lang/ghc810/distinfo
--- a/lang/ghc810/distinfo      Sat May 01 03:54:14 2021 +0000
+++ b/lang/ghc810/distinfo      Sat May 01 04:43:57 2021 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.2 2021/02/16 15:41:10 ryoon Exp $
+$NetBSD: distinfo,v 1.3 2021/05/01 04:43:57 pho Exp $
 
 SHA1 (ghc-8.10.4-src.tar.xz) = 41f242d2bb2509c63bedbd6751b2b142ae65ba3e
 RMD160 (ghc-8.10.4-src.tar.xz) = 9b7ab19c21229f0c565c19e851323529c4184f4b
@@ -14,6 +14,7 @@
 Size (netbsd-9.0-amd64-libterminfo.tar.gz) = 27744 bytes
 SHA1 (patch-aclocal.m4) = 16ac8899a7d87cf93a6139edba9e5222eb4c5c66
 SHA1 (patch-configure.ac) = 5d33ac8e1a9ab2f729bf5580eddfd87c9fed386a
+SHA1 (patch-ghc.mk) = fdcbc5b0c48b616eb96868e49681536d773eaddd
 SHA1 (patch-libraries_Cabal_Cabal_Distribution_Simple_GHC.hs) = a4c82b1282c0580a7945be8c3b9d38bc760db99f
 SHA1 (patch-libraries_base_GHC_Event_KQueue.hsc) = 8ee5da667a241a05fde3c580d3dc9bdc05aa5f00
 SHA1 (patch-libraries_base_System_CPUTime_Posix_Times.hsc) = 2bfb779d534d12073287274ce5e90b99e457a860
@@ -27,3 +28,6 @@
 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-rts_ghc.mk) = 6e3daf71fb7e656131aa2aeeb0346c651520216a
+SHA1 (patch-rules_build-package-way.mk) = ec73df0bbc85e962f76a9068683879a1a1ba1815
+SHA1 (patch-rules_distdir-way-opts.mk) = a058c6428faf02ef94aab3336d2d2874f2726f4e
diff -r ebc331fa6352 -r daf77ce8541c lang/ghc810/patches/patch-ghc.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/ghc810/patches/patch-ghc.mk  Sat May 01 04:43:57 2021 +0000
@@ -0,0 +1,16 @@
+$NetBSD: patch-ghc.mk,v 1.1 2021/05/01 04:43:57 pho Exp $
+
+Use the wrapper scripts for ghc as we can't use the ones from the DESTDIR
+as the libraries are not in the right place yet.
+
+--- ghc.mk.orig        2021-01-25 16:30:28.000000000 +0000
++++ ghc.mk
+@@ -938,7 +938,7 @@ endif
+ 
+ INSTALLED_PACKAGE_CONF=$(DESTDIR)$(topdir)/package.conf.d
+ 
+-ifeq "$(BINDIST) $(CrossCompiling)" "NO YES"
++ifeq "$(BINDIST)" "NO"
+ # when installing ghc-stage2 we can't run target's
+ # 'ghc-pkg' and 'ghc-stage2' but those are needed for registration.
+ INSTALLED_GHC_REAL=$(TOP)/inplace/bin/ghc-stage1
diff -r ebc331fa6352 -r daf77ce8541c lang/ghc810/patches/patch-rts_ghc.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/ghc810/patches/patch-rts_ghc.mk      Sat May 01 04:43:57 2021 +0000
@@ -0,0 +1,14 @@
+$NetBSD: patch-rts_ghc.mk,v 1.1 2021/05/01 04:43:57 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 -r ebc331fa6352 -r daf77ce8541c lang/ghc810/patches/patch-rules_build-package-way.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/ghc810/patches/patch-rules_build-package-way.mk      Sat May 01 04:43:57 2021 +0000
@@ -0,0 +1,14 @@
+$NetBSD: patch-rules_build-package-way.mk,v 1.1 2021/05/01 04:43:57 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 -r ebc331fa6352 -r daf77ce8541c lang/ghc810/patches/patch-rules_distdir-way-opts.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/ghc810/patches/patch-rules_distdir-way-opts.mk       Sat May 01 04:43:57 2021 +0000
@@ -0,0 +1,27 @@
+$NetBSD: patch-rules_distdir-way-opts.mk,v 1.1 2021/05/01 04:43:57 pho Exp $
+
+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,11 +209,10 @@ ifneq "$4" "0"
+ ifeq "$$(TargetElf)" "YES"
+ $1_$2_$3_GHC_LD_OPTS += \
+     -fno-use-rpaths \
+-    $$(foreach d,$$($1_$2_TRANSITIVE_DEP_COMPONENT_IDS),-optl-Wl$$(comma)-rpath -optl-Wl$$(comma)'$$$$ORIGIN/../$$d') -optl-Wl,-zorigin
++    $$(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 \
+-    $$(foreach d,$$($1_$2_TRANSITIVE_DEP_COMPONENT_IDS),-optl-Wl$$(comma)-rpath -optl-Wl$$(comma)'@loader_path/../$$d')
++    -fno-use-rpaths
+ endif
+ endif
+ endif



Home | Main Index | Thread Index | Old Index