Diff ghc-9.0.2-r3 with a ghc-9.0.2-r4

/usr/portage/dev-lang/ghc/ghc-9.0.2-r4.ebuild 2023-10-09 14:52:29.460368349 +0300
13 13
	fi
14 14
fi
15 15

  
16
PYTHON_COMPAT=( python3_{9..10} )
16
PYTHON_COMPAT=( python3_{9..11} )
17 17
inherit python-any-r1
18 18
inherit autotools bash-completion-r1 flag-o-matic ghc-package
19 19
inherit multiprocessing pax-utils toolchain-funcs prefix
20
inherit check-reqs llvm
20
inherit check-reqs llvm unpacker
21 21
DESCRIPTION="The Glasgow Haskell Compiler"
22 22
HOMEPAGE="https://www.haskell.org/ghc/"
23 23

  
......
25 25
arch_binaries=""
26 26

  
27 27
BIN_PV=${PV}
28
[[ $PR != r0 ]] && BIN_REV=${PR}
28 29

  
29 30
# Differentiate glibc/musl
30 31

  
31 32
#glibc_binaries="$glibc_binaries alpha? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-alpha.tbz2 )"
32
glibc_binaries="$glibc_binaries amd64? ( https://eidetic.codes/ghc-bin-${PV}-x86_64-pc-linux-gnu-r1.tbz2 )"
33
glibc_binaries+=" amd64? ( https://eidetic.codes/${PN}-bin-${PVR}-x86_64-pc-linux-gnu.gpkg.tar )"
33 34
#glibc_binaries="$glibc_binaries arm? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-armv7a-hardfloat-linux-gnueabi.tbz2 )"
34
glibc_binaries="$glibc_binaries arm64? ( https://github.com/matoro/ghc/releases/download/${PV}/ghc-bin-${PV}-aarch64-unknown-linux-gnu.tar.gz )"
35
glibc_binaries="$glibc_binaries arm64? ( https://github.com/matoro/ghc/releases/download/${PVR}/ghc-bin-${PVR}-aarch64-unknown-linux-gnu.tar.gz )"
35 36
#glibc_binaries="$glibc_binaries ia64?  ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ia64-fixed-fiw.tbz2 )"
36 37
#glibc_binaries="$glibc_binaries ppc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc.tbz2 )"
37
#glibc_binaries="$glibc_binaries ppc64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc64.tbz2 )"
38 38
glibc_binaries="$glibc_binaries ppc64? (
39
	big-endian? ( https://github.com/matoro/ghc/releases/download/${PV}/ghc-bin-${PV}-powerpc64-unknown-linux-gnu.tar.gz )
40
	!big-endian? ( https://github.com/matoro/ghc/releases/download/${PV}/ghc-bin-${PV}-powerpc64le-unknown-linux-gnu.tar.gz )
39
	big-endian? ( https://github.com/matoro/ghc/releases/download/${PVR}/ghc-bin-${PVR}-powerpc64-unknown-linux-gnu.tar.gz )
40
	!big-endian? ( https://github.com/matoro/ghc/releases/download/${PVR}/ghc-bin-${PVR}-powerpc64le-unknown-linux-gnu.tar.gz )
41 41
)"
42
glibc_binaries="$glibc_binaries riscv? ( https://github.com/matoro/ghc/releases/download/${PV}/ghc-bin-${PV}-riscv64-unknown-linux-gnu.tar.gz )"
42
glibc_binaries="$glibc_binaries riscv? ( https://github.com/matoro/ghc/releases/download/${PVR}/ghc-bin-${PVR}-riscv64-unknown-linux-gnu.tar.gz )"
43 43
#glibc_binaries="$glibc_binaries sparc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-sparc.tbz2 )"
44
glibc_binaries="$glibc_binaries x86? ( https://eidetic.codes/ghc-bin-${PV}-i686-pc-linux-gnu.tbz2 )"
44
glibc_binaries+=" x86? ( https://eidetic.codes/${PN}-bin-${PVR}-i686-pc-linux-gnu.gpkg.tar )"
45 45

  
46 46
#musl_binaries="$musl_binaries alpha? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-alpha.tbz2 )"
47 47
#musl_binaries="$musl_binaries amd64? ( https://eidetic.codes/ghc-bin-${PV}-x86_64-pc-linux-musl.tbz2 )"
......
55 55
#musl_binaries="$musl_binaries sparc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-sparc.tbz2 )"
56 56
#musl_binaries="$musl_binaries x86? ( https://eidetic.codes/ghc-bin-${PV}-i686-pc-linux-musl.tbz2 )"
57 57

  
58
[[ -n $glibc_binaries ]] && arch_binaries="$arch_binaries elibc_glibc? ( $glibc_binaries )"
59
[[ -n $musl_binaries ]] && arch_binaries="$arch_binaries elibc_musl? ( $musl_binaries )"
58
[[ -n $glibc_binaries ]] && arch_binaries+=" elibc_glibc? ( $glibc_binaries )"
59
[[ -n $musl_binaries ]] && arch_binaries+=" elibc_musl? ( $musl_binaries )"
60 60

  
61 61
# various ports:
62 62
#arch_binaries="$arch_binaries x86-fbsd? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86-fbsd.tbz2 )"
......
96 96
				*) return 1 ;;
97 97
			esac
98 98
			;;
99
		*) return 1 ;;
99 100
	esac
100 101
}
101 102

  
......
115 116

  
116 117
BUMP_LIBRARIES=(
117 118
	# "hackage-name          hackage-version"
119
	"process          1.6.16.0"
118 120
)
119 121

  
120 122
LICENSE="BSD"
121 123
SLOT="0/${PV}"
122
KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86"
124
KEYWORDS="amd64 ~arm64 ~ppc64 ~riscv ~x86"
123 125
IUSE="big-endian +doc elfutils ghcbootstrap ghcmakebinary +gmp llvm numa profile test unregisterised"
124 126
IUSE+=" binary"
125 127
RESTRICT="!test? ( test )"
......
459 461
	case ${CHOST} in
