Compare commits

...

10 Commits

Author SHA1 Message Date
David Abdurachmanov 69494acec6
Add support for riscv64
Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
2023-11-14 20:08:38 +02:00
Jens Petersen af12036cab changelog for sphinx7 and external links tweak 2023-09-11 14:08:22 +08:00
Jens Petersen 24eeb06d7d tweak a couple of comments 2023-09-11 14:03:30 +08:00
Jens Petersen afd169846d sync ghc9.4: add sphinx7 patch 2023-09-11 14:00:31 +08:00
Jens Petersen 029e0a3682 user_guide: update external links patch to final upstream
https://gitlab.haskell.org/ghc/ghc/-/issues/22690
2023-09-11 13:28:30 +08:00
Jens Petersen 7b4a7ac6f8 quote commented gpgverify macros 2023-08-09 02:38:59 +08:00
Jens Petersen 751bee0355 disable ghc9.4 obsoletes for 9.4.6 2023-08-09 02:38:30 +08:00
Jens Petersen d003c8c955 fixup SPDX license tags to use "AND" 2023-08-07 00:45:46 +02:00
Jens Petersen 2b31b684ce rebase to 9.4.5 from ghc9.4 package
- https://downloads.haskell.org/~ghc/9.4.5/docs/users_guide/9.4.1-notes.html
2023-07-28 18:37:27 +08:00
Jens Petersen 624ff1fac9 changelog for commits added to fix mass rebuild 2023-07-25 15:27:03 +08:00
11 changed files with 379 additions and 144 deletions

2
.gitignore vendored
View File

@ -42,3 +42,5 @@ testsuite-6.12.3.tar.bz2
/ghc-9.2.5-src.tar.xz.sig
/ghc-9.2.6-src.tar.xz
/ghc-9.2.6-src.tar.xz.sig
/ghc-9.4.5-src.tar.xz
/ghc-9.4.5-src.tar.xz.sig

View File

@ -34,8 +34,8 @@ index dcc7fbaef62..c9888a13adc 100644
extlinks = {
- 'ghc-ticket': ('https://gitlab.haskell.org/ghc/ghc/issues/%s', '#'),
- 'ghc-wiki': ('https://gitlab.haskell.org/ghc/ghc/wikis/%s', '#'),
+ 'ghc-ticket': ('https://gitlab.haskell.org/ghc/ghc/issues/%s', '%s'),
+ 'ghc-wiki': ('https://gitlab.haskell.org/ghc/ghc/wikis/%s', '#%s'),
+ 'ghc-ticket': ('https://gitlab.haskell.org/ghc/ghc/issues/%s', '#%s'),
+ 'ghc-wiki': ('https://gitlab.haskell.org/ghc/ghc/wikis/%s', '%s'),
}
libs_base_uri = '../libraries'

42
10928.patch Normal file
View File

@ -0,0 +1,42 @@
From 5ce7496dba3368faa5088c88168f0f4d69cff32b Mon Sep 17 00:00:00 2001
From: Jens Petersen <petersen@redhat.com>
Date: Fri, 21 Jul 2023 15:26:16 +0800
Subject: [PATCH] make hadrian buildable with Cabal-3.8
---
hadrian/hadrian.cabal | 2 +-
hadrian/src/Hadrian/Haskell/Cabal/Parse.hs | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/hadrian/hadrian.cabal b/hadrian/hadrian.cabal
index c37974914a9..eb5690bbd1a 100644
--- a/hadrian/hadrian.cabal
+++ b/hadrian/hadrian.cabal
@@ -147,7 +147,7 @@ executable hadrian
, BangPatterns
other-extensions: MultiParamTypeClasses
, TypeFamilies
- build-depends: Cabal >= 3.2 && < 3.7
+ build-depends: Cabal >= 3.2 && < 3.9
, base >= 4.8 && < 5
, bytestring >= 0.10 && < 0.12
, containers >= 0.5 && < 0.7
diff --git a/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs b/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs
index 079f675b6ea..2d262a36445 100644
--- a/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs
+++ b/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs
@@ -23,7 +23,11 @@ import qualified Distribution.ModuleName as C
import qualified Distribution.Package as C
import qualified Distribution.PackageDescription as C
import qualified Distribution.PackageDescription.Configuration as C
+#if MIN_VERSION_Cabal(3,8,0)
+import qualified Distribution.Simple.PackageDescription as C
+#else
import qualified Distribution.PackageDescription.Parsec as C
+#endif
import qualified Distribution.Simple.Compiler as C
import qualified Distribution.Simple.Program.Db as C
import qualified Distribution.Simple as C
--
GitLab

View File

@ -0,0 +1,48 @@
From 6e12e3c178fe9ad16131eb3c089bd6578976f5d6 Mon Sep 17 00:00:00 2001
From: Ben Gamari <ben@smart-cactus.org>
Date: Tue, 3 May 2022 13:48:56 -0400
Subject: [PATCH] configure: Check for ffi.h
As noted in #21485, we checked for ffi.h yet then failed to throw an
error if it is missing.
Fixes #21485.
---
m4/fp_find_libffi.m4 | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/m4/fp_find_libffi.m4 b/m4/fp_find_libffi.m4
index ddc511553c8..bf52afefbb8 100644
--- a/m4/fp_find_libffi.m4
+++ b/m4/fp_find_libffi.m4
@@ -49,6 +49,7 @@ AC_DEFUN([FP_FIND_LIBFFI],
CFLAGS="$LIBFFI_CFLAGS $CFLAGS"
LDFLAGS2="$LDFLAGS"
LDFLAGS="$LIBFFI_LDFLAGS $LDFLAGS"
+
if test "$HostOS" = "openbsd";
then
# OpenBSD's libffi is not directly linked to the libpthread but
@@ -58,10 +59,16 @@ AC_DEFUN([FP_FIND_LIBFFI],
# symbols.
LDFLAGS="$LDFLAGS -lpthread"
fi
+
AC_CHECK_LIB(ffi, ffi_call,
- [AC_CHECK_HEADERS([ffi.h], [break], [])
- AC_DEFINE([HAVE_SYSTEM_LIBFFI], [1], [Define to 1 if you have libffi.])],
- [AC_MSG_ERROR([Cannot find system libffi])])
+ [AC_CHECK_HEADERS(
+ [ffi.h],
+ [AC_DEFINE([HAVE_SYSTEM_LIBFFI], [1], [Define to 1 if you have libffi.])],
+ [AC_MSG_ERROR([Cannot find ffi.h for system libffi])]
+ )],
+ [AC_MSG_ERROR([Cannot find system libffi])]
+ )
+
CFLAGS="$CFLAGS2"
LDFLAGS="$LDFLAGS2"
])
--
GitLab

View File

