commit:     5c8ee4d0315853e2a0595e2d75316cba5c717c31
Author:     hololeap <hololeap <AT> users <DOT> noreply <DOT> github <DOT> com>
AuthorDate: Thu Feb  9 19:58:25 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Feb 21 05:13:27 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5c8ee4d0

dev-lang/ghc: Upgrade bundled process package

Use process-1.6.16.0 on all versions of ghc

There have been recent bug fixes in the process package which are
now required by the 3.8 branch of cabal-install.

See: 
https://github.com/haskell/cabal/commit/ad9e4dc3c63a293bbd89444fc356294e64766556
See: https://github.com/haskell/process/issues/226
Signed-off-by: hololeap <hololeap <AT> users.noreply.github.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-lang/ghc/Manifest                              |   1 +
 .../{ghc-8.10.6-r2.ebuild => ghc-8.10.6-r3.ebuild} |   1 +
 .../{ghc-8.10.6-r2.ebuild => ghc-9.0.2-r4.ebuild}  | 121 ++++++++++++++-------
 3 files changed, 86 insertions(+), 37 deletions(-)

diff --git a/dev-lang/ghc/Manifest b/dev-lang/ghc/Manifest
index f3d895e800a6..f55ad841e091 100644
--- a/dev-lang/ghc/Manifest
+++ b/dev-lang/ghc/Manifest
@@ -11,3 +11,4 @@ DIST ghc-bin-9.0.2-powerpc64-unknown-linux-gnu.tar.gz 
235636284 BLAKE2B 878ac300
 DIST ghc-bin-9.0.2-powerpc64le-unknown-linux-gnu.tar.gz 275226316 BLAKE2B 
10ade2359432b0ede7431ee543f0ff47f4b203465d81719da579ad63ca467359eb9fcf7336a12feb6ff75a480f349576ff8ea1b4ebe1094fff228ae4fd00d6e0
 SHA512 
64b4c84d149358b8d3a6cb29a6d3a75af11e7b14e6d910c9789c9949262e4ed2a17f8a0d1e5dd297121957061fe2395d6f43acae6b4ab28851e3cd414cd9c89c
 DIST ghc-bin-9.0.2-riscv64-unknown-linux-gnu.tar.gz 313475807 BLAKE2B 
a5e1bbd4630eaff63dd01d79fdcb26a663771c0241d3211aa3a0033cb58addbe8e696177500ac06ae727fc645bfc6f16a3df763a6a0ae039b8823bcbfb9918bb
 SHA512 
5e462f6f9d3f3507b3e09230729faa2a3e1fa92a8024fac602d75b804fff25f27e335871658f4b7b2c671f9e066373ca0285720da315a6c22f6f2c9c3cfea927
 DIST ghc-bin-9.0.2-x86_64-pc-linux-gnu-r1.tbz2 121347519 BLAKE2B 
6bd41cdb8ba1661735e46df4709888e6461cff969678716c82681a0a0b0e8d0a32532a070f52efb0ab99ca126207998e8883d01902071e797a7a0f19881d5925
 SHA512 
c7de43577fd97e6fbde7bbffba4e1d2b83cdda405cff46f95c9eff23260542b426091d8dba75605d81ed41740a793a409e7448538e5adc7a391a901f20e8f2e4
+DIST process-1.6.16.0.tar.gz 87354 BLAKE2B 
8c2977d6801faef8825ed35f058a6207a518f72eb87ac3144f630bc028f4753cefb9ed4d3fc29185438bcb4f38d33f5a45aebec6a8101e4cdc1b3570ada2e5dc
 SHA512 
1663f2746a05a5a4c29d249db54eaa49edbbadfe8d189eab02276c3f6f3d6b84c81cc4333318c42c7a7265638402cb13276f08aeea134a7f5dd98da050a34341

diff --git a/dev-lang/ghc/ghc-8.10.6-r2.ebuild 
b/dev-lang/ghc/ghc-8.10.6-r3.ebuild
similarity index 99%
copy from dev-lang/ghc/ghc-8.10.6-r2.ebuild
copy to dev-lang/ghc/ghc-8.10.6-r3.ebuild
index d3def7c1d0a9..2478db3c35bd 100644
--- a/dev-lang/ghc/ghc-8.10.6-r2.ebuild
+++ b/dev-lang/ghc/ghc-8.10.6-r3.ebuild
@@ -109,6 +109,7 @@ S="${WORKDIR}"/${GHC_P}
 
 BUMP_LIBRARIES=(
        # "hackage-name          hackage-version"
+       "process          1.6.16.0"
 )
 
 LICENSE="BSD"

diff --git a/dev-lang/ghc/ghc-8.10.6-r2.ebuild 
b/dev-lang/ghc/ghc-9.0.2-r4.ebuild
similarity index 86%
rename from dev-lang/ghc/ghc-8.10.6-r2.ebuild
rename to dev-lang/ghc/ghc-9.0.2-r4.ebuild
index d3def7c1d0a9..9f6a1b7d14d4 100644
--- a/dev-lang/ghc/ghc-8.10.6-r2.ebuild
+++ b/dev-lang/ghc/ghc-9.0.2-r4.ebuild
@@ -16,8 +16,8 @@ fi
 PYTHON_COMPAT=( python3_{9..10} )
 inherit python-any-r1
 inherit autotools bash-completion-r1 flag-o-matic ghc-package
-inherit multilib multiprocessing pax-utils toolchain-funcs prefix
-inherit check-reqs
+inherit multiprocessing pax-utils toolchain-funcs prefix
+inherit check-reqs llvm
 DESCRIPTION="The Glasgow Haskell Compiler"
 HOMEPAGE="https://www.haskell.org/ghc/";
 
@@ -29,26 +29,31 @@ BIN_PV=${PV}
 # Differentiate glibc/musl
 
 #glibc_binaries="$glibc_binaries alpha? ( 
https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-alpha.tbz2 )"
-glibc_binaries="$glibc_binaries amd64? ( 
https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86_64-pc-linux-gnu.tbz2 
)"
+glibc_binaries="$glibc_binaries amd64? ( 
https://eidetic.codes/ghc-bin-${PV}-x86_64-pc-linux-gnu-r1.tbz2 )"
 #glibc_binaries="$glibc_binaries arm? ( 
https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-armv7a-hardfloat-linux-gnueabi.tbz2
 )"
-#glibc_binaries="$glibc_binaries arm64? ( 
https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-aarch64-unknown-linux-gnu.tbz2
 )"
+glibc_binaries="$glibc_binaries arm64? ( 
https://github.com/matoro/ghc/releases/download/${PV}/ghc-bin-${PV}-aarch64-unknown-linux-gnu.tar.gz
 )"
 #glibc_binaries="$glibc_binaries ia64?  ( 
https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ia64-fixed-fiw.tbz2 )"
 #glibc_binaries="$glibc_binaries ppc? ( 
https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc.tbz2 )"
 #glibc_binaries="$glibc_binaries ppc64? ( 
https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc64.tbz2 )"
-#glibc_binaries="$glibc_binaries ppc64? ( !big-endian? ( 
https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-powerpc64le-unknown-linux-gnu.tbz2
 ) )"
+glibc_binaries="$glibc_binaries ppc64? (
+       big-endian? ( 
https://github.com/matoro/ghc/releases/download/${PV}/ghc-bin-${PV}-powerpc64-unknown-linux-gnu.tar.gz
 )
+       !big-endian? ( 
https://github.com/matoro/ghc/releases/download/${PV}/ghc-bin-${PV}-powerpc64le-unknown-linux-gnu.tar.gz
 )
+)"
+glibc_binaries="$glibc_binaries riscv? ( 
https://github.com/matoro/ghc/releases/download/${PV}/ghc-bin-${PV}-riscv64-unknown-linux-gnu.tar.gz
 )"
 #glibc_binaries="$glibc_binaries sparc? ( 
https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-sparc.tbz2 )"
-glibc_binaries="$glibc_binaries x86? ( 
https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-i686-pc-linux-gnu.tbz2 )"
+glibc_binaries="$glibc_binaries x86? ( 
https://eidetic.codes/ghc-bin-${PV}-i686-pc-linux-gnu.tbz2 )"
 
 #musl_binaries="$musl_binaries alpha? ( 