460 462
		*-darwin* | *-solaris*)  ONLYA=${GHC_P}-src.tar.xz  ;;
461 463
	esac
462
	unpack ${ONLYA}
464
	unpacker ${ONLYA}
463 465
}
464 466

  
465 467
src_prepare() {
......
475 477
	# https://src.fedoraproject.org/rpms/ghc9.0/blob/rawhide/f/ghc9.0.spec#_327
476 478
	rm -rf "libraries/containers/containers/dist-install" || die
477 479

  
478
	if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then
479
		# Modify the wrapper script from the binary tarball to use GHC_PERSISTENT_FLAGS.
480
		# See bug #313635.
481
		sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
482
			"${WORKDIR}/usr/bin/ghc-${BIN_PV}"
483

  
484
		# allow hardened users use vanilla binary to bootstrap ghc
485
		# ghci uses mmap with rwx protection at it implements dynamic
486
		# linking on it's own (bug #299709)
487
		pax-mark -m "${WORKDIR}/usr/$(get_libdir)/${PN}-${BIN_PV}/bin/ghc"
480
	if ! use ghcbootstrap; then
481
		# The switch to gpkg binaries means that they are unpacked in the wrong
482
		# location. They are now unnpacked in the $orig_bindir and need to be
483
		# moved so that usr/ is in $WORKDIR.
484
		local orig_bindir="${WORKDIR}/${PN}-${BIN_PV}${BIN_REV:+-${BIN_REV}}"
485
		mv -v "${orig_bindir}/image/usr" "${WORKDIR}" || die
486

  
487
		if [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then
488
			# Modify the wrapper script from the binary tarball to use GHC_PERSISTENT_FLAGS.
489
			# See bug #313635.
490
			sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
491
				"${WORKDIR}/usr/bin/ghc-${BIN_PV}"
492

  
493
			# allow hardened users use vanilla binary to bootstrap ghc
494
			# ghci uses mmap with rwx protection at it implements dynamic
495
			# linking on it's own (bug #299709)
496
			pax-mark -m "${WORKDIR}/usr/$(get_libdir)/${PN}-${BIN_PV}/bin/ghc"
497
		fi
488 498
	fi
489 499

  
490 500
	use llvm && ! use ghcbootstrap && llvmize "${WORKDIR}/usr/bin"
......
502 512
		[[ -e "${f}" ]] || ln -sf "$($(tc-getPKG_CONFIG) --cflags-only-I libffi | sed "s/-I//g" | tr -d " ")/$(basename "${f}")" "${f}" || die
503 513
	done
504 514

  
505
	eapply "${FILESDIR}"/${PN}-9.0.2-sphinx-6.patch
506

  
507 515
	if use binary; then
508 516
		if use prefix; then
509 517
			relocate_ghc "${EPREFIX}"
......
587 595
		eapply "${FILESDIR}"/latomic-subword
588 596
		eapply "${WORKDIR}"/${P}-riscv64-llvm.patch
589 597
		eapply "${FILESDIR}"/${PN}-9.0.2-fptools.patch # clang-16 workaround
598
		eapply "${FILESDIR}"/${PN}-9.0.2-sphinx-6.patch
590 599

  
591 600
		# mingw32 target
592 601
		pushd "${S}/libraries/Win32"
Thank you!