@ -0,0 +1,11 @@
--- ghc-9.4.1/compiler/GHC/Driver/Pipeline/Execute.hs~ 2022-08-07 12:00:38.000000000 +0800
+++ ghc-9.4.1/compiler/GHC/Driver/Pipeline/Execute.hs 2022-08-16 18:31:48.638516201 +0800
@@ -1161,7 +1161,7 @@
-- suppress the generation of the .note.gnu.build-id section,
-- which we don't need and sometimes causes ld to emit a
-- warning:
- ld_build_id | toolSettings_ldSupportsBuildId toolSettings' = ["--build-id=none"]
+ ld_build_id {-| toolSettings_ldSupportsBuildId toolSettings' = ["--build-id=none"]-}
| otherwise = []
if ldIsGnuLd

70
ghc-configure-c99.patch Normal file
View File

@ -0,0 +1,70 @@
Submitted upstream:
<https://gitlab.haskell.org/ghc/ghc/-/merge_requests/9394>
From 6b218717ac85d6dc9104f470cac0b4fb594104f4 Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Tue, 22 Nov 2022 15:23:50 +0100
Subject: [PATCH] m4/fp_leading_underscore.m4: Avoid implicit exit function
declaration
Content-type: text/plain
And switch to a new-style function definition.
Fixes build issues with compilers that do not accept implicit function
declarations.
---
m4/fp_leading_underscore.m4 | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/m4/fp_leading_underscore.m4 b/m4/fp_leading_underscore.m4
index fde57c7625..939cee3b69 100644
--- a/m4/fp_leading_underscore.m4
+++ b/m4/fp_leading_underscore.m4
@@ -32,17 +32,15 @@ struct nlist xYzzY1[] = {{"xYzzY1", 0},{0}};
struct nlist xYzzY2[] = {{"_xYzzY2", 0},{0}};
#endif
-int main(argc, argv)
-int argc;
-char **argv;
+int main(int argc, char **argv)
{
#if defined(HAVE_NLIST_H)
if(nlist(argv[0], xYzzY1) == 0 && xYzzY1[0].n_value != 0)
- exit(1);
+ return 1;
if(nlist(argv[0], xYzzY2) == 0 && xYzzY2[0].n_value != 0)
- exit(0);
+ return 0;
#endif
- exit(1);
+ return 1;
}]])],[fptools_cv_leading_underscore=yes],[fptools_cv_leading_underscore=no],[fptools_cv_leading_underscore=no])
;;
esac]);
diff -ur ghc-9.4.3.orig/configure ghc-9.4.3/configure
--- ghc-9.4.3.orig/configure 2022-11-03 04:46:32.000000000 +0100
+++ ghc-9.4.3/configure 2022-11-22 16:37:07.812512120 +0100
@@ -17095,17 +17101,15 @@
struct nlist xYzzY2[] = {{"_xYzzY2", 0},{0}};
#endif
-int main(argc, argv)
-int argc;
-char **argv;
+int main(int argc, char **argv)
{
#if defined(HAVE_NLIST_H)
if(nlist(argv[0], xYzzY1) == 0 && xYzzY1[0].n_value != 0)
- exit(1);
+ return 1;
if(nlist(argv[0], xYzzY2) == 0 && xYzzY2[0].n_value != 0)
- exit(0);
+ return 0;
#endif
- exit(1);
+ return 1;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :

View File

@ -0,0 +1,11 @@
--- ghc-9.4.1/hadrian/hadrian.cabal~ 2022-08-07 12:00:38.000000000 +0800
+++ ghc-9.4.1/hadrian/hadrian.cabal 2022-08-10 19:54:33.335164261 +0800
@@ -173,7 +173,7 @@
-- waiting for external processes
-- * -qg: Don't use parallel GC as the synchronization
-- time tends to eat any benefit.
- "-with-rtsopts=-I0 -qg"
+ "-with-rtsopts=-I0"
-threaded
if flag(selftest)

293
ghc.spec
View File

@ -1,58 +1,53 @@
# turn off for quick build to disable prof, docs
# This must be enabled 1 for all koji production builds
%bcond prodbuild 1
# Start: prod settings
# all *bcond_without* for production builds:
# - performance build (disable for quick build)
%bcond perfbuild 1
%bcond build_hadrian 1
%global with_hadrian 1
%if %{with hadrian}
%bcond manual 1
%endif
# End: prod settings
# make sure ghc libraries' ABI hashes unchanged
%bcond abicheck 1
# not for production builds
%if %{without perfbuild}
# disable profiling libraries (overriding macros.ghc-srpm)
%undefine with_ghc_prof
# disable haddock documentation (overriding macros.ghc-os)
%undefine with_haddock
%endif
# use Hadrian buildsystem for production builds
# use Hadrian buildsystem for production builds: seems redundant
%bcond hadrian 1
# build hadrian for production builds:
%bcond build_hadrian 1
%ifarch riscv64
%global _lto_cflags %{nil}
%endif
# disabled to allow parallel install of ghc9.2-9.2.7 and ghc-9.2.6
# disabled to allow parallel install of ghcX.Y-X.Y.(Z+1) and ghc-X.Y.Z
%if 0
%global ghc_major 9.2
%global ghc_major 9.4
%global ghc_obsoletes_name ghc%{ghc_major}
%endif
# to handle RCs
%global ghc_release %{version}
%global base_ver 4.16.4.0
%global ghc_bignum_ver 1.2
%global base_ver 4.17.1.0
%global ghc_bignum_ver 1.3
%global ghc_compact_ver 0.1.0.0
%global hpc_ver 0.6.1.0
%global rts_ver 1.0.2
%global xhtml_ver 3000.2.2.1
%undefine with_ghc_prof
%undefine with_haddock
# build profiling libraries and haddock documentation
# perf production build (disable for quick build)
%if %{with prodbuild}
%bcond ghc_prof 1
# https://gitlab.haskell.org/ghc/ghc/-/issues/19754
# https://github.com/haskell/haddock/issues/1384
%ifnarch armv7hl %{ix86}
%bcond haddock 1
%endif
%if %{with hadrian}
%bcond manual 1
%endif
%bcond perf_build 1
%else
# Quick build
%bcond ghc_prof 0
%bcond haddock 0
%if %{with hadrian}
%bcond manual 0
%endif
%bcond perf_build 0
%if %{without hadrian}
# locked together since disabling haddock causes no manuals built
# and disabling haddock still created index.html
# https://gitlab.haskell.org/ghc/ghc/-/issues/15190
%{?with_haddock:%bcond manual 1}
%endif
# experimental - also try with hadrian
%if %{without hadrian}
# to enable dwarf info (only on intel archs): overrides perf
# disabled 0 by default
@ -67,17 +62,20 @@
%{?with_haddock:%bcond manual 1}
%endif
# make sure ghc libraries' ABI hashes unchanged
%bcond abicheck 1
# no longer build testsuite (takes time and not really being used)
%bcond testsuite 0
# 9.2 needs llvm 9-12
%global llvm_major 12
# 9.4 needs llvm 10-14
%global llvm_major 14
%if %{with hadrian}
%global ghc_llvm_archs armv7hl s390x
%global ghc_unregisterized_arches s390 %{mips} riscv64
%global ghc_llvm_archs armv7hl s390x riscv64
%global ghc_unregisterized_arches s390 %{mips}
%else
%global ghc_llvm_archs armv7hl
%global ghc_unregisterized_arches s390 s390x %{mips} riscv64
%global ghc_llvm_archs armv7hl riscv64
%global ghc_unregisterized_arches s390 s390x %{mips}
%endif
%global obsoletes_ghcXY() \
@ -88,15 +86,15 @@ Provides: %{ghc_obsoletes_name}%{?1:-%1} = %{version}-%{release}\
%{nil}
Name: ghc
Version: 9.2.6
Version: 9.4.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: 133%{?dist}
Release: 136.0.riscv64%{?dist}
Summary: Glasgow Haskell Compiler
License: BSD-3-Clause and HaskellReport
License: BSD-3-Clause AND HaskellReport
URL: https://haskell.org/ghc/
Source0: https://downloads.haskell.org/ghc/%{ghc_release}/ghc-%{version}-src.tar.xz
%if %{with testsuite}
@ -107,70 +105,59 @@ Source5: ghc-pkg.man
Source6: haddock.man
Source7: runghc.man
# cannot until i686 is disabled for koji noarch builds at least (pandoc etc)
#ExcludeArch: %%{ix86}
# https://bugzilla.redhat.com/show_bug.cgi?id=2083103
ExcludeArch: armv7hl
# https://gitlab.haskell.org/ghc/ghc/-/issues/19421 (m32_allocator_init)
Patch0: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/10453.patch
# absolute haddock path (was for html/libraries -> libraries)
Patch1: ghc-gen_contents_index-haddock-path.patch
Patch2: ghc-Cabal-install-PATH-warning.patch
Patch3: ghc-gen_contents_index-nodocs.patch
# https://gitlab.haskell.org/ghc/ghc/-/issues/23286 (sphinx modern extlinks)
# detect ffi.h
# https://gitlab.haskell.org/ghc/ghc/-/issues/21485
Patch5: https://gitlab.haskell.org/ghc/ghc/-/commit/6e12e3c178fe9ad16131eb3c089bd6578976f5d6.patch
Patch7: ghc-compiler-enable-build-id.patch
Patch8: ghc-configure-c99.patch
# https://gitlab.haskell.org/ghc/ghc/-/issues/23286 (needed for sphinx-6)
Patch9: https://gitlab.haskell.org/ghc/ghc/-/commit/00dc51060881df81258ba3b3bdf447294618a4de.patch
# distutils gone in python 3.12
# https://gitlab.haskell.org/ghc/ghc/-/merge_requests/10922
Patch8: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/10922.patch
Patch10: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/10922.patch
# https://gitlab.haskell.org/ghc/ghc/-/merge_requests/10928
# allow building hadrian with Cabal-3.8
Patch11: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/10928.patch
# https://phabricator.haskell.org/rGHC4eebc8016f68719e1ccdf460754a97d1f4d6ef05
# https://gitlab.haskell.org/ghc/ghc/-/issues/19684
# DerivedConstants.h not produced atomically
Patch10: https://gitlab.haskell.org/ghc/ghc/-/commit/9aace0eaf6279f17368a1753b65afbdc466e8291.patch
# https://fedoraproject.org/wiki/Toolchain/PortingToModernC
# https://gitlab.haskell.org/ghc/ghc/-/merge_requests/9394
Patch11: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/9394.patch
# armv7hl patches
# arm patches
Patch12: ghc-armv7-VFPv3D16--NEON.patch
# https://github.com/haskell/text/issues/396
# reverts https://github.com/haskell/text/pull/405
Patch13: text2-allow-ghc8-arm.patch
# for unregisterized
# https://gitlab.haskell.org/ghc/ghc/-/issues/15689
Patch15: ghc-warnings.mk-CC-Wall.patch
Patch16: ghc-9.2.1-hadrian-s390x-rts--qg.patch
# bigendian (s390x and ppc64)
# 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://gitlab.haskell.org/ghc/ghc/-/issues/15914
# https://gitlab.haskell.org/ghc/ghc/issues/16973
# https://bugzilla.redhat.com/show_bug.cgi?id=1733030
# https://gitlab.haskell.org/ghc/ghc/-/issues/16998
Patch18: Disable-unboxed-arrays.patch
# ppc64le
# enable smp with hadrian
# https://gitlab.haskell.org/ghc/ghc/-/issues/19825
Patch20: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/5725.patch
Patch16: ghc-hadrian-s390x-rts--qg.patch
# Debian patches:
Patch24: buildpath-abi-stability.patch
Patch26: no-missing-haddock-file-warning.patch
Patch27: haddock-remove-googleapis-fonts.patch
Patch30: https://src.opensuse.org/rpm/ghc/raw/branch/factory/sphinx7.patch
# https://gitlab.haskell.org/ghc/ghc/-/wikis/platforms
# fedora ghc has been bootstrapped on
# %%{ix86} x86_64 s390x ppc64le aarch64
# and retired arches: alpha sparcv9 armv5tel ppc ppc64 s390 armv7hl
# see also deprecated ghc_arches defined in ghc-srpm-macros
# /usr/lib/rpm/macros.d/macros.ghc-srpm
BuildRequires: ghc-compiler > 8.10
BuildRequires: ghc-compiler > 9.0
# for ABI hash checking
%if %{with abicheck}
BuildRequires: %{name}
%endif
BuildRequires: ghc-rpm-macros-extra >= 2.5.0
BuildRequires: ghc-rpm-macros-extra
BuildRequires: ghc-binary-devel
BuildRequires: ghc-bytestring-devel
BuildRequires: ghc-containers-devel
@ -179,22 +166,20 @@ BuildRequires: ghc-pretty-devel
BuildRequires: ghc-process-devel
BuildRequires: ghc-stm-devel
BuildRequires: ghc-template-haskell-devel
%if %{without hadrian}
BuildRequires: ghc-text-devel
%endif
BuildRequires: ghc-transformers-devel
BuildRequires: alex
BuildRequires: gmp-devel
BuildRequires: happy
BuildRequires: libffi-devel
BuildRequires: make
BuildRequires: gcc-c++
# for terminfo
BuildRequires: ncurses-devel
BuildRequires: perl-interpreter
# needed for:
# - binary-dist-dir
# - patch11 and patch12
BuildRequires: autoconf automake
%if %{with testsuite}
BuildRequires: python3
%endif
%if %{with manual}
BuildRequires: python3-sphinx
%endif
@ -204,11 +189,12 @@ BuildRequires: llvm%{llvm_major}
%if %{with dwarf}
BuildRequires: elfutils-devel
%endif
%if %{with prodbuild}
%if %{with perfbuild}
#BuildRequires: gnupg2
%endif
%if %{with hadrian}
BuildRequires: happy
# needed for binary-dist-dir
BuildRequires: autoconf automake
%if %{with build_hadrian}
BuildRequires: ghc-Cabal-static
BuildRequires: ghc-QuickCheck-static
@ -224,7 +210,6 @@ BuildRequires: ghc-shake-static
BuildRequires: ghc-stm-static
BuildRequires: ghc-transformers-static
BuildRequires: ghc-unordered-containers-static
BuildRequires: alex
%else
BuildRequires: %{name}-hadrian
%endif
@ -320,8 +305,7 @@ Summary: GHC library documentation indexing
License: BSD-3-Clause
Obsoletes: ghc-doc-cron < %{version}-%{release}
Requires: %{name}-compiler = %{version}-%{release}
# due to disabled haddock archs
#BuildArch: noarch
BuildArch: noarch
%obsoletes_ghcXY doc-index
%description doc-index
@ -330,8 +314,7 @@ The package enables re-indexing of installed library documention.
%package filesystem
Summary: Shared directories for Haskell documentation
# due to disabled haddock archs
#BuildArch: noarch
BuildArch: noarch
Obsoletes: %{name}-filesystem < %{version}-%{release}
%obsoletes_ghcXY filesystem
@ -367,19 +350,20 @@ Version: 0.1.0.0
This provides the hadrian tool which can be used to build ghc.
%endif
%global BSDHaskellReport %{quote:BSD-3-Clause and HaskellReport}
%global BSDHaskellReport %{quote:BSD-3-Clause AND HaskellReport}
# use "./libraries-versions.sh" to check versions
%if %{defined ghclibdir}
%ghc_lib_subpackage -d -l BSD-3-Clause Cabal-3.6.3.0
%ghc_lib_subpackage -d -l BSD-3-Clause Cabal-3.8.1.0
%ghc_lib_subpackage -d -l BSD-3-Clause Cabal-syntax-3.8.1.0
%ghc_lib_subpackage -d -l %BSDHaskellReport array-0.5.4.0
%ghc_lib_subpackage -d -l %BSDHaskellReport -c gmp-devel%{?_isa},libffi-devel%{?_isa} base-%{base_ver}
%ghc_lib_subpackage -d -l BSD-3-Clause binary-0.8.9.0
%ghc_lib_subpackage -d -l BSD-3-Clause binary-0.8.9.1
%ghc_lib_subpackage -d -l BSD-3-Clause bytestring-0.11.4.0
%ghc_lib_subpackage -d -l %BSDHaskellReport containers-0.6.5.1
%ghc_lib_subpackage -d -l %BSDHaskellReport deepseq-1.4.6.1
%ghc_lib_subpackage -d -l %BSDHaskellReport directory-1.3.6.2
%ghc_lib_subpackage -d -l %BSDHaskellReport exceptions-0.10.4
%ghc_lib_subpackage -d -l %BSDHaskellReport containers-0.6.7
%ghc_lib_subpackage -d -l %BSDHaskellReport deepseq-1.4.8.0
%ghc_lib_subpackage -d -l %BSDHaskellReport directory-1.3.7.1
%ghc_lib_subpackage -d -l %BSDHaskellReport exceptions-0.10.5
%ghc_lib_subpackage -d -l BSD-3-Clause filepath-1.4.2.2
# in ghc not ghc-libraries:
%ghc_lib_subpackage -d -x ghc-%{ghc_version_override}
@ -395,16 +379,17 @@ This provides the hadrian tool which can be used to build ghc.
# see below for integer-gmp
%ghc_lib_subpackage -d -x -l %BSDHaskellReport libiserv-%{ghc_version_override}
%ghc_lib_subpackage -d -l BSD-3-Clause mtl-2.2.2
%ghc_lib_subpackage -d -l BSD-3-Clause parsec-3.1.15.0
%ghc_lib_subpackage -d -l BSD-3-Clause parsec-3.1.16.1
%ghc_lib_subpackage -d -l BSD-3-Clause pretty-1.1.3.6
%ghc_lib_subpackage -d -l %BSDHaskellReport process-1.6.16.0
%ghc_lib_subpackage -d -l BSD-3-Clause stm-2.5.0.2
%ghc_lib_subpackage -d -l BSD-3-Clause template-haskell-2.18.0.0
# see below for rts
%ghc_lib_subpackage -d -l BSD-3-Clause stm-2.5.1.0
%ghc_lib_subpackage -d -l BSD-3-Clause template-haskell-2.19.0.0
%ghc_lib_subpackage -d -l BSD-3-Clause -c ncurses-devel%{?_isa} terminfo-0.4.1.5
%ghc_lib_subpackage -d -l BSD-3-Clause text-1.2.5.0
%ghc_lib_subpackage -d -l BSD-3-Clause time-1.11.1.1
%ghc_lib_subpackage -d -l BSD-3-Clause text-2.0.2
%ghc_lib_subpackage -d -l BSD-3-Clause time-1.12.2
%ghc_lib_subpackage -d -l BSD-3-Clause transformers-0.5.6.2
%ghc_lib_subpackage -d -l BSD-3-Clause unix-2.7.2.2
%ghc_lib_subpackage -d -l BSD-3-Clause unix-2.7.3
%if %{with haddock} || %{with hadrian}
%ghc_lib_subpackage -d -l BSD-3-Clause xhtml-%{xhtml_ver}
%endif
@ -414,7 +399,7 @@ This provides the hadrian tool which can be used to build ghc.
%package devel
Summary: GHC development libraries meta package
License: BSD-3-Clause and HaskellReport
License: BSD-3-Clause AND HaskellReport
Requires: %{name}-compiler = %{version}-%{release}
Obsoletes: %{name}-libraries < %{version}-%{release}
Provides: %{name}-libraries = %{version}-%{release}
@ -441,45 +426,48 @@ Installing this package causes %{name}-*-prof packages corresponding to
%prep
%if %{with prodbuild}
#%%{gpgverify} --keyring='%{SOURCE3}' --signature='%{SOURCE2}' --data='%{SOURCE0}'
#%%{gpgverify} --keyring='%%{SOURCE3}' --signature='%%{SOURCE2}' --data='%%{SOURCE0}'
%endif
%setup -q -n ghc-%{version} %{?with_testsuite:-b1}
%patch -P0 -p1 -b .orig
%patch -P1 -p1 -b .orig
%patch -P3 -p1 -b .orig
%patch -P2 -p1 -b .orig
%patch -P9 -p1 -b .orig
%patch -P5 -p1 -b .orig
# should be safe but testing in fedora first
%if 0%{?fedora}
%patch -P7 -p1 -b .orig
%endif
%patch -P8 -p1 -b .orig
%patch -P9 -p1 -b .orig
%patch -P10 -p1 -b .orig
%patch -P11 -p1 -b .orig11
%patch -P11 -p1 -b .orig
rm libffi-tarballs/libffi-*.tar.gz
%ifarch armv7hl
%patch -P12 -p1 -b .orig
%endif
%ifarch aarch64 armv7hl
%patch -P13 -p1 -b .orig
%endif
# remove s390x after complete switching to llvm
%ifarch %{ghc_unregisterized_arches}
%ifarch %{ghc_unregisterized_arches} riscv64
%patch -P15 -p1 -b .orig
%patch -P16 -p1 -b .orig
%endif
# bigendian
%ifarch s390x
%patch -P18 -p1 -b .orig
%endif
# ppc64le
%patch -P20 -p1 -b .orig
# debian
%patch -P24 -p1 -b .orig
#debian
#%%patch -P24 -p1 -b .orig
%patch -P26 -p1 -b .orig
%patch -P27 -p1 -b .orig
#sphinx 7
%if 0%{?fedora} >= 40
%patch -P30 -p1 -b .orig
%endif
%if %{with haddock} && %{without hadrian}
%global gen_contents_index gen_contents_index.orig
if [ ! -f "libraries/%{gen_contents_index}" ]; then
@ -489,9 +477,8 @@ fi
%endif
%if %{without hadrian}
# https://gitlab.haskell.org/ghc/ghc/-/wikis/platforms
cat > mk/build.mk << EOF
%if %{with perf_build}
%if %{with perfbuild}
%ifarch %{ghc_llvm_archs}
BuildFlavour = perf-llvm
%else
@ -528,8 +515,8 @@ EOF
%build
# for patch11
autoreconf
# patch5 and patch12
autoupdate
%ghc_set_gcc_flags
export CC=%{_bindir}/gcc
@ -537,7 +524,9 @@ export CC=%{_bindir}/gcc
# /usr/bin/debugedit: Cannot handle 8-byte build ID
# https://bugzilla.redhat.com/show_bug.cgi?id=2116508
# https://gitlab.haskell.org/ghc/ghc/-/issues/22195
%ifnarch riscv64
export LD=%{_bindir}/ld.gold
%endif
# * %%configure induces cross-build due to different target/host/build platform names
./configure --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} \
@ -576,10 +565,17 @@ cd hadrian
%global hadrian_llvm +llvm
%endif
%define hadrian_docs %{!?with_haddock:--docs=no-haddocks} --docs=%[%{?with_manual} ? "no-sphinx-pdfs" : "no-sphinx"]
# aarch64 with 224 cpus: _build/stage0/bin/ghc: createProcess: pipe: resource exhausted (Too many open files)
# https://koji.fedoraproject.org/koji/taskinfo?taskID=105428124
%global _smp_ncpus_max 1
# quickest does not build shared libs
%{hadrian} %{?_smp_mflags} --flavour=%[%{?with_prodbuild} ? "perf" : "quick"]%{!?with_ghc_prof:+no_profiled_libs}%{?hadrian_llvm} %{hadrian_docs} binary-dist-dir
# try release instead of perf
%{hadrian} -j1 --flavour=%[%{?with_perfbuild} ? "perf" : "quick"]%{!?with_ghc_prof:+no_profiled_libs}%{?hadrian_llvm} %{hadrian_docs} binary-dist-dir
%else
make %{?_smp_mflags}
# https://gitlab.haskell.org/ghc/ghc/-/issues/22099
# 48 cpus breaks build: Error: ghc-cabal: Encountered missing or private dependencies: rts >=1.0 && <1.1
%global _smp_ncpus_max 1
make -j1
%endif
@ -610,7 +606,6 @@ sed -i -e 's!^library-dirs: %{ghclibdir}/rts!&\ndynamic-library-dirs: %{_ghcdynl
%endif
%endif
# https://bugzilla.redhat.com/show_bug.cgi?id=2166028
%if "%{?_ghcdynlibdir}" != "%_libdir"
mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d
echo "%{?_ghcdynlibdir}%{!?_ghcdynlibdir:%{ghclibplatform}}" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}.conf
@ -622,6 +617,9 @@ done
# containers src moved to a subdir
cp -p libraries/containers/containers/LICENSE libraries/containers/LICENSE
# hack for Cabal-syntax/LICENSE
mkdir -p libraries/Cabal-syntax
cp -p libraries/Cabal/Cabal-syntax/LICENSE libraries/Cabal-syntax
rm -f %{name}-*.files
@ -646,7 +644,7 @@ echo "%%dir %ghclibplatform" >> %{name}-base%{?_ghcdynlibdir:-devel}.files
%ghc_gen_filelists hpc %{hpc_ver}
%ghc_gen_filelists libiserv %{ghc_version_override}
%ghc_gen_filelists ghc-prim 0.8.0
%ghc_gen_filelists ghc-prim 0.9.0
%ghc_gen_filelists integer-gmp 1.1
%if %{with hadrian}
%ghc_gen_filelists rts %{rts_ver}
@ -699,7 +697,9 @@ sed -i -e 's!^library-dirs: %{ghclibdir}/rts!&\ndynamic-library-dirs: %{_libdir}
ls -d %{buildroot}%{ghclibdir}/package.conf.d/rts.conf >> %{name}-base-devel.files
%endif
ls -d %{buildroot}%{ghclibdir}/include >> %{name}-base-devel.files
if [ -f %{buildroot}%{ghcliblib}/package.conf.d/system-cxx-std-lib-1.0.conf ]; then
ls -d %{buildroot}%{ghcliblib}/package.conf.d/system-cxx-std-lib-1.0.conf >> %{name}-base-devel.files
fi
%if %{with ghc_prof}
ls %{buildroot}%{ghclibdir}/bin/ghc-iserv-prof* >> %{name}-base-prof.files
@ -732,7 +732,8 @@ rm %{buildroot}%{_pkgdocdir}/archives/libraries.html.tar.xz
%if %{with manual}
rm %{buildroot}%{_pkgdocdir}/archives/Haddock.html.tar.xz
rm %{buildroot}%{_pkgdocdir}/archives/users_guide.html.tar.xz
mv %{buildroot}%{_ghc_doc_dir}/users_guide/build-man/ghc.1 %{buildroot}%{_mandir}/man1/
# https://gitlab.haskell.org/ghc/ghc/-/issues/23707
rm %{buildroot}%{_ghc_doc_dir}/users_guide/build-man/ghc.1
%endif
%endif
@ -927,10 +928,6 @@ env -C %{ghc_html_libraries_dir} ./gen_contents_index
%{ghcliblib}/bin/ghc-iserv
%{ghcliblib}/bin/ghc-iserv-dyn
%{ghcliblib}/bin/unlit
%{ghcliblib}/DerivedConstants.h
%{ghcliblib}/ghcautoconf.h
%{ghcliblib}/ghcplatform.h
%{ghcliblib}/ghcversion.h
%endif
%{ghcliblib}/ghc-usage.txt
%{ghcliblib}/ghci-usage.txt
@ -952,10 +949,12 @@ env -C %{ghc_html_libraries_dir} ./gen_contents_index
%{ghcliblib}/html
%{ghcliblib}/latex
%endif
%if %{with haddock} || (%{with hadrian} && %{with manual})
%{ghc_html_libraries_dir}/prologue.txt
%endif
%if %{with haddock}
%if %{without hadrian}
%{ghclibdir}/bin/haddock
%{ghc_html_libraries_dir}/prologue.txt
%endif
%verify(not size mtime) %{ghc_html_libraries_dir}/haddock-bundle.min.js
%verify(not size mtime) %{ghc_html_libraries_dir}/linuwial.css
@ -973,8 +972,8 @@ env -C %{ghc_html_libraries_dir} ./gen_contents_index
%{ghc_html_dir}/index.html
%files doc-index
%{ghc_html_libraries_dir}/gen_contents_index
%if %{with haddock}
#%%{ghc_html_libraries_dir}/gen_contents_index
%verify(not size mtime) %{ghc_html_libraries_dir}/doc-index*.html
%verify(not size mtime) %{ghc_html_libraries_dir}/index*.html
%endif
@ -982,10 +981,8 @@ env -C %{ghc_html_libraries_dir} ./gen_contents_index
%files filesystem
%dir %_ghc_doc_dir
%dir %ghc_html_dir
%if %{with haddock}
%dir %ghc_html_libraries_dir
%endif
%endif
%if %{with hadrian} && %{with build_hadrian}
%files hadrian
@ -1014,12 +1011,28 @@ env -C %{ghc_html_libraries_dir} ./gen_contents_index
%changelog
* Tue Nov 14 2023 David Abdurachmanov <davidlt@rivosinc.com> - 9.4.5-136.0.riscv64
- Add support for riscv64
* Mon Sep 11 2023 Jens Petersen <petersen@redhat.com> - 9.4.5-136
- sync with ghc9.4: add sphinx7 patch
- user_guide: update external links patch in line with final upstream
* Tue Aug 8 2023 Jens Petersen <petersen@redhat.com> - 9.4.5-135
- disable ghc9.4 obsoletes due to 9.4.6 release
* Tue Jul 25 2023 Jens Petersen <petersen@redhat.com> - 9.4.5-134
- rebase to 9.4.5 from ghc9.4 package
- https://downloads.haskell.org/~ghc/9.4.5/docs/users_guide/9.4.1-notes.html
* Tue Jul 25 2023 Jens Petersen <petersen@redhat.com> - 9.2.6-133
- base subpkg now owns ghcliblib and ghclibplatform dirs (#2185357)
- s390x: no longer apply unregisterized patches
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 9.2.6-132
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
- fix sphinx flags.py: python 3.12 dropped distutils (petersen)
- fix BSD3 SPDX tags (petersen)
* Thu May 25 2023 Jens Petersen <petersen@redhat.com> - 9.2.6-131
- include backport of 9.4 m32_allocator_init changes by Sylvain Henry (#2209162)

View File

@ -1,2 +1,2 @@
SHA512 (ghc-9.2.6-src.tar.xz) = 187e00780b97ef784a01e1caa278d2c5b22d350de7d18d0b4c8c522c2d9e7895f5720ffbf589352ed601c81eee6f10a39cb4a3060e6639cda45494aeaa4f94a0
SHA512 (ghc-9.2.6-src.tar.xz.sig) = df13365e2dabd2459e1df3f624d0f39213a1fdda597274ba96dcf2de44d9bd56106f7438bab3622f55757d12f3b1fec4fdeb865bb34b0bfe0713133aa8799f74
SHA512 (ghc-9.4.5-src.tar.xz) = 6e469558433e9d1d83ae348fb242a178ee7008fcb5c9707f0bdf93f17c394dc05d993b9cd7f9cd65d20c32fadcd1276ed49c3a74ade98235735de5268c3c1315
SHA512 (ghc-9.4.5-src.tar.xz.sig) = a46b41f21760dbeb5078af3ca1a8bb1acbc3404c54bd201122e4ee06a3bf21d772b88751c8dd7e16891a9a5d2545e5f2894e2fe79922a5e20f7235106dddf1a1

26
sphinx7.patch Normal file
View File

@ -0,0 +1,26 @@
From 52d701b31dc4427b7e321a04be3f5f13a5fc271e Mon Sep 17 00:00:00 2001
From: "mimi.vx" <mimi.vx@gmail.com>
Date: Wed, 24 May 2023 12:42:15 +0000
Subject: [PATCH] Fix for Sphinx 7 removed style key
Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/23444
---
docs/users_guide/rtd-theme/layout.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/users_guide/rtd-theme/layout.html b/docs/users_guide/rtd-theme/layout.html
index 2a61142514a..7ffeff7befc 100644
--- a/docs/users_guide/rtd-theme/layout.html
+++ b/docs/users_guide/rtd-theme/layout.html
@@ -64,7 +64,7 @@
{%- endif %}
{# CSS #}
- <link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
+ <link rel="stylesheet" href="{{ pathto('_static/' + styles[-1], 1) }}" type="text/css" />
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
{%- for css in css_files %}
{%- if css|attr("rel") %}
--
GitLab

View File

@ -0,0 +1,12 @@
--- ghc-9.4.0.20220501/libraries/text/text.cabal~ 2022-04-30 02:50:06.000000000 +0800
+++ ghc-9.4.0.20220501/libraries/text/text.cabal 2022-05-06 23:55:56.091521266 +0800
@@ -121,9 +121,6 @@
if os(windows) && impl(ghc >= 8.2 && < 8.4 || == 8.6.3 || == 8.10.1)
build-depends: base < 0
- -- GHC 8.10 has linking issues (probably TH-related) on ARM.
- if (arch(aarch64) || arch(arm)) && impl(ghc == 8.10.*)
- build-depends: base < 0
-- Subword primitives in GHC 9.2.1 are broken on ARM platforms.
if (arch(aarch64) || arch(arm)) && impl(ghc == 9.2.1)