Merge remote-tracking branch 'up/f31' into master-riscv64
Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
This commit is contained in:
commit
222ebef05a
|
@ -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
|
||||
|
|
|
@ -0,0 +1,92 @@
|
|||
From 3e0812fe9d3f4712638a1c4c49bf2b2a7dc4311b Mon Sep 17 00:00:00 2001
|
||||
From: Ben Gamari <ben@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>
|
|
@ -0,0 +1,24 @@
|
|||
From 73ea41b3622e2e578d928f7513941aac9d873279 Mon Sep 17 00:00:00 2001
|
||||
From: Ben Gamari <ben@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;
|
|
@ -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
|
|
@ -0,0 +1,54 @@
|
|||
commit ce3897ffd6e7c8b8f36b8e920168bac8c7f836ae
|
||||
Author: Ilias Tsitsimpis <iliastsi@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
|
|
@ -0,0 +1,63 @@
|
|||
From: Sergei Trofimovich <slyfox@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/e175aaf6918bb2b497b83618dc4c270a0d231a1c
|
||||
|
||||
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@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");
|
|
@ -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@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);
|
|
@ -1,43 +1,32 @@
|
|||
commit 4eebc8016f68719e1ccdf460754a97d1f4d6ef05
|
||||
Author: Ben Gamari <ben@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
|
||||
--- 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 {}
|
||||
|
||||
@@ -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_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)
|
||||
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')
|
||||
+
|
|
@ -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
|
|
@ -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
|
472
ghc.spec
472
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,38 +8,42 @@
|
|||
# to handle RCs
|
||||
%global ghc_release %{version}
|
||||
|
||||
%global base_ver 4.12.0.0
|
||||
|
||||
# build profiling libraries
|
||||
# build docs (haddock and manuals)
|
||||
# - 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}
|
||||
%bcond_with prof
|
||||
%bcond_with docs
|
||||
%undefine with_ghc_prof
|
||||
%undefine with_haddock
|
||||
%bcond_with perf_build
|
||||
%undefine _enable_debug_packages
|
||||
%else
|
||||
%bcond_without prof
|
||||
%bcond_without docs
|
||||
%bcond_without haddock
|
||||
%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
|
||||
|
||||
# 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} riscv64
|
||||
|
||||
Name: ghc
|
||||
# ghc must be rebuilt after a version bump to avoid ABI change problems
|
||||
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: 75.0.riscv64%{?dist}
|
||||
Release: 100.0.riscv64%{?dist}
|
||||
Summary: Glasgow Haskell Compiler
|
||||
|
||||
License: BSD and HaskellReport
|
||||
|
@ -48,38 +52,53 @@ 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}-testsuite.tar.xz
|
||||
%endif
|
||||
Source3: ghc-doc-index.cron
|
||||
Source4: ghc-doc-index
|
||||
Source5: ghc-pkg.man
|
||||
Source6: haddock.man
|
||||
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 packages
|
||||
# https://github.com/haskell/process/pull/148
|
||||
Patch10: https://github.com/haskell/process/commit/73ea41b3622e2e578d928f7513941aac9d873279.patch
|
||||
Patch11: https://github.com/haskell/process/commit/3e0812fe9d3f4712638a1c4c49bf2b2a7dc4311b.patch
|
||||
|
||||
# Arch dependent patches
|
||||
|
||||
# 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://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/35a897782b6b0a252da7fdcf4921198ad4e1d96c.patch
|
||||
# https://gitlab.haskell.org/ghc/ghc/commit/35a897782b6b0a252da7fdcf4921198ad4e1d96c.patch
|
||||
# https://salsa.debian.org/haskell-team/DHG_packages/blob/master/p/ghc/debian/patches/PprC-Add-support-for-adjacent-floats
|
||||
Patch17: PprC-Add-support-for-adjacent-floats.patch
|
||||
|
||||
# revert 8.4.4 llvm changes
|
||||
# https://ghc.haskell.org/trac/ghc/ticket/15780
|
||||
Patch16: https://github.com/ghc/ghc/commit/6e361d895dda4600a85e01c72ff219474b5c7190.patch
|
||||
# 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/5deb133cf910e9e0ca9ad9fe53f7383a/Disable-unboxed-arrays.patch
|
||||
|
||||
# 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
|
||||
# https://salsa.debian.org/haskell-team/DHG_packages/blob/master/p/ghc/debian/patches/add_-latomic_to_ghc-prim
|
||||
Patch30: add_-latomic_to_ghc-prim.patch
|
||||
# https://salsa.debian.org/haskell-team/DHG_packages/blob/master/p/ghc/debian/patches/e175aaf6918bb2b497b83618dc4c270a0d231a1c.patch
|
||||
Patch32: https://salsa.debian.org/haskell-team/DHG_packages/raw/master/p/ghc/debian/patches/e175aaf6918bb2b497b83618dc4c270a0d231a1c.patch
|
||||
# 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/debian/patches/fix-build-using-unregisterized-v8.4
|
||||
Patch34: fix-build-using-unregisterized-v8.4.patch
|
||||
|
||||
# RISC-V
|
||||
Patch40: ghc-8.2.20-riscv.patch
|
||||
|
@ -94,7 +113,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
|
||||
|
@ -104,31 +123,43 @@ 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}
|
||||
%if 0%{?fedora} >= 29
|
||||
BuildRequires: llvm%{llvm_major}
|
||||
%else
|
||||
BuildRequires: llvm >= %{llvm_major}
|
||||
%endif
|
||||
%endif
|
||||
# patch5
|
||||
BuildRequires: autoconf
|
||||
%ifarch armv7hl
|
||||
# patch12
|
||||
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
|
||||
|
||||
|
@ -159,46 +190,49 @@ 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}
|
||||
%if 0%{?fedora} >= 29
|
||||
Requires: llvm%{llvm_major}
|
||||
%else
|
||||
Requires: llvm >= %{llvm_major}
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%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
|
||||
|
@ -212,111 +246,116 @@ 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 BSD binary-0.8.5.1
|
||||
%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.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
|
||||
# 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 %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 -x ghci-%{ghc_version_override}
|
||||
%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 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 -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}
|
||||
|
||||
%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}
|
||||
|
||||
%patch1 -p1 -b .orig
|
||||
|
||||
%patch2 -p1 -b .orig
|
||||
%patch5 -p1 -b .orig
|
||||
%patch6 -p1 -b .orig
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel} > 6
|
||||
rm -r libffi-tarballs
|
||||
%endif
|
||||
|
||||
(
|
||||
cd libraries/process
|
||||
%patch10 -p1 -b .orig10
|
||||
%patch11 -p1 -b .orig11
|
||||
)
|
||||
|
||||
%ifarch armv7hl
|
||||
%patch12 -p1 -b .orig
|
||||
%endif
|
||||
|
||||
%ifarch s390x
|
||||
%ifarch %{ghc_unregisterized_arches}
|
||||
%patch15 -p1 -b .orig
|
||||
%patch17 -p1 -b .orig
|
||||
%patch34 -p1 -b .orig
|
||||
%endif
|
||||
|
||||
%ifarch armv7hl aarch64
|
||||
%patch16 -p1 -b .orig -R
|
||||
# bigendian
|
||||
%ifarch ppc64 s390x
|
||||
%patch18 -p1 -b .orig
|
||||
%endif
|
||||
|
||||
# debian
|
||||
%patch24 -p1 -b .orig
|
||||
%patch26 -p1 -b .orig
|
||||
%patch28 -p1 -b .orig
|
||||
%ifarch s390x
|
||||
%patch30 -p1 -b .orig
|
||||
%endif
|
||||
%patch32 -p1 -b .orig
|
||||
|
||||
%ifarch riscv64
|
||||
%patch40 -p1 -b .orig
|
||||
%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
|
||||
|
@ -338,15 +377,20 @@ 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 --hoogle --quickjump
|
||||
%else
|
||||
HADDOCK_DOCS = NO
|
||||
BUILD_MAN = NO
|
||||
%endif
|
||||
EXTRA_HADDOCK_OPTS += --hyperlinked-source
|
||||
%if %{with manual}
|
||||
BUILD_MAN = YES
|
||||
BUILD_SPHINX_HTML = YES
|
||||
%else
|
||||
BUILD_MAN = NO
|
||||
BUILD_SPHINX_HTML = NO
|
||||
%endif
|
||||
BUILD_SPHINX_PDF = NO
|
||||
EOF
|
||||
## for verbose build output
|
||||
|
@ -359,16 +403,17 @@ EOF
|
|||
# for patch12
|
||||
%ifarch armv7hl riscv64
|
||||
autoreconf
|
||||
%else
|
||||
# for patch5
|
||||
autoconf
|
||||
%endif
|
||||
|
||||
# replace later with ghc_set_gcc_flags
|
||||
%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
|
||||
|
||||
# * %%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} \
|
||||
|
@ -376,12 +421,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)"
|
||||
|
@ -393,96 +436,69 @@ 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}
|
||||
%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()\
|
||||
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
|
||||
|
@ -543,30 +559,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
|
||||
|
@ -574,6 +567,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
|
||||
|
||||
|
@ -588,11 +594,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
|
||||
|
@ -600,7 +605,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
|
||||
|
@ -611,6 +616,7 @@ fi
|
|||
%{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
|
||||
|
@ -624,16 +630,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
|
||||
|
@ -647,35 +649,69 @@ 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 manual}
|
||||
%{_mandir}/man1/ghc.1*
|
||||
%endif
|
||||
|
||||
%if %{with docs}
|
||||
%files doc-cron
|
||||
%config(noreplace) %{_sysconfdir}/cron.hourly/ghc-doc-index
|
||||
%files devel
|
||||
|
||||
%if %{with haddock}
|
||||
%files doc
|
||||
|
||||
%files doc-index
|
||||
%endif
|
||||
|
||||
%files libraries
|
||||
|
||||
|
||||
%if %{with docs}
|
||||
%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
|
||||
%endif
|
||||
|
||||
%if %{with ghc_prof}
|
||||
%files prof
|
||||
%endif
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue Jul 23 2019 David Abdurachmanov <david.abdurachmanov@sifive.com> - 8.4.4-75.0.riscv64
|
||||
* Sat Sep 21 2019 David Abdurachmanov <david.abdurachmanov@sifive.com> - 8.6.5-100.0.riscv64
|
||||
- Enable RISC-V (riscv64)
|
||||
|
||||
* Wed Jul 31 2019 Jens Petersen <petersen@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-notes.html
|
||||
- https://downloads.haskell.org/~ghc/8.6.5/docs/html/users_guide/8.6.2-notes.html
|
||||
- https://downloads.haskell.org/~ghc/8.6.5/docs/html/users_guide/8.6.3-notes.html
|
||||
- https://downloads.haskell.org/~ghc/8.6.5/docs/html/users_guide/8.6.4-notes.html
|
||||
- https://downloads.haskell.org/~ghc/8.6.5/docs/html/users_guide/8.6.5-notes.html
|
||||
- fix process library initgroups issue
|
||||
(https://github.com/haskell/process/pull/148)
|
||||
- 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 30 2019 Jens Petersen <petersen@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@fedoraproject.org>
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
* Fri Jun 28 2019 Jens Petersen <petersen@redhat.com> - 8.4.4-75
|
||||
- add transfiletriggers that will replace individual post/postun scriptlets
|
||||
|
||||
|
|
2
sources
2
sources
|
@ -1 +1 @@
|
|||
SHA512 (ghc-8.4.4-src.tar.xz) = 685e102eee8cf8b6a377afd7871998c8c368a5da288469367e3fb804aa6109e6f59be5945b8cd3d1e36c851190ea9a7f74c576528589589313d237b721d86da5
|
||||
SHA512 (ghc-8.6.5-src.tar.xz) = c08a7480200cb99e1ffbe4ce7669f552b1054054966f7e7efcbc5f98af8032e1249fa391c4fc4c7d62cc8e0be5d17fa05845177f3cea3dbcf86e6c92d40fc0f9
|
||||
|
|
Loading…
Reference in New Issue