https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-alpha.tbz2 )"
-#musl_binaries="$musl_binaries amd64? ( 
https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86_64-pc-linux-musl.tbz2 
)"
+#musl_binaries="$musl_binaries amd64? ( 
https://eidetic.codes/ghc-bin-${PV}-x86_64-pc-linux-musl.tbz2 )"
 #musl_binaries="$musl_binaries arm? ( 
https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-armv7a-hardfloat-linux-musl.tbz2
 )"
 #musl_binaries="$musl_binaries arm64? ( 
https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-aarch64-unknown-linux-musl.tbz2
 )"
 #musl_binaries="$musl_binaries ia64?  ( 
https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ia64-fixed-fiw.tbz2 )"
 #musl_binaries="$musl_binaries ppc? ( 
https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc.tbz2 )"
 #musl_binaries="$musl_binaries ppc64? ( 
https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc64.tbz2 )"
-#musl_binaries="$musl_binaries ppc64? ( !big-endian? ( 
https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-powerpc64le-unknown-linux-musl.tbz2
 ) )"
+#musl_binaries="$musl_binaries ppc64? ( !big-endian? ( 
https://github.com/matoro/ghc/releases/download/${PV}/ghc-bin-${PV}-powerpc64le-unknown-linux-musl.tar.gz
 ) )"
+#musl_binaries="$musl_binaries riscv? ( 
https://github.com/matoro/ghc/releases/download/${PV}/ghc-bin-${PV}-riscv64-unknown-linux-musl.tar.gz
 )"
 #musl_binaries="$musl_binaries sparc? ( 
https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-sparc.tbz2 )"
-#musl_binaries="$musl_binaries x86? ( 
https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-i686-pc-linux-musl.tbz2 )"
+#musl_binaries="$musl_binaries x86? ( 
https://eidetic.codes/ghc-bin-${PV}-i686-pc-linux-musl.tbz2 )"
 
 [[ -n $glibc_binaries ]] && arch_binaries="$arch_binaries elibc_glibc? ( 
$glibc_binaries )"
 [[ -n $musl_binaries ]] && arch_binaries="$arch_binaries elibc_musl? ( 
$musl_binaries )"
@@ -62,14 +67,13 @@ yet_binary() {
                glibc)
                        case "${ARCH}" in
                                #alpha) return 0 ;;
-                               #arm64) return 0 ;;
+                               arm64) return 0 ;;
                                #arm) return 0 ;;
                                amd64) return 0 ;;
                                #ia64) return 0 ;;
                                #ppc) return 0 ;;
-                               #ppc64)
-                               #       use big-endian || return 0
-                               #       ;;
+                               ppc64) return 0 ;;
+                               riscv) return 0 ;;
                                #sparc) return 0 ;;
                                x86) return 0 ;;
                                *) return 1 ;;
@@ -86,12 +90,12 @@ yet_binary() {
                                #ppc64)
                                #       use big-endian || return 0
                                #       ;;
+                               #riscv) return 0 ;;
                                #sparc) return 0 ;;
                                #x86) return 0 ;;
                                *) return 1 ;;
                        esac
                        ;;
-               *) return 1 ;;
        esac
 }
 
@@ -103,28 +107,38 @@ SRC_URI="!binary? (
        https://downloads.haskell.org/ghc/${PV/_/-}/${GHC_P}-src.tar.xz
        test? ( 
https://downloads.haskell.org/ghc/${PV/_/-}/${GHC_P}-testsuite.tar.xz )
 )"
