The package rpms/ghc.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/ghc.git/commit/?id=5ee2271b2b8390...
https://src.fedoraproject.org/cgit/rpms/ghc.git/commit/?id=826e5b4b12a7ca....
Change:
+%ifarch %{ghc_unregisterized_arches}
-%ifarch %{ghc_unregisterized_arches}
Thanks.
Full change:
============
commit 7ef199a2592a735b1fee59e903aeb74fc8f685ab
Author: Jens Petersen <petersen(a)redhat.com>
Date: Sat Jul 27 12:26:41 2019 +0000
update changelog with latest patches
diff --git a/ghc.spec b/ghc.spec
index 57ffcae..7728f42 100644
--- a/ghc.spec
+++ b/ghc.spec
@@ -680,8 +680,13 @@ make test
-
https://downloads.haskell.org/~ghc/8.6.5/docs/html/users_guide/8.6.5-note...
- fix process library initgroups issue
(
https://github.com/haskell/process/pull/148)
-- enable s390x with unregisterized workaround for 8.4 (#1648537)
-- also re-enable ppc64 with bigendian patch for containers (#1651448)
+- add fix-build-using-unregisterized-v8.4.patch for s390x (#1648537)
+
https://gitlab.haskell.org/ghc/ghc/issues/15913
+- add bigendian patch for containers (#1651448)
+
https://gitlab.haskell.org/ghc/ghc/issues/15411
+- Debian patches:
+ - add_-latomic_to_ghc-prim.patch,
+ - rts osReserveHeapMemory block alignment
* Tue Jul 16 2019 Jens Petersen <petersen(a)redhat.com> - 8.4.4-99
- subpackage library haddock documentation and profiling libraries
commit 826e5b4b12a7ca6ec24d99a4825aa9fa6481b535
Author: Jens Petersen <petersen(a)redhat.com>
Date: Sat Jul 27 12:08:22 2019 +0000
use Debian fix-build-using-unregisterized-v8.4.patch
https://gitlab.haskell.org/ghc/ghc/issues/15913
- remove ghc wrapper script hack!
diff --git a/fix-build-using-unregisterized-v8.4.patch
b/fix-build-using-unregisterized-v8.4.patch
new file mode 100644
index 0000000..c524733
--- /dev/null
+++ b/fix-build-using-unregisterized-v8.4.patch
@@ -0,0 +1,58 @@
+Description: Allow unregisterised ghc-8.4 to build newer GHC
+ Commit 4075656e8bb introduced a regression stopping existing unregisteristed
+ compilers from being able to compile newer versions of GHC. The problem is
+ that the bootstrap compiler uses the newer `rts/storage/ClosureTypes.h` file
+ where some defines have been renamed, resulting in the following error:
+.
+ error: stg_MUT_ARR_PTRS_FROZEN0_info undeclared (first use in this function); did you
mean stg_MUT_ARR_PTRS_FROZEN_DIRTY_info?
+.
+ For more information, see
https://gitlab.haskell.org/ghc/ghc/issues/15913.
+.
+ This patch can be removed, once ghc-8.4 is no longer the bootstrap compiler.
+Author: Ilias Tsitsimpis <iliastsi(a)debian.org>
+Bug:
https://gitlab.haskell.org/ghc/ghc/issues/15913
+Bug-Debian:
https://bugs.debian.org/932941
+
+Index: b/includes/rts/storage/ClosureTypes.h
+===================================================================
+--- a/includes/rts/storage/ClosureTypes.h
++++ b/includes/rts/storage/ClosureTypes.h
+@@ -82,5 +82,11 @@
+ #define SMALL_MUT_ARR_PTRS_DIRTY 60
+ #define SMALL_MUT_ARR_PTRS_FROZEN_DIRTY 61
+ #define SMALL_MUT_ARR_PTRS_FROZEN_CLEAN 62
++#if __GLASGOW_HASKELL__ < 806
++#define SMALL_MUT_ARR_PTRS_FROZEN0 SMALL_MUT_ARR_PTRS_FROZEN_DIRTY
++#define SMALL_MUT_ARR_PTRS_FROZEN SMALL_MUT_ARR_PTRS_FROZEN_CLEAN
++#define MUT_ARR_PTRS_FROZEN0 MUT_ARR_PTRS_FROZEN_DIRTY
++#define MUT_ARR_PTRS_FROZEN MUT_ARR_PTRS_FROZEN_CLEAN
++#endif
+ #define COMPACT_NFDATA 63
+ #define N_CLOSURE_TYPES 64
+Index: b/includes/stg/MiscClosures.h
+===================================================================
+--- a/includes/stg/MiscClosures.h
++++ b/includes/stg/MiscClosures.h
+@@ -116,12 +116,22 @@ RTS_ENTRY(stg_ARR_WORDS);
+ RTS_ENTRY(stg_MUT_ARR_WORDS);
+ RTS_ENTRY(stg_MUT_ARR_PTRS_CLEAN);
+ RTS_ENTRY(stg_MUT_ARR_PTRS_DIRTY);
++#if __GLASGOW_HASKELL__ < 806
++RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN);
++RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN0);
++#else
+ RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN_CLEAN);
+ RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN_DIRTY);
++#endif
+ RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_CLEAN);
+ RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_DIRTY);
++#if __GLASGOW_HASKELL__ < 806
++RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_FROZEN);
++RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_FROZEN0);
++#else
+ RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_FROZEN_CLEAN);
+ RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_FROZEN_DIRTY);
++#endif
+ RTS_ENTRY(stg_MUT_VAR_CLEAN);
+ RTS_ENTRY(stg_MUT_VAR_DIRTY);
+ RTS_ENTRY(stg_END_TSO_QUEUE);
diff --git a/ghc.spec b/ghc.spec
index a2808bd..57ffcae 100644
--- a/ghc.spec
+++ b/ghc.spec
@@ -94,6 +94,10 @@ Patch28: x32-use-native-x86_64-insn.patch
Patch30: add_-latomic_to_ghc-prim.patch
#
https://salsa.debian.org/haskell-team/DHG_packages/blob/master/p/ghc/debi...
Patch32:
https://salsa.debian.org/haskell-team/DHG_packages/raw/master/p/ghc/debia...
+#
https://gitlab.haskell.org/ghc/ghc/issues/15913
+# remove after Fedora default moves to 8.6
+#
https://salsa.debian.org/haskell-team/DHG_packages/blob/master/p/ghc/debi...
+Patch34: fix-build-using-unregisterized-v8.4.patch
# fedora ghc has been bootstrapped on
# %%{ix86} x86_64 ppc ppc64 armv7hl s390 s390x ppc64le aarch64
@@ -327,6 +331,7 @@ cd libraries/process
%ifarch %{ghc_unregisterized_arches}
%patch15 -p1 -b .orig
%patch17 -p1 -b .orig
+%patch34 -p1 -b .orig
%endif
# bigendian
@@ -401,16 +406,6 @@ export LDFLAGS="${LDFLAGS:-%{?__global_ldflags}}"
# for ghc >= 8.2
export CC=%{_bindir}/gcc
-# remove after Fedora default moves to 8.6
-%ifarch %{ghc_unregisterized_arches}
-cat > ghc-unregisterised-wrapper << EOF
-#!/usr/bin/sh
-exec /usr/bin/ghc -optc-I%{_libdir}/ghc-$(ghc --numeric-version)/include
\${1+"\$@"}
-EOF
-chmod a+x ghc-unregisterised-wrapper
-ln -s /usr/bin/ghc-pkg ghc-pkg-unregisterised-wrapper
-%endif
-
# * %%configure induces cross-build due to different target/host/build platform names
./configure --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} \
--bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} \
@@ -421,7 +416,6 @@ ln -s /usr/bin/ghc-pkg ghc-pkg-unregisterised-wrapper
--with-system-libffi \
%ifarch %{ghc_unregisterized_arches}
--enable-unregisterised \
- --with-ghc=$PWD/ghc-unregisterised-wrapper \
%endif
%{nil}
commit 6250e0ee75c8babddcbbb0232541c9a223fd5fa7
Author: Jens Petersen <petersen(a)redhat.com>
Date: Sat Jul 27 12:05:55 2019 +0000
add some patches from Debian (thanks!)
https://salsa.debian.org/haskell-team/DHG_packages/tree/master/p/ghc/debi...
- rename 35a897782b6b0a252da7fdcf4921198ad4e1d96c.patch ->
PprC-Add-support-for-adjacent-floats.patch
- add_-latomic_to_ghc-prim.patch
- e175aaf6918bb2b497b83618dc4c270a0d231a1c.patch (rts osReserveHeapMemory block
alignment)
diff --git a/35a897782b6b0a252da7fdcf4921198ad4e1d96c.patch
b/35a897782b6b0a252da7fdcf4921198ad4e1d96c.patch
deleted file mode 100644
index 3a297c7..0000000
--- a/35a897782b6b0a252da7fdcf4921198ad4e1d96c.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From 35a897782b6b0a252da7fdcf4921198ad4e1d96c Mon Sep 17 00:00:00 2001
-From: James Clarke <jrtc27(a)jrtc27.com>
-Date: Thu, 22 Nov 2018 11:55:17 -0500
-Subject: [PATCH] UNREG: PprC: Add support for adjacent floats
-
-When two 32-bit floats are adjacent for a 64-bit target, there is no
-padding between them to force alignment, so we must combine their bit
-representations into a single word.
-
-Reviewers: bgamari, simonmar
-
-Reviewed By: simonmar
-
-Subscribers: rwbarton, carter
-
-GHC Trac Issues: #15853
-
-Differential Revision:
https://phabricator.haskell.org/D5306
----
- compiler/cmm/PprC.hs | 24 +++++++++++++++++++++++-
- 1 file changed, 23 insertions(+), 1 deletion(-)
-
-diff --git a/compiler/cmm/PprC.hs b/compiler/cmm/PprC.hs
-index 17fef7fc97..6ebfd20291 100644
---- a/compiler/cmm/PprC.hs
-+++ b/compiler/cmm/PprC.hs
-@@ -512,9 +512,12 @@ pprLit1 other = pprLit other
- pprStatics :: DynFlags -> [CmmStatic] -> [SDoc]
- pprStatics _ [] = []
- pprStatics dflags (CmmStaticLit (CmmFloat f W32) : rest)
-- -- floats are padded to a word by padLitToWord, see #1852
-+ -- odd numbers of floats are padded to a word by mkVirtHeapOffsetsWithPadding
- | wORD_SIZE dflags == 8, CmmStaticLit (CmmInt 0 W32) : rest' <- rest
- = pprLit1 (floatToWord dflags f) : pprStatics dflags rest'
-+ -- adjacent floats aren't padded but combined into a single word
-+ | wORD_SIZE dflags == 8, CmmStaticLit (CmmFloat g W32) : rest' <- rest
-+ = pprLit1 (floatPairToWord dflags f g) : pprStatics dflags rest'
- | wORD_SIZE dflags == 4
- = pprLit1 (floatToWord dflags f) : pprStatics dflags rest
- | otherwise
-@@ -1270,6 +1273,25 @@ floatToWord dflags r
- , wORDS_BIGENDIAN dflags = 32
- | otherwise = 0
-
-+floatPairToWord :: DynFlags -> Rational -> Rational -> CmmLit
-+floatPairToWord dflags r1 r2
-+ = runST (do
-+ arr <- newArray_ ((0::Int),1)
-+ writeArray arr 0 (fromRational r1)
-+ writeArray arr 1 (fromRational r2)
-+ arr' <- castFloatToWord32Array arr
-+ w32_1 <- readArray arr' 0
-+ w32_2 <- readArray arr' 1
-+ return (pprWord32Pair w32_1 w32_2)
-+ )
-+ where pprWord32Pair w32_1 w32_2
-+ | wORDS_BIGENDIAN dflags =
-+ CmmInt ((shiftL i1 32) .|. i2) W64
-+ | otherwise =
-+ CmmInt ((shiftL i2 32) .|. i1) W64
-+ where i1 = toInteger w32_1
-+ i2 = toInteger w32_2
-+
- doubleToWords :: DynFlags -> Rational -> [CmmLit]
- doubleToWords dflags r
- = runST (do
---
-2.19.2
-
diff --git a/PprC-Add-support-for-adjacent-floats.patch
b/PprC-Add-support-for-adjacent-floats.patch
new file mode 100644
index 0000000..3a297c7
--- /dev/null
+++ b/PprC-Add-support-for-adjacent-floats.patch
@@ -0,0 +1,69 @@
+From 35a897782b6b0a252da7fdcf4921198ad4e1d96c Mon Sep 17 00:00:00 2001
+From: James Clarke <jrtc27(a)jrtc27.com>
+Date: Thu, 22 Nov 2018 11:55:17 -0500
+Subject: [PATCH] UNREG: PprC: Add support for adjacent floats
+
+When two 32-bit floats are adjacent for a 64-bit target, there is no
+padding between them to force alignment, so we must combine their bit
+representations into a single word.
+
+Reviewers: bgamari, simonmar
+
+Reviewed By: simonmar
+
+Subscribers: rwbarton, carter
+
+GHC Trac Issues: #15853
+
+Differential Revision:
https://phabricator.haskell.org/D5306
+---
+ compiler/cmm/PprC.hs | 24 +++++++++++++++++++++++-
+ 1 file changed, 23 insertions(+), 1 deletion(-)
+
+diff --git a/compiler/cmm/PprC.hs b/compiler/cmm/PprC.hs
+index 17fef7fc97..6ebfd20291 100644
+--- a/compiler/cmm/PprC.hs
++++ b/compiler/cmm/PprC.hs
+@@ -512,9 +512,12 @@ pprLit1 other = pprLit other
+ pprStatics :: DynFlags -> [CmmStatic] -> [SDoc]
+ pprStatics _ [] = []
+ pprStatics dflags (CmmStaticLit (CmmFloat f W32) : rest)
+- -- floats are padded to a word by padLitToWord, see #1852
++ -- odd numbers of floats are padded to a word by mkVirtHeapOffsetsWithPadding
+ | wORD_SIZE dflags == 8, CmmStaticLit (CmmInt 0 W32) : rest' <- rest
+ = pprLit1 (floatToWord dflags f) : pprStatics dflags rest'
++ -- adjacent floats aren't padded but combined into a single word
++ | wORD_SIZE dflags == 8, CmmStaticLit (CmmFloat g W32) : rest' <- rest
++ = pprLit1 (floatPairToWord dflags f g) : pprStatics dflags rest'
+ | wORD_SIZE dflags == 4
+ = pprLit1 (floatToWord dflags f) : pprStatics dflags rest
+ | otherwise
+@@ -1270,6 +1273,25 @@ floatToWord dflags r
+ , wORDS_BIGENDIAN dflags = 32
+ | otherwise = 0
+
++floatPairToWord :: DynFlags -> Rational -> Rational -> CmmLit
++floatPairToWord dflags r1 r2
++ = runST (do
++ arr <- newArray_ ((0::Int),1)
++ writeArray arr 0 (fromRational r1)
++ writeArray arr 1 (fromRational r2)
++ arr' <- castFloatToWord32Array arr
++ w32_1 <- readArray arr' 0
++ w32_2 <- readArray arr' 1
++ return (pprWord32Pair w32_1 w32_2)
++ )
++ where pprWord32Pair w32_1 w32_2
++ | wORDS_BIGENDIAN dflags =
++ CmmInt ((shiftL i1 32) .|. i2) W64
++ | otherwise =
++ CmmInt ((shiftL i2 32) .|. i1) W64
++ where i1 = toInteger w32_1
++ i2 = toInteger w32_2
++
+ doubleToWords :: DynFlags -> Rational -> [CmmLit]
+ doubleToWords dflags r
+ = runST (do
+--
+2.19.2
+
diff --git a/add_-latomic_to_ghc-prim.patch b/add_-latomic_to_ghc-prim.patch
new file mode 100644
index 0000000..71e4ddb
--- /dev/null
+++ b/add_-latomic_to_ghc-prim.patch
@@ -0,0 +1,54 @@
+commit ce3897ffd6e7c8b8f36b8e920168bac8c7f836ae
+Author: Ilias Tsitsimpis <iliastsi(a)debian.org>
+Date: Tue Sep 18 17:45:17 2018 +0200
+
+ Fix check whether GCC supports __atomic_ builtins
+
+ Summary:
+ C11 atomics are never used because:
+
+ * The program used for checking whether GCC supports
+ __atomic_ builtins fails with the following error:
+
+ ```
+ error: size mismatch in argument 2 of `__atomic_load`
+ int test(int *x) { int y; __atomic_load(&x, &y, __ATOMIC_SEQ_CST); return
x; }
+ ```
+
+ * There is a typo when checking if CONF_GCC_SUPPORTS__ATOMICS equals YES,
+ resulting in PRIM_CFLAGS and PRIM_EXTRA_LIBRARIES never being set.
+
+ Reviewers: bgamari
+
+ Reviewed By: bgamari
+
+ Subscribers: rwbarton, erikd, carter
+
+ Differential Revision:
https://phabricator.haskell.org/D5154
+
+Index: b/libraries/ghc-prim/aclocal.m4
+===================================================================
+--- a/libraries/ghc-prim/aclocal.m4
++++ b/libraries/ghc-prim/aclocal.m4
+@@ -5,7 +5,7 @@ AC_DEFUN([FP_GCC_SUPPORTS__ATOMICS],
+ [
+ AC_REQUIRE([AC_PROG_CC])
+ AC_MSG_CHECKING([whether GCC supports __atomic_ builtins])
+- echo 'int test(int *x) { int y; __atomic_load(&x, &y, __ATOMIC_SEQ_CST);
return x; }' > conftest.c
++ echo 'int test(int *x) { int y; __atomic_load(x, &y, __ATOMIC_SEQ_CST);
return y; }' > conftest.c
+ if $CC -c conftest.c > /dev/null 2>&1; then
+ CONF_GCC_SUPPORTS__ATOMICS=YES
+ AC_MSG_RESULT([yes])
+Index: b/libraries/ghc-prim/configure.ac
+===================================================================
+--- a/libraries/ghc-prim/configure.ac
++++ b/libraries/ghc-prim/configure.ac
+@@ -8,7 +8,7 @@ dnl unregisterised, Sparc, and PPC ba
+ FP_GCC_SUPPORTS__ATOMICS
+ AC_DEFINE([HAVE_C11_ATOMICS], [$CONF_GCC_SUPPORTS__ATOMICS], [Does GCC support __atomic
primitives?])
+
+-if test "x$CONF_GCC_SUPPORTS__ATOMICS" = YES
++if test "$CONF_GCC_SUPPORTS__ATOMICS" = "YES"
+ then PRIM_CFLAGS=-DHAVE_C11_ATOMICS
+ PRIM_EXTRA_LIBRARIES=atomic
+ fi
diff --git a/e175aaf6918bb2b497b83618dc4c270a0d231a1c.patch
b/e175aaf6918bb2b497b83618dc4c270a0d231a1c.patch
new file mode 100644
index 0000000..8824289
--- /dev/null
+++ b/e175aaf6918bb2b497b83618dc4c270a0d231a1c.patch
@@ -0,0 +1,63 @@
+From: Sergei Trofimovich <slyfox(a)gentoo.org>
+Date: Wed, 18 Jul 2018 22:36:58 +0000 (+0100)
+Subject: fix osReserveHeapMemory block alignment
+X-Git-Url:
https://git.haskell.org/ghc.git/commitdiff_plain/e175aaf6918bb2b497b83618...
+
+fix osReserveHeapMemory block alignment
+
+Before the change osReserveHeapMemory() attempted
+to allocate chunks of memory via osTryReserveHeapMemory()
+not multiple of MBLOCK_SIZE in the following fallback code:
+
+```
+ if (at == NULL) {
+ *len -= *len / 8;
+```
+
+and caused assertion failure:
+
+```
+$ make fulltest TEST=T11607 WAY=threaded1
+T11607: internal error: ASSERTION FAILED: file rts/posix/OSMem.c, line 457
+ (GHC version 8.7.20180716 for riscv64_unknown_linux)
+
+```
+
+The change applies alignment mask before each MBLOCK allocation attempt
+and fixes WAY=threaded1 test failures on qemu-riscv64.
+
+Signed-off-by: Sergei Trofimovich <slyfox(a)gentoo.org>
+
+Test Plan: run 'make fulltest WAY=threaded1'
+
+Reviewers: simonmar, bgamari, erikd
+
+Reviewed By: simonmar
+
+Subscribers: rwbarton, thomie, carter
+
+Differential Revision:
https://phabricator.haskell.org/D4982
+---
+
+Index: b/rts/posix/OSMem.c
+===================================================================
+--- a/rts/posix/OSMem.c
++++ b/rts/posix/OSMem.c
+@@ -476,6 +476,8 @@ osTryReserveHeapMemory (W_ len, void *hi
+ void *base, *top;
+ void *start, *end;
+
++ ASSERT((len & ~MBLOCK_MASK) == len);
++
+ /* We try to allocate len + MBLOCK_SIZE,
+ because we need memory which is MBLOCK_SIZE aligned,
+ and then we discard what we don't need */
+@@ -552,6 +554,8 @@ void *osReserveHeapMemory(void *startAdd
+
+ attempt = 0;
+ while (1) {
++ *len &= ~MBLOCK_MASK;
++
+ if (*len < MBLOCK_SIZE) {
+ // Give up if the system won't even give us 16 blocks worth of heap
+ barf("osReserveHeapMemory: Failed to allocate heap storage");
diff --git a/ghc.spec b/ghc.spec
index 07942ff..a2808bd 100644
--- a/ghc.spec
+++ b/ghc.spec
@@ -69,12 +69,14 @@ Patch11:
https://github.com/haskell/process/commit/3e0812fe9d3f4712638a1c4c49bf2
# arm
Patch12: ghc-armv7-VFPv3D16--NEON.patch
-# for s390x
+# for unregisterized (s390x)
#
https://ghc.haskell.org/trac/ghc/ticket/15689
Patch15: ghc-warnings.mk-CC-Wall.patch
#
https://gitlab.haskell.org/ghc/ghc/issues/15853
#
https://phabricator.haskell.org/D5306 (in 8.8)
-Patch17:
https://gitlab.haskell.org/ghc/ghc/commit/35a897782b6b0a252da7fdcf4921198...
+#
https://gitlab.haskell.org/ghc/ghc/commit/35a897782b6b0a252da7fdcf4921198...
+#
https://salsa.debian.org/haskell-team/DHG_packages/blob/master/p/ghc/debi...
+Patch17: PprC-Add-support-for-adjacent-floats.patch
# bigendian (s390x and ppc64)
# fix haddock-library
@@ -88,6 +90,10 @@ Patch18:
https://gitlab.haskell.org/ghc/ghc/uploads/5deb133cf910e9e0ca9ad9fe53f7
Patch24: buildpath-abi-stability.patch
Patch26: no-missing-haddock-file-warning.patch
Patch28: x32-use-native-x86_64-insn.patch
+#
https://salsa.debian.org/haskell-team/DHG_packages/blob/master/p/ghc/debi...
+Patch30: add_-latomic_to_ghc-prim.patch
+#
https://salsa.debian.org/haskell-team/DHG_packages/blob/master/p/ghc/debi...
+Patch32:
https://salsa.debian.org/haskell-team/DHG_packages/raw/master/p/ghc/debia...
# fedora ghc has been bootstrapped on
# %%{ix86} x86_64 ppc ppc64 armv7hl s390 s390x ppc64le aarch64
@@ -328,9 +334,12 @@ cd libraries/process
%patch18 -p1 -b .orig
%endif
+# debian
%patch24 -p1 -b .orig
%patch26 -p1 -b .orig
%patch28 -p1 -b .orig
+%patch30 -p1 -b .orig
+%patch32 -p1 -b .orig
%global gen_contents_index gen_contents_index.orig
%if %{with haddock}
commit bbd41d24d2e5574cce8745fac9a052567e7abe6f
Author: Jens Petersen <petersen(a)redhat.com>
Date: Fri Jul 19 03:02:09 2019 +0000
fix initgroups issue in process library
https://github.com/haskell/process/pull/148
diff --git a/3e0812fe9d3f4712638a1c4c49bf2b2a7dc4311b.patch
b/3e0812fe9d3f4712638a1c4c49bf2b2a7dc4311b.patch
new file mode 100644
index 0000000..98a7925
--- /dev/null
+++ b/3e0812fe9d3f4712638a1c4c49bf2b2a7dc4311b.patch
@@ -0,0 +1,92 @@
+From 3e0812fe9d3f4712638a1c4c49bf2b2a7dc4311b Mon Sep 17 00:00:00 2001
+From: Ben Gamari <ben(a)smart-cactus.org>
+Date: Mon, 1 Jul 2019 11:03:33 -0400
+Subject: [PATCH] Call initgroups before setuid
+
+Previously we would fail to call initgroups before setuid'ing. This
+meant that our groups we not be reset to reflect those our new user
+belongs to. Fix this.
+---
+ cbits/runProcess.c | 32 +++++++++++++++++++++++++++++---
+ include/runProcess.h | 4 ++++
+ 2 files changed, 33 insertions(+), 3 deletions(-)
+
+diff --git a/cbits/runProcess.c b/cbits/runProcess.c
+index 10794bc..84d5fd4 100644
+--- a/cbits/runProcess.c
++++ b/cbits/runProcess.c
+@@ -33,6 +33,10 @@ static long max_fd = 0;
+ extern void blockUserSignals(void);
+ extern void unblockUserSignals(void);
+
++// These are arbitrarily chosen -- JP
++#define forkSetgidFailed 124
++#define forkSetuidFailed 125
++
+ // See #1593. The convention for the exit code when
+ // exec() fails seems to be 127 (gleened from C's
+ // system()), but there's no equivalent convention for
+@@ -40,9 +44,8 @@ extern void unblockUserSignals(void);
+ #define forkChdirFailed 126
+ #define forkExecFailed 127
+
+-// These are arbitrarily chosen -- JP
+-#define forkSetgidFailed 124
+-#define forkSetuidFailed 125
++#define forkGetpwuidFailed 128
++#define forkInitgroupsFailed 129
+
+ __attribute__((__noreturn__))
+ static void childFailed(int pipe, int failCode) {
+@@ -182,6 +185,23 @@ runInteractiveProcess (char *const args[],
+ }
+
+ if ( childUser) {
++ // Using setuid properly first requires that we initgroups.
++ // However, to do this we must know the username of the user we are
++ // switching to.
++ struct passwd pw;
++ struct passwd *res = NULL;
++ int buf_len = sysconf(_SC_GETPW_R_SIZE_MAX);
++ char *buf = malloc(buf_len);
++ gid_t suppl_gid = childGroup ? *childGroup : getgid();
++ if ( getpwuid_r(*childUser, &pw, buf, buf_len, &res) != 0) {
++ childFailed(forkCommunicationFds[1], forkGetpwuidFailed);
++ }
++ if ( res == NULL ) {
++ childFailed(forkCommunicationFds[1], forkGetpwuidFailed);
++ }
++ if ( initgroups(res->pw_name, suppl_gid) != 0) {
++ childFailed(forkCommunicationFds[1], forkInitgroupsFailed);
++ }
+ if ( setuid( *childUser) != 0) {
+ // ERROR
+ childFailed(forkCommunicationFds[1], forkSetuidFailed);
+@@ -330,6 +350,12 @@ runInteractiveProcess (char *const args[],
+ case forkSetuidFailed:
+ *failed_doing = "runInteractiveProcess: setuid";
+ break;
++ case forkGetpwuidFailed:
++ *failed_doing = "runInteractiveProcess: getpwuid";
++ break;
++ case forkInitgroupsFailed:
++ *failed_doing = "runInteractiveProcess: initgroups";
++ break;
+ default:
+ *failed_doing = "runInteractiveProcess: unknown";
+ break;
+diff --git a/include/runProcess.h b/include/runProcess.h
+index 3807389..dff3905 100644
+--- a/include/runProcess.h
++++ b/include/runProcess.h
+@@ -21,6 +21,10 @@
+
+ #include <unistd.h>
+ #include <sys/types.h>
++#if !(defined(_MSC_VER) || defined(__MINGW32__) || defined(_WIN32))
++#include <pwd.h>
++#include <grp.h>
++#endif
+
+ #ifdef HAVE_FCNTL_H
+ #include <fcntl.h>
diff --git a/73ea41b3622e2e578d928f7513941aac9d873279.patch
b/73ea41b3622e2e578d928f7513941aac9d873279.patch
new file mode 100644
index 0000000..5b8d646
--- /dev/null
+++ b/73ea41b3622e2e578d928f7513941aac9d873279.patch
@@ -0,0 +1,24 @@
+From 73ea41b3622e2e578d928f7513941aac9d873279 Mon Sep 17 00:00:00 2001
+From: Ben Gamari <ben(a)smart-cactus.org>
+Date: Mon, 1 Jul 2019 11:02:45 -0400
+Subject: [PATCH] Fix incorrect case fallthrough
+
+The error message lookup logic would fallthrough from the
+forkSetuidFailed case into the default case, meaning that the error
+message of the former would never be returned.
+---
+ cbits/runProcess.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/cbits/runProcess.c b/cbits/runProcess.c
+index c621158..10794bc 100644
+--- a/cbits/runProcess.c
++++ b/cbits/runProcess.c
+@@ -329,6 +329,7 @@ runInteractiveProcess (char *const args[],
+ break;
+ case forkSetuidFailed:
+ *failed_doing = "runInteractiveProcess: setuid";
++ break;
+ default:
+ *failed_doing = "runInteractiveProcess: unknown";
+ break;
diff --git a/ghc.spec b/ghc.spec
index 39338b4..07942ff 100644
--- a/ghc.spec
+++ b/ghc.spec
@@ -60,6 +60,10 @@ Patch2: ghc-Cabal-install-PATH-warning.patch
#
https://phabricator.haskell.org/rGHC4eebc8016f68719e1ccdf460754a97d1f4d6ef05
Patch6: ghc-8.6.3-sphinx-1.8.patch
+#
https://github.com/haskell/process/pull/148
+Patch10:
https://github.com/haskell/process/commit/73ea41b3622e2e578d928f7513941aa...
+Patch11:
https://github.com/haskell/process/commit/3e0812fe9d3f4712638a1c4c49bf2b2...
+
# Arch dependent patches
# arm
@@ -304,6 +308,12 @@ packages to be automatically installed too.
rm -r libffi-tarballs
+(
+cd libraries/process
+%patch10 -p1 -b .orig10
+%patch11 -p1 -b .orig11
+)
+
%ifarch armv7hl
%patch12 -p1 -b .orig
%endif
@@ -665,6 +675,8 @@ make test
-
https://downloads.haskell.org/~ghc/8.6.5/docs/html/users_guide/8.6.3-note...
-
https://downloads.haskell.org/~ghc/8.6.5/docs/html/users_guide/8.6.4-note...
-
https://downloads.haskell.org/~ghc/8.6.5/docs/html/users_guide/8.6.5-note...
+- fix process library initgroups issue
+ (
https://github.com/haskell/process/pull/148)
- enable s390x with unregisterized workaround for 8.4 (#1648537)
- also re-enable ppc64 with bigendian patch for containers (#1651448)
commit 5ee2271b2b839084d13af3531609ee6924151dc5
Author: Jens Petersen <petersen(a)redhat.com>
Date: Thu Jul 18 02:45:36 2019 +0000
update to ghc-8.6.5 (backported from ghc:8.6)
diff --git a/.gitignore b/.gitignore
index 5c04983..33b3d92 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,3 +26,4 @@ testsuite-6.12.3.tar.bz2
/ghc-8.2.2-src.tar.xz
/ghc-8.2.2-testsuite.tar.xz
/ghc-8.4.4-src.tar.xz
+/ghc-8.6.5-src.tar.xz
diff --git a/Disable-unboxed-arrays.patch b/Disable-unboxed-arrays.patch
new file mode 100644
index 0000000..17d81c5
--- /dev/null
+++ b/Disable-unboxed-arrays.patch
@@ -0,0 +1,12 @@
+Index: ghc-8.6.1/libraries/containers/include/containers.h
+===================================================================
+--- ghc-8.6.1.orig/libraries/containers/include/containers.h
++++ ghc-8.6.1/libraries/containers/include/containers.h
+@@ -35,7 +35,6 @@
+
+ #ifdef __GLASGOW_HASKELL__
+ # define USE_ST_MONAD 1
+-# define USE_UNBOXED_ARRAYS 1
+ #endif
+
+ #endif
diff --git a/ghc-8.6.3-sphinx-1.8.patch b/ghc-8.6.3-sphinx-1.8.patch
new file mode 100644
index 0000000..2f94fc0
--- /dev/null
+++ b/ghc-8.6.3-sphinx-1.8.patch
@@ -0,0 +1,35 @@
+--- ghc-8.6.3/docs/users_guide/flags.py~ 2018-09-21 06:18:23.000000000 +0800
++++ ghc-8.6.3/docs/users_guide/flags.py 2019-03-05 10:20:38.639782096 +0800
+@@ -49,6 +49,8 @@
+ import sphinx
+ from sphinx import addnodes
+ from sphinx.domains.std import GenericObject
++from sphinx.domains import ObjType
++from sphinx.roles import XRefRole
+ from sphinx.errors import SphinxError
+ from distutils.version import LooseVersion
+ from utils import build_table_from_list
+@@ -603,14 +605,21 @@
+ sphinx_version = LooseVersion(sphinx.__version__)
+ override_arg = {'override': True} if sphinx_version >=
LooseVersion('1.8') else {}
+
++ # Yuck: We can't use app.add_object_type since we need to provide the
++ # Directive instance ourselves.
++ std_object_types = app.registry.domain_object_types.setdefault('std', {})
++
+ # Add ghc-flag directive, and override the class with our own
+- app.add_object_type('ghc-flag', 'ghc-flag')
+ app.add_directive_to_domain('std', 'ghc-flag', Flag,
**override_arg)
++ app.add_role_to_domain('std', 'ghc-flag', XRefRole())
++ std_object_types['ghc-flag'] = ObjType('ghc-flag',
'ghc-flag')
+
+ # Add extension directive, and override the class with our own
+- app.add_object_type('extension', 'extension')
+ app.add_directive_to_domain('std', 'extension', LanguageExtension,
+ **override_arg)
++ app.add_role_to_domain('std', 'extension', XRefRole())
++ std_object_types['extension'] = ObjType('ghc-flag',
'ghc-flag')
++
+ # NB: language-extension would be misinterpreted by sphinx, and produce
+ # lang="extensions" XML attributes
+
diff --git a/ghc-sphinx-1.8-4eebc8016.patch b/ghc-sphinx-1.8-4eebc8016.patch
deleted file mode 100644
index 155be14..0000000
--- a/ghc-sphinx-1.8-4eebc8016.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-commit 4eebc8016f68719e1ccdf460754a97d1f4d6ef05
-Author: Ben Gamari <ben(a)smart-cactus.org>
-Date: Thu Sep 20 08:27:37 2018 -0400
-
- users-guide: Fix build with sphinx 1.8
-
- It seems that both add_object_type and add_directive_to_domain both register a
- directive. Previously sphinx didn't seem to mind this but as of Sphinx 1.8 it
- crashes with an exception.
-
-diff --git a/docs/users_guide/flags.py b/docs/users_guide/flags.py
-index a70f7fef1e..284b5e06cc 100644
---- a/docs/users_guide/flags.py
-+++ b/docs/users_guide/flags.py
-@@ -48,6 +48,8 @@ from docutils import nodes
- from docutils.parsers.rst import Directive, directives
- from sphinx import addnodes
- from sphinx.domains.std import GenericObject
-+from sphinx.domains import ObjType
-+from sphinx.roles import XRefRole
- from sphinx.errors import SphinxError
- from utils import build_table_from_list
-
-@@ -599,14 +601,20 @@ def purge_flags(app, env, docname):
- ### Initialization
-
- def setup(app):
-+ # Yuck: We can't use app.add_object_type since we need to provide the
-+ # Directive instance ourselves.
-+ std_object_types = app.registry.domain_object_types.setdefault('std', {})
-
- # Add ghc-flag directive, and override the class with our own
-- app.add_object_type('ghc-flag', 'ghc-flag')
- app.add_directive_to_domain('std', 'ghc-flag', Flag)
-+ app.add_role_to_domain('std', 'ghc-flag', XRefRole())
-+ std_object_types['ghc-flag'] = ObjType('ghc-flag',
'ghc-flag')
-
- # Add extension directive, and override the class with our own
-- app.add_object_type('extension', 'extension')
- app.add_directive_to_domain('std', 'extension', LanguageExtension)
-+ app.add_role_to_domain('std', 'extension', XRefRole())
-+ std_object_types['extension'] = ObjType('ghc-flag',
'ghc-flag')
-+
- # NB: language-extension would be misinterpreted by sphinx, and produce
- # lang="extensions" XML attributes
-
diff --git a/ghc.spec b/ghc.spec
index 263bd88..39338b4 100644
--- a/ghc.spec
+++ b/ghc.spec
@@ -8,7 +8,7 @@
# to handle RCs
%global ghc_release %{version}
-%global base_ver 4.11.1.0
+%global base_ver 4.12.0.0
# build profiling libraries
# build haddock
@@ -30,19 +30,19 @@
# no longer build testsuite (takes time and not really being used)
%bcond_with testsuite
-# 8.4 needs llvm-5.0
-%global llvm_major 5.0
+# 8.6 needs llvm-6.0
+%global llvm_major 6.0
%global ghc_llvm_archs armv7hl aarch64
%global ghc_unregisterized_arches s390 s390x %{mips}
Name: ghc
-Version: 8.4.4
+Version: 8.6.5
# Since library subpackages are versioned:
# - release can only be reset if *all* library versions get bumped simultaneously
# (sometimes after a major release)
# - minor release numbers for a branch should be incremented monotonically
-Release: 99%{?dist}
+Release: 100%{?dist}
Summary: Glasgow Haskell Compiler
License: BSD and HaskellReport
@@ -57,10 +57,8 @@ Source7: runghc.man
# absolute haddock path (was for html/libraries -> libraries)
Patch1: ghc-gen_contents_index-haddock-path.patch
Patch2: ghc-Cabal-install-PATH-warning.patch
-#
https://github.com/ghc/ghc/pull/143
-Patch5: ghc-configure-fix-sphinx-version-check.patch
#
https://phabricator.haskell.org/rGHC4eebc8016f68719e1ccdf460754a97d1f4d6ef05
-Patch6: ghc-sphinx-1.8-4eebc8016.patch
+Patch6: ghc-8.6.3-sphinx-1.8.patch
# Arch dependent patches
@@ -70,19 +68,22 @@ Patch12: ghc-armv7-VFPv3D16--NEON.patch
# for s390x
#
https://ghc.haskell.org/trac/ghc/ticket/15689
Patch15: ghc-warnings.mk-CC-Wall.patch
-#
https://ghc.haskell.org/trac/ghc/ticket/15853
+#
https://gitlab.haskell.org/ghc/ghc/issues/15853
#
https://phabricator.haskell.org/D5306 (in 8.8)
Patch17:
https://gitlab.haskell.org/ghc/ghc/commit/35a897782b6b0a252da7fdcf4921198...
-# revert 8.4.4 llvm changes
-#
https://ghc.haskell.org/trac/ghc/ticket/15780
-Patch16:
https://github.com/ghc/ghc/commit/6e361d895dda4600a85e01c72ff219474b5c719...
+# bigendian (s390x and ppc64)
+# fix haddock-library
+#
https://gitlab.haskell.org/ghc/ghc/issues/15411
+#
https://gitlab.haskell.org/ghc/ghc/issues/16505
+#
https://bugzilla.redhat.com/show_bug.cgi?id=1651448
+#
https://ghc.haskell.org/trac/ghc/ticket/15914
+Patch18:
https://gitlab.haskell.org/ghc/ghc/uploads/5deb133cf910e9e0ca9ad9fe53f738...
# Debian patches:
Patch24: buildpath-abi-stability.patch
Patch26: no-missing-haddock-file-warning.patch
Patch28: x32-use-native-x86_64-insn.patch
-Patch30: fix-build-using-unregisterized-v8.2.patch
# fedora ghc has been bootstrapped on
# %%{ix86} x86_64 ppc ppc64 armv7hl s390 s390x ppc64le aarch64
@@ -119,10 +120,12 @@ BuildRequires: python2-sphinx
%endif
%endif
%ifarch %{ghc_llvm_archs}
+%if 0%{?fedora} >= 29
BuildRequires: llvm%{llvm_major}
+%else
+BuildRequires: llvm >= %{llvm_major}
+%endif
%endif
-# patch5
-BuildRequires: autoconf
%ifarch armv7hl
# patch12
BuildRequires: autoconf, automake
@@ -174,7 +177,11 @@ Requires: ghc-base-devel%{?_isa} = %{base_ver}-%{release}
Obsoletes: ghc-doc-index < %{version}-%{release}
%endif
%ifarch %{ghc_llvm_archs}
+%if 0%{?fedora} >= 29
Requires: llvm%{llvm_major}
+%else
+Requires: llvm >= %{llvm_major}
+%endif
%endif
%description compiler
@@ -225,37 +232,39 @@ This package provides the User Guide and Haddock manual.
# use "./libraries-versions.sh" to check versions
%if %{defined ghclibdir}
-%ghc_lib_subpackage -d -l BSD Cabal-2.2.0.1
-%ghc_lib_subpackage -d -l %BSDHaskellReport array-0.5.2.0
+%ghc_lib_subpackage -d -l BSD Cabal-2.4.0.1
+%ghc_lib_subpackage -d -l %BSDHaskellReport array-0.5.3.0
%ghc_lib_subpackage -d -l %BSDHaskellReport -c gmp-devel%{?_isa},libffi-devel%{?_isa}
base-%{base_ver}
-%ghc_lib_subpackage -d -l BSD binary-0.8.5.1
+%ghc_lib_subpackage -d -l BSD binary-0.8.6.0
%ghc_lib_subpackage -d -l BSD bytestring-0.10.8.2
-%ghc_lib_subpackage -d -l %BSDHaskellReport containers-0.5.11.0
-%ghc_lib_subpackage -d -l %BSDHaskellReport deepseq-1.4.3.0
-%ghc_lib_subpackage -d -l %BSDHaskellReport directory-1.3.1.5
-%ghc_lib_subpackage -d -l BSD filepath-1.4.2
+%ghc_lib_subpackage -d -l %BSDHaskellReport containers-0.6.0.1
+%ghc_lib_subpackage -d -l %BSDHaskellReport deepseq-1.4.4.0
+%ghc_lib_subpackage -d -l %BSDHaskellReport directory-1.3.3.0
+%ghc_lib_subpackage -d -l BSD filepath-1.4.2.1
%ghc_lib_subpackage -d -l BSD ghc-boot-th-%{ghc_version_override}
%ghc_lib_subpackage -d -l BSD ghc-compact-0.1.0.0
-%ghc_lib_subpackage -d -l BSD haskeline-0.7.4.2
+%ghc_lib_subpackage -d -l BSD ghc-heap-%{ghc_version_override}
+%ghc_lib_subpackage -d -l BSD haskeline-0.7.4.3
%ghc_lib_subpackage -d -l BSD hpc-0.6.0.3
+%ghc_lib_subpackage -d -l %BSDHaskellReport libiserv-8.6.3
%ghc_lib_subpackage -d -l BSD mtl-2.2.2
%ghc_lib_subpackage -d -l BSD parsec-3.1.13.0
%ghc_lib_subpackage -d -l BSD pretty-1.1.3.6
-%ghc_lib_subpackage -d -l %BSDHaskellReport process-1.6.3.0
-%ghc_lib_subpackage -d -l BSD stm-2.4.5.1
-%ghc_lib_subpackage -d -l BSD template-haskell-2.13.0.0
-%ghc_lib_subpackage -d -l BSD -c ncurses-devel%{?_isa} terminfo-0.4.1.1
+%ghc_lib_subpackage -d -l %BSDHaskellReport process-1.6.5.0
+%ghc_lib_subpackage -d -l BSD stm-2.5.0.0
+%ghc_lib_subpackage -d -l BSD template-haskell-2.14.0.0
+%ghc_lib_subpackage -d -l BSD -c ncurses-devel%{?_isa} terminfo-0.4.1.2
%ghc_lib_subpackage -d -l BSD text-1.2.3.1
%ghc_lib_subpackage -d -l BSD time-1.8.0.2
-%ghc_lib_subpackage -d -l BSD transformers-0.5.5.0
+%ghc_lib_subpackage -d -l BSD transformers-0.5.6.2
%ghc_lib_subpackage -d -l BSD unix-2.7.2.2
%if %{with haddock}
%ghc_lib_subpackage -d -l BSD xhtml-3000.2.2.1
%endif
# in ghc not ghc-devel:
%ghc_lib_subpackage -d -x ghc-%{ghc_version_override}
-%ghc_lib_subpackage -d -l BSD -x ghc-boot-%{ghc_version_override}
-%ghc_lib_subpackage -d -l BSD -x ghci-%{ghc_version_override}
+%ghc_lib_subpackage -d -x -l BSD ghc-boot-%{ghc_version_override}
+%ghc_lib_subpackage -d -x -l BSD ghci-%{ghc_version_override}
%endif
%global version %{ghc_version_override}
@@ -291,7 +300,6 @@ packages to be automatically installed too.
%patch1 -p1 -b .orig
%patch2 -p1 -b .orig
-%patch5 -p1 -b .orig
%patch6 -p1 -b .orig
rm -r libffi-tarballs
@@ -300,21 +308,19 @@ rm -r libffi-tarballs
%patch12 -p1 -b .orig
%endif
-%ifarch s390x
+%ifarch %{ghc_unregisterized_arches}
%patch15 -p1 -b .orig
%patch17 -p1 -b .orig
%endif
-%ifarch armv7hl aarch64
-%patch16 -p1 -b .orig -R
+# bigendian
+%ifarch ppc64 s390x
+%patch18 -p1 -b .orig
%endif
%patch24 -p1 -b .orig
%patch26 -p1 -b .orig
%patch28 -p1 -b .orig
-%ifarch s390x
-%patch30 -p1 -b .orig
-%endif
%global gen_contents_index gen_contents_index.orig
%if %{with haddock}
@@ -365,14 +371,27 @@ EOF
# for patch12
%ifarch armv7hl
autoreconf
-%else
-# for patch5
-autoconf
%endif
+%if 0%{?fedora} > 28
%ghc_set_gcc_flags
+%else
+export CFLAGS="${CFLAGS:-%optflags}"
+export LDFLAGS="${LDFLAGS:-%{?__global_ldflags}}"
+%endif
# for ghc >= 8.2
export CC=%{_bindir}/gcc
+
+# remove after Fedora default moves to 8.6
+%ifarch %{ghc_unregisterized_arches}
+cat > ghc-unregisterised-wrapper << EOF
+#!/usr/bin/sh
+exec /usr/bin/ghc -optc-I%{_libdir}/ghc-$(ghc --numeric-version)/include
\${1+"\$@"}
+EOF
+chmod a+x ghc-unregisterised-wrapper
+ln -s /usr/bin/ghc-pkg ghc-pkg-unregisterised-wrapper
+%endif
+
# * %%configure induces cross-build due to different target/host/build platform names
./configure --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} \
--bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} \
@@ -383,6 +402,7 @@ export CC=%{_bindir}/gcc
--with-system-libffi \
%ifarch %{ghc_unregisterized_arches}
--enable-unregisterised \
+ --with-ghc=$PWD/ghc-unregisterised-wrapper \
%endif
%{nil}
@@ -426,7 +446,7 @@ echo "%{ghclibdir}/include" >> ghc-base-devel.files
%ghc_gen_filelists ghc-boot %{ghc_version_override}
%ghc_gen_filelists ghc %{ghc_version_override}
%ghc_gen_filelists ghci %{ghc_version_override}
-%ghc_gen_filelists ghc-prim 0.5.2.0
+%ghc_gen_filelists ghc-prim 0.5.3
%ghc_gen_filelists integer-gmp 1.0.2.0
%define merge_filelist()\
@@ -575,6 +595,7 @@ make test
%{ghclibdir}/bin/unlit
%{ghclibdir}/ghc-usage.txt
%{ghclibdir}/ghci-usage.txt
+%{ghclibdir}/llvm-passes
%{ghclibdir}/llvm-targets
%dir %{ghclibdir}/package.conf.d
%ghost %{ghclibdir}/package.conf.d/package.cache
@@ -637,6 +658,16 @@ make test
%changelog
+* Wed Jul 17 2019 Jens Petersen <petersen(a)redhat.com> - 8.6.5-100
+- update to GHC 8.6.5 (backport ghc:8.6 module stream)
+-
https://downloads.haskell.org/~ghc/8.6.5/docs/html/users_guide/8.6.1-note...
+-
https://downloads.haskell.org/~ghc/8.6.5/docs/html/users_guide/8.6.2-note...
+-
https://downloads.haskell.org/~ghc/8.6.5/docs/html/users_guide/8.6.3-note...
+-
https://downloads.haskell.org/~ghc/8.6.5/docs/html/users_guide/8.6.4-note...
+-
https://downloads.haskell.org/~ghc/8.6.5/docs/html/users_guide/8.6.5-note...
+- enable s390x with unregisterized workaround for 8.4 (#1648537)
+- also re-enable ppc64 with bigendian patch for containers (#1651448)
+
* Tue Jul 16 2019 Jens Petersen <petersen(a)redhat.com> - 8.4.4-99
- subpackage library haddock documentation and profiling libraries
- add ghc-doc and ghc-prof metapackages to pull in lib docs and prof libs
diff --git a/sources b/sources
index a6f24f6..3790399 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (ghc-8.4.4-src.tar.xz) =
685e102eee8cf8b6a377afd7871998c8c368a5da288469367e3fb804aa6109e6f59be5945b8cd3d1e36c851190ea9a7f74c576528589589313d237b721d86da5
+SHA512 (ghc-8.6.5-src.tar.xz) =
c08a7480200cb99e1ffbe4ce7669f552b1054054966f7e7efcbc5f98af8032e1249fa391c4fc4c7d62cc8e0be5d17fa05845177f3cea3dbcf86e6c92d40fc0f9
commit 63a3f34ef25ec0715215a0e7adaa8f8faf023378
Author: Jens Petersen <petersen(a)redhat.com>
Date: Wed Jul 17 16:45:58 2019 +0000
haddock: add --hoogle & --quickjump
diff --git a/ghc.spec b/ghc.spec
index fc846b9..263bd88 100644
--- a/ghc.spec
+++ b/ghc.spec
@@ -342,7 +342,7 @@ BuildFlavour = quick
GhcLibWays = v dyn %{?with_ghc_prof:p}
%if %{with haddock}
HADDOCK_DOCS = YES
-EXTRA_HADDOCK_OPTS += --hyperlinked-source
+EXTRA_HADDOCK_OPTS += --hyperlinked-source --hoogle --quickjump
%else
HADDOCK_DOCS = NO
%endif
commit 850e71d7433551515bfc2bc222cbbd4c712bb613
Author: Jens Petersen <petersen(a)redhat.com>
Date: Wed Jul 17 16:42:57 2019 +0000
lock manual bcond to with_haddock
We should probably just use haddock until Hadrian...
diff --git a/ghc.spec b/ghc.spec
index f4eba1a..fc846b9 100644
--- a/ghc.spec
+++ b/ghc.spec
@@ -11,21 +11,22 @@
%global base_ver 4.11.1.0
# build profiling libraries
-# build haddock and manuals
-# - earlier combined since disabling haddock seems to cause no manuals built?
-# - <
https://ghc.haskell.org/trac/ghc/ticket/15190>
+# build haddock
# perf production build (disable for quick build)
%if %{with quickbuild}
%undefine with_ghc_prof
%undefine with_haddock
-%bcond_with manual
%bcond_with perf_build
%undefine _enable_debug_packages
%else
-%bcond_without manual
%bcond_without perf_build
%endif
+# locked together since disabling haddock causes no manuals built
+# and disabling haddock still created index.html
+#
https://ghc.haskell.org/trac/ghc/ticket/15190
+%{?with_haddock:%bcond_without manual}
+
# no longer build testsuite (takes time and not really being used)
%bcond_with testsuite
@@ -347,8 +348,10 @@ HADDOCK_DOCS = NO
%endif
%if %{with manual}
BUILD_MAN = YES
+BUILD_SPHINX_HTML = YES
%else
BUILD_MAN = NO
+BUILD_SPHINX_HTML = NO
%endif
BUILD_SPHINX_PDF = NO
EOF
@@ -623,10 +626,10 @@ make test
#%%{ghc_html_dir}/Cabal
%if %{with haddock}
%{ghc_html_dir}/haddock
-%endif
%{ghc_html_dir}/index.html
%{ghc_html_dir}/users_guide
%endif
+%endif
%if %{with ghc_prof}
%files prof
commit 48dd6aa4cdda9f62629c3bbba3a0e1819da74a17
Author: Jens Petersen <petersen(a)redhat.com>
Date: Tue Jul 16 16:23:37 2019 +0000
major rework of ghc packaging: particularly prof and doc subpackages
- bump release to 99
- drop ghc-doc-index script and cronjob
- lock compiler to ghc-base-devel verrel
- switch from %without_prof to %with_ghc_prof
- split docs bcond to %with_haddock and %with_manual
- disable debuginfo for quickbuild
- BR ghc-rpm-macros 2.0 and make
- allow python2-sphinx for current fedora releases
- lighten ghc: only suggest ghc-doc, ghc-doc-index, ghc-manual, ghc-prof
- drop support for rhel6 builds
- use %ghc_set_gcc_flags
- remove alternatives
- filetriggers for haddock index updating
- in future we might separate static devel subpackages too (if cabal
can handle vanilla or dyn only)
diff --git a/ghc-doc-index b/ghc-doc-index
deleted file mode 100755
index a0223fa..0000000
--- a/ghc-doc-index
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/sh
-
-LOCKFILE=/var/lock/ghc-doc-index.lock
-
-# the lockfile is not meant to be perfect, it's just in case
-# two cron scripts get run close to each other to keep
-# them from stepping on each other's toes.
-if [ -f $LOCKFILE ]; then
- echo "Locked with $LOCKFILE"
- exit 0
-fi
-
-if [ "$(id -u)" != "0" ]; then
- echo Need to be root!
- exit 1
-fi
-
-trap "{ rm -f $LOCKFILE ; exit 255; }" EXIT
-touch $LOCKFILE
-
-PKGDIRCACHE=/var/lib/ghc/pkg-dir.cache
-LISTING="env LANG=C ls -dl"
-
-# only re-index ghc docs when there are changes
-cd /usr/share/doc/ghc/html/libraries
-if [ -r "$PKGDIRCACHE" ]; then
- $LISTING */ > $PKGDIRCACHE.new
- DIR_DIFF=$(diff $PKGDIRCACHE $PKGDIRCACHE.new)
-else
- $LISTING */ > $PKGDIRCACHE
-fi
-if [ -x "gen_contents_index" -a ! -r "$PKGDIRCACHE.new" -o -n
"$DIR_DIFF" ]; then
- ./gen_contents_index
-fi
-
-if [ -f $PKGDIRCACHE.new ]; then
- mv -f $PKGDIRCACHE.new $PKGDIRCACHE
-fi
diff --git a/ghc-doc-index.cron b/ghc-doc-index.cron
deleted file mode 100755
index 4efe2ff..0000000
--- a/ghc-doc-index.cron
+++ /dev/null
@@ -1,9 +0,0 @@
-#! /bin/bash
-# updates the library documentation index after updates
-
-# This can be disabled by uninstalling ghc-doc-index
-# or adding ghc-doc-index to "./jobs-deny".
-
-/usr/bin/ghc-doc-index
-
-exit 0
diff --git a/ghc.spec b/ghc.spec
index e794ced..f4eba1a 100644
--- a/ghc.spec
+++ b/ghc.spec
@@ -1,5 +1,5 @@
-# disable prof, docs, perf build
-# NB This SHOULD be disabled (bcond_with) for all koji production builds
+# disable prof, docs, perf build, debuginfo
+# NB This must be disabled (bcond_with) for all koji production builds
%bcond_with quickbuild
# make sure ghc libraries' ABI hashes unchanged
@@ -8,18 +8,21 @@
# to handle RCs
%global ghc_release %{version}
+%global base_ver 4.11.1.0
+
# build profiling libraries
-# build docs (haddock and manuals)
-# - combined since disabling haddock seems to cause no manuals built
+# build haddock and manuals
+# - earlier combined since disabling haddock seems to cause no manuals built?
# - <
https://ghc.haskell.org/trac/ghc/ticket/15190>
# perf production build (disable for quick build)
%if %{with quickbuild}
-%bcond_with prof
-%bcond_with docs
+%undefine with_ghc_prof
+%undefine with_haddock
+%bcond_with manual
%bcond_with perf_build
+%undefine _enable_debug_packages
%else
-%bcond_without prof
-%bcond_without docs
+%bcond_without manual
%bcond_without perf_build
%endif
@@ -33,13 +36,12 @@
%global ghc_unregisterized_arches s390 s390x %{mips}
Name: ghc
-# ghc must be rebuilt after a version bump to avoid ABI change problems
Version: 8.4.4
# Since library subpackages are versioned:
# - release can only be reset if *all* library versions get bumped simultaneously
# (sometimes after a major release)
# - minor release numbers for a branch should be incremented monotonically
-Release: 76%{?dist}
+Release: 99%{?dist}
Summary: Glasgow Haskell Compiler
License: BSD and HaskellReport
@@ -48,8 +50,6 @@ Source0:
https://downloads.haskell.org/~ghc/%{ghc_release}/ghc-%{version}-src.ta
%if %{with testsuite}
Source1:
https://downloads.haskell.org/~ghc/%{ghc_release}/ghc-%{version}-testsuit...
%endif
-Source3: ghc-doc-index.cron
-Source4: ghc-doc-index
Source5: ghc-pkg.man
Source6: haddock.man
Source7: runghc.man
@@ -61,7 +61,9 @@ Patch5: ghc-configure-fix-sphinx-version-check.patch
#
https://phabricator.haskell.org/rGHC4eebc8016f68719e1ccdf460754a97d1f4d6ef05
Patch6: ghc-sphinx-1.8-4eebc8016.patch
-# Arch dependent packages
+# Arch dependent patches
+
+# arm
Patch12: ghc-armv7-VFPv3D16--NEON.patch
# for s390x
@@ -91,7 +93,7 @@ BuildRequires: ghc-compiler
%if %{with abicheck}
BuildRequires: ghc
%endif
-BuildRequires: ghc-rpm-macros-extra
+BuildRequires: ghc-rpm-macros-extra >= 2.0
BuildRequires: ghc-binary-devel
BuildRequires: ghc-bytestring-devel
BuildRequires: ghc-containers-devel
@@ -101,15 +103,19 @@ BuildRequires: ghc-process-devel
BuildRequires: ghc-transformers-devel
BuildRequires: gmp-devel
BuildRequires: libffi-devel
+BuildRequires: make
# for terminfo
BuildRequires: ncurses-devel
-# for man and docs
BuildRequires: perl-interpreter
%if %{with testsuite}
BuildRequires: python3
%endif
-%if %{with docs}
+%if %{with manual}
+%if 0%{?fedora} >= 31
BuildRequires: python3-sphinx
+%else
+BuildRequires: python2-sphinx
+%endif
%endif
%ifarch %{ghc_llvm_archs}
BuildRequires: llvm%{llvm_major}
@@ -122,10 +128,16 @@ BuildRequires: autoconf, automake
%endif
Requires: ghc-compiler = %{version}-%{release}
Requires: ghc-ghc-devel = %{version}-%{release}
-Requires: ghc-libraries = %{version}-%{release}
-%if %{with docs}
-Recommends: ghc-doc-cron = %{version}-%{release}
-Recommends: ghc-manual = %{version}-%{release}
+Requires: ghc-devel = %{version}-%{release}
+%if %{with haddock}
+Suggests: ghc-doc = %{version}-%{release}
+Suggests: ghc-doc-index = %{version}-%{release}
+%endif
+%if %{with manual}
+Suggests: ghc-manual = %{version}-%{release}
+%endif
+%if %{with ghc_prof}
+Suggests: ghc-prof = %{version}-%{release}
%endif
Recommends: zlib-devel
@@ -156,15 +168,8 @@ for the functional language Haskell. Highlights:
Summary: GHC compiler and utilities
License: BSD
Requires: gcc%{?_isa}
-Requires: ghc-base-devel%{?_isa}
-# for alternatives
-Requires(post): %{_sbindir}/update-alternatives
-Requires(postun): %{_sbindir}/update-alternatives
-# added in f14
-Obsoletes: ghc-doc < 6.12.3-4
-%if %{without docs}
-Obsoletes: ghc-doc-cron < %{version}-%{release}
-# added in f28
+Requires: ghc-base-devel%{?_isa} = %{base_ver}-%{release}
+%if %{without haddock}
Obsoletes: ghc-doc-index < %{version}-%{release}
%endif
%ifarch %{ghc_llvm_archs}
@@ -174,28 +179,34 @@ Requires: llvm%{llvm_major}
%description compiler
The package contains the GHC compiler, tools and utilities.
-The ghc libraries are provided by ghc-libraries.
+The ghc libraries are provided by ghc-devel.
To install all of ghc (including the ghc library),
install the main ghc package.
-%if %{with docs}
-%package doc-cron
-Summary: GHC library documentation indexing cronjob
+%if %{with haddock}
+%package doc
+Summary: Haskell library documentation meta package
+License: BSD
+
+%description doc
+Installing this package causes ghc-*-doc packages corresponding to ghc-*-devel
+packages to be automatically installed too.
+
+
+%package doc-index
+Summary: GHC library documentation indexing
License: BSD
+Obsoletes: ghc-doc-cron < %{version}-%{release}
Requires: ghc-compiler = %{version}-%{release}
-Requires: crontabs
-# added in f28
-Obsoletes: ghc-doc-index < %{version}-%{release}
BuildArch: noarch
-%description doc-cron
-The package provides a cronjob for re-indexing installed library development
-documention.
+%description doc-index
+The package enables re-indexing of installed library documention.
%endif
-%if %{with docs}
+%if %{with manual}
%package manual
Summary: GHC manual
License: BSD
@@ -209,35 +220,21 @@ This package provides the User Guide and Haddock manual.
# ghclibdir also needs ghc_version_override for bootstrapping
%global ghc_version_override %{version}
-# EL7 rpm supports fileattrs ghc.attr
-%if 0%{?rhel} && 0%{?rhel} < 7
-# needs ghc_version_override for bootstrapping
-%global _use_internal_dependency_generator 0
-%global __find_provides /usr/lib/rpm/rpmdeps --provides
-%global __find_requires %{_rpmconfigdir}/ghc-deps.sh --requires %{buildroot}%{ghclibdir}
-%endif
-
-%global ghc_pkg_c_deps ghc-compiler = %{ghc_version_override}-%{release}
-
%global BSDHaskellReport %{quote:BSD and HaskellReport}
# use "./libraries-versions.sh" to check versions
%if %{defined ghclibdir}
%ghc_lib_subpackage -d -l BSD Cabal-2.2.0.1
%ghc_lib_subpackage -d -l %BSDHaskellReport array-0.5.2.0
-%ghc_lib_subpackage -d -l %BSDHaskellReport -c gmp-devel%{?_isa},libffi-devel%{?_isa}
base-4.11.1.0
+%ghc_lib_subpackage -d -l %BSDHaskellReport -c gmp-devel%{?_isa},libffi-devel%{?_isa}
base-%{base_ver}
%ghc_lib_subpackage -d -l BSD binary-0.8.5.1
%ghc_lib_subpackage -d -l BSD bytestring-0.10.8.2
%ghc_lib_subpackage -d -l %BSDHaskellReport containers-0.5.11.0
%ghc_lib_subpackage -d -l %BSDHaskellReport deepseq-1.4.3.0
%ghc_lib_subpackage -d -l %BSDHaskellReport directory-1.3.1.5
%ghc_lib_subpackage -d -l BSD filepath-1.4.2
-# in ghc not ghc-libraries:
-%ghc_lib_subpackage -d -x ghc-%{ghc_version_override}
-%ghc_lib_subpackage -d -x -l BSD ghc-boot-%{ghc_version_override}
%ghc_lib_subpackage -d -l BSD ghc-boot-th-%{ghc_version_override}
%ghc_lib_subpackage -d -l BSD ghc-compact-0.1.0.0
-%ghc_lib_subpackage -d -l BSD -x ghci-%{ghc_version_override}
%ghc_lib_subpackage -d -l BSD haskeline-0.7.4.2
%ghc_lib_subpackage -d -l BSD hpc-0.6.0.3
%ghc_lib_subpackage -d -l BSD mtl-2.2.2
@@ -251,30 +248,42 @@ This package provides the User Guide and Haddock manual.
%ghc_lib_subpackage -d -l BSD time-1.8.0.2
%ghc_lib_subpackage -d -l BSD transformers-0.5.5.0
%ghc_lib_subpackage -d -l BSD unix-2.7.2.2
-%if %{with docs}
+%if %{with haddock}
%ghc_lib_subpackage -d -l BSD xhtml-3000.2.2.1
%endif
+# in ghc not ghc-devel:
+%ghc_lib_subpackage -d -x ghc-%{ghc_version_override}
+%ghc_lib_subpackage -d -l BSD -x ghc-boot-%{ghc_version_override}
+%ghc_lib_subpackage -d -l BSD -x ghci-%{ghc_version_override}
%endif
%global version %{ghc_version_override}
-%package libraries
+%package devel
Summary: GHC development libraries meta package
License: BSD and HaskellReport
Requires: ghc-compiler = %{version}-%{release}
-Obsoletes: ghc-devel < %{version}-%{release}
-Provides: ghc-devel = %{version}-%{release}
-Obsoletes: ghc-prof < %{version}-%{release}
-Provides: ghc-prof = %{version}-%{release}
-# since f15
-Obsoletes: ghc-libs < 7.0.1-3
+Obsoletes: ghc-libraries < %{version}-%{release}
+Provides: ghc-libraries = %{version}-%{release}
%{?ghc_packages_list:Requires: %(echo %{ghc_packages_list} | sed -e "s/\([^
]*\)-\([^ ]*\)/ghc-\1-devel = \2-%{release},/g")}
-%description libraries
+%description devel
This is a meta-package for all the development library packages in GHC
except the ghc library, which is installed by the toplevel ghc metapackage.
+%if %{with ghc_prof}
+%package prof
+Summary: GHC profiling libraries meta package
+License: BSD
+Requires: ghc-compiler = %{version}-%{release}
+
+%description prof
+Installing this package causes ghc-*-prof packages corresponding to ghc-*-devel
+packages to be automatically installed too.
+%endif
+
+
%prep
%setup -q -n %{name}-%{version} %{?with_testsuite:-b1}
@@ -284,9 +293,7 @@ except the ghc library, which is installed by the toplevel ghc
metapackage.
%patch5 -p1 -b .orig
%patch6 -p1 -b .orig
-%if 0%{?fedora} || 0%{?rhel} > 6
rm -r libffi-tarballs
-%endif
%ifarch armv7hl
%patch12 -p1 -b .orig
@@ -309,7 +316,7 @@ rm -r libffi-tarballs
%endif
%global gen_contents_index gen_contents_index.orig
-%if %{with docs}
+%if %{with haddock}
if [ ! -f "libraries/%{gen_contents_index}" ]; then
echo "Missing libraries/%{gen_contents_index}, needed at end of %%install!"
exit 1
@@ -331,15 +338,18 @@ BuildFlavour = quick-llvm
BuildFlavour = quick
%endif
%endif
-GhcLibWays = v dyn %{?with_prof:p}
-%if %{with docs}
+GhcLibWays = v dyn %{?with_ghc_prof:p}
+%if %{with haddock}
HADDOCK_DOCS = YES
-BUILD_MAN = YES
+EXTRA_HADDOCK_OPTS += --hyperlinked-source
%else
HADDOCK_DOCS = NO
+%endif
+%if %{with manual}
+BUILD_MAN = YES
+%else
BUILD_MAN = NO
%endif
-EXTRA_HADDOCK_OPTS += --hyperlinked-source
BUILD_SPHINX_PDF = NO
EOF
## for verbose build output
@@ -357,9 +367,7 @@ autoreconf
autoconf
%endif
-# replace later with ghc_set_gcc_flags
-export CFLAGS="${CFLAGS:-%optflags}"
-export LDFLAGS="${LDFLAGS:-%{?__global_ldflags}}"
+%ghc_set_gcc_flags
# for ghc >= 8.2
export CC=%{_bindir}/gcc
# * %%configure induces cross-build due to different target/host/build platform names
@@ -369,12 +377,10 @@ export CC=%{_bindir}/gcc
--libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} \
--sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} \
--docdir=%{_docdir}/ghc \
+ --with-system-libffi \
%ifarch %{ghc_unregisterized_arches}
--enable-unregisterised \
%endif
-%if 0%{?fedora} || 0%{?rhel} > 6
- --with-system-libffi \
-%endif
%{nil}
# avoid "ghc: hGetContents: invalid argument (invalid byte sequence)"
@@ -386,28 +392,33 @@ make %{?_smp_mflags}
make DESTDIR=%{buildroot} install
%if %{defined _ghcdynlibdir}
-mv %{buildroot}%{ghclibdir}/*/libHS*ghc%{ghc_version}.so %{buildroot}%{_libdir}/
-for i in $(find %{buildroot} -type f -exec sh -c "file {} | grep -q 'dynamically
linked'" \; -print); do
+mv %{buildroot}%{ghclibdir}/*/libHS*ghc%{ghc_version}.so %{buildroot}%{_ghcdynlibdir}/
+for i in $(find %{buildroot} -type f -executable -exec sh -c "file {} | grep -q
'dynamically linked'" \; -print); do
chrpath -d $i
done
for i in %{buildroot}%{ghclibdir}/package.conf.d/*.conf; do
- sed -i -e 's!^dynamic-library-dirs: .*!dynamic-library-dirs: %{_libdir}!' $i
+ sed -i -e 's!^dynamic-library-dirs: .*!dynamic-library-dirs: %{_ghcdynlibdir}!'
$i
done
-sed -i -e 's!^library-dirs: %{ghclibdir}/rts!&\ndynamic-library-dirs:
%{_libdir}!' %{buildroot}%{ghclibdir}/package.conf.d/rts.conf
+sed -i -e 's!^library-dirs: %{ghclibdir}/rts!&\ndynamic-library-dirs:
%{_ghcdynlibdir}!' %{buildroot}%{ghclibdir}/package.conf.d/rts.conf
%endif
+# libraries licenses
+rm %{buildroot}%{ghc_html_libraries_dir}/{ghc-prim,integer-gmp}-*/LICENSE
+mkdir -p %{buildroot}%{_ghclicensedir}
+for i in $(cd %{buildroot}%{ghc_html_libraries_dir}; ls */LICENSE); do
+ pkg=$(dirname $i | sed -e "s/\\(.*\\)-.*/\\1/")
+ mkdir %{buildroot}%{_ghclicensedir}/ghc-$pkg
+ mv %{buildroot}%{ghc_html_libraries_dir}/$i %{buildroot}%{_ghclicensedir}/ghc-$pkg/
+done
+
for i in %{ghc_packages_list}; do
name=$(echo $i | sed -e "s/\(.*\)-.*/\1/")
ver=$(echo $i | sed -e "s/.*-\(.*\)/\1/")
%ghc_gen_filelists $name $ver
-%if 0%{?rhel} && 0%{?rhel} < 7
-echo "%%doc libraries/$name/LICENSE" >> ghc-$name.files
-%else
-echo "%%license libraries/$name/LICENSE" >> ghc-$name.files
-%endif
done
echo "%%dir %{ghclibdir}" >> ghc-base%{?_ghcdynlibdir:-devel}.files
+echo "%{ghclibdir}/include" >> ghc-base-devel.files
%ghc_gen_filelists ghc-boot %{ghc_version_override}
%ghc_gen_filelists ghc %{ghc_version_override}
@@ -416,66 +427,34 @@ echo "%%dir %{ghclibdir}" >>
ghc-base%{?_ghcdynlibdir:-devel}.files
%ghc_gen_filelists integer-gmp 1.0.2.0
%define merge_filelist()\
-cat ghc-%1.files >> ghc-%2.files\
-cat ghc-%1-devel.files >> ghc-%2-devel.files\
cp -p libraries/%1/LICENSE libraries/LICENSE.%1\
-%if 0%{?rhel} && 0%{?rhel} < 7\
-echo "%%doc libraries/LICENSE.%1" >> ghc-%2.files\
-%else\
echo "%%license libraries/LICENSE.%1" >> ghc-%2.files\
-%endif
+cat ghc-%1.files >> ghc-%2.files\
+for i in devel doc prof; do\
+ cat ghc-%1-$i.files >> ghc-%2-$i.files\
+done
%merge_filelist integer-gmp base
%merge_filelist ghc-prim base
# add rts libs
-%if %{defined _ghcdynlibdir}
-echo "%{ghclibdir}/rts" >> ghc-base-devel.files
-%else
-echo "%%dir %{ghclibdir}/rts" >> ghc-base.files
-ls -d %{buildroot}%{ghclibdir}/rts/lib*.a >> ghc-base-devel.files
-%endif
-ls %{buildroot}%{?_ghcdynlibdir}%{!?_ghcdynlibdir:%{ghclibdir}/rts}/libHSrts*.so >>
ghc-base.files
-%if 0%{?rhel} && 0%{?rhel} < 7
-ls %{buildroot}%{ghclibdir}/rts/libffi.so.* >> ghc-base.files
-%endif
-%if %{defined _ghcdynlibdir}
-sed -i -e 's!^library-dirs: %{ghclibdir}/rts!&\ndynamic-library-dirs:
%{_libdir}!' %{buildroot}%{ghclibdir}/package.conf.d/rts.conf
-%endif
-
-ls -d %{buildroot}%{ghclibdir}/package.conf.d/rts.conf %{buildroot}%{ghclibdir}/include
>> ghc-base-devel.files
-%if 0%{?rhel} && 0%{?rhel} < 7
-ls %{buildroot}%{ghclibdir}/rts/libffi.so >> ghc-base-devel.files
-%endif
-
-sed -i -e "s|^%{buildroot}||g" ghc-base*.files
-
-# these are handled as alternatives
-for i in hsc2hs runhaskell; do
- if [ -x %{buildroot}%{_bindir}/$i-ghc ]; then
- rm %{buildroot}%{_bindir}/$i
- else
- mv %{buildroot}%{_bindir}/$i{,-ghc}
- fi
- touch %{buildroot}%{_bindir}/$i
-done
-
-%if %{with docs}
-mkdir -p %{buildroot}%{_sysconfdir}/cron.hourly
-install -p --mode=0755 %SOURCE3 %{buildroot}%{_sysconfdir}/cron.hourly/ghc-doc-index
-mkdir -p %{buildroot}%{_localstatedir}/lib/ghc
-touch %{buildroot}%{_localstatedir}/lib/ghc/pkg-dir.cache{,.new}
-install -p --mode=0755 %SOURCE4 %{buildroot}%{_bindir}/ghc-doc-index
-
+rm -f rts.files
+touch rts.files
+ls
%{buildroot}%{?_ghcdynlibdir}%{!?_ghcdynlibdir:%{ghclibdir}/rts}/libHSrts*-ghc%{ghc_version}.so
>> rts.files
+find %{buildroot}%{ghclibdir}/rts -type d -fprintf rts-devel.files '%%%%dir %p\n'
-o -name 'libHSrts*_p.a' -fprint rts-prof.files -o -fprint rts-devel.files
+echo "%{ghclibdir}/package.conf.d/rts.conf" >> rts-devel.files
+sed -i -e "s!%{buildroot}!!g" rts.files rts-devel.files rts-prof.files
+cat rts.files >> ghc-base.files
+cat rts-devel.files >> ghc-base-devel.files
+cat rts-prof.files >> ghc-base-prof.files
+
+%if %{with haddock}
# generate initial lib doc index
cd libraries
sh %{gen_contents_index} --intree --verbose
cd ..
%endif
-# we package the library license files separately
-find %{buildroot}%{ghc_html_libraries_dir} -name LICENSE -exec rm '{}'
';'
-
mkdir -p %{buildroot}%{_mandir}/man1
install -p -m 0644 %{SOURCE5} %{buildroot}%{_mandir}/man1/ghc-pkg.1
install -p -m 0644 %{SOURCE6} %{buildroot}%{_mandir}/man1/haddock.1
@@ -536,30 +515,7 @@ make test
%endif
-%post compiler
-# Alas, GHC, Hugs, and nhc all come with different set of tools in
-# addition to a runFOO:
-#
-# * GHC: hsc2hs
-# * Hugs: hsc2hs, cpphs
-# * nhc: cpphs
-#
-# Therefore it is currently not possible to use --slave below to form
-# link groups under a single name 'runhaskell'. Either these tools
-# should be disentangled from the Haskell implementations, or all
-# implementations should have the same set of tools. *sigh*
-
-update-alternatives --install %{_bindir}/runhaskell runhaskell \
- %{_bindir}/runghc 500
-update-alternatives --install %{_bindir}/hsc2hs hsc2hs \
- %{_bindir}/hsc2hs-ghc 500
-
-%preun compiler
-if [ "$1" = 0 ]; then
- update-alternatives --remove runhaskell %{_bindir}/runghc
- update-alternatives --remove hsc2hs %{_bindir}/hsc2hs-ghc
-fi
-
+%if %{defined ghclibdir}
%transfiletriggerin compiler -- %{ghclibdir}/package.conf.d
%ghc_pkg_recache
%end
@@ -567,6 +523,19 @@ fi
%transfiletriggerpostun compiler -- %{ghclibdir}/package.conf.d
%ghc_pkg_recache
%end
+%endif
+
+
+%if %{with haddock}
+%transfiletriggerin doc-index -- %{ghc_html_libraries_dir}
+%{ghc_html_libraries_dir}/gen_contents_index
+%end
+
+%transfiletriggerpostun doc-index -- %{ghc_html_libraries_dir}
+%{ghc_html_libraries_dir}/gen_contents_index
+%end
+%endif
+
%files
@@ -581,11 +550,10 @@ fi
%{_bindir}/ghci-%{version}
%{_bindir}/hp2ps
%{_bindir}/hpc
-%ghost %{_bindir}/hsc2hs
-%{_bindir}/hsc2hs-ghc
-%{_bindir}/runghc*
-%ghost %{_bindir}/runhaskell
-%{_bindir}/runhaskell-ghc
+%{_bindir}/hsc2hs
+%{_bindir}/runghc
+%{_bindir}/runghc-%{ghc_version}
+%{_bindir}/runhaskell
%dir %{ghclibdir}/bin
%{ghclibdir}/bin/ghc
%{ghclibdir}/bin/ghc-pkg
@@ -593,7 +561,7 @@ fi
%{ghclibdir}/bin/hsc2hs
%{ghclibdir}/bin/ghc-iserv
%{ghclibdir}/bin/ghc-iserv-dyn
-%if %{with prof}
+%if %{with ghc_prof}
%{ghclibdir}/bin/ghc-iserv-prof
%endif
%{ghclibdir}/bin/runghc
@@ -617,16 +585,12 @@ fi
%{_mandir}/man1/haddock.1*
%{_mandir}/man1/runghc.1*
-%if %{with docs}
-%{_bindir}/ghc-doc-index
+%if %{with haddock}
%{_bindir}/haddock
%{_bindir}/haddock-ghc-%{version}
%{ghclibdir}/bin/haddock
%{ghclibdir}/html
%{ghclibdir}/latex
-%if %{with docs}
-%{_mandir}/man1/ghc.1*
-%endif
%dir %{ghc_html_dir}/libraries
%{ghc_html_dir}/libraries/gen_contents_index
%{ghc_html_dir}/libraries/prologue.txt
@@ -640,32 +604,46 @@ fi
%ghost %{ghc_html_dir}/libraries/plus.gif
%ghost %{ghc_html_dir}/libraries/quick-jump.css
%ghost %{ghc_html_dir}/libraries/synopsis.png
-%dir %{_localstatedir}/lib/ghc
-%ghost %{_localstatedir}/lib/ghc/pkg-dir.cache
-%ghost %{_localstatedir}/lib/ghc/pkg-dir.cache.new
%endif
-
-%if %{with docs}
-%files doc-cron
-%config(noreplace) %{_sysconfdir}/cron.hourly/ghc-doc-index
+%if %{with manual}
+%{_mandir}/man1/ghc.1*
%endif
-%files libraries
+%files devel
+%if %{with haddock}
+%files doc
-%if %{with docs}
+%files doc-index
+%endif
+
+%if %{with manual}
%files manual
## needs pandoc
#%%{ghc_html_dir}/Cabal
-%if %{with docs}
+%if %{with haddock}
%{ghc_html_dir}/haddock
%endif
%{ghc_html_dir}/index.html
%{ghc_html_dir}/users_guide
%endif
+%if %{with ghc_prof}
+%files prof
+%endif
+
%changelog
+* Tue Jul 16 2019 Jens Petersen <petersen(a)redhat.com> - 8.4.4-99
+- subpackage library haddock documentation and profiling libraries
+- add ghc-doc and ghc-prof metapackages to pull in lib docs and prof libs
+- rename ghc-doc-cron with ghc-doc-index using file triggers
+- rename ghc-libraries to ghc-devel
+- for quickbuild disable debuginfo
+- lock ghc-compiler requires ghc-base-devel to ver-rel
+- drop alternatives for runhaskell and hsc2hs
+- use ghc_set_gcc_flags, with_ghc_prof, and with_haddock
+
* Thu Jul 25 2019 Fedora Release Engineering <releng(a)fedoraproject.org>
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild