From 7bd77a6744e2cd6d203240181996a998985e0288 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 26 Nov 2022 01:13:45 +0000 Subject: gentoo auto-resync : 26:11:2022 - 01:13:45 --- dev-lang/Manifest.gz | Bin 19351 -> 19349 bytes dev-lang/ghc/Manifest | 6 +- dev-lang/ghc/files/ghc-8.10.6-aclocal.patch | 26 + dev-lang/ghc/files/ghc-9.0.2-fptools.patch | 26 + dev-lang/ghc/ghc-8.10.6-r1.ebuild | 820 ++++++++++++++++++++++++++ dev-lang/ghc/ghc-8.10.6.ebuild | 819 -------------------------- dev-lang/ghc/ghc-9.0.2-r2.ebuild | 854 ++++++++++++++++++++++++++++ dev-lang/ghc/ghc-9.0.2.ebuild | 853 --------------------------- dev-lang/rust-bin/Manifest | 2 +- dev-lang/rust-bin/rust-bin-1.65.0.ebuild | 9 +- dev-lang/rust/Manifest | 2 +- dev-lang/rust/rust-1.65.0.ebuild | 11 +- 12 files changed, 1736 insertions(+), 1692 deletions(-) create mode 100644 dev-lang/ghc/files/ghc-8.10.6-aclocal.patch create mode 100644 dev-lang/ghc/files/ghc-9.0.2-fptools.patch create mode 100644 dev-lang/ghc/ghc-8.10.6-r1.ebuild delete mode 100644 dev-lang/ghc/ghc-8.10.6.ebuild create mode 100644 dev-lang/ghc/ghc-9.0.2-r2.ebuild delete mode 100644 dev-lang/ghc/ghc-9.0.2.ebuild (limited to 'dev-lang') diff --git a/dev-lang/Manifest.gz b/dev-lang/Manifest.gz index a08f3c296c68..2f49536ebade 100644 Binary files a/dev-lang/Manifest.gz and b/dev-lang/Manifest.gz differ diff --git a/dev-lang/ghc/Manifest b/dev-lang/ghc/Manifest index 993ae155a8c7..1e2878dc7d7c 100644 --- a/dev-lang/ghc/Manifest +++ b/dev-lang/ghc/Manifest @@ -2,6 +2,7 @@ AUX ghc-7.0.4-CHOST-prefix.patch 276 BLAKE2B 77c706d291928a229edad6bcde37786b2c1 AUX ghc-7.8.3-prim-lm.patch 444 BLAKE2B a930bb9657441a48941debf79711e06223c5680df0f60d7d972e0150950109bf8f8a99c35c7dbcda21172dddcb15d8a379085813e44647583e3888f27f597568 SHA512 6979e002589a54c870c70eee8357dad4feb55b4e5102350cc09a466145677dacaa1bab5ebe4818cf0d3cd8ab50ee0ec2ab642ab0fb3fd34f4a266e5e90f9f389 AUX ghc-8.10.1-allow-cross-bootstrap.patch 541 BLAKE2B b77b3c9ebb7a33af6f82ec1b9927664e9bfce04450560a8e436ffa87feca50d606824192b7333e3b98d5552622592b6d39d0b184037ce646d6f7ebd205deb348 SHA512 d87a99ac96846e161d8c939079f8314d380be8e1dc62f956e3afcce1339a76447a14002b30bac1c86c807fd8eba23a0648912a3d074248f3513f9aadacd27489 AUX ghc-8.10.5-modorigin-verbose-conflict.patch 956 BLAKE2B 8ce1e156c92d0d931930a4ad366f62be184be46beb1f25b92ad97be03d47c9702313be758c33a17c40002816a26e70f4017e4e02325f1513864086e50ac6136b SHA512 27f884e8b4e6250cbd2620a190531ae72693518da8cb56e736fe58bc436fca67ba9eb8d3fa89fcd0234858a8533ca3e15d5b0c20ed1953fba56736000fc8a732 +AUX ghc-8.10.6-aclocal.patch 699 BLAKE2B 363b46ccd0c116aef0d0be29010cee13a5f8b56e0bb0a5834e790db4a9bc82250466b2214f17634f8cb0e01d5e877f1ae6fd6c900b020c421e2daa6c614b8be7 SHA512 733ff5cbdd55c7ae6c5bfcc80eb30456f372c0338671e65bf7fe99cc741b2776b9e7e21d3926c3259e7484678e98bbbf05e2b22aa8a339dd8028195c9489cce4 AUX ghc-8.2.1-darwin.patch 910 BLAKE2B 2f1a44dd7ead59301b5dd59c8cab932710655416640f2c8d5273cf07da4a45bf702d840768e2d32822e89f1b07cc9ed3a6110e1847e11468fca5c515e9e26f70 SHA512 0177fda8717d9158a99d96853feb1bf40ff13df8f5c5669c7c48f33accf69d6ddb05876776cda66705e85ee56c5ecff8f81722d8e748b6c2ed6b9bf611e42a2c AUX ghc-8.2.1_rc1-hp2ps-cross.patch 3865 BLAKE2B d68b1e15c091047d086be780dc0bb5ce2a1b713244ee240ae045052ccac947baf6a5bdea8cad50d0fac2984700069af7dcd320b96ca09af8c7b81021329da41c SHA512 d2ed48701216f5c03567e61c207e32d6218009380941275c690edd8eb0197728e7e3c0edb00d512792dc2041a958de82ceef393e96d3324b690157162e28d29a AUX ghc-8.2.1_rc1-win32-cross-2-hack.patch 6231 BLAKE2B 8ad4428ebe9a373e08e94e5373ad9578cafdf95b866ced2a4000434d9e5d4298b129e832e13e8e175e8977b9dda9351d01a896e2c320a1a40551d5892b0efc33 SHA512 8617c1346ba7aa2b41ee01feaa47f2ca477353f9b825be48c5d3505a134e0a80b613efc6cb92e7fbd3fe062e77450e197c826151a42c0c77177fc6ef8e65287f @@ -10,6 +11,7 @@ AUX ghc-9.0.2-CHOST-prefix.patch 282 BLAKE2B e0a2505c2ae91d5aad41fa3faf4fa7ece8e AUX ghc-9.0.2-darwin.patch 916 BLAKE2B ece65347ee4d40ce729642766273792c5f619c5f2788366f5f1e1784d630efadf59fa1c1e2e03dbd81633ad4202c81fc39a6c94472db52af2f99362ee1e67093 SHA512 300167a4c5c4b4bf6b18cdce242c8e27def88f4f3d810da0e5b60bdb77a186975716c2ac2ced8365e2f6a17b799e77eba8b3b77ae4b9efe69339dec48e78963a AUX ghc-9.0.2-disable-unboxed-arrays.patch 1298 BLAKE2B d3d8cf5b8f7f012cb93f6481822348c68e7ff79896664f51de5e4b248f8de68ea04144791bf8959b83ea265f384c055100fc27caf0da17f9a5a173c333928c4b SHA512 cc979c2fdb877716dee3fb75d9ee0734737f2f9a5611a0a1d20e2d603b48ebeaa339d09a130a79fce45eebe659a3741cf862b17eafecf814f408399139250806 AUX ghc-9.0.2-fix-tests-python310.patch 1116 BLAKE2B fc7a7390cbbc737c66ea8401c9211318d078499bfd103f07ec2df0db9824041dfee279e364601a21d4d37a694a9442f3570c0333b2baab6173d6daa366c931da SHA512 0620ebffc49a06a65bd45bf324de4674b98e874291e6bebae1a95d585bbdf38cc201a734f7f20133880b46e9abf0839b59278688b00c892b94091d1c0257352b +AUX ghc-9.0.2-fptools.patch 711 BLAKE2B b529444c270fea04b27e57ccd5a758ecb5889cf2b25a5f47930d0fda67fa415c5d960c3c5dfe55970c6ecbb0a136b80e5c741bb0245e120c2d1b7a464379607d SHA512 f898eebaf25c121f075b6c9c531a8b3879b6c025043cfea2d4e416b12220d3fe5898cb0595a7ab92ce46ecb791ede28484c6bd738737aa24a3a0e91d767fdc97 AUX ghc-9.0.2-llvm-13.patch 988 BLAKE2B dee0a02ffb7b79981981615e7933f5ba3348f700794dac1a34fa71987ab9d267af9a79a40db7d66f6bf6ffdb26bed57bdd7dc157f3f27efa296c4152b8e81070 SHA512 a20213400f48882e8c8521a950088fa9dcbfe7cc2ae678d76fd6f1298f019dae9ed334f03050116527554d9ada60b649694d6674a914ce48fa1b5bbf918aa712 AUX ghc-9.0.2-modorigin-semigroup.patch 1210 BLAKE2B e29917dd740bded98257366ca37d3ac8fdc8ffd0e988e6286b8cf21fb9f0232ce1584a1a22665f4afad36e5585c29091040cac16b1204022f5a5f3328420c4ff SHA512 dc54fb02dfed55f5a9309c61ec23859ad4f80fd271fe0ccb41b786fc7d44bc0d9722069e2f56731c6af5ad1703c5081ba9e4b4e683911af4ad9b498f53b67a5e AUX ghc-bash-completion 6496 BLAKE2B dc94a1979e886026a2fbe04bf7b45718ffa3e025a0e8945262e21a1243bfce6517fa1794f2ba6cd54cc853e93ad5d80472b9019b95762f10b5be83634a479955 SHA512 ede79ccf23555f60f48297d29bd98e3ccfd67d2cf27462153e00beb930398cb497e34ba8316e91df44c577ed11fdbe5606f7c6a2777e35d5e783590e49ccfeb5 @@ -27,6 +29,6 @@ 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 -EBUILD ghc-8.10.6.ebuild 26284 BLAKE2B 6285637fa2be744f41815e25ba512146381106fd8deffb8a684fe94307e256242357c52b36a584cab5d2f54bb629c067b25cffc4d2d38df49bfe31baf666ead6 SHA512 d2ed3dfd4d3416573229af26416ba96382861eda5c09764facc5dac95b485d61e8425799d10ebd6bc1e98b7be680f86fb63c4df8b764f7ed3855c5debece356c -EBUILD ghc-9.0.2.ebuild 27657 BLAKE2B febf70313c8b1b7f07db3131bd42b3f53871cec698af686a7995c42be0a0dc98a24fac7eeb5eb430521df8fb808d53ab81229ff9352adbb65310ce8709cdbb06 SHA512 3c9fdca1d9170f10df84728255a43e46bd4d18d456e001becaeeaf7013a34abfb6c4aa6ba7bba66ff1edcb571fa3d6311a7103ac84cbb807a70331520d5f566d +EBUILD ghc-8.10.6-r1.ebuild 26334 BLAKE2B 037d373d59f693e0655ac828ad4f3dd947e037d08ed857b7ba5c6bce7ba3f371b0e598d9a518a244316c19018c6c1484c6d4a56738839d55f91b6da942fdd703 SHA512 987e2d286a5f3d7a5255c4667220b0c6162ea4120ab0c1dcfb4f1421809419c9ab26ea210bfa1018aee92c692aed738545eda4b0ca7885fa3613f09b4edf1b1f +EBUILD ghc-9.0.2-r2.ebuild 27728 BLAKE2B 66e4012003e5bef7333905b25d47ea221bdb942d18886d4731acb160067758ac8c9d55dd34bba50f78732dfc8eab896d9d9efddd7d34963315b76c0a8ca07e75 SHA512 8627dd6488975d47a0aebfa0f1d5d7d58930c972a6af3a96fb0ae5633208524da5cb8c83c4a7842d60361d2a517d872cbcbfcf8cc8410a05565d5a3682cce658 MISC metadata.xml 1172 BLAKE2B 88b5e4af0e8c0e3335185f2c5469837a43ee87e6fc598242f29aced9bb8a3c330139978c564eb4ca503101934917e8406e9400dffd2eeaf7cd9983e8dc96105e SHA512 b03bb932efa54be0d55be591850064fcc967c8d77afdded255be91794544d47bdbbbd2959103cb739f6ec57b8571a955352e965ee1540a9854235a963b218bd3 diff --git a/dev-lang/ghc/files/ghc-8.10.6-aclocal.patch b/dev-lang/ghc/files/ghc-8.10.6-aclocal.patch new file mode 100644 index 000000000000..8bd3ce58d072 --- /dev/null +++ b/dev-lang/ghc/files/ghc-8.10.6-aclocal.patch @@ -0,0 +1,26 @@ +diff --git a/aclocal.m4 b/aclocal.m4 +index 47d69c5..212ebc6 100644 +--- a/aclocal.m4 ++++ b/aclocal.m4 +@@ -966,17 +966,15 @@ struct nlist xYzzY1[] = {{"xYzzY1", 0},{0}}; + struct nlist xYzzY2[] = {{"_xYzzY2", 0},{0}}; + #endif + +-int main(argc, argv) +-int argc; +-char **argv; ++int main(int argc, char **argv) + { + #if defined(HAVE_NLIST_H) + if(nlist(argv[0], xYzzY1) == 0 && xYzzY1[0].n_value != 0) +- exit(1); ++ return 1; + if(nlist(argv[0], xYzzY2) == 0 && xYzzY2[0].n_value != 0) +- exit(0); ++ return 0; + #endif +- exit(1); ++ return 1; + }]])],[fptools_cv_leading_underscore=yes],[fptools_cv_leading_underscore=no],[fptools_cv_leading_underscore=no]) + ;; + esac]); diff --git a/dev-lang/ghc/files/ghc-9.0.2-fptools.patch b/dev-lang/ghc/files/ghc-9.0.2-fptools.patch new file mode 100644 index 000000000000..8b00517386dd --- /dev/null +++ b/dev-lang/ghc/files/ghc-9.0.2-fptools.patch @@ -0,0 +1,26 @@ +diff --git a/m4/fptools.m4 b/m4/fptools.m4 +index 8c6c9b7..a5db447 100644 +--- a/m4/fptools.m4 ++++ b/m4/fptools.m4 +@@ -976,17 +976,15 @@ struct nlist xYzzY1[] = {{"xYzzY1", 0},{0}}; + struct nlist xYzzY2[] = {{"_xYzzY2", 0},{0}}; + #endif + +-int main(argc, argv) +-int argc; +-char **argv; ++int main(int argc, char **argv) + { + #if defined(HAVE_NLIST_H) + if(nlist(argv[0], xYzzY1) == 0 && xYzzY1[0].n_value != 0) +- exit(1); ++ return 1; + if(nlist(argv[0], xYzzY2) == 0 && xYzzY2[0].n_value != 0) +- exit(0); ++ return 0; + #endif +- exit(1); ++ return 1; + }]])],[fptools_cv_leading_underscore=yes],[fptools_cv_leading_underscore=no],[fptools_cv_leading_underscore=no]) + ;; + esac]); diff --git a/dev-lang/ghc/ghc-8.10.6-r1.ebuild b/dev-lang/ghc/ghc-8.10.6-r1.ebuild new file mode 100644 index 000000000000..40a6e8f7868b --- /dev/null +++ b/dev-lang/ghc/ghc-8.10.6-r1.ebuild @@ -0,0 +1,820 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +# to make make a crosscompiler use crossdev and symlink ghc tree into +# cross overlay. result would look like 'cross-sparc-unknown-linux-gnu/ghc' +export CBUILD=${CBUILD:-${CHOST}} +export CTARGET=${CTARGET:-${CHOST}} +if [[ ${CTARGET} = ${CHOST} ]] ; then + if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then + export CTARGET=${CATEGORY/cross-} + fi +fi + +PYTHON_COMPAT=( python3_{8..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 +DESCRIPTION="The Glasgow Haskell Compiler" +HOMEPAGE="https://www.haskell.org/ghc/" + +# we don't have any binaries yet +arch_binaries="" + +BIN_PV=${PV} +# sorted! +#arch_binaries="$arch_binaries alpha? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-alpha.tbz2 )" +#arch_binaries="$arch_binaries arm? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-armv7a-hardfloat-linux-gnueabi.tbz2 )" +#arch_binaries="$arch_binaries arm64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-aarch64-unknown-linux-gnu.tbz2 )" +arch_binaries="$arch_binaries amd64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86_64-pc-linux-gnu.tbz2 )" +#arch_binaries="$arch_binaries ia64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ia64-fixed-fiw.tbz2 )" +#arch_binaries="$arch_binaries ppc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc.tbz2 )" +#arch_binaries="$arch_binaries ppc64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc64.tbz2 )" +#arch_binaries="$arch_binaries ppc64? ( !big-endian? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-powerpc64le-unknown-linux-gnu.tbz2 ) )" +#arch_binaries="$arch_binaries sparc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-sparc.tbz2 )" +arch_binaries="$arch_binaries x86? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-i686-pc-linux-gnu.tbz2 )" + +# various ports: +#arch_binaries="$arch_binaries x86-fbsd? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86-fbsd.tbz2 )" + +# 0 - yet +yet_binary() { + case "${ARCH}" in + #alpha) return 0 ;; + #arm64) return 0 ;; + #arm) return 0 ;; + amd64) return 0 ;; + #ia64) return 0 ;; + #ppc) return 0 ;; + #ppc64) + # use big-endian && return 0 + # return 0 + # ;; + #sparc) return 0 ;; + x86) return 0 ;; + *) return 1 ;; + esac +} + +GHC_PV=${PV} +#GHC_PV=8.10.0.20200123 # uncomment only for -alpha, -beta, -rc ebuilds +GHC_P=${PN}-${GHC_PV} # using ${P} is almost never correct + +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 ) +)" +S="${WORKDIR}"/${GHC_P} + +[[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )" + +BUMP_LIBRARIES=( + # "hackage-name hackage-version" +) + +LICENSE="BSD" +SLOT="0/${PV}" +KEYWORDS="~amd64 ~x86" +IUSE="big-endian +doc elfutils ghcbootstrap ghcmakebinary +gmp numa profile test" +IUSE+=" binary" +RESTRICT="!test? ( test )" + +RDEPEND=" + >=dev-lang/perl-5.6.1 + dev-libs/gmp:0= + sys-libs/ncurses:=[unicode(+)] + elfutils? ( dev-libs/elfutils ) + !ghcmakebinary? ( dev-libs/libffi:= ) + numa? ( sys-process/numactl ) +" + +# This set of dependencies is needed to run +# prebuilt ghc. We specifically avoid ncurses +# dependency with: +# utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING +PREBUILT_BINARY_DEPENDS=" + !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.17 ) ) +" +# This set of dependencies is needed to install +# ghc[binary] in system. terminfo package is linked +# against ncurses. +PREBUILT_BINARY_RDEPENDS="${PREBUILT_BINARY_DEPENDS} + sys-libs/ncurses:0/6 +" + +RDEPEND+="binary? ( ${PREBUILT_BINARY_RDEPENDS} )" + +DEPEND="${RDEPEND}" +BDEPEND=" + virtual/pkgconfig + doc? ( app-text/docbook-xml-dtd:4.2 + app-text/docbook-xml-dtd:4.5 + app-text/docbook-xsl-stylesheets + dev-python/sphinx + >=dev-libs/libxslt-1.1.2 ) + !ghcbootstrap? ( ${PREBUILT_BINARY_DEPENDS} ) + test? ( ${PYTHON_DEPS} ) +" + +needs_python() { + # test driver is written in python + use test && return 0 + return 1 +} + +# we build binaries without profiling support +REQUIRED_USE=" + ?? ( ghcbootstrap binary ) + ?? ( profile binary ) +" + +# haskell libraries built with cabal in configure mode, #515354 +QA_CONFIGURE_OPTIONS+=" --with-compiler --with-gcc" + +is_crosscompile() { + [[ ${CHOST} != ${CTARGET} ]] +} + +is_native() { + [[ ${CHOST} == ${CBUILD} ]] && [[ ${CHOST} == ${CTARGET} ]] +} + +if ! is_crosscompile; then + PDEPEND="!ghcbootstrap? ( >=app-admin/haskell-updater-1.2 )" +fi + +# returns tool prefix for crosscompiler. +# Example: +# CTARGET=armv7a-unknown-linux-gnueabi +# CHOST=x86_64-pc-linux-gnu +# "armv7a-unknown-linux-gnueabi-" +# CTARGET=${CHOST} +# "" +# Used in tools and library prefix: +# "${ED}"/usr/bin/$(cross)haddock +# "${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d" + +cross() { + if is_crosscompile; then + echo "${CTARGET}-" + else + echo "" + fi +} + +append-ghc-cflags() { + local persistent compile assemble link + local flag ghcflag + + for flag in $*; do + case ${flag} in + persistent) persistent="yes";; + compile) compile="yes";; + assemble) assemble="yes";; + link) link="yes";; + *) + [[ ${compile} ]] && ghcflag="-optc${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" && + [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}" + [[ ${assemble} ]] && ghcflag="-opta${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" && + [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}" + [[ ${link} ]] && ghcflag="-optl${flag}" LDFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" && + [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}" + ;; + esac + done +} + +# $1 - lib name (under libraries/) +# $2 - lib version +# example: bump_lib "transformers" "0.4.2.0" +bump_lib() { + local pn=$1 pv=$2 + local p=${pn}-${pv} + local f + + einfo "Bumping ${pn} up to ${pv}" + + for f in ghc.mk GNUmakefile; do + mv libraries/"${pn}"/$f "${WORKDIR}"/"${p}"/$f || die + done + mv libraries/"${pn}" "${WORKDIR}"/"${pn}".old || die + mv "${WORKDIR}"/"${p}" libraries/"${pn}" || die +} + +update_SRC_URI() { + local p pn pv + for p in "${BUMP_LIBRARIES[@]}"; do + set -- $p + pn=$1 pv=$2 + + SRC_URI+=" https://hackage.haskell.org/package/${pn}-${pv}/${pn}-${pv}.tar.gz" + done +} + +update_SRC_URI + +bump_libs() { + local p pn pv + for p in "${BUMP_LIBRARIES[@]}"; do + set -- $p + pn=$1 pv=$2 + + bump_lib "${pn}" "${pv}" + done +} + +ghc_setup_cflags() { + # TODO: plumb CFLAGS and BUILD_CFLAGS to respective CONF_CC_OPTS_STAGE + if ! is_native; then + export CFLAGS=${GHC_CFLAGS-"-O2 -pipe"} + export LDFLAGS=${GHC_LDFLAGS-"-Wl,-O1"} + einfo "Crosscompiling mode:" + einfo " CHOST: ${CHOST}" + einfo " CTARGET: ${CTARGET}" + einfo " CFLAGS: ${CFLAGS}" + einfo " LDFLAGS: ${LDFLAGS}" + einfo " prefix: $(cross)" + return + fi + # We need to be very careful with the CFLAGS we ask ghc to pass through to + # gcc. There are plenty of flags which will make gcc produce output that + # breaks ghc in various ways. The main ones we want to pass through are + # -mcpu / -march flags. These are important for arches like alpha & sparc. + # We also use these CFLAGS for building the C parts of ghc, ie the rts. + strip-flags + strip-unsupported-flags + + # Cmm can't parse line numbers #482086 + replace-flags -ggdb[3-9] -ggdb2 + + GHC_FLAGS="" + GHC_PERSISTENT_FLAGS="" + for flag in ${CFLAGS}; do + case ${flag} in + + # Ignore extra optimisation (ghc passes -O to gcc anyway) + # -O2 and above break on too many systems + -O*) ;; + + # Arch and ABI flags are what we're really after + -m*) append-ghc-cflags compile assemble ${flag};; + + # Sometimes it's handy to see backtrace of RTS + # to get an idea what happens there + -g*) append-ghc-cflags compile ${flag};; + + # Ignore all other flags, including all -f* flags + esac + done + + 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 ... +relocate_path() { + local from=$1 + local to=$2 + shift 2 + local file= + for file in "$@" + do + sed -i -e "s|$from|$to|g" \ + "$file" || die "path relocation failed for '$file'" + done +} + +# changes hardcoded ghc paths and updates package index +# $1 - new absolute root path +relocate_ghc() { + local to=$1 ghc_v=${BIN_PV} + + # libdir for prebuilt binary and for current system may mismatch + # It does for prefix installation for example: bug #476998 + local bin_ghc_prefix=${WORKDIR}/usr + local bin_libpath=$(echo "${bin_ghc_prefix}"/lib*) + local bin_libdir=${bin_libpath#${bin_ghc_prefix}/} + + # backup original script to use it later after relocation + local gp_back="${T}/ghc-pkg-${ghc_v}-orig" + cp "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" "$gp_back" || die "unable to backup ghc-pkg wrapper" + + if [[ ${bin_libdir} != $(get_libdir) ]]; then + einfo "Relocating '${bin_libdir}' to '$(get_libdir)' (bug #476998)" + # moving the dir itself is not strictly needed + # but then USE=binary would result in installing + # in '${bin_libdir}' + mv "${bin_ghc_prefix}/${bin_libdir}" "${bin_ghc_prefix}/$(get_libdir)" || die + + relocate_path "/usr/${bin_libdir}" "/usr/$(get_libdir)" \ + "${WORKDIR}/usr/bin/ghc-${ghc_v}" \ + "${WORKDIR}/usr/bin/ghci-${ghc_v}" \ + "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" \ + "${WORKDIR}/usr/bin/hsc2hs" \ + "${WORKDIR}/usr/bin/runghc-${ghc_v}" \ + "$gp_back" \ + "${WORKDIR}/usr/$(get_libdir)/${PN}-${ghc_v}/package.conf.d/"* + fi + + # Relocate from /usr to ${EPREFIX}/usr + relocate_path "/usr" "${to}/usr" \ + "${WORKDIR}/usr/bin/ghc-${ghc_v}" \ + "${WORKDIR}/usr/bin/ghci-${ghc_v}" \ + "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" \ + "${WORKDIR}/usr/bin/haddock-ghc-${ghc_v}" \ + "${WORKDIR}/usr/bin/hp2ps" \ + "${WORKDIR}/usr/bin/hpc" \ + "${WORKDIR}/usr/bin/hsc2hs" \ + "${WORKDIR}/usr/bin/runghc-${ghc_v}" \ + "${WORKDIR}/usr/$(get_libdir)/${PN}-${ghc_v}/package.conf.d/"* + + # this one we will use to regenerate cache + # so it should point to current tree location + relocate_path "/usr" "${WORKDIR}/usr" "$gp_back" + + if use prefix; then + hprefixify "${bin_libpath}"/${PN}*/settings + fi + + # regenerate the binary package cache + "$gp_back" recache || die "failed to update cache after relocation" + rm "$gp_back" +} + +ghc-check-reqs() { + # These are pessimistic values (slightly bigger than worst-case) + # Worst case is UNREG USE=profile ia64. See bug #611866 for some + # numbers on various arches. + CHECKREQS_DISK_BUILD=8G + CHECKREQS_DISK_USR=2G + # USE=binary roughly takes + use binary && CHECKREQS_DISK_BUILD=4G + + "$@" +} + +pkg_pretend() { + ghc-check-reqs check-reqs_pkg_pretend +} + +pkg_setup() { + ghc-check-reqs check-reqs_pkg_setup + + # quiet portage about prebuilt binaries + use binary && QA_PREBUILT="*" + + [[ ${MERGE_TYPE} == binary ]] && return + + if use ghcbootstrap; then + ewarn "You requested ghc bootstrapping, this is usually only used" + ewarn "by Gentoo developers to make binary .tbz2 packages." + + [[ -z $(type -P ghc) ]] && \ + die "Could not find a ghc to bootstrap with." + else + if ! yet_binary; then + eerror "Please try emerging with USE=ghcbootstrap and report build" + eerror "sucess or failure to the haskell team (haskell@gentoo.org)" + die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap" + fi + fi + + if needs_python; then + python-any-r1_pkg_setup + fi +} + +src_unpack() { + # Create the ${S} dir if we're using the binary version + use binary && mkdir "${S}" + + # the Solaris and Darwin binaries from ghc (maeder) need to be + # unpacked separately, so prevent them from being unpacked + local ONLYA=${A} + case ${CHOST} in + *-darwin* | *-solaris*) ONLYA=${GHC_P}-src.tar.xz ;; + esac + unpack ${ONLYA} +} + +src_prepare() { + # Force the use of C.utf8 locale + # + # + export LC_ALL=C.utf8 + + ghc_setup_cflags + + if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then + # Modify the wrapper script from the binary tarball to use GHC_PERSISTENT_FLAGS. + # See bug #313635. + sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \ + "${WORKDIR}/usr/bin/ghc-${BIN_PV}" + + # allow hardened users use vanilla binary to bootstrap ghc + # ghci uses mmap with rwx protection at it implements dynamic + # linking on it's own (bug #299709) + pax-mark -m "${WORKDIR}/usr/$(get_libdir)/${PN}-${BIN_PV}/bin/ghc" + fi + + if use binary; then + if use prefix; then + relocate_ghc "${EPREFIX}" + fi + + # Move unpacked files to the expected place + mv "${WORKDIR}/usr" "${S}" + eapply_user + else + if ! use ghcbootstrap; then + case ${CHOST} in + *-darwin* | *-solaris*) + # UPDATE ME for ghc-7 + mkdir "${WORKDIR}"/ghc-bin-installer || die + pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die + use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2 + use x86-solaris && unpack ghc-7.0.3-i386-unknown-solaris2.tar.bz2 + use x86-macos && unpack ghc-7.4.1-i386-apple-darwin.tar.bz2 + use x64-macos && unpack ghc-7.4.1-x86_64-apple-darwin.tar.bz2 + popd > /dev/null + + pushd "${WORKDIR}"/ghc-bin-installer/ghc-[67].?*.? > /dev/null || die + # fix the binaries so they run, on Solaris we need an + # LD_LIBRARY_PATH which has our prefix libdirs, on + # Darwin we need to replace the frameworks with our libs + # from the prefix fix before installation, because some + # of the tools are actually used during configure/make + if [[ ${CHOST} == *-solaris* ]] ; then + export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}" + elif [[ ${CHOST} == *-darwin* ]] ; then + local readline_framework=GNUreadline.framework/GNUreadline + local gmp_framework=/opt/local/lib/libgmp.10.dylib + local ncurses_file=/opt/local/lib/libncurses.5.dylib + for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do + install_name_tool -change \ + ${readline_framework} \ + "${EPREFIX}"/lib/libreadline.dylib \ + ${binary} || die + install_name_tool -change \ + ${gmp_framework} \ + "${EPREFIX}"/usr/lib/libgmp.dylib \ + ${binary} || die + install_name_tool -change \ + ${ncurses_file} \ + "${EPREFIX}"/usr/lib/libncurses.dylib \ + ${binary} || die + done + # we don't do frameworks! + sed -i \ + -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \ + -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \ + rts/package.conf.in || die + fi + + # it is autoconf, but we really don't want to give it too + # many arguments, in fact we do the make in-place anyway + ./configure --prefix="${WORKDIR}"/usr || die + make install || die + popd > /dev/null + ;; + *) + relocate_ghc "${WORKDIR}" + ;; + esac + fi + + sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \ + "${S}/ghc/ghc.wrapper" + + 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}-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 + + # mingw32 target + pushd "${S}/libraries/Win32" + eapply "${FILESDIR}"/${PN}-8.2.1_rc1-win32-cross-2-hack.patch # bad workaround + popd + + bump_libs + + eapply_user + # as we have changed the build system + eautoreconf + fi +} + +src_configure() { + if ! use binary; then + # initialize build.mk + echo '# Gentoo changes' > mk/build.mk + + # Put docs into the right place, ie /usr/share/doc/ghc-${GHC_PV} + echo "docdir = ${EPREFIX}/usr/share/doc/$(cross)${PF}" >> mk/build.mk + echo "htmldir = ${EPREFIX}/usr/share/doc/$(cross)${PF}" >> mk/build.mk + + # We also need to use the GHC_FLAGS flags when building ghc itself + echo "SRC_HC_OPTS+=${HCFLAGS} ${GHC_FLAGS}" >> mk/build.mk + echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk + echo "SRC_LD_OPTS+=${LDFLAGS}" >> mk/build.mk + # Speed up initial Cabal bootstrap + echo "utils/ghc-cabal_dist_EXTRA_HC_OPTS+=$(ghc-make-args)" >> mk/build.mk + + # We can't depend on haddock except when bootstrapping when we + # must build docs and include them into the binary .tbz2 package + # app-text/dblatex is not in portage, can not build PDF or PS + echo "BUILD_SPHINX_PDF = NO" >> mk/build.mk + echo "BUILD_SPHINX_HTML = $(usex doc YES NO)" >> mk/build.mk + echo "BUILD_MAN = $(usex doc YES NO)" >> mk/build.mk + + # this controls presence on 'xhtml' and 'haddock' in final install + echo "HADDOCK_DOCS = YES" >> mk/build.mk + + # not used outside of ghc's test + if [[ -n ${GHC_BUILD_DPH} ]]; then + echo "BUILD_DPH = YES" >> mk/build.mk + else + echo "BUILD_DPH = NO" >> mk/build.mk + fi + + # Any non-native build has to skip as it needs + # target haddock binary to be runnabine. + if ! is_native; then + # disable docs generation as it requires running stage2 + echo "HADDOCK_DOCS=NO" >> mk/build.mk + echo "BUILD_SPHINX_HTML=NO" >> mk/build.mk + echo "BUILD_SPHINX_PDF=NO" >> mk/build.mk + fi + + if is_crosscompile; then + # Install ghc-stage1 crosscompiler instead of + # ghc-stage2 cross-built compiler. + echo "Stage1Only=YES" >> mk/build.mk + fi + + # allows overriding build flavours for libraries: + # v - vanilla (static libs) + # p - profiled + # dyn - shared libraries + # example: GHC_LIBRARY_WAYS="v dyn" + if [[ -n ${GHC_LIBRARY_WAYS} ]]; then + echo "GhcLibWays=${GHC_LIBRARY_WAYS}" >> mk/build.mk + fi + echo "BUILD_PROF_LIBS = $(usex profile YES NO)" >> mk/build.mk + + # Get ghc from the unpacked binary .tbz2 + # except when bootstrapping we just pick ghc up off the path + if ! use ghcbootstrap; then + export PATH="${WORKDIR}/usr/bin:${PATH}" + fi + + echo "INTEGER_LIBRARY = $(usex gmp integer-gmp integer-simple)" >> mk/build.mk + + # don't strip anything. Very useful when stage2 SIGSEGVs on you + echo "STRIP_CMD = :" >> mk/build.mk + + local econf_args=() + + # GHC embeds toolchain it was built by and uses it later. + # Don't allow things like ccache or versioned binary slip. + # We use stable thing across gcc upgrades. + # User can use EXTRA_ECONF=CC=... to override this default. + econf_args+=( + AR=${CTARGET}-ar + CC=${CTARGET}-gcc + # these should be inferred by GHC but ghc defaults + # to using bundled tools on windows. + Windres=${CTARGET}-windres + DllWrap=${CTARGET}-dllwrap + # we set the linker explicitly below + --disable-ld-override + ) + case ${CTARGET} in + arm*) + # ld.bfd-2.28 does not work for ghc. Force ld.gold + # instead. This should be removed once gentoo gets + # a fix for R_ARM_COPY bug: https://sourceware.org/PR16177 + econf_args+=(LD=${CTARGET}-ld.gold) + ;; + sparc*) + # ld.gold-2.28 does not work for ghc. Force ld.bfd + # instead. This should be removed once gentoo gets + # a fix for missing --no-relax support bug: + # https://sourceware.org/ml/binutils/2017-07/msg00183.html + econf_args+=(LD=${CTARGET}-ld.bfd) + ;; + *) + econf_args+=(LD=${CTARGET}-ld) + esac + + if [[ ${CBUILD} != ${CHOST} ]]; then + # GHC bug: ghc claims not to support cross-building. + # It does, but does not distinct --host= value + # for stage1 and stage2 compiler. + econf_args+=(--host=${CBUILD}) + fi + + if use ghcmakebinary; then + # When building booting libary we are trying to + # bundle or restrict most of external depends + # with unstable ABI: + # - embed libffi (default GHC behaviour) + # - disable ncurses support for ghci (via haskeline) + # https://bugs.gentoo.org/557478 + # - disable ncurses support for ghc-pkg + echo "libraries/haskeline_CONFIGURE_OPTS += --flag=-terminfo" >> mk/build.mk + echo "utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING" >> mk/build.mk + elif is_native; then + # using ${GTARGET}'s libffi is not supported yet: + # GHC embeds full path for ffi includes without /usr/${CTARGET} account. + econf_args+=(--with-system-libffi) + econf_args+=(--with-ffi-includes=$($(tc-getPKG_CONFIG) libffi --cflags-only-I | sed -e 's@^-I@@')) + fi + + einfo "Final mk/build.mk:" + cat mk/build.mk || die + + econf ${econf_args[@]} \ + --enable-bootstrap-with-devel-snapshot \ + $(use_enable elfutils dwarf-unwind) \ + $(use_enable numa) + + if [[ ${PV} == *9999* ]]; then + GHC_PV="$(grep 'S\[\"PACKAGE_VERSION\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')" + GHC_P=${PN}-${GHC_PV} + fi + fi # ! use binary +} + +src_compile() { + if ! use binary; then + # Stage1Only crosscompiler does not build stage2 + if ! is_crosscompile; then + # 1. build/pax-mark compiler binary first + emake ghc/stage2/build/tmp/ghc-stage2 + # 2. pax-mark (bug #516430) + pax-mark -m ghc/stage2/build/tmp/ghc-stage2 + # 2. build/pax-mark haddock using ghc-stage2 + if is_native; then + # non-native build does not build haddock + # due to HADDOCK_DOCS=NO, but it could. + emake utils/haddock/dist/build/tmp/haddock + pax-mark -m utils/haddock/dist/build/tmp/haddock + fi + fi + # 3. and then all the rest + emake all + fi # ! use binary +} + +src_test() { + # TODO: deal with: + # - sandbox (pollutes environment) + # - extra packages (to extend testsuite coverage) + # bits are taken from 'validate' + local make_test_target='test' # can be fulltest + # not 'emake' as testsuite uses '$MAKE' without jobserver available + make $make_test_target stage=2 THREADS=$(makeopts_jobs) +} + +src_install() { + if use binary; then + use prefix && mkdir -p "${ED}" + mv "${S}/usr" "${ED}" + else + [[ -f VERSION ]] || emake VERSION + + # -j1 due to a rare race in install script: + # make --no-print-directory -f ghc.mk phase=final install + # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 755 \ + # -d "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404/include" + # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 644 utils/hsc2hs/template-hsc.h \ + # "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404" + # /usr/bin/install: cannot create regular file \ + # '/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}" + + # Skip for cross-targets as they all share target location: + # /usr/share/doc/ghc-9999/ + if ! is_crosscompile; then + dodoc "distrib/README" "LICENSE" "VERSION" + fi + + # rename ghc-shipped files to avoid collision + # of external packages. Motivating example: + # user had installed: + # dev-lang/ghc-7.8.4-r0 (with transformers-0.3.0.0) + # dev-haskell/transformers-0.4.2.0 + # then user tried to update to + # dev-lang/ghc-7.8.4-r1 (with transformers-0.4.2.0) + # this will lead to single .conf file collision. + local shipped_conf renamed_conf + local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d" + for shipped_conf in "${package_confdir}"/*.conf; do + # rename 'pkg-ver-id.conf' to 'pkg-ver-id-gentoo-${PF}.conf' + renamed_conf=${shipped_conf%.conf}-gentoo-${PF}.conf + mv "${shipped_conf}" "${renamed_conf}" || die + done + + # remove link, but leave 'haddock-${GHC_P}' + rm -f "${ED}"/usr/bin/$(cross)haddock + + if ! is_crosscompile; then + newbashcomp "${FILESDIR}"/ghc-bash-completion ghc-pkg + newbashcomp utils/completion/ghc.bash ghc + fi + fi + + # path to the package.cache + local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d" + PKGCACHE="${package_confdir}"/package.cache + # copy the package.conf.d, including timestamp, save it so we can help + # users that have a broken package.conf.d + cp -pR "${package_confdir}"{,.initial} || die "failed to backup intial package.conf.d" + + # copy the package.conf, including timestamp, save it so we later can put it + # back before uninstalling, or when upgrading. + cp -p "${PKGCACHE}"{,.shipped} \ + || die "failed to copy package.conf.d/package.cache" + + if is_crosscompile; then + # When we build a cross-compiler the layout is the following: + # usr/lib/${CTARGET}-ghc-${VER}/ contains target libraries + # but + # usr/lib/${CTARGET}-ghc-${VER}/bin/ directory + # containst host binaries (modulo bugs). + + # Portage's stripping mechanism does not skip stripping + # foreign binaries. This frequently causes binaries to be + # broken. + # + # Thus below we disable stripping of target libraries and allow + # stripping hosts executables. + dostrip -x "/usr/$(get_libdir)/$(cross)${GHC_P}" + dostrip "/usr/$(get_libdir)/$(cross)${GHC_P}/bin" + fi +} + +pkg_preinst() { + # have we got an earlier version of ghc installed? + if has_version "<${CATEGORY}/${PF}"; then + haskell_updater_warn="1" + fi +} + +pkg_postinst() { + ghc-reregister + + # path to the package.cache + PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache" + + # give the cache a new timestamp, it must be as recent as + # the package.conf.d directory. + touch "${PKGCACHE}" + + if [[ "${haskell_updater_warn}" == "1" ]]; then + ewarn + ewarn "\e[1;31m************************************************************************\e[0m" + ewarn + ewarn "You have just upgraded from an older version of GHC." + ewarn "You may have to run" + ewarn " 'haskell-updater'" + ewarn "to rebuild all ghc-based Haskell libraries." + ewarn + ewarn "\e[1;31m************************************************************************\e[0m" + ewarn + fi +} + +pkg_prerm() { + PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache" + rm -rf "${PKGCACHE}" + + cp -p "${PKGCACHE}"{.shipped,} +} + +pkg_postrm() { + ghc-package_pkg_postrm +} diff --git a/dev-lang/ghc/ghc-8.10.6.ebuild b/dev-lang/ghc/ghc-8.10.6.ebuild deleted file mode 100644 index cee8a725c06a..000000000000 --- a/dev-lang/ghc/ghc-8.10.6.ebuild +++ /dev/null @@ -1,819 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -# to make make a crosscompiler use crossdev and symlink ghc tree into -# cross overlay. result would look like 'cross-sparc-unknown-linux-gnu/ghc' -export CBUILD=${CBUILD:-${CHOST}} -export CTARGET=${CTARGET:-${CHOST}} -if [[ ${CTARGET} = ${CHOST} ]] ; then - if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then - export CTARGET=${CATEGORY/cross-} - fi -fi - -PYTHON_COMPAT=( python3_{8..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 -DESCRIPTION="The Glasgow Haskell Compiler" -HOMEPAGE="https://www.haskell.org/ghc/" - -# we don't have any binaries yet -arch_binaries="" - -BIN_PV=${PV} -# sorted! -#arch_binaries="$arch_binaries alpha? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-alpha.tbz2 )" -#arch_binaries="$arch_binaries arm? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-armv7a-hardfloat-linux-gnueabi.tbz2 )" -#arch_binaries="$arch_binaries arm64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-aarch64-unknown-linux-gnu.tbz2 )" -arch_binaries="$arch_binaries amd64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86_64-pc-linux-gnu.tbz2 )" -#arch_binaries="$arch_binaries ia64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ia64-fixed-fiw.tbz2 )" -#arch_binaries="$arch_binaries ppc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc.tbz2 )" -#arch_binaries="$arch_binaries ppc64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc64.tbz2 )" -#arch_binaries="$arch_binaries ppc64? ( !big-endian? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-powerpc64le-unknown-linux-gnu.tbz2 ) )" -#arch_binaries="$arch_binaries sparc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-sparc.tbz2 )" -arch_binaries="$arch_binaries x86? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-i686-pc-linux-gnu.tbz2 )" - -# various ports: -#arch_binaries="$arch_binaries x86-fbsd? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86-fbsd.tbz2 )" - -# 0 - yet -yet_binary() { - case "${ARCH}" in - #alpha) return 0 ;; - #arm64) return 0 ;; - #arm) return 0 ;; - amd64) return 0 ;; - #ia64) return 0 ;; - #ppc) return 0 ;; - #ppc64) - # use big-endian && return 0 - # return 0 - # ;; - #sparc) return 0 ;; - x86) return 0 ;; - *) return 1 ;; - esac -} - -GHC_PV=${PV} -#GHC_PV=8.10.0.20200123 # uncomment only for -alpha, -beta, -rc ebuilds -GHC_P=${PN}-${GHC_PV} # using ${P} is almost never correct - -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 ) -)" -S="${WORKDIR}"/${GHC_P} - -[[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )" - -BUMP_LIBRARIES=( - # "hackage-name hackage-version" -) - -LICENSE="BSD" -SLOT="0/${PV}" -KEYWORDS="~amd64 ~x86" -IUSE="big-endian +doc elfutils ghcbootstrap ghcmakebinary +gmp numa profile test" -IUSE+=" binary" -RESTRICT="!test? ( test )" - -RDEPEND=" - >=dev-lang/perl-5.6.1 - dev-libs/gmp:0= - sys-libs/ncurses:=[unicode(+)] - elfutils? ( dev-libs/elfutils ) - !ghcmakebinary? ( dev-libs/libffi:= ) - numa? ( sys-process/numactl ) -" - -# This set of dependencies is needed to run -# prebuilt ghc. We specifically avoid ncurses -# dependency with: -# utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING -PREBUILT_BINARY_DEPENDS=" - !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.17 ) ) -" -# This set of dependencies is needed to install -# ghc[binary] in system. terminfo package is linked -# against ncurses. -PREBUILT_BINARY_RDEPENDS="${PREBUILT_BINARY_DEPENDS} - sys-libs/ncurses:0/6 -" - -RDEPEND+="binary? ( ${PREBUILT_BINARY_RDEPENDS} )" - -DEPEND="${RDEPEND}" -BDEPEND=" - virtual/pkgconfig - doc? ( app-text/docbook-xml-dtd:4.2 - app-text/docbook-xml-dtd:4.5 - app-text/docbook-xsl-stylesheets - dev-python/sphinx - >=dev-libs/libxslt-1.1.2 ) - !ghcbootstrap? ( ${PREBUILT_BINARY_DEPENDS} ) - test? ( ${PYTHON_DEPS} ) -" - -needs_python() { - # test driver is written in python - use test && return 0 - return 1 -} - -# we build binaries without profiling support -REQUIRED_USE=" - ?? ( ghcbootstrap binary ) - ?? ( profile binary ) -" - -# haskell libraries built with cabal in configure mode, #515354 -QA_CONFIGURE_OPTIONS+=" --with-compiler --with-gcc" - -is_crosscompile() { - [[ ${CHOST} != ${CTARGET} ]] -} - -is_native() { - [[ ${CHOST} == ${CBUILD} ]] && [[ ${CHOST} == ${CTARGET} ]] -} - -if ! is_crosscompile; then - PDEPEND="!ghcbootstrap? ( >=app-admin/haskell-updater-1.2 )" -fi - -# returns tool prefix for crosscompiler. -# Example: -# CTARGET=armv7a-unknown-linux-gnueabi -# CHOST=x86_64-pc-linux-gnu -# "armv7a-unknown-linux-gnueabi-" -# CTARGET=${CHOST} -# "" -# Used in tools and library prefix: -# "${ED}"/usr/bin/$(cross)haddock -# "${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d" - -cross() { - if is_crosscompile; then - echo "${CTARGET}-" - else - echo "" - fi -} - -append-ghc-cflags() { - local persistent compile assemble link - local flag ghcflag - - for flag in $*; do - case ${flag} in - persistent) persistent="yes";; - compile) compile="yes";; - assemble) assemble="yes";; - link) link="yes";; - *) - [[ ${compile} ]] && ghcflag="-optc${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" && - [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}" - [[ ${assemble} ]] && ghcflag="-opta${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" && - [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}" - [[ ${link} ]] && ghcflag="-optl${flag}" LDFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" && - [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}" - ;; - esac - done -} - -# $1 - lib name (under libraries/) -# $2 - lib version -# example: bump_lib "transformers" "0.4.2.0" -bump_lib() { - local pn=$1 pv=$2 - local p=${pn}-${pv} - local f - - einfo "Bumping ${pn} up to ${pv}" - - for f in ghc.mk GNUmakefile; do - mv libraries/"${pn}"/$f "${WORKDIR}"/"${p}"/$f || die - done - mv libraries/"${pn}" "${WORKDIR}"/"${pn}".old || die - mv "${WORKDIR}"/"${p}" libraries/"${pn}" || die -} - -update_SRC_URI() { - local p pn pv - for p in "${BUMP_LIBRARIES[@]}"; do - set -- $p - pn=$1 pv=$2 - - SRC_URI+=" https://hackage.haskell.org/package/${pn}-${pv}/${pn}-${pv}.tar.gz" - done -} - -update_SRC_URI - -bump_libs() { - local p pn pv - for p in "${BUMP_LIBRARIES[@]}"; do - set -- $p - pn=$1 pv=$2 - - bump_lib "${pn}" "${pv}" - done -} - -ghc_setup_cflags() { - # TODO: plumb CFLAGS and BUILD_CFLAGS to respective CONF_CC_OPTS_STAGE - if ! is_native; then - export CFLAGS=${GHC_CFLAGS-"-O2 -pipe"} - export LDFLAGS=${GHC_LDFLAGS-"-Wl,-O1"} - einfo "Crosscompiling mode:" - einfo " CHOST: ${CHOST}" - einfo " CTARGET: ${CTARGET}" - einfo " CFLAGS: ${CFLAGS}" - einfo " LDFLAGS: ${LDFLAGS}" - einfo " prefix: $(cross)" - return - fi - # We need to be very careful with the CFLAGS we ask ghc to pass through to - # gcc. There are plenty of flags which will make gcc produce output that - # breaks ghc in various ways. The main ones we want to pass through are - # -mcpu / -march flags. These are important for arches like alpha & sparc. - # We also use these CFLAGS for building the C parts of ghc, ie the rts. - strip-flags - strip-unsupported-flags - - # Cmm can't parse line numbers #482086 - replace-flags -ggdb[3-9] -ggdb2 - - GHC_FLAGS="" - GHC_PERSISTENT_FLAGS="" - for flag in ${CFLAGS}; do - case ${flag} in - - # Ignore extra optimisation (ghc passes -O to gcc anyway) - # -O2 and above break on too many systems - -O*) ;; - - # Arch and ABI flags are what we're really after - -m*) append-ghc-cflags compile assemble ${flag};; - - # Sometimes it's handy to see backtrace of RTS - # to get an idea what happens there - -g*) append-ghc-cflags compile ${flag};; - - # Ignore all other flags, including all -f* flags - esac - done - - 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 ... -relocate_path() { - local from=$1 - local to=$2 - shift 2 - local file= - for file in "$@" - do - sed -i -e "s|$from|$to|g" \ - "$file" || die "path relocation failed for '$file'" - done -} - -# changes hardcoded ghc paths and updates package index -# $1 - new absolute root path -relocate_ghc() { - local to=$1 ghc_v=${BIN_PV} - - # libdir for prebuilt binary and for current system may mismatch - # It does for prefix installation for example: bug #476998 - local bin_ghc_prefix=${WORKDIR}/usr - local bin_libpath=$(echo "${bin_ghc_prefix}"/lib*) - local bin_libdir=${bin_libpath#${bin_ghc_prefix}/} - - # backup original script to use it later after relocation - local gp_back="${T}/ghc-pkg-${ghc_v}-orig" - cp "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" "$gp_back" || die "unable to backup ghc-pkg wrapper" - - if [[ ${bin_libdir} != $(get_libdir) ]]; then - einfo "Relocating '${bin_libdir}' to '$(get_libdir)' (bug #476998)" - # moving the dir itself is not strictly needed - # but then USE=binary would result in installing - # in '${bin_libdir}' - mv "${bin_ghc_prefix}/${bin_libdir}" "${bin_ghc_prefix}/$(get_libdir)" || die - - relocate_path "/usr/${bin_libdir}" "/usr/$(get_libdir)" \ - "${WORKDIR}/usr/bin/ghc-${ghc_v}" \ - "${WORKDIR}/usr/bin/ghci-${ghc_v}" \ - "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" \ - "${WORKDIR}/usr/bin/hsc2hs" \ - "${WORKDIR}/usr/bin/runghc-${ghc_v}" \ - "$gp_back" \ - "${WORKDIR}/usr/$(get_libdir)/${PN}-${ghc_v}/package.conf.d/"* - fi - - # Relocate from /usr to ${EPREFIX}/usr - relocate_path "/usr" "${to}/usr" \ - "${WORKDIR}/usr/bin/ghc-${ghc_v}" \ - "${WORKDIR}/usr/bin/ghci-${ghc_v}" \ - "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" \ - "${WORKDIR}/usr/bin/haddock-ghc-${ghc_v}" \ - "${WORKDIR}/usr/bin/hp2ps" \ - "${WORKDIR}/usr/bin/hpc" \ - "${WORKDIR}/usr/bin/hsc2hs" \ - "${WORKDIR}/usr/bin/runghc-${ghc_v}" \ - "${WORKDIR}/usr/$(get_libdir)/${PN}-${ghc_v}/package.conf.d/"* - - # this one we will use to regenerate cache - # so it should point to current tree location - relocate_path "/usr" "${WORKDIR}/usr" "$gp_back" - - if use prefix; then - hprefixify "${bin_libpath}"/${PN}*/settings - fi - - # regenerate the binary package cache - "$gp_back" recache || die "failed to update cache after relocation" - rm "$gp_back" -} - -ghc-check-reqs() { - # These are pessimistic values (slightly bigger than worst-case) - # Worst case is UNREG USE=profile ia64. See bug #611866 for some - # numbers on various arches. - CHECKREQS_DISK_BUILD=8G - CHECKREQS_DISK_USR=2G - # USE=binary roughly takes - use binary && CHECKREQS_DISK_BUILD=4G - - "$@" -} - -pkg_pretend() { - ghc-check-reqs check-reqs_pkg_pretend -} - -pkg_setup() { - ghc-check-reqs check-reqs_pkg_setup - - # quiet portage about prebuilt binaries - use binary && QA_PREBUILT="*" - - [[ ${MERGE_TYPE} == binary ]] && return - - if use ghcbootstrap; then - ewarn "You requested ghc bootstrapping, this is usually only used" - ewarn "by Gentoo developers to make binary .tbz2 packages." - - [[ -z $(type -P ghc) ]] && \ - die "Could not find a ghc to bootstrap with." - else - if ! yet_binary; then - eerror "Please try emerging with USE=ghcbootstrap and report build" - eerror "sucess or failure to the haskell team (haskell@gentoo.org)" - die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap" - fi - fi - - if needs_python; then - python-any-r1_pkg_setup - fi -} - -src_unpack() { - # Create the ${S} dir if we're using the binary version - use binary && mkdir "${S}" - - # the Solaris and Darwin binaries from ghc (maeder) need to be - # unpacked separately, so prevent them from being unpacked - local ONLYA=${A} - case ${CHOST} in - *-darwin* | *-solaris*) ONLYA=${GHC_P}-src.tar.xz ;; - esac - unpack ${ONLYA} -} - -src_prepare() { - # Force the use of C.utf8 locale - # - # - export LC_ALL=C.utf8 - - ghc_setup_cflags - - if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then - # Modify the wrapper script from the binary tarball to use GHC_PERSISTENT_FLAGS. - # See bug #313635. - sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \ - "${WORKDIR}/usr/bin/ghc-${BIN_PV}" - - # allow hardened users use vanilla binary to bootstrap ghc - # ghci uses mmap with rwx protection at it implements dynamic - # linking on it's own (bug #299709) - pax-mark -m "${WORKDIR}/usr/$(get_libdir)/${PN}-${BIN_PV}/bin/ghc" - fi - - if use binary; then - if use prefix; then - relocate_ghc "${EPREFIX}" - fi - - # Move unpacked files to the expected place - mv "${WORKDIR}/usr" "${S}" - eapply_user - else - if ! use ghcbootstrap; then - case ${CHOST} in - *-darwin* | *-solaris*) - # UPDATE ME for ghc-7 - mkdir "${WORKDIR}"/ghc-bin-installer || die - pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die - use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2 - use x86-solaris && unpack ghc-7.0.3-i386-unknown-solaris2.tar.bz2 - use x86-macos && unpack ghc-7.4.1-i386-apple-darwin.tar.bz2 - use x64-macos && unpack ghc-7.4.1-x86_64-apple-darwin.tar.bz2 - popd > /dev/null - - pushd "${WORKDIR}"/ghc-bin-installer/ghc-[67].?*.? > /dev/null || die - # fix the binaries so they run, on Solaris we need an - # LD_LIBRARY_PATH which has our prefix libdirs, on - # Darwin we need to replace the frameworks with our libs - # from the prefix fix before installation, because some - # of the tools are actually used during configure/make - if [[ ${CHOST} == *-solaris* ]] ; then - export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}" - elif [[ ${CHOST} == *-darwin* ]] ; then - local readline_framework=GNUreadline.framework/GNUreadline - local gmp_framework=/opt/local/lib/libgmp.10.dylib - local ncurses_file=/opt/local/lib/libncurses.5.dylib - for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do - install_name_tool -change \ - ${readline_framework} \ - "${EPREFIX}"/lib/libreadline.dylib \ - ${binary} || die - install_name_tool -change \ - ${gmp_framework} \ - "${EPREFIX}"/usr/lib/libgmp.dylib \ - ${binary} || die - install_name_tool -change \ - ${ncurses_file} \ - "${EPREFIX}"/usr/lib/libncurses.dylib \ - ${binary} || die - done - # we don't do frameworks! - sed -i \ - -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \ - -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \ - rts/package.conf.in || die - fi - - # it is autoconf, but we really don't want to give it too - # many arguments, in fact we do the make in-place anyway - ./configure --prefix="${WORKDIR}"/usr || die - make install || die - popd > /dev/null - ;; - *) - relocate_ghc "${WORKDIR}" - ;; - esac - fi - - sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \ - "${S}/ghc/ghc.wrapper" - - 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}-8.10.1-allow-cross-bootstrap.patch - eapply "${FILESDIR}"/${PN}-8.10.5-modorigin-verbose-conflict.patch - - # a bunch of crosscompiler patches - # needs newer version: - #eapply "${FILESDIR}"/${PN}-8.2.1_rc1-hp2ps-cross.patch - - # mingw32 target - pushd "${S}/libraries/Win32" - eapply "${FILESDIR}"/${PN}-8.2.1_rc1-win32-cross-2-hack.patch # bad workaround - popd - - bump_libs - - eapply_user - # as we have changed the build system - eautoreconf - fi -} - -src_configure() { - if ! use binary; then - # initialize build.mk - echo '# Gentoo changes' > mk/build.mk - - # Put docs into the right place, ie /usr/share/doc/ghc-${GHC_PV} - echo "docdir = ${EPREFIX}/usr/share/doc/$(cross)${PF}" >> mk/build.mk - echo "htmldir = ${EPREFIX}/usr/share/doc/$(cross)${PF}" >> mk/build.mk - - # We also need to use the GHC_FLAGS flags when building ghc itself - echo "SRC_HC_OPTS+=${HCFLAGS} ${GHC_FLAGS}" >> mk/build.mk - echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk - echo "SRC_LD_OPTS+=${LDFLAGS}" >> mk/build.mk - # Speed up initial Cabal bootstrap - echo "utils/ghc-cabal_dist_EXTRA_HC_OPTS+=$(ghc-make-args)" >> mk/build.mk - - # We can't depend on haddock except when bootstrapping when we - # must build docs and include them into the binary .tbz2 package - # app-text/dblatex is not in portage, can not build PDF or PS - echo "BUILD_SPHINX_PDF = NO" >> mk/build.mk - echo "BUILD_SPHINX_HTML = $(usex doc YES NO)" >> mk/build.mk - echo "BUILD_MAN = $(usex doc YES NO)" >> mk/build.mk - - # this controls presence on 'xhtml' and 'haddock' in final install - echo "HADDOCK_DOCS = YES" >> mk/build.mk - - # not used outside of ghc's test - if [[ -n ${GHC_BUILD_DPH} ]]; then - echo "BUILD_DPH = YES" >> mk/build.mk - else - echo "BUILD_DPH = NO" >> mk/build.mk - fi - - # Any non-native build has to skip as it needs - # target haddock binary to be runnabine. - if ! is_native; then - # disable docs generation as it requires running stage2 - echo "HADDOCK_DOCS=NO" >> mk/build.mk - echo "BUILD_SPHINX_HTML=NO" >> mk/build.mk - echo "BUILD_SPHINX_PDF=NO" >> mk/build.mk - fi - - if is_crosscompile; then - # Install ghc-stage1 crosscompiler instead of - # ghc-stage2 cross-built compiler. - echo "Stage1Only=YES" >> mk/build.mk - fi - - # allows overriding build flavours for libraries: - # v - vanilla (static libs) - # p - profiled - # dyn - shared libraries - # example: GHC_LIBRARY_WAYS="v dyn" - if [[ -n ${GHC_LIBRARY_WAYS} ]]; then - echo "GhcLibWays=${GHC_LIBRARY_WAYS}" >> mk/build.mk - fi - echo "BUILD_PROF_LIBS = $(usex profile YES NO)" >> mk/build.mk - - # Get ghc from the unpacked binary .tbz2 - # except when bootstrapping we just pick ghc up off the path - if ! use ghcbootstrap; then - export PATH="${WORKDIR}/usr/bin:${PATH}" - fi - - echo "INTEGER_LIBRARY = $(usex gmp integer-gmp integer-simple)" >> mk/build.mk - - # don't strip anything. Very useful when stage2 SIGSEGVs on you - echo "STRIP_CMD = :" >> mk/build.mk - - local econf_args=() - - # GHC embeds toolchain it was built by and uses it later. - # Don't allow things like ccache or versioned binary slip. - # We use stable thing across gcc upgrades. - # User can use EXTRA_ECONF=CC=... to override this default. - econf_args+=( - AR=${CTARGET}-ar - CC=${CTARGET}-gcc - # these should be inferred by GHC but ghc defaults - # to using bundled tools on windows. - Windres=${CTARGET}-windres - DllWrap=${CTARGET}-dllwrap - # we set the linker explicitly below - --disable-ld-override - ) - case ${CTARGET} in - arm*) - # ld.bfd-2.28 does not work for ghc. Force ld.gold - # instead. This should be removed once gentoo gets - # a fix for R_ARM_COPY bug: https://sourceware.org/PR16177 - econf_args+=(LD=${CTARGET}-ld.gold) - ;; - sparc*) - # ld.gold-2.28 does not work for ghc. Force ld.bfd - # instead. This should be removed once gentoo gets - # a fix for missing --no-relax support bug: - # https://sourceware.org/ml/binutils/2017-07/msg00183.html - econf_args+=(LD=${CTARGET}-ld.bfd) - ;; - *) - econf_args+=(LD=${CTARGET}-ld) - esac - - if [[ ${CBUILD} != ${CHOST} ]]; then - # GHC bug: ghc claims not to support cross-building. - # It does, but does not distinct --host= value - # for stage1 and stage2 compiler. - econf_args+=(--host=${CBUILD}) - fi - - if use ghcmakebinary; then - # When building booting libary we are trying to - # bundle or restrict most of external depends - # with unstable ABI: - # - embed libffi (default GHC behaviour) - # - disable ncurses support for ghci (via haskeline) - # https://bugs.gentoo.org/557478 - # - disable ncurses support for ghc-pkg - echo "libraries/haskeline_CONFIGURE_OPTS += --flag=-terminfo" >> mk/build.mk - echo "utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING" >> mk/build.mk - elif is_native; then - # using ${GTARGET}'s libffi is not supported yet: - # GHC embeds full path for ffi includes without /usr/${CTARGET} account. - econf_args+=(--with-system-libffi) - econf_args+=(--with-ffi-includes=$($(tc-getPKG_CONFIG) libffi --cflags-only-I | sed -e 's@^-I@@')) - fi - - einfo "Final mk/build.mk:" - cat mk/build.mk || die - - econf ${econf_args[@]} \ - --enable-bootstrap-with-devel-snapshot \ - $(use_enable elfutils dwarf-unwind) \ - $(use_enable numa) - - if [[ ${PV} == *9999* ]]; then - GHC_PV="$(grep 'S\[\"PACKAGE_VERSION\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')" - GHC_P=${PN}-${GHC_PV} - fi - fi # ! use binary -} - -src_compile() { - if ! use binary; then - # Stage1Only crosscompiler does not build stage2 - if ! is_crosscompile; then - # 1. build/pax-mark compiler binary first - emake ghc/stage2/build/tmp/ghc-stage2 - # 2. pax-mark (bug #516430) - pax-mark -m ghc/stage2/build/tmp/ghc-stage2 - # 2. build/pax-mark haddock using ghc-stage2 - if is_native; then - # non-native build does not build haddock - # due to HADDOCK_DOCS=NO, but it could. - emake utils/haddock/dist/build/tmp/haddock - pax-mark -m utils/haddock/dist/build/tmp/haddock - fi - fi - # 3. and then all the rest - emake all - fi # ! use binary -} - -src_test() { - # TODO: deal with: - # - sandbox (pollutes environment) - # - extra packages (to extend testsuite coverage) - # bits are taken from 'validate' - local make_test_target='test' # can be fulltest - # not 'emake' as testsuite uses '$MAKE' without jobserver available - make $make_test_target stage=2 THREADS=$(makeopts_jobs) -} - -src_install() { - if use binary; then - use prefix && mkdir -p "${ED}" - mv "${S}/usr" "${ED}" - else - [[ -f VERSION ]] || emake VERSION - - # -j1 due to a rare race in install script: - # make --no-print-directory -f ghc.mk phase=final install - # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 755 \ - # -d "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404/include" - # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 644 utils/hsc2hs/template-hsc.h \ - # "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404" - # /usr/bin/install: cannot create regular file \ - # '/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}" - - # Skip for cross-targets as they all share target location: - # /usr/share/doc/ghc-9999/ - if ! is_crosscompile; then - dodoc "distrib/README" "LICENSE" "VERSION" - fi - - # rename ghc-shipped files to avoid collision - # of external packages. Motivating example: - # user had installed: - # dev-lang/ghc-7.8.4-r0 (with transformers-0.3.0.0) - # dev-haskell/transformers-0.4.2.0 - # then user tried to update to - # dev-lang/ghc-7.8.4-r1 (with transformers-0.4.2.0) - # this will lead to single .conf file collision. - local shipped_conf renamed_conf - local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d" - for shipped_conf in "${package_confdir}"/*.conf; do - # rename 'pkg-ver-id.conf' to 'pkg-ver-id-gentoo-${PF}.conf' - renamed_conf=${shipped_conf%.conf}-gentoo-${PF}.conf - mv "${shipped_conf}" "${renamed_conf}" || die - done - - # remove link, but leave 'haddock-${GHC_P}' - rm -f "${ED}"/usr/bin/$(cross)haddock - - if ! is_crosscompile; then - newbashcomp "${FILESDIR}"/ghc-bash-completion ghc-pkg - newbashcomp utils/completion/ghc.bash ghc - fi - fi - - # path to the package.cache - local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d" - PKGCACHE="${package_confdir}"/package.cache - # copy the package.conf.d, including timestamp, save it so we can help - # users that have a broken package.conf.d - cp -pR "${package_confdir}"{,.initial} || die "failed to backup intial package.conf.d" - - # copy the package.conf, including timestamp, save it so we later can put it - # back before uninstalling, or when upgrading. - cp -p "${PKGCACHE}"{,.shipped} \ - || die "failed to copy package.conf.d/package.cache" - - if is_crosscompile; then - # When we build a cross-compiler the layout is the following: - # usr/lib/${CTARGET}-ghc-${VER}/ contains target libraries - # but - # usr/lib/${CTARGET}-ghc-${VER}/bin/ directory - # containst host binaries (modulo bugs). - - # Portage's stripping mechanism does not skip stripping - # foreign binaries. This frequently causes binaries to be - # broken. - # - # Thus below we disable stripping of target libraries and allow - # stripping hosts executables. - dostrip -x "/usr/$(get_libdir)/$(cross)${GHC_P}" - dostrip "/usr/$(get_libdir)/$(cross)${GHC_P}/bin" - fi -} - -pkg_preinst() { - # have we got an earlier version of ghc installed? - if has_version "<${CATEGORY}/${PF}"; then - haskell_updater_warn="1" - fi -} - -pkg_postinst() { - ghc-reregister - - # path to the package.cache - PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache" - - # give the cache a new timestamp, it must be as recent as - # the package.conf.d directory. - touch "${PKGCACHE}" - - if [[ "${haskell_updater_warn}" == "1" ]]; then - ewarn - ewarn "\e[1;31m************************************************************************\e[0m" - ewarn - ewarn "You have just upgraded from an older version of GHC." - ewarn "You may have to run" - ewarn " 'haskell-updater'" - ewarn "to rebuild all ghc-based Haskell libraries." - ewarn - ewarn "\e[1;31m************************************************************************\e[0m" - ewarn - fi -} - -pkg_prerm() { - PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache" - rm -rf "${PKGCACHE}" - - cp -p "${PKGCACHE}"{.shipped,} -} - -pkg_postrm() { - ghc-package_pkg_postrm -} diff --git a/dev-lang/ghc/ghc-9.0.2-r2.ebuild b/dev-lang/ghc/ghc-9.0.2-r2.ebuild new file mode 100644 index 000000000000..363423eb235e --- /dev/null +++ b/dev-lang/ghc/ghc-9.0.2-r2.ebuild @@ -0,0 +1,854 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +# to make make a crosscompiler use crossdev and symlink ghc tree into +# cross overlay. result would look like 'cross-sparc-unknown-linux-gnu/ghc' +export CBUILD=${CBUILD:-${CHOST}} +export CTARGET=${CTARGET:-${CHOST}} +if [[ ${CTARGET} = ${CHOST} ]] ; then + if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then + export CTARGET=${CATEGORY/cross-} + fi +fi + +PYTHON_COMPAT=( python3_{8..10} ) +inherit python-any-r1 +inherit autotools bash-completion-r1 flag-o-matic ghc-package +inherit multiprocessing pax-utils toolchain-funcs prefix +inherit check-reqs llvm +DESCRIPTION="The Glasgow Haskell Compiler" +HOMEPAGE="https://www.haskell.org/ghc/" + +# we don't have any binaries yet +arch_binaries="" + +BIN_PV=${PV} +# sorted! +#arch_binaries="$arch_binaries alpha? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-alpha.tbz2 )" +#arch_binaries="$arch_binaries arm? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-armv7a-hardfloat-linux-gnueabi.tbz2 )" +arch_binaries="$arch_binaries arm64? ( https://github.com/matoro/ghc/releases/download/${PV}/ghc-bin-${PV}-aarch64-unknown-linux-gnu.tar.gz )" +arch_binaries="$arch_binaries amd64? ( https://eidetic.codes/ghc-bin-${PV}-x86_64-pc-linux-gnu-r1.tbz2 )" +#arch_binaries="$arch_binaries ia64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ia64-fixed-fiw.tbz2 )" +#arch_binaries="$arch_binaries ppc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc.tbz2 )" +arch_binaries="$arch_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 ) +)" +arch_binaries="$arch_binaries riscv? ( https://github.com/matoro/ghc/releases/download/${PV}/ghc-bin-${PV}-riscv64-unknown-linux-gnu.tar.gz )" +#arch_binaries="$arch_binaries sparc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-sparc.tbz2 )" +arch_binaries="$arch_binaries x86? ( https://eidetic.codes/ghc-bin-${PV}-i686-pc-linux-gnu.tbz2 )" + +# various ports: +#arch_binaries="$arch_binaries x86-fbsd? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86-fbsd.tbz2 )" + +# 0 - yet +yet_binary() { + case "${ARCH}" in + #alpha) return 0 ;; + arm64) return 0 ;; + #arm) return 0 ;; + amd64) return 0 ;; + #ia64) return 0 ;; + #ppc) return 0 ;; + ppc64) return 0 ;; + riscv) return 0 ;; + #sparc) return 0 ;; + x86) return 0 ;; + *) return 1 ;; + esac +} + +GHC_PV=${PV} +#GHC_PV=8.10.0.20200123 # uncomment only for -alpha, -beta, -rc ebuilds +GHC_P=${PN}-${GHC_PV} # using ${P} is almost never correct + +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" +) + +LICENSE="BSD" +SLOT="0/${PV}" +KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86" +IUSE="big-endian +doc elfutils ghcbootstrap ghcmakebinary +gmp llvm numa profile test unregisterised" +IUSE+=" binary" +RESTRICT="!test? ( test )" + +LLVM_MAX_SLOT="13" +RDEPEND=" + >=dev-lang/perl-5.6.1 + dev-libs/gmp:0= + sys-libs/ncurses:=[unicode(+)] + elfutils? ( dev-libs/elfutils ) + !ghcmakebinary? ( dev-libs/libffi:= ) + numa? ( sys-process/numactl ) + llvm? ( + + if ! is_native; then + export CFLAGS=${GHC_CFLAGS-"-O2 -pipe"} + export LDFLAGS=${GHC_LDFLAGS-"-Wl,-O1"} + einfo "Crosscompiling mode:" + einfo " CHOST: ${CHOST}" + einfo " CTARGET: ${CTARGET}" + einfo " CFLAGS: ${CFLAGS}" + einfo " LDFLAGS: ${LDFLAGS}" + einfo " prefix: $(cross)" + return + fi + # We need to be very careful with the CFLAGS we ask ghc to pass through to + # gcc. There are plenty of flags which will make gcc produce output that + # breaks ghc in various ways. The main ones we want to pass through are + # -mcpu / -march flags. These are important for arches like alpha & sparc. + # We also use these CFLAGS for building the C parts of ghc, ie the rts. + strip-flags + strip-unsupported-flags + + # Cmm can't parse line numbers #482086 + replace-flags -ggdb[3-9] -ggdb2 + + GHC_FLAGS="" + GHC_PERSISTENT_FLAGS="" + for flag in ${CFLAGS}; do + case ${flag} in + + # Ignore extra optimisation (ghc passes -O to gcc anyway) + # -O2 and above break on too many systems + -O*) ;; + + # Arch and ABI flags are what we're really after + -m*) append-ghc-cflags compile assemble ${flag};; + + # Sometimes it's handy to see backtrace of RTS + # to get an idea what happens there + -g*) append-ghc-cflags compile ${flag};; + + # Ignore all other flags, including all -f* flags + esac + done + + for flag in ${LDFLAGS}; do + append-ghc-cflags link ${flag} + done +} + +# substitutes string $1 to $2 in files $3 $4 ... +relocate_path() { + local from=$1 + local to=$2 + shift 2 + local file= + for file in "$@" + do + sed -i -e "s|$from|$to|g" \ + "$file" || die "path relocation failed for '$file'" + done +} + +# changes hardcoded ghc paths and updates package index +# $1 - new absolute root path +relocate_ghc() { + local to=$1 ghc_v=${BIN_PV} + + # libdir for prebuilt binary and for current system may mismatch + # It does for prefix installation for example: bug #476998 + local bin_ghc_prefix=${WORKDIR}/usr + local bin_libpath=$(echo "${bin_ghc_prefix}"/lib*) + local bin_libdir=${bin_libpath#${bin_ghc_prefix}/} + + # backup original script to use it later after relocation + local gp_back="${T}/ghc-pkg-${ghc_v}-orig" + cp "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" "$gp_back" || die "unable to backup ghc-pkg wrapper" + + if [[ ${bin_libdir} != $(get_libdir) ]]; then + einfo "Relocating '${bin_libdir}' to '$(get_libdir)' (bug #476998)" + # moving the dir itself is not strictly needed + # but then USE=binary would result in installing + # in '${bin_libdir}' + mv "${bin_ghc_prefix}/${bin_libdir}" "${bin_ghc_prefix}/$(get_libdir)" || die + + relocate_path "/usr/${bin_libdir}" "/usr/$(get_libdir)" \ + "${WORKDIR}/usr/bin/ghc-${ghc_v}" \ + "${WORKDIR}/usr/bin/ghci-${ghc_v}" \ + "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" \ + "${WORKDIR}/usr/bin/hsc2hs" \ + "${WORKDIR}/usr/bin/runghc-${ghc_v}" \ + "$gp_back" \ + "${WORKDIR}/usr/$(get_libdir)/${PN}-${ghc_v}/package.conf.d/"* + fi + + # Relocate from /usr to ${EPREFIX}/usr + relocate_path "/usr" "${to}/usr" \ + "${WORKDIR}/usr/bin/ghc-${ghc_v}" \ + "${WORKDIR}/usr/bin/ghci-${ghc_v}" \ + "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" \ + "${WORKDIR}/usr/bin/haddock-ghc-${ghc_v}" \ + "${WORKDIR}/usr/bin/hp2ps" \ + "${WORKDIR}/usr/bin/hpc" \ + "${WORKDIR}/usr/bin/hsc2hs" \ + "${WORKDIR}/usr/bin/runghc-${ghc_v}" \ + "${WORKDIR}/usr/$(get_libdir)/${PN}-${ghc_v}/package.conf.d/"* + + # this one we will use to regenerate cache + # so it should point to current tree location + relocate_path "/usr" "${WORKDIR}/usr" "$gp_back" + + if use prefix; then + hprefixify "${bin_libpath}"/${PN}*/settings + fi + + # regenerate the binary package cache + "$gp_back" recache || die "failed to update cache after relocation" + rm "$gp_back" +} + +ghc-check-reqs() { + # These are pessimistic values (slightly bigger than worst-case) + # Worst case is UNREG USE=profile ia64. See bug #611866 for some + # numbers on various arches. + CHECKREQS_DISK_BUILD=8G + CHECKREQS_DISK_USR=2G + # USE=binary roughly takes + use binary && CHECKREQS_DISK_BUILD=4G + + "$@" +} + +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 +} + +pkg_setup() { + ghc-check-reqs check-reqs_pkg_setup + + # quiet portage about prebuilt binaries + use binary && QA_PREBUILT="*" + + [[ ${MERGE_TYPE} == binary ]] && return + + if use ghcbootstrap; then + ewarn "You requested ghc bootstrapping, this is usually only used" + ewarn "by Gentoo developers to make binary .tbz2 packages." + + [[ -z $(type -P ghc) ]] && \ + die "Could not find a ghc to bootstrap with." + else + if ! yet_binary; then + eerror "Please try emerging with USE=ghcbootstrap and report build" + eerror "sucess or failure to the haskell team (haskell@gentoo.org)" + die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap" + fi + fi + + if needs_python; then + python-any-r1_pkg_setup + fi + + use llvm && llvm_pkg_setup +} + +src_unpack() { + # Create the ${S} dir if we're using the binary version + use binary && mkdir "${S}" + + # the Solaris and Darwin binaries from ghc (maeder) need to be + # unpacked separately, so prevent them from being unpacked + local ONLYA=${A} + case ${CHOST} in + *-darwin* | *-solaris*) ONLYA=${GHC_P}-src.tar.xz ;; + esac + unpack ${ONLYA} +} + +src_prepare() { + ghc_setup_cflags + + # ghc-9.0.2 release anomaly + # https://www.mail-archive.com/search?l=ghc-devs@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. + sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \ + "${WORKDIR}/usr/bin/ghc-${BIN_PV}" + + # allow hardened users use vanilla binary to bootstrap ghc + # ghci uses mmap with rwx protection at it implements dynamic + # linking on it's own (bug #299709) + 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 + + if use binary; then + if use prefix; then + relocate_ghc "${EPREFIX}" + fi + + # Move unpacked files to the expected place + mv "${WORKDIR}/usr" "${S}" + eapply_user + else + if ! use ghcbootstrap; then + case ${CHOST} in + *-darwin* | *-solaris*) + # UPDATE ME for ghc-7 + mkdir "${WORKDIR}"/ghc-bin-installer || die + pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die + use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2 + use x86-solaris && unpack ghc-7.0.3-i386-unknown-solaris2.tar.bz2 + use x86-macos && unpack ghc-7.4.1-i386-apple-darwin.tar.bz2 + use x64-macos && unpack ghc-7.4.1-x86_64-apple-darwin.tar.bz2 + popd > /dev/null + + pushd "${WORKDIR}"/ghc-bin-installer/ghc-[67].?*.? > /dev/null || die + # fix the binaries so they run, on Solaris we need an + # LD_LIBRARY_PATH which has our prefix libdirs, on + # Darwin we need to replace the frameworks with our libs + # from the prefix fix before installation, because some + # of the tools are actually used during configure/make + if [[ ${CHOST} == *-solaris* ]] ; then + export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}" + elif [[ ${CHOST} == *-darwin* ]] ; then + local readline_framework=GNUreadline.framework/GNUreadline + local gmp_framework=/opt/local/lib/libgmp.10.dylib + local ncurses_file=/opt/local/lib/libncurses.5.dylib + for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do + install_name_tool -change \ + ${readline_framework} \ + "${EPREFIX}"/lib/libreadline.dylib \ + ${binary} || die + install_name_tool -change \ + ${gmp_framework} \ + "${EPREFIX}"/usr/lib/libgmp.dylib \ + ${binary} || die + install_name_tool -change \ + ${ncurses_file} \ + "${EPREFIX}"/usr/lib/libncurses.dylib \ + ${binary} || die + done + # we don't do frameworks! + sed -i \ + -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \ + -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \ + rts/package.conf.in || die + fi + + # it is autoconf, but we really don't want to give it too + # many arguments, in fact we do the make in-place anyway + ./configure --prefix="${WORKDIR}"/usr || die + make install || die + popd > /dev/null + ;; + *) + relocate_ghc "${WORKDIR}" + ;; + esac + fi + + sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \ + "${S}/ghc/ghc.wrapper" + + cd "${S}" # otherwise eapply will break + + 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}-9.0.2-disable-unboxed-arrays.patch + eapply "${FILESDIR}"/${PN}-9.0.2-llvm-13.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" + eapply "${FILESDIR}"/${PN}-8.2.1_rc1-win32-cross-2-hack.patch # bad workaround + popd + + bump_libs + + eapply_user + # as we have changed the build system + eautoreconf + fi +} + +src_configure() { + if ! use binary; then + # initialize build.mk + echo '# Gentoo changes' > mk/build.mk + + # Put docs into the right place, ie /usr/share/doc/ghc-${GHC_PV} + echo "docdir = ${EPREFIX}/usr/share/doc/$(cross)${PF}" >> mk/build.mk + echo "htmldir = ${EPREFIX}/usr/share/doc/$(cross)${PF}" >> mk/build.mk + + # We also need to use the GHC_FLAGS flags when building ghc itself + echo "SRC_HC_OPTS+=${HCFLAGS} ${GHC_FLAGS}" >> mk/build.mk + echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk + echo "SRC_LD_OPTS+=${LDFLAGS}" >> mk/build.mk + # Speed up initial Cabal bootstrap + echo "utils/ghc-cabal_dist_EXTRA_HC_OPTS+=$(ghc-make-args)" >> mk/build.mk + + # We can't depend on haddock except when bootstrapping when we + # must build docs and include them into the binary .tbz2 package + # app-text/dblatex is not in portage, can not build PDF or PS + echo "BUILD_SPHINX_PDF = NO" >> mk/build.mk + echo "BUILD_SPHINX_HTML = $(usex doc YES NO)" >> mk/build.mk + echo "BUILD_MAN = $(usex doc YES NO)" >> mk/build.mk + + # this controls presence on 'xhtml' and 'haddock' in final install + echo "HADDOCK_DOCS = YES" >> mk/build.mk + + # not used outside of ghc's test + if [[ -n ${GHC_BUILD_DPH} ]]; then + echo "BUILD_DPH = YES" >> mk/build.mk + else + echo "BUILD_DPH = NO" >> mk/build.mk + fi + + # Any non-native build has to skip as it needs + # target haddock binary to be runnabine. + if ! is_native; then + # disable docs generation as it requires running stage2 + echo "HADDOCK_DOCS=NO" >> mk/build.mk + echo "BUILD_SPHINX_HTML=NO" >> mk/build.mk + echo "BUILD_SPHINX_PDF=NO" >> mk/build.mk + fi + + if is_crosscompile; then + # Install ghc-stage1 crosscompiler instead of + # ghc-stage2 cross-built compiler. + echo "Stage1Only=YES" >> mk/build.mk + fi + + # allows overriding build flavours for libraries: + # v - vanilla (static libs) + # p - profiled + # dyn - shared libraries + # example: GHC_LIBRARY_WAYS="v dyn" + if [[ -n ${GHC_LIBRARY_WAYS} ]]; then + echo "GhcLibWays=${GHC_LIBRARY_WAYS}" >> mk/build.mk + fi + echo "BUILD_PROF_LIBS = $(usex profile YES NO)" >> mk/build.mk + + # Get ghc from the unpacked binary .tbz2 + # except when bootstrapping we just pick ghc up off the path + if ! use ghcbootstrap; then + export PATH="${WORKDIR}/usr/bin:${PATH}" + fi + + 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 + + local econf_args=() + + # GHC embeds toolchain it was built by and uses it later. + # Don't allow things like ccache or versioned binary slip. + # We use stable thing across gcc upgrades. + # User can use EXTRA_ECONF=CC=... to override this default. + econf_args+=( + AR=${CTARGET}-ar + CC=${CTARGET}-gcc + # these should be inferred by GHC but ghc defaults + # to using bundled tools on windows. + Windres=${CTARGET}-windres + DllWrap=${CTARGET}-dllwrap + # we set the linker explicitly below + --disable-ld-override + ) + case ${CTARGET} in + arm*) + # ld.bfd-2.28 does not work for ghc. Force ld.gold + # instead. This should be removed once gentoo gets + # a fix for R_ARM_COPY bug: https://sourceware.org/PR16177 + econf_args+=(LD=${CTARGET}-ld.gold) + ;; + sparc*) + # ld.gold-2.28 does not work for ghc. Force ld.bfd + # instead. This should be removed once gentoo gets + # a fix for missing --no-relax support bug: + # https://sourceware.org/ml/binutils/2017-07/msg00183.html + econf_args+=(LD=${CTARGET}-ld.bfd) + ;; + *) + econf_args+=(LD=${CTARGET}-ld) + esac + + if [[ ${CBUILD} != ${CHOST} ]]; then + # GHC bug: ghc claims not to support cross-building. + # It does, but does not distinct --host= value + # for stage1 and stage2 compiler. + econf_args+=(--host=${CBUILD}) + fi + + if use ghcmakebinary; then + # When building booting libary we are trying to + # bundle or restrict most of external depends + # with unstable ABI: + # - embed libffi (default GHC behaviour) + # - disable ncurses support for ghci (via haskeline) + # https://bugs.gentoo.org/557478 + # - disable ncurses support for ghc-pkg + echo "libraries/haskeline_CONFIGURE_OPTS += --flag=-terminfo" >> mk/build.mk + echo "utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING" >> mk/build.mk + elif is_native; then + # using ${GTARGET}'s libffi is not supported yet: + # GHC embeds full path for ffi includes without /usr/${CTARGET} account. + econf_args+=(--with-system-libffi) + econf_args+=(--with-ffi-includes=$($(tc-getPKG_CONFIG) libffi --cflags-only-I | sed -e 's@^-I@@')) + fi + + einfo "Final mk/build.mk:" + cat mk/build.mk || die + + econf ${econf_args[@]} \ + --enable-bootstrap-with-devel-snapshot \ + $(use_enable elfutils dwarf-unwind) \ + $(use_enable numa) \ + $(use_enable unregisterised) + + if [[ ${PV} == *9999* ]]; then + GHC_PV="$(grep 'S\[\"PACKAGE_VERSION\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')" + GHC_P=${PN}-${GHC_PV} + fi + fi # ! use binary +} + +src_compile() { + if ! use binary; then + # Stage1Only crosscompiler does not build stage2 + if ! is_crosscompile; then + # 1. build/pax-mark compiler binary first + emake ghc/stage2/build/tmp/ghc-stage2 + # 2. pax-mark (bug #516430) + pax-mark -m ghc/stage2/build/tmp/ghc-stage2 + # 2. build/pax-mark haddock using ghc-stage2 + if is_native; then + # non-native build does not build haddock + # due to HADDOCK_DOCS=NO, but it could. + emake utils/haddock/dist/build/tmp/haddock + pax-mark -m utils/haddock/dist/build/tmp/haddock + fi + fi + # 3. and then all the rest + emake all + fi # ! use binary +} + +src_test() { + # TODO: deal with: + # - sandbox (pollutes environment) + # - extra packages (to extend testsuite coverage) + # bits are taken from 'validate' + local make_test_target='test' # can be fulltest + # not 'emake' as testsuite uses '$MAKE' without jobserver available + make $make_test_target stage=2 THREADS=$(makeopts_jobs) +} + +src_install() { + if use binary; then + use prefix && mkdir -p "${ED}" + mv "${S}/usr" "${ED}" + else + [[ -f VERSION ]] || emake VERSION + + # -j1 due to a rare race in install script: + # make --no-print-directory -f ghc.mk phase=final install + # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 755 \ + # -d "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404/include" + # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 644 utils/hsc2hs/template-hsc.h \ + # "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404" + # /usr/bin/install: cannot create regular file \ + # '/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 + dodoc "distrib/README" "LICENSE" "VERSION" + fi + + # rename ghc-shipped files to avoid collision + # of external packages. Motivating example: + # user had installed: + # dev-lang/ghc-7.8.4-r0 (with transformers-0.3.0.0) + # dev-haskell/transformers-0.4.2.0 + # then user tried to update to + # dev-lang/ghc-7.8.4-r1 (with transformers-0.4.2.0) + # this will lead to single .conf file collision. + local shipped_conf renamed_conf + local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d" + for shipped_conf in "${package_confdir}"/*.conf; do + # rename 'pkg-ver-id.conf' to 'pkg-ver-id-gentoo-${PF}.conf' + renamed_conf=${shipped_conf%.conf}-gentoo-${PF}.conf + mv "${shipped_conf}" "${renamed_conf}" || die + done + + # remove link, but leave 'haddock-${GHC_P}' + rm -f "${ED}"/usr/bin/$(cross)haddock + + if ! is_crosscompile; then + newbashcomp "${FILESDIR}"/ghc-bash-completion ghc-pkg + newbashcomp utils/completion/ghc.bash ghc + fi + fi + + # path to the package.cache + local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d" + PKGCACHE="${package_confdir}"/package.cache + # copy the package.conf.d, including timestamp, save it so we can help + # users that have a broken package.conf.d + cp -pR "${package_confdir}"{,.initial} || die "failed to backup intial package.conf.d" + + # copy the package.conf, including timestamp, save it so we later can put it + # back before uninstalling, or when upgrading. + cp -p "${PKGCACHE}"{,.shipped} \ + || die "failed to copy package.conf.d/package.cache" + + if is_crosscompile; then + # When we build a cross-compiler the layout is the following: + # usr/lib/${CTARGET}-ghc-${VER}/ contains target libraries + # but + # usr/lib/${CTARGET}-ghc-${VER}/bin/ directory + # containst host binaries (modulo bugs). + + # Portage's stripping mechanism does not skip stripping + # foreign binaries. This frequently causes binaries to be + # broken. + # + # Thus below we disable stripping of target libraries and allow + # stripping hosts executables. + dostrip -x "/usr/$(get_libdir)/$(cross)${GHC_P}" + dostrip "/usr/$(get_libdir)/$(cross)${GHC_P}/bin" + fi +} + +pkg_preinst() { + # have we got an earlier version of ghc installed? + if has_version "<${CATEGORY}/${PF}"; then + haskell_updater_warn="1" + fi +} + +pkg_postinst() { + ghc-reregister + + # path to the package.cache + PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache" + + # give the cache a new timestamp, it must be as recent as + # the package.conf.d directory. + touch "${PKGCACHE}" + + if [[ "${haskell_updater_warn}" == "1" ]]; then + ewarn + ewarn "\e[1;31m************************************************************************\e[0m" + ewarn + ewarn "You have just upgraded from an older version of GHC." + ewarn "You may have to run" + ewarn " 'haskell-updater'" + ewarn "to rebuild all ghc-based Haskell libraries." + ewarn + ewarn "\e[1;31m************************************************************************\e[0m" + ewarn + fi +} + +pkg_prerm() { + PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache" + rm -rf "${PKGCACHE}" + + cp -p "${PKGCACHE}"{.shipped,} +} + +pkg_postrm() { + ghc-package_pkg_postrm +} diff --git a/dev-lang/ghc/ghc-9.0.2.ebuild b/dev-lang/ghc/ghc-9.0.2.ebuild deleted file mode 100644 index faea36c1c7ba..000000000000 --- a/dev-lang/ghc/ghc-9.0.2.ebuild +++ /dev/null @@ -1,853 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -# to make make a crosscompiler use crossdev and symlink ghc tree into -# cross overlay. result would look like 'cross-sparc-unknown-linux-gnu/ghc' -export CBUILD=${CBUILD:-${CHOST}} -export CTARGET=${CTARGET:-${CHOST}} -if [[ ${CTARGET} = ${CHOST} ]] ; then - if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then - export CTARGET=${CATEGORY/cross-} - fi -fi - -PYTHON_COMPAT=( python3_{8..10} ) -inherit python-any-r1 -inherit autotools bash-completion-r1 flag-o-matic ghc-package -inherit multiprocessing pax-utils toolchain-funcs prefix -inherit check-reqs llvm -DESCRIPTION="The Glasgow Haskell Compiler" -HOMEPAGE="https://www.haskell.org/ghc/" - -# we don't have any binaries yet -arch_binaries="" - -BIN_PV=${PV} -# sorted! -#arch_binaries="$arch_binaries alpha? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-alpha.tbz2 )" -#arch_binaries="$arch_binaries arm? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-armv7a-hardfloat-linux-gnueabi.tbz2 )" -arch_binaries="$arch_binaries arm64? ( https://github.com/matoro/ghc/releases/download/${PV}/ghc-bin-${PV}-aarch64-unknown-linux-gnu.tar.gz )" -arch_binaries="$arch_binaries amd64? ( https://eidetic.codes/ghc-bin-${PV}-x86_64-pc-linux-gnu-r1.tbz2 )" -#arch_binaries="$arch_binaries ia64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ia64-fixed-fiw.tbz2 )" -#arch_binaries="$arch_binaries ppc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc.tbz2 )" -arch_binaries="$arch_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 ) -)" -arch_binaries="$arch_binaries riscv? ( https://github.com/matoro/ghc/releases/download/${PV}/ghc-bin-${PV}-riscv64-unknown-linux-gnu.tar.gz )" -#arch_binaries="$arch_binaries sparc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-sparc.tbz2 )" -arch_binaries="$arch_binaries x86? ( https://eidetic.codes/ghc-bin-${PV}-i686-pc-linux-gnu.tbz2 )" - -# various ports: -#arch_binaries="$arch_binaries x86-fbsd? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86-fbsd.tbz2 )" - -# 0 - yet -yet_binary() { - case "${ARCH}" in - #alpha) return 0 ;; - arm64) return 0 ;; - #arm) return 0 ;; - amd64) return 0 ;; - #ia64) return 0 ;; - #ppc) return 0 ;; - ppc64) return 0 ;; - riscv) return 0 ;; - #sparc) return 0 ;; - x86) return 0 ;; - *) return 1 ;; - esac -} - -GHC_PV=${PV} -#GHC_PV=8.10.0.20200123 # uncomment only for -alpha, -beta, -rc ebuilds -GHC_P=${PN}-${GHC_PV} # using ${P} is almost never correct - -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" -) - -LICENSE="BSD" -SLOT="0/${PV}" -KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86" -IUSE="big-endian +doc elfutils ghcbootstrap ghcmakebinary +gmp llvm numa profile test unregisterised" -IUSE+=" binary" -RESTRICT="!test? ( test )" - -LLVM_MAX_SLOT="13" -RDEPEND=" - >=dev-lang/perl-5.6.1 - dev-libs/gmp:0= - sys-libs/ncurses:=[unicode(+)] - elfutils? ( dev-libs/elfutils ) - !ghcmakebinary? ( dev-libs/libffi:= ) - numa? ( sys-process/numactl ) - llvm? ( - - if ! is_native; then - export CFLAGS=${GHC_CFLAGS-"-O2 -pipe"} - export LDFLAGS=${GHC_LDFLAGS-"-Wl,-O1"} - einfo "Crosscompiling mode:" - einfo " CHOST: ${CHOST}" - einfo " CTARGET: ${CTARGET}" - einfo " CFLAGS: ${CFLAGS}" - einfo " LDFLAGS: ${LDFLAGS}" - einfo " prefix: $(cross)" - return - fi - # We need to be very careful with the CFLAGS we ask ghc to pass through to - # gcc. There are plenty of flags which will make gcc produce output that - # breaks ghc in various ways. The main ones we want to pass through are - # -mcpu / -march flags. These are important for arches like alpha & sparc. - # We also use these CFLAGS for building the C parts of ghc, ie the rts. - strip-flags - strip-unsupported-flags - - # Cmm can't parse line numbers #482086 - replace-flags -ggdb[3-9] -ggdb2 - - GHC_FLAGS="" - GHC_PERSISTENT_FLAGS="" - for flag in ${CFLAGS}; do - case ${flag} in - - # Ignore extra optimisation (ghc passes -O to gcc anyway) - # -O2 and above break on too many systems - -O*) ;; - - # Arch and ABI flags are what we're really after - -m*) append-ghc-cflags compile assemble ${flag};; - - # Sometimes it's handy to see backtrace of RTS - # to get an idea what happens there - -g*) append-ghc-cflags compile ${flag};; - - # Ignore all other flags, including all -f* flags - esac - done - - for flag in ${LDFLAGS}; do - append-ghc-cflags link ${flag} - done -} - -# substitutes string $1 to $2 in files $3 $4 ... -relocate_path() { - local from=$1 - local to=$2 - shift 2 - local file= - for file in "$@" - do - sed -i -e "s|$from|$to|g" \ - "$file" || die "path relocation failed for '$file'" - done -} - -# changes hardcoded ghc paths and updates package index -# $1 - new absolute root path -relocate_ghc() { - local to=$1 ghc_v=${BIN_PV} - - # libdir for prebuilt binary and for current system may mismatch - # It does for prefix installation for example: bug #476998 - local bin_ghc_prefix=${WORKDIR}/usr - local bin_libpath=$(echo "${bin_ghc_prefix}"/lib*) - local bin_libdir=${bin_libpath#${bin_ghc_prefix}/} - - # backup original script to use it later after relocation - local gp_back="${T}/ghc-pkg-${ghc_v}-orig" - cp "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" "$gp_back" || die "unable to backup ghc-pkg wrapper" - - if [[ ${bin_libdir} != $(get_libdir) ]]; then - einfo "Relocating '${bin_libdir}' to '$(get_libdir)' (bug #476998)" - # moving the dir itself is not strictly needed - # but then USE=binary would result in installing - # in '${bin_libdir}' - mv "${bin_ghc_prefix}/${bin_libdir}" "${bin_ghc_prefix}/$(get_libdir)" || die - - relocate_path "/usr/${bin_libdir}" "/usr/$(get_libdir)" \ - "${WORKDIR}/usr/bin/ghc-${ghc_v}" \ - "${WORKDIR}/usr/bin/ghci-${ghc_v}" \ - "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" \ - "${WORKDIR}/usr/bin/hsc2hs" \ - "${WORKDIR}/usr/bin/runghc-${ghc_v}" \ - "$gp_back" \ - "${WORKDIR}/usr/$(get_libdir)/${PN}-${ghc_v}/package.conf.d/"* - fi - - # Relocate from /usr to ${EPREFIX}/usr - relocate_path "/usr" "${to}/usr" \ - "${WORKDIR}/usr/bin/ghc-${ghc_v}" \ - "${WORKDIR}/usr/bin/ghci-${ghc_v}" \ - "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" \ - "${WORKDIR}/usr/bin/haddock-ghc-${ghc_v}" \ - "${WORKDIR}/usr/bin/hp2ps" \ - "${WORKDIR}/usr/bin/hpc" \ - "${WORKDIR}/usr/bin/hsc2hs" \ - "${WORKDIR}/usr/bin/runghc-${ghc_v}" \ - "${WORKDIR}/usr/$(get_libdir)/${PN}-${ghc_v}/package.conf.d/"* - - # this one we will use to regenerate cache - # so it should point to current tree location - relocate_path "/usr" "${WORKDIR}/usr" "$gp_back" - - if use prefix; then - hprefixify "${bin_libpath}"/${PN}*/settings - fi - - # regenerate the binary package cache - "$gp_back" recache || die "failed to update cache after relocation" - rm "$gp_back" -} - -ghc-check-reqs() { - # These are pessimistic values (slightly bigger than worst-case) - # Worst case is UNREG USE=profile ia64. See bug #611866 for some - # numbers on various arches. - CHECKREQS_DISK_BUILD=8G - CHECKREQS_DISK_USR=2G - # USE=binary roughly takes - use binary && CHECKREQS_DISK_BUILD=4G - - "$@" -} - -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 -} - -pkg_setup() { - ghc-check-reqs check-reqs_pkg_setup - - # quiet portage about prebuilt binaries - use binary && QA_PREBUILT="*" - - [[ ${MERGE_TYPE} == binary ]] && return - - if use ghcbootstrap; then - ewarn "You requested ghc bootstrapping, this is usually only used" - ewarn "by Gentoo developers to make binary .tbz2 packages." - - [[ -z $(type -P ghc) ]] && \ - die "Could not find a ghc to bootstrap with." - else - if ! yet_binary; then - eerror "Please try emerging with USE=ghcbootstrap and report build" - eerror "sucess or failure to the haskell team (haskell@gentoo.org)" - die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap" - fi - fi - - if needs_python; then - python-any-r1_pkg_setup - fi - - use llvm && llvm_pkg_setup -} - -src_unpack() { - # Create the ${S} dir if we're using the binary version - use binary && mkdir "${S}" - - # the Solaris and Darwin binaries from ghc (maeder) need to be - # unpacked separately, so prevent them from being unpacked - local ONLYA=${A} - case ${CHOST} in - *-darwin* | *-solaris*) ONLYA=${GHC_P}-src.tar.xz ;; - esac - unpack ${ONLYA} -} - -src_prepare() { - ghc_setup_cflags - - # ghc-9.0.2 release anomaly - # https://www.mail-archive.com/search?l=ghc-devs@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. - sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \ - "${WORKDIR}/usr/bin/ghc-${BIN_PV}" - - # allow hardened users use vanilla binary to bootstrap ghc - # ghci uses mmap with rwx protection at it implements dynamic - # linking on it's own (bug #299709) - 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 - - if use binary; then - if use prefix; then - relocate_ghc "${EPREFIX}" - fi - - # Move unpacked files to the expected place - mv "${WORKDIR}/usr" "${S}" - eapply_user - else - if ! use ghcbootstrap; then - case ${CHOST} in - *-darwin* | *-solaris*) - # UPDATE ME for ghc-7 - mkdir "${WORKDIR}"/ghc-bin-installer || die - pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die - use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2 - use x86-solaris && unpack ghc-7.0.3-i386-unknown-solaris2.tar.bz2 - use x86-macos && unpack ghc-7.4.1-i386-apple-darwin.tar.bz2 - use x64-macos && unpack ghc-7.4.1-x86_64-apple-darwin.tar.bz2 - popd > /dev/null - - pushd "${WORKDIR}"/ghc-bin-installer/ghc-[67].?*.? > /dev/null || die - # fix the binaries so they run, on Solaris we need an - # LD_LIBRARY_PATH which has our prefix libdirs, on - # Darwin we need to replace the frameworks with our libs - # from the prefix fix before installation, because some - # of the tools are actually used during configure/make - if [[ ${CHOST} == *-solaris* ]] ; then - export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}" - elif [[ ${CHOST} == *-darwin* ]] ; then - local readline_framework=GNUreadline.framework/GNUreadline - local gmp_framework=/opt/local/lib/libgmp.10.dylib - local ncurses_file=/opt/local/lib/libncurses.5.dylib - for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do - install_name_tool -change \ - ${readline_framework} \ - "${EPREFIX}"/lib/libreadline.dylib \ - ${binary} || die - install_name_tool -change \ - ${gmp_framework} \ - "${EPREFIX}"/usr/lib/libgmp.dylib \ - ${binary} || die - install_name_tool -change \ - ${ncurses_file} \ - "${EPREFIX}"/usr/lib/libncurses.dylib \ - ${binary} || die - done - # we don't do frameworks! - sed -i \ - -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \ - -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \ - rts/package.conf.in || die - fi - - # it is autoconf, but we really don't want to give it too - # many arguments, in fact we do the make in-place anyway - ./configure --prefix="${WORKDIR}"/usr || die - make install || die - popd > /dev/null - ;; - *) - relocate_ghc "${WORKDIR}" - ;; - esac - fi - - sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \ - "${S}/ghc/ghc.wrapper" - - cd "${S}" # otherwise eapply will break - - 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}-9.0.2-disable-unboxed-arrays.patch - eapply "${FILESDIR}"/${PN}-9.0.2-llvm-13.patch - eapply "${FILESDIR}"/latomic-subword - eapply "${WORKDIR}"/${P}-riscv64-llvm.patch - - # mingw32 target - pushd "${S}/libraries/Win32" - eapply "${FILESDIR}"/${PN}-8.2.1_rc1-win32-cross-2-hack.patch # bad workaround - popd - - bump_libs - - eapply_user - # as we have changed the build system - eautoreconf - fi -} - -src_configure() { - if ! use binary; then - # initialize build.mk - echo '# Gentoo changes' > mk/build.mk - - # Put docs into the right place, ie /usr/share/doc/ghc-${GHC_PV} - echo "docdir = ${EPREFIX}/usr/share/doc/$(cross)${PF}" >> mk/build.mk - echo "htmldir = ${EPREFIX}/usr/share/doc/$(cross)${PF}" >> mk/build.mk - - # We also need to use the GHC_FLAGS flags when building ghc itself - echo "SRC_HC_OPTS+=${HCFLAGS} ${GHC_FLAGS}" >> mk/build.mk - echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk - echo "SRC_LD_OPTS+=${LDFLAGS}" >> mk/build.mk - # Speed up initial Cabal bootstrap - echo "utils/ghc-cabal_dist_EXTRA_HC_OPTS+=$(ghc-make-args)" >> mk/build.mk - - # We can't depend on haddock except when bootstrapping when we - # must build docs and include them into the binary .tbz2 package - # app-text/dblatex is not in portage, can not build PDF or PS - echo "BUILD_SPHINX_PDF = NO" >> mk/build.mk - echo "BUILD_SPHINX_HTML = $(usex doc YES NO)" >> mk/build.mk - echo "BUILD_MAN = $(usex doc YES NO)" >> mk/build.mk - - # this controls presence on 'xhtml' and 'haddock' in final install - echo "HADDOCK_DOCS = YES" >> mk/build.mk - - # not used outside of ghc's test - if [[ -n ${GHC_BUILD_DPH} ]]; then - echo "BUILD_DPH = YES" >> mk/build.mk - else - echo "BUILD_DPH = NO" >> mk/build.mk - fi - - # Any non-native build has to skip as it needs - # target haddock binary to be runnabine. - if ! is_native; then - # disable docs generation as it requires running stage2 - echo "HADDOCK_DOCS=NO" >> mk/build.mk - echo "BUILD_SPHINX_HTML=NO" >> mk/build.mk - echo "BUILD_SPHINX_PDF=NO" >> mk/build.mk - fi - - if is_crosscompile; then - # Install ghc-stage1 crosscompiler instead of - # ghc-stage2 cross-built compiler. - echo "Stage1Only=YES" >> mk/build.mk - fi - - # allows overriding build flavours for libraries: - # v - vanilla (static libs) - # p - profiled - # dyn - shared libraries - # example: GHC_LIBRARY_WAYS="v dyn" - if [[ -n ${GHC_LIBRARY_WAYS} ]]; then - echo "GhcLibWays=${GHC_LIBRARY_WAYS}" >> mk/build.mk - fi - echo "BUILD_PROF_LIBS = $(usex profile YES NO)" >> mk/build.mk - - # Get ghc from the unpacked binary .tbz2 - # except when bootstrapping we just pick ghc up off the path - if ! use ghcbootstrap; then - export PATH="${WORKDIR}/usr/bin:${PATH}" - fi - - 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 - - local econf_args=() - - # GHC embeds toolchain it was built by and uses it later. - # Don't allow things like ccache or versioned binary slip. - # We use stable thing across gcc upgrades. - # User can use EXTRA_ECONF=CC=... to override this default. - econf_args+=( - AR=${CTARGET}-ar - CC=${CTARGET}-gcc - # these should be inferred by GHC but ghc defaults - # to using bundled tools on windows. - Windres=${CTARGET}-windres - DllWrap=${CTARGET}-dllwrap - # we set the linker explicitly below - --disable-ld-override - ) - case ${CTARGET} in - arm*) - # ld.bfd-2.28 does not work for ghc. Force ld.gold - # instead. This should be removed once gentoo gets - # a fix for R_ARM_COPY bug: https://sourceware.org/PR16177 - econf_args+=(LD=${CTARGET}-ld.gold) - ;; - sparc*) - # ld.gold-2.28 does not work for ghc. Force ld.bfd - # instead. This should be removed once gentoo gets - # a fix for missing --no-relax support bug: - # https://sourceware.org/ml/binutils/2017-07/msg00183.html - econf_args+=(LD=${CTARGET}-ld.bfd) - ;; - *) - econf_args+=(LD=${CTARGET}-ld) - esac - - if [[ ${CBUILD} != ${CHOST} ]]; then - # GHC bug: ghc claims not to support cross-building. - # It does, but does not distinct --host= value - # for stage1 and stage2 compiler. - econf_args+=(--host=${CBUILD}) - fi - - if use ghcmakebinary; then - # When building booting libary we are trying to - # bundle or restrict most of external depends - # with unstable ABI: - # - embed libffi (default GHC behaviour) - # - disable ncurses support for ghci (via haskeline) - # https://bugs.gentoo.org/557478 - # - disable ncurses support for ghc-pkg - echo "libraries/haskeline_CONFIGURE_OPTS += --flag=-terminfo" >> mk/build.mk - echo "utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING" >> mk/build.mk - elif is_native; then - # using ${GTARGET}'s libffi is not supported yet: - # GHC embeds full path for ffi includes without /usr/${CTARGET} account. - econf_args+=(--with-system-libffi) - econf_args+=(--with-ffi-includes=$($(tc-getPKG_CONFIG) libffi --cflags-only-I | sed -e 's@^-I@@')) - fi - - einfo "Final mk/build.mk:" - cat mk/build.mk || die - - econf ${econf_args[@]} \ - --enable-bootstrap-with-devel-snapshot \ - $(use_enable elfutils dwarf-unwind) \ - $(use_enable numa) \ - $(use_enable unregisterised) - - if [[ ${PV} == *9999* ]]; then - GHC_PV="$(grep 'S\[\"PACKAGE_VERSION\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')" - GHC_P=${PN}-${GHC_PV} - fi - fi # ! use binary -} - -src_compile() { - if ! use binary; then - # Stage1Only crosscompiler does not build stage2 - if ! is_crosscompile; then - # 1. build/pax-mark compiler binary first - emake ghc/stage2/build/tmp/ghc-stage2 - # 2. pax-mark (bug #516430) - pax-mark -m ghc/stage2/build/tmp/ghc-stage2 - # 2. build/pax-mark haddock using ghc-stage2 - if is_native; then - # non-native build does not build haddock - # due to HADDOCK_DOCS=NO, but it could. - emake utils/haddock/dist/build/tmp/haddock - pax-mark -m utils/haddock/dist/build/tmp/haddock - fi - fi - # 3. and then all the rest - emake all - fi # ! use binary -} - -src_test() { - # TODO: deal with: - # - sandbox (pollutes environment) - # - extra packages (to extend testsuite coverage) - # bits are taken from 'validate' - local make_test_target='test' # can be fulltest - # not 'emake' as testsuite uses '$MAKE' without jobserver available - make $make_test_target stage=2 THREADS=$(makeopts_jobs) -} - -src_install() { - if use binary; then - use prefix && mkdir -p "${ED}" - mv "${S}/usr" "${ED}" - else - [[ -f VERSION ]] || emake VERSION - - # -j1 due to a rare race in install script: - # make --no-print-directory -f ghc.mk phase=final install - # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 755 \ - # -d "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404/include" - # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 644 utils/hsc2hs/template-hsc.h \ - # "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404" - # /usr/bin/install: cannot create regular file \ - # '/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 - dodoc "distrib/README" "LICENSE" "VERSION" - fi - - # rename ghc-shipped files to avoid collision - # of external packages. Motivating example: - # user had installed: - # dev-lang/ghc-7.8.4-r0 (with transformers-0.3.0.0) - # dev-haskell/transformers-0.4.2.0 - # then user tried to update to - # dev-lang/ghc-7.8.4-r1 (with transformers-0.4.2.0) - # this will lead to single .conf file collision. - local shipped_conf renamed_conf - local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d" - for shipped_conf in "${package_confdir}"/*.conf; do - # rename 'pkg-ver-id.conf' to 'pkg-ver-id-gentoo-${PF}.conf' - renamed_conf=${shipped_conf%.conf}-gentoo-${PF}.conf - mv "${shipped_conf}" "${renamed_conf}" || die - done - - # remove link, but leave 'haddock-${GHC_P}' - rm -f "${ED}"/usr/bin/$(cross)haddock - - if ! is_crosscompile; then - newbashcomp "${FILESDIR}"/ghc-bash-completion ghc-pkg - newbashcomp utils/completion/ghc.bash ghc - fi - fi - - # path to the package.cache - local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d" - PKGCACHE="${package_confdir}"/package.cache - # copy the package.conf.d, including timestamp, save it so we can help - # users that have a broken package.conf.d - cp -pR "${package_confdir}"{,.initial} || die "failed to backup intial package.conf.d" - - # copy the package.conf, including timestamp, save it so we later can put it - # back before uninstalling, or when upgrading. - cp -p "${PKGCACHE}"{,.shipped} \ - || die "failed to copy package.conf.d/package.cache" - - if is_crosscompile; then - # When we build a cross-compiler the layout is the following: - # usr/lib/${CTARGET}-ghc-${VER}/ contains target libraries - # but - # usr/lib/${CTARGET}-ghc-${VER}/bin/ directory - # containst host binaries (modulo bugs). - - # Portage's stripping mechanism does not skip stripping - # foreign binaries. This frequently causes binaries to be - # broken. - # - # Thus below we disable stripping of target libraries and allow - # stripping hosts executables. - dostrip -x "/usr/$(get_libdir)/$(cross)${GHC_P}" - dostrip "/usr/$(get_libdir)/$(cross)${GHC_P}/bin" - fi -} - -pkg_preinst() { - # have we got an earlier version of ghc installed? - if has_version "<${CATEGORY}/${PF}"; then - haskell_updater_warn="1" - fi -} - -pkg_postinst() { - ghc-reregister - - # path to the package.cache - PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache" - - # give the cache a new timestamp, it must be as recent as - # the package.conf.d directory. - touch "${PKGCACHE}" - - if [[ "${haskell_updater_warn}" == "1" ]]; then - ewarn - ewarn "\e[1;31m************************************************************************\e[0m" - ewarn - ewarn "You have just upgraded from an older version of GHC." - ewarn "You may have to run" - ewarn " 'haskell-updater'" - ewarn "to rebuild all ghc-based Haskell libraries." - ewarn - ewarn "\e[1;31m************************************************************************\e[0m" - ewarn - fi -} - -pkg_prerm() { - PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache" - rm -rf "${PKGCACHE}" - - cp -p "${PKGCACHE}"{.shipped,} -} - -pkg_postrm() { - ghc-package_pkg_postrm -} diff --git a/dev-lang/rust-bin/Manifest b/dev-lang/rust-bin/Manifest index 86242a60bde2..00d835fa49cb 100644 --- a/dev-lang/rust-bin/Manifest +++ b/dev-lang/rust-bin/Manifest @@ -67,5 +67,5 @@ DIST rust-1.65.0-x86_64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 054f1b773518a9 DIST rust-src-1.64.0.tar.xz 2437612 BLAKE2B 9bd5cb64c4ac98ffe60f15bf62517f3ba214ec788d939a27135bca4b770a7a760299ffa43090846e9a83c734a6b2d97102e51f9760f655cb596bda91214012a0 SHA512 a1867ea7a36f669fcde149578dceb8bc7503435d9c740594cd6181e0ea0e4be9d3c8b79f755c0f457bdbc3200149cd94eba17922d00610c5ff6be5fe1f8bd862 DIST rust-src-1.65.0.tar.xz 2488012 BLAKE2B d48f5591e72e14084f2fb0d66c1365f1648060d514af23c0498e02adfd7223b1a79bd1f512859b058f9cabc4b88b9230d15960df7c30762a5263d1785b877a68 SHA512 247f822a9c2f16d1de29d1cf6fa7ff393b7c7fe01da66a7c0b4add6259d72403922b8b1bd1b511ed8a9cc0b2c12ff574945aa7fc76c731fba620b466bcdc2eac EBUILD rust-bin-1.64.0-r1.ebuild 6874 BLAKE2B 712d0b0046332418063598f64fc8bd0c024397e27d846e3c11aebdae6c4d29d7fc3da892b64d2d5fdc31f319b19fb380dfb5f96718cdd3cf7da6c4ee8add2fa6 SHA512 1418917f21689335fdd10249a4c7703b4271d89a103b2fd4762a28a98935944daf2e0f9da9456c8e16ab11c123d34d82cd3d0893393d2492f6e076b5ddf453ab -EBUILD rust-bin-1.65.0.ebuild 6882 BLAKE2B e50a2b5d8dc7323e3f4ed9f53f68bed136af92757601df70299ea8210a565e19721c9343d45b6abecd06a8271fff68937afa2533c7066a86ba6ee2078c0a417c SHA512 c6a1ff09323d5dbf90ccfe3d8e5d3babc38d2ffd3030ca57d5812772769486cab4b2d889f2de0b240c650162b5b6d8af25f9975770b93d2322d761e43e39cd0b +EBUILD rust-bin-1.65.0.ebuild 6731 BLAKE2B 7b99f342ca789758847d407d1c90176d50260505bdcfc9b49b27b636e0765b375e48d9c8230fe919b095c84b1889ec6e4c68cb52f290a33c002242ffb7f196cf SHA512 263d90323d4feb1526eb32ec7b51e8d02d55b8f68db16bc286e99a6fab1fccf484c210ff96a23bc13a6b0709c07161918aec28cb733bedea0c5c37341c0ff736 MISC metadata.xml 696 BLAKE2B d6c2665e1859a18e6b1bf7c04a0de5adda80e34b759994e158a137219e314ed0e4890a8a7f680e1b7bfb940c04e3c0b49eb3518f2fc08dcc9e19cd5fb867d02e SHA512 b93c2ab79c454d8897948e810150cb2512ca606083a2aa2135425a69ac7b7077f64e3d86f8f8b13734640a05e668a870d70003d6dc9fd3d151ca7ffcf2fb3c44 diff --git a/dev-lang/rust-bin/rust-bin-1.65.0.ebuild b/dev-lang/rust-bin/rust-bin-1.65.0.ebuild index c00d7db1e499..2622c2b69c23 100644 --- a/dev-lang/rust-bin/rust-bin-1.65.0.ebuild +++ b/dev-lang/rust-bin/rust-bin-1.65.0.ebuild @@ -21,7 +21,7 @@ SRC_URI+=" sparc? ( ${GENTOO_BIN_BASEURI}/${MY_P}-sparc64-unknown-linux-gnu.tar. LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA" SLOT="stable" KEYWORDS="amd64 arm arm64 ~mips ppc ppc64 ~riscv ~s390 sparc ~x86" -IUSE="clippy cpu_flags_x86_sse2 doc prefix rls rust-analyzer rust-src rustfmt" +IUSE="clippy cpu_flags_x86_sse2 doc prefix rust-analyzer rust-src rustfmt" DEPEND="" @@ -95,9 +95,8 @@ multilib_src_install() { local components="rustc,cargo,${std}" use doc && components="${components},rust-docs" use clippy && components="${components},clippy-preview" - use rls && components="${components},rls-preview,${analysis}" use rustfmt && components="${components},rustfmt-preview" - use rust-analyzer && components="${components},rust-analyzer-preview" + use rust-analyzer && components="${components},rust-analyzer-preview,${analysis}" # Rust component 'rust-src' is extracted from separate archive if use rust-src; then einfo "Combining rust and rust-src installers" @@ -133,7 +132,6 @@ multilib_src_install() { ) use clippy && symlinks+=( clippy-driver cargo-clippy ) - use rls && symlinks+=( rls ) use rustfmt && symlinks+=( rustfmt cargo-fmt ) use rust-analyzer && symlinks+=( rust-analyzer ) @@ -181,9 +179,6 @@ multilib_src_install() { echo /usr/bin/clippy-driver >> "${T}/provider-${P}" echo /usr/bin/cargo-clippy >> "${T}/provider-${P}" fi - if use rls; then - echo /usr/bin/rls >> "${T}/provider-${P}" - fi if use rustfmt; then echo /usr/bin/rustfmt >> "${T}/provider-${P}" echo /usr/bin/cargo-fmt >> "${T}/provider-${P}" diff --git a/dev-lang/rust/Manifest b/dev-lang/rust/Manifest index 11062bba26b6..7206406ad68d 100644 --- a/dev-lang/rust/Manifest +++ b/dev-lang/rust/Manifest @@ -71,5 +71,5 @@ DIST rustc-1.64.0-src.tar.xz.asc 801 BLAKE2B 69f7bd7600d99794859c6fad4b44f0e9886 DIST rustc-1.65.0-src.tar.xz 139674928 BLAKE2B a218263fb67e306b153f5a6dae95b5ec653acaa5eb4b833862d6f0fd4685a8cec097dadc1b8a934e1bf6055672c7a617f9a0ad4a7dbf2e78084297f10b7ada04 SHA512 3d0369ed3028209c4ecb9b9e7b5f5e3a20be8cc05199675df4f091d62a96c0734bc1dbd7630928fe162792392ec6d0daf9ceed10771531ce022200c7b631e3be DIST rustc-1.65.0-src.tar.xz.asc 801 BLAKE2B 43ff92011cd6f7f34ce0495fa341379e5907d032ea90f91e533e5edaec6ad518aad50a9d8b2694074d6909ee96aa779403b16e95792e962e79c1b967542ae26f SHA512 75b9be53363022c81333117876cbcc573bbd4733edf767cbb164218644efb1a9c4bfc2aa73aaa1e39f248a84f1adacb1930a94a6e63f60093ff760fb9ae02efc EBUILD rust-1.64.0-r1.ebuild 23867 BLAKE2B b9d8aa35b84e668fb038fb813bfc6bc2bae4dce945e381cff0645a1fa9463a8cd30aa92e0018a407263929bd0da169191de136e634c9edacccd1ac0ffb69337b SHA512 4a174b1d34e6f7bfd860629d0bc06e99a7accf9eb7c7bf51f10db8b255237c63b3a5aee1291dd2ceb404676a67f5e507a7414ecc132c5926ee292cc047b0ced4 -EBUILD rust-1.65.0.ebuild 23996 BLAKE2B d7a926797df27b629379e237dff0b2017965a488f4cda8c0e26e3e44d32a5d09511e446fd03a4c6312d609a576955a6a216651babe754b7e14c81b8d3d0da35c SHA512 0c651df80c60ff8dbefcc72fe452088d42d04c98e3d5c51257eb91558962b74209286ec274b1ff0d7b66812fc6406cf13278d349b9a85aa2f851526a3ab87738 +EBUILD rust-1.65.0.ebuild 23814 BLAKE2B 85f3750587026d3447efc5c7c6aacfe083e24408b2c19b1ec665608aabee39b0d1787714fac3f720a2678c3bdcfb2879beeae0260618cb3551125edb3e3f1ac9 SHA512 f02ab726b02167a018f924ed46138036beb87d462508f6fa159050e7d0a78b91e65e7c42e832b298bd511dc1050453b888e05d93eec1fd88c24a77f4ab736bdd MISC metadata.xml 1770 BLAKE2B d5881dc5ea39a5bfff7c74fa883dc1a6370db572568e10fce81467c2f2a17018de48123dfa7993d6d9644305bfc5ef5b0f445ef40362065fce943efb4af2e761 SHA512 c914e1a0cee95fa5cb332240f3eb6fbee73e5d8baabfa6bdcdc3e852c9480fea0686e435b969e14f45d8c791655edc6e6a7df2259ac99b6a6e63af65b09fa57e diff --git a/dev-lang/rust/rust-1.65.0.ebuild b/dev-lang/rust/rust-1.65.0.ebuild index bfc942995c50..2306e80be316 100644 --- a/dev-lang/rust/rust-1.65.0.ebuild +++ b/dev-lang/rust/rust-1.65.0.ebuild @@ -41,7 +41,7 @@ LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/(-)?} LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA" -IUSE="clippy cpu_flags_x86_sse2 debug dist doc llvm-libunwind miri nightly parallel-compiler profiler rls rustfmt rust-analyzer rust-src system-bootstrap system-llvm test wasm ${ALL_LLVM_TARGETS[*]}" +IUSE="clippy cpu_flags_x86_sse2 debug dist doc llvm-libunwind miri nightly parallel-compiler profiler rustfmt rust-analyzer rust-src system-bootstrap system-llvm test wasm ${ALL_LLVM_TARGETS[*]}" # Please keep the LLVM dependency block separate. Since LLVM is slotted, # we need to *really* make sure we're not pulling more than one slot @@ -126,7 +126,6 @@ RDEPEND="${DEPEND} REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} ) miri? ( nightly ) parallel-compiler? ( nightly ) - rls? ( rust-src ) rust-analyzer? ( !wasm ) test? ( ${ALL_LLVM_TARGETS[*]} ) wasm? ( llvm_targets_WebAssembly ) @@ -208,7 +207,6 @@ pre_build_checks() { fi M=$(( $(usex clippy 128 0) + ${M} )) M=$(( $(usex miri 128 0) + ${M} )) - M=$(( $(usex rls 512 0) + ${M} )) M=$(( $(usex rustfmt 256 0) + ${M} )) # add 2G if we compile llvm and 256M per llvm_target if ! use system-llvm; then @@ -331,9 +329,8 @@ src_configure() { use clippy && tools+=',"clippy"' use miri && tools+=',"miri"' use profiler && tools+=',"rust-demangler"' - use rls && tools+=',"rls","analysis"' use rustfmt && tools+=',"rustfmt"' - use rust-analyzer && tools+=',"rust-analyzer"' + use rust-analyzer && tools+=',"rust-analyzer","analysis"' use rust-src && tools+=',"src"' local rust_stage0_root @@ -658,7 +655,6 @@ src_install() { use clippy && symlinks+=( clippy-driver cargo-clippy ) use miri && symlinks+=( miri cargo-miri ) use profiler && symlinks+=( rust-demangler ) - use rls && symlinks+=( rls ) use rustfmt && symlinks+=( rustfmt cargo-fmt ) use rust-analyzer && symlinks+=( rust-analyzer ) @@ -719,9 +715,6 @@ src_install() { if use profiler; then echo /usr/bin/rust-demangler >> "${T}/provider-${P}" fi - if use rls; then - echo /usr/bin/rls >> "${T}/provider-${P}" - fi if use rustfmt; then echo /usr/bin/rustfmt >> "${T}/provider-${P}" echo /usr/bin/cargo-fmt >> "${T}/provider-${P}" -- cgit v1.2.3