+SRC_URI+=" 
https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-riscv64-llvm.patch.xz";
+
 S="${WORKDIR}"/${GHC_P}
 
 [[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )"
 
 BUMP_LIBRARIES=(
        # "hackage-name          hackage-version"
+       "process          1.6.16.0"
 )
 
 LICENSE="BSD"
 SLOT="0/${PV}"
 KEYWORDS="~amd64 ~x86"
-IUSE="big-endian +doc elfutils ghcbootstrap ghcmakebinary +gmp numa profile 
test"
+IUSE="big-endian +doc elfutils ghcbootstrap ghcmakebinary +gmp llvm numa 
profile test unregisterised"
 IUSE+=" binary"
 RESTRICT="!test? ( test )"
 
+LLVM_MAX_SLOT="14"
 RDEPEND="
        >=dev-lang/perl-5.6.1
        dev-libs/gmp:0=
        sys-libs/ncurses:=[unicode(+)]
        elfutils? ( dev-libs/elfutils )
-       !ghcmakebinary? ( dev-libs/libffi:=[-exec-static-trampoline] )
+       !ghcmakebinary? ( dev-libs/libffi:= )
        numa? ( sys-process/numactl )
+       llvm? (
+               <sys-devel/llvm-$((${LLVM_MAX_SLOT} + 1)):=
+               || (
+                       sys-devel/llvm:14
+               )
+       )
 "
 
 # This set of dependencies is needed to run
@@ -165,6 +179,7 @@ needs_python() {
 REQUIRED_USE="
        ?? ( ghcbootstrap binary )
        ?? ( profile binary )
+       ?? ( llvm unregisterised )
 "
 
 # haskell libraries built with cabal in configure mode, #515354
@@ -309,15 +324,6 @@ ghc_setup_cflags() {
        for flag in ${LDFLAGS}; do
                append-ghc-cflags link ${flag}
        done
-
-       # GHC uses ${CBUILD}-gcc, ${CHOST}-gcc and ${CTARGET}-gcc at a single 
build.
-       # Skip any gentoo-specific tweaks for cross-case to avoid passing 
unsupported
-       # options to gcc.
-       if is_native; then
-               # prevent from failing to build unregisterised ghc:
-               # 
https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg171602.html
-               use ppc64 && append-ghc-cflags persistent compile -mminimal-toc
-       fi
 }
 
 # substitutes string $1 to $2 in files $3 $4 ...
@@ -402,6 +408,15 @@ ghc-check-reqs() {
        "$@"
 }
 
+llvmize() {
+       [[ -z "${1}" ]] && return
+       ( find "${1}" -type f \
+               | file -if- \
+               | grep "text/x-shellscript" \
+               | awk -F: '{print $1}' \
+               | xargs sed -i "s#^exec #PATH=\"$(get_llvm_prefix 
"${LLVM_MAX_SLOT}")/bin:\${PATH}\" exec #") || die
+}
+
 pkg_pretend() {
        ghc-check-reqs check-reqs_pkg_pretend
 }
@@ -431,6 +446,8 @@ pkg_setup() {
        if needs_python; then
                python-any-r1_pkg_setup
        fi
+
+       use llvm && llvm_pkg_setup
 }
 
 src_unpack() {
@@ -454,6 +471,11 @@ src_prepare() {
 
        ghc_setup_cflags
 
+       # ghc-9.0.2 release anomaly
+       # 
https://www.mail-archive.com/search?l=ghc-d...@haskell.org&q=subject:%22Re%5C%3A+%5C%5BHaskell%5C%5D+%5C%5BANNOUNCE%5C%5D+GHC+9.0.2+released%22&o=newest&f=1
+       # 
https://src.fedoraproject.org/rpms/ghc9.0/blob/rawhide/f/ghc9.0.spec#_327
+       rm -rf "libraries/containers/containers/dist-install" || die
+
        if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != 
*-solaris* ]]; then
                # Modify the wrapper script from the binary tarball to use 
GHC_PERSISTENT_FLAGS.
                # See bug #313635.
@@ -466,6 +488,24 @@ src_prepare() {
                pax-mark -m 
"${WORKDIR}/usr/$(get_libdir)/${PN}-${BIN_PV}/bin/ghc"
        fi
 
+       use llvm && ! use ghcbootstrap && llvmize "${WORKDIR}/usr/bin"
+
+       # binpkg may have been built with FEATURES=splitdebug
+       if [[ -d "${WORKDIR}/usr/lib/debug" ]] ; then
+               rm -rf "${WORKDIR}/usr/lib/debug" || die
+       fi
+       find "${WORKDIR}/usr/lib" -type d -empty -delete 2>/dev/null # do not 
die on failure here
+
+       # ffi headers don't get included in the binpkg for some reason
+       for f in 
"${WORKDIR}/usr/$(get_libdir)/${PN}-${BIN_PV}/include/"{ffi.h,ffitarget.h}
+       do
+               mkdir -p "$(dirname "${f}")"
+               [[ -e "${f}" ]] || ln -sf "$($(tc-getPKG_CONFIG) 
--cflags-only-I libffi | sed "s/-I//g" | tr -d " ")/$(basename "${f}")" "${f}" 
|| die
+       done
+
+
+       eapply "${FILESDIR}"/${PN}-9.0.2-sphinx-6.patch
+
        if use binary; then
                if use prefix; then
                        relocate_ghc "${EPREFIX}"
@@ -537,17 +577,21 @@ src_prepare() {
 
                cd "${S}" # otherwise eapply will break
 
-               eapply "${FILESDIR}"/${PN}-7.0.4-CHOST-prefix.patch
-               eapply "${FILESDIR}"/${PN}-8.2.1-darwin.patch
-               eapply "${FILESDIR}"/${PN}-7.8.3-prim-lm.patch
-               eapply "${FILESDIR}"/${PN}-8.8.1-revert-CPP.patch
+               eapply "${FILESDIR}"/${PN}-9.0.2-CHOST-prefix.patch
+               eapply "${FILESDIR}"/${PN}-9.0.2-darwin.patch
+               # Fixes panic when compiling some packages
+               # 
https://github.com/gentoo-haskell/gentoo-haskell/issues/1250#issuecomment-1044257595
+               # https://gitlab.haskell.org/ghc/ghc/-/issues/21097
+               eapply "${FILESDIR}/${PN}-9.0.2-modorigin-semigroup.patch"
+               # Needed for testing with python-3.10
+               use test && eapply 
"${FILESDIR}/${PN}-9.0.2-fix-tests-python310.patch"
                eapply "${FILESDIR}"/${PN}-8.10.1-allow-cross-bootstrap.patch
-               eapply 
"${FILESDIR}"/${PN}-8.10.5-modorigin-verbose-conflict.patch
-               eapply "${FILESDIR}"/${PN}-8.10.6-aclocal.patch
-
-               # a bunch of crosscompiler patches
-               # needs newer version:
-               #eapply "${FILESDIR}"/${PN}-8.2.1_rc1-hp2ps-cross.patch
+               eapply "${FILESDIR}"/${PN}-9.0.2-disable-unboxed-arrays.patch
+               eapply "${FILESDIR}"/${PN}-9.0.2-llvm-13.patch
+               eapply "${FILESDIR}"/${PN}-9.0.2-llvm-14.patch
+               eapply "${FILESDIR}"/latomic-subword
+               eapply "${WORKDIR}"/${P}-riscv64-llvm.patch
+               eapply "${FILESDIR}"/${PN}-9.0.2-fptools.patch # clang-16 
workaround
 
                # mingw32 target
                pushd "${S}/libraries/Win32"
@@ -626,7 +670,7 @@ src_configure() {
                        export PATH="${WORKDIR}/usr/bin:${PATH}"
                fi
 
-               echo "INTEGER_LIBRARY = $(usex gmp integer-gmp integer-simple)" 
>> mk/build.mk
+               echo "BIGNUM_BACKEND = $(usex gmp gmp native)" >> mk/build.mk
 
                # don't strip anything. Very useful when stage2 SIGSEGVs on you
                echo "STRIP_CMD = :" >> mk/build.mk
@@ -695,7 +739,8 @@ src_configure() {
                econf ${econf_args[@]} \
                        --enable-bootstrap-with-devel-snapshot \
                        $(use_enable elfutils dwarf-unwind) \
-                       $(use_enable numa)
+                       $(use_enable numa) \
+                       $(use_enable unregisterised)
 
                if [[ ${PV} == *9999* ]]; then
                        GHC_PV="$(grep 'S\[\"PACKAGE_VERSION\"\]' config.status 
| sed -e 's@^.*=\"\(.*\)\"@\1@')"
@@ -752,6 +797,8 @@ src_install() {
                #           
'/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404':
 No such file or directory
                emake -j1 install DESTDIR="${D}"
 
+               use llvm && llvmize "${ED}/usr/bin"
+
                # Skip for cross-targets as they all share target location:
                # /usr/share/doc/ghc-9999/
                if ! is_crosscompile; then

Reply via email to