From bae478b64a6bc9eca66b65bcfa318fc21e7f34bb Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 21 Jan 2023 11:40:40 +0000 Subject: gentoo auto-resync : 21:01:2023 - 11:40:40 --- dev-lang/Manifest.gz | Bin 19520 -> 19528 bytes dev-lang/clipsjni/Manifest | 2 +- dev-lang/clipsjni/clipsjni-6.40-r1.ebuild | 4 +- dev-lang/eisl/Manifest | 2 +- dev-lang/eisl/eisl-2.63.ebuild | 4 +- dev-lang/fennel/Manifest | 2 +- dev-lang/fennel/fennel-1.2.1.ebuild | 4 +- dev-lang/ghc/Manifest | 2 +- dev-lang/ghc/ghc-8.10.6-r1.ebuild | 820 ------------------------------ dev-lang/ghc/ghc-8.10.6-r2.ebuild | 820 ++++++++++++++++++++++++++++++ 10 files changed, 830 insertions(+), 830 deletions(-) delete mode 100644 dev-lang/ghc/ghc-8.10.6-r1.ebuild create mode 100644 dev-lang/ghc/ghc-8.10.6-r2.ebuild (limited to 'dev-lang') diff --git a/dev-lang/Manifest.gz b/dev-lang/Manifest.gz index 272cbc94076a..cf56e13e5af9 100644 Binary files a/dev-lang/Manifest.gz and b/dev-lang/Manifest.gz differ diff --git a/dev-lang/clipsjni/Manifest b/dev-lang/clipsjni/Manifest index bf360ae3e312..f12239a16aef 100644 --- a/dev-lang/clipsjni/Manifest +++ b/dev-lang/clipsjni/Manifest @@ -1,5 +1,5 @@ AUX clipsjni-library-src_makefile.lnx-remove_hardcoded.patch 969 BLAKE2B 14cb1593decec72341774f2057fb3326c70d632e756cd78e569eea0173cd967f13ff5bc12e2df9d3df2dd9ff90e544c5a79616c622a6a6645b4ba428b2674d5e SHA512 b4a3d5162c88ce7bfa56d39c85c2791b5f69614aa9225fa0ac9dcb9806d1b5d33b36cad7d158b9f5c33abbcbca06efe4b1fa6a6e8d5e0a62a75e7ff19b792802 AUX clipsjni-makefile.lnx-java.patch 2408 BLAKE2B 9dc608b442429cf7551bdd260b5f50bc98ae001e75fceb2ec6f5d65320296cd6b546b497a397b77af74be87ad687917c317f8fecb9c288928929e3482bf3fe76 SHA512 d55f56bec1481ef06fa33eaf0fbaa726a97b53ef1df52a8d72cecb33a29284ee6953fbb342695557377f981f30b062000624de65e481342c109db139f21f8e84 DIST clipsjni-6.40.tar.gz 3924580 BLAKE2B 6fce0ba8d2483291e1328ad8cba08bf663959e49414ae29e43bb226b8c82391ccde2d26732c6687ab52ee5cd88101df19c17258907d2fda84bde759d0d3687c6 SHA512 aacfe56ee64ade0be834654246e57a087cfc41d030a7138892158145a3485b0c9af60e188929123e3212ae0cf3cac0d4eac1e13ea0662d72ad714d67d4772d44 -EBUILD clipsjni-6.40-r1.ebuild 1644 BLAKE2B 020a6682c64d920199b792ea6cc1c3fcdaa24bbe1102cdf79b020a8946b5e4466e3c8e3c6096b76d0a81fbfc32d71dc6da2eeb61d12726c709399616069f99c6 SHA512 870d4bf23f4528e4b35cf5b3ccfa3a2e1c8933db99ecc6613e73b7797dc38f8ba665c53ccf34c71571f98a16d9cdb409e5e584e8ee10ec42effadb51258e5921 +EBUILD clipsjni-6.40-r1.ebuild 1643 BLAKE2B 318c3b4001539ba137f56b04357ec58d09d68a07f3e32a62477e517e598bd1e5b72784ca5a67a402a4227770bf6c9f2013a6f70e0f95be92b76398c4f02c9369 SHA512 8dcfb7f45270472eb5bce4823db8c25a7f804349d0593779d8c58b6ce1a06569bf4ef20aeaa259c49b397fe1c14518cfda2fe04e34a921569659ec1459c25d27 MISC metadata.xml 711 BLAKE2B 4f1edc8c2ac622563c61a89dd4334743ae8952523a7d6fc8f17b42668e09e0ef9a43dc9e39a9e204b291175cec54a3661a6dd3de60129e5391d4668d2e5ca1ef SHA512 861a56ca701dfcbcbc93a3e8da1d27a371b55286ecec69be7420829e6d9572c06db31ad76de7bef1f30d0c88ffab44d6ec0682881a147e8aaa6c5970686c1f41 diff --git a/dev-lang/clipsjni/clipsjni-6.40-r1.ebuild b/dev-lang/clipsjni/clipsjni-6.40-r1.ebuild index 5e5cd3a37252..f899be5be27d 100644 --- a/dev-lang/clipsjni/clipsjni-6.40-r1.ebuild +++ b/dev-lang/clipsjni/clipsjni-6.40-r1.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2022 Gentoo Authors +# Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -15,7 +15,7 @@ SRC_URI="https://sourceforge.net/projects/clipsrules/files/CLIPS/${PV}/${CLPN}.t S="${WORKDIR}/${PN^^}" LICENSE="public-domain" -KEYWORDS="~amd64 ~x86" +KEYWORDS="amd64 ~x86" SLOT="0" IUSE="examples" diff --git a/dev-lang/eisl/Manifest b/dev-lang/eisl/Manifest index de6564b13078..445c2f6f0ff8 100644 --- a/dev-lang/eisl/Manifest +++ b/dev-lang/eisl/Manifest @@ -3,7 +3,7 @@ AUX eisl-2.67-Makefile.patch 981 BLAKE2B f237f8757f527e8d2e3fb9a207cb0ccbc94427c DIST eisl-2.63.tar.gz 2004974 BLAKE2B f563c28ebfa6f45b1d5ace1087646fa63e99b98a6f44f42ed74f2bc4d7e29083bc1ad6c4e5234b5cdaf391fd07900fb309c153107a12e553b7636f978084a776 SHA512 fb2cead1cddb98ce63d471ef04f31cda3a8426d627f7d333fa5dc74401a075d923060dfb98ee9d399116535632983e649f2a99440157825f0528da03dae5d051 DIST eisl-2.65.tar.gz 2025074 BLAKE2B d4703b696ea28dd5113dba199ccaf6a37955ca27297efaff4fc7c575fb94d0adfca1a3ae3b2f2baa8fc17ab04cc1b0a5ee0eb2059743a0828b81d6a324a574ce SHA512 7e2f64b37211b119e8a12975403ceec7b0861826a5de0c5e776f1140323f5ee73c75443f2e3438dda4d4cf7e1a8738c6883b1ab6d579558813fa5ddbc6be7898 DIST eisl-2.69.tar.gz 2124476 BLAKE2B 8aa1c63f669f7fc04ca9d3f751cb298d3499d52007ccee7f6bc7d1a0cf6d4539e6d6dd9e76d2fa2ff887a26235ffcaa545d59d2c6c045b8d5f44913798e683af SHA512 3131f917408f768df51f488aadcc168705c118970a984ba5d72a5beb1a39cdd1327d3bc282108ec865df75110ef97c7f25ecfccf3fd552b5cdb0539ca3ca33b5 -EBUILD eisl-2.63.ebuild 874 BLAKE2B 10e2619ab900d581161d371bbe4aefc24752216f814aba28c65ac0b98f3eba2b007ed330183e7b2b72f3cbe197f4521e022aff90ee2755195ea033c71f7b6a2b SHA512 69435c9bd770e4f356d8e3861dcfd8c83779e1ac4e925e4dd808fad542b37f2a97688e4f99a4e3d5b174053261157e3cdc05c8c2e697dfe3c27a89b357bc4484 +EBUILD eisl-2.63.ebuild 873 BLAKE2B 7438f1e9c6324f10b90b6189136f0ca049870ee2f475fdd451b0e3abc679c8d528ffdbe2021715a002beb0cb21e302622ae0586e4eae9b6172db144f8c457977 SHA512 242c39416e07b29855c84e9607cebfba81ee36c0d4fcc035a26371d84bc0a934c32fa8f6a11d76c5e06aea74011149e7907db4f35baec3ea5ba51c9ef7ddd2b4 EBUILD eisl-2.65.ebuild 880 BLAKE2B 1930928d50094260796379906e7b0b4daf9b78036f0dc5a05de8068797ddb0548ccb575dc1e89be78122c979adb8d91ecd1e465af07b709a7fdaa3657f013d3c SHA512 4e1c465a1ea0a72521adf4dedb878148d75aabdb515eeeaaea9a8805e20105e2a14e7e46d6089dfc3795828038c32e0dfaca35206f7d350c65550673b11bbe06 EBUILD eisl-2.69.ebuild 880 BLAKE2B 6b593c8a07e1959a701ac46d2f8458d6ef95286e5cd69e4108cf8f05c2dd1eafa4b632b3af250f4bb4d24813ce94bf48b9623064238766b2bd653d76e5a0514f SHA512 c5e6c7bf69fc643edc8a1917d98054b960983a4f53397e9d02da2447dfda0471ff250cda650b3623cf5dd6d9da32e5bcb628b84e911fbb4c837d3abf9dbd9c27 MISC metadata.xml 631 BLAKE2B fd171b07cf1f7beae7be774a5da360d466c83f01a6bd52dc69af436926ae5aebec27a2723c11498be21c4f96f6b82c6aa3571f4b84e763459ef78086450252f2 SHA512 dd9e329f24ce6d3922e92e81d36234b93151f71c88d6ba4b38557565a7c1c3bc4b7172d4d55f1d2d5bd6c5cada449691067cc71abd4d456941f6a8b78fe0df87 diff --git a/dev-lang/eisl/eisl-2.63.ebuild b/dev-lang/eisl/eisl-2.63.ebuild index 3b3256166271..8f1958272ec6 100644 --- a/dev-lang/eisl/eisl-2.63.ebuild +++ b/dev-lang/eisl/eisl-2.63.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2022 Gentoo Authors +# Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -12,7 +12,7 @@ SRC_URI="https://github.com/sasagawa888/eisl/archive/v${PV}.tar.gz LICENSE="BSD-2" SLOT="0" -KEYWORDS="~amd64 ~x86" +KEYWORDS="amd64 ~x86" RESTRICT="test" # Tests run cppcheck (and fail) DOCS=( README{,-ja}.md documents ) diff --git a/dev-lang/fennel/Manifest b/dev-lang/fennel/Manifest index b75f33bc69fb..8f0463b3648d 100644 --- a/dev-lang/fennel/Manifest +++ b/dev-lang/fennel/Manifest @@ -3,5 +3,5 @@ DIST fennel-1.2.0.tar.gz 270255 BLAKE2B b5cacec8bc6b4baf30e1219b55184176b50819c3 DIST fennel-1.2.1.tar.gz 271590 BLAKE2B 63068e8e9d763bb4a51a5912439e8691b40e7e36da6441329e913c58cd6edb87ad01e35914f2eba881a8b40657c9cc7cbba131709fae42adc1baa7130a2d14d7 SHA512 dc8c99c1708457d1d84f5755145b66e691040ac06bf218e4140e1b3eb614b41b0b7211e304f9bae51304a78c1ec82595d32cf497085fcae4805c51f245620f55 EBUILD fennel-1.1.0.ebuild 768 BLAKE2B 857588a2f43031d3a7121d3d8637e4b1e3fdf2daf15a4e3fbe01179e9377e321b68729c007bdeb4417d56844c7571c852795ce2af59e02340152e7b7406a161e SHA512 517a32ac814917f4e06cc84727539db24cc8b8860ddf13d557f13bad229d0270b50f4fe968e55d9409ad8cfdc31d8c5db9525093fc3004ac80c62a5889ded2b3 EBUILD fennel-1.2.0.ebuild 768 BLAKE2B 857588a2f43031d3a7121d3d8637e4b1e3fdf2daf15a4e3fbe01179e9377e321b68729c007bdeb4417d56844c7571c852795ce2af59e02340152e7b7406a161e SHA512 517a32ac814917f4e06cc84727539db24cc8b8860ddf13d557f13bad229d0270b50f4fe968e55d9409ad8cfdc31d8c5db9525093fc3004ac80c62a5889ded2b3 -EBUILD fennel-1.2.1.ebuild 768 BLAKE2B 857588a2f43031d3a7121d3d8637e4b1e3fdf2daf15a4e3fbe01179e9377e321b68729c007bdeb4417d56844c7571c852795ce2af59e02340152e7b7406a161e SHA512 517a32ac814917f4e06cc84727539db24cc8b8860ddf13d557f13bad229d0270b50f4fe968e55d9409ad8cfdc31d8c5db9525093fc3004ac80c62a5889ded2b3 +EBUILD fennel-1.2.1.ebuild 767 BLAKE2B 45057df58609921d4f65ce1f2538bf7b7e7fc6cd3efca25b101af2c203f7e561aedadfce4fb2c62122d0f93888ceac85212876d0842a2d5210380b6a07860c7a SHA512 b89a4d91b4c476570fdc009eb380c8147645f16a7ecdccfaef5ed8b5902bc16bea1242c40e17987df364925fcb587bb055e0581f405ee5a95105f43e85957925 MISC metadata.xml 1061 BLAKE2B 49ef84fd44f2efd7526055bfc6fd1a37fa0d426a0746d769844ad6fd4ae1efc7dcc541f61fe6f3d8e0e92cb324c6bdfb061312c15ed1d696cf1985aa4cb4097d SHA512 3381a38c5c2ae6482325e6aeea556db767cc6166e89280511d0597c06fbc532a6592d526954f8b1fd40badcac7a951eece9f6aeaf18802f85ca16ccb5da4510d diff --git a/dev-lang/fennel/fennel-1.2.1.ebuild b/dev-lang/fennel/fennel-1.2.1.ebuild index f470a84c2717..541189e07195 100644 --- a/dev-lang/fennel/fennel-1.2.1.ebuild +++ b/dev-lang/fennel/fennel-1.2.1.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2022 Gentoo Authors +# Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -16,7 +16,7 @@ if [[ ${PV} == 9999 ]] ; then EGIT_REPO_URI="https://git.sr.ht/~technomancy/${PN}" else SRC_URI="https://git.sr.ht/~technomancy/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" - KEYWORDS="~amd64 ~x86" + KEYWORDS="amd64 ~x86" fi LICENSE="MIT" diff --git a/dev-lang/ghc/Manifest b/dev-lang/ghc/Manifest index dab5921e859e..acf06ec526e9 100644 --- a/dev-lang/ghc/Manifest +++ b/dev-lang/ghc/Manifest @@ -29,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-r1.ebuild 26334 BLAKE2B 711202b8642c44b41d4f7b335e2e02e407cc112ddc29f3953730c0228d16db6fc704e25d190be58b98bdcac194ed068a784ef3283c58b94c75c426d33dec4950 SHA512 0bdb8b2f18e6a639b5d48df144bda89eb7a2bc635d7d1ef078bc01d1d59f0093ca22fe0f929d6efc12db4e98ac50a1bda76783d4330c7b0d36c0a3f4c2b145ce +EBUILD ghc-8.10.6-r2.ebuild 26359 BLAKE2B c81305dbb761361d63dff6ff8d040632f5f0be5c2f9d0bf8406211321332888f232a377a081625bd19163d228d388aa42ccefe286e61cd8e82ea1255be6546ef SHA512 1e22cfa9a22ee3f28f825ef342ac69574dab3c2cda262a39ad369da08735000556ac5d5510f7b6d15d7fecbb0a261bc386e88d217162853e460c0e0053b1f1ff EBUILD ghc-9.0.2-r2.ebuild 27728 BLAKE2B b63102fb73bb0cd10e3eec9d6f37c513035faa3ab37b3a68a7ba73670a41691570a07b94a3a120a0ec0e7d81371e4758053fe34f03a22578ac685042f8908b8e SHA512 86fad384650abea74d37b1d3c299afb51a83e053fb49f51b671471e1a40a08438b28028dc3af4e702df9a4b9ab42dfab999ffea0a5175441e4ac58ac700435b3 MISC metadata.xml 1172 BLAKE2B 88b5e4af0e8c0e3335185f2c5469837a43ee87e6fc598242f29aced9bb8a3c330139978c564eb4ca503101934917e8406e9400dffd2eeaf7cd9983e8dc96105e SHA512 b03bb932efa54be0d55be591850064fcc967c8d77afdded255be91794544d47bdbbbd2959103cb739f6ec57b8571a955352e965ee1540a9854235a963b218bd3 diff --git a/dev-lang/ghc/ghc-8.10.6-r1.ebuild b/dev-lang/ghc/ghc-8.10.6-r1.ebuild deleted file mode 100644 index 32dcc0691043..000000000000 --- a/dev-lang/ghc/ghc-8.10.6-r1.ebuild +++ /dev/null @@ -1,820 +0,0 @@ -# Copyright 1999-2023 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_{9..10} ) -inherit python-any-r1 -inherit autotools bash-completion-r1 flag-o-matic ghc-package -inherit multilib multiprocessing pax-utils toolchain-funcs prefix -inherit check-reqs -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-r2.ebuild b/dev-lang/ghc/ghc-8.10.6-r2.ebuild new file mode 100644 index 000000000000..a6c5e39b7c68 --- /dev/null +++ b/dev-lang/ghc/ghc-8.10.6-r2.ebuild @@ -0,0 +1,820 @@ +# Copyright 1999-2023 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_{9..10} ) +inherit python-any-r1 +inherit autotools bash-completion-r1 flag-o-matic ghc-package +inherit multilib multiprocessing pax-utils toolchain-funcs prefix +inherit check-reqs +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:=[-exec-static-trampoline] ) + 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 +} -- cgit v1.2.3