From 091003f06f86cfe98006693ec8e5f619c9139a08 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: May 03 2022 00:57:50 +0000 Subject: initial import derived from ghc9.2 --- diff --git a/9aace0eaf6279f17368a1753b65afbdc466e8291.patch b/9aace0eaf6279f17368a1753b65afbdc466e8291.patch new file mode 100644 index 0000000..101281b --- /dev/null +++ b/9aace0eaf6279f17368a1753b65afbdc466e8291.patch @@ -0,0 +1,93 @@ +From 9aace0eaf6279f17368a1753b65afbdc466e8291 Mon Sep 17 00:00:00 2001 +From: Sylvain Henry +Date: Sat, 10 Apr 2021 14:48:16 +0200 +Subject: [PATCH] Produce constant file atomically (#19684) + +--- + utils/deriveConstants/Main.hs | 21 ++++++++++++++++----- + utils/deriveConstants/deriveConstants.cabal | 3 ++- + 2 files changed, 18 insertions(+), 6 deletions(-) + +diff --git a/utils/deriveConstants/Main.hs b/utils/deriveConstants/Main.hs +index 8bf8ae7b44d7..9db673a98529 100644 +--- a/utils/deriveConstants/Main.hs ++++ b/utils/deriveConstants/Main.hs +@@ -34,9 +34,10 @@ import Data.Maybe (catMaybes, mapMaybe, fromMaybe) + import Numeric (readHex) + import System.Environment (getArgs) + import System.Exit (ExitCode(ExitSuccess), exitFailure) +-import System.FilePath (()) ++import System.FilePath ((),(<.>)) + import System.IO (stderr, hPutStrLn) + import System.Process (showCommandForUser, readProcess, rawSystem) ++import System.Directory (renameFile) + + main :: IO () + main = do opts <- parseArgs +@@ -79,6 +80,16 @@ data Options = Options { + o_targetOS :: Maybe String + } + ++-- | Write a file atomically ++-- ++-- This avoids other processes seeing the file while it is being written into. ++atomicWriteFile :: FilePath -> String -> IO () ++atomicWriteFile fn s = do ++ let tmp = fn <.> "tmp" ++ writeFile tmp s ++ renameFile tmp fn ++ ++ + parseArgs :: IO Options + parseArgs = do args <- getArgs + opts <- f emptyOptions args +@@ -670,7 +681,7 @@ getWanted verbose os tmpdir gccProgram gccFlags nmProgram mobjdumpProgram + = do let cStuff = unlines (headers ++ concatMap (doWanted . snd) (wanteds os)) + cFile = tmpdir "tmp.c" + oFile = tmpdir "tmp.o" +- writeFile cFile cStuff ++ atomicWriteFile cFile cStuff + execute verbose gccProgram (gccFlags ++ ["-c", cFile, "-o", oFile]) + xs <- case os of + "openbsd" -> readProcess objdumpProgam ["--syms", oFile] "" +@@ -855,7 +866,7 @@ getWanted verbose os tmpdir gccProgram gccFlags nmProgram mobjdumpProgram + = return (w, FieldTypeGcptrMacro name) + + writeHaskellType :: FilePath -> [What Fst] -> IO () +-writeHaskellType fn ws = writeFile fn xs ++writeHaskellType fn ws = atomicWriteFile fn xs + where xs = unlines [header, body, footer, parser] + header = "module GHC.Platform.Constants where\n\n\ + \import Prelude\n\ +@@ -920,7 +931,7 @@ writeHaskellType fn ws = writeFile fn xs + + + writeHaskellValue :: FilePath -> [What Snd] -> IO () +-writeHaskellValue fn rs = writeFile fn xs ++writeHaskellValue fn rs = atomicWriteFile fn xs + where xs = unlines [header, body, footer] + header = "PlatformConstants {" + footer = " }" +@@ -937,7 +948,7 @@ writeHaskellValue fn rs = writeFile fn xs + doWhat (FieldTypeGcptrMacro {}) = [] + + writeHeader :: FilePath -> [(Where, What Snd)] -> IO () +-writeHeader fn rs = writeFile fn xs ++writeHeader fn rs = atomicWriteFile fn xs + where xs = headers ++ hs ++ unlines body + headers = "/* This file is created automatically. Do not edit by hand.*/\n\n" + haskellRs = fmap snd $ filter (\r -> fst r `elem` [Haskell,Both]) rs +diff --git a/utils/deriveConstants/deriveConstants.cabal b/utils/deriveConstants/deriveConstants.cabal +index 50b5b695c305..36ba7ebe1f7a 100644 +--- a/utils/deriveConstants/deriveConstants.cabal ++++ b/utils/deriveConstants/deriveConstants.cabal +@@ -20,4 +20,5 @@ Executable deriveConstants + Build-Depends: base >= 4 && < 5, + containers, + process, +- filepath ++ filepath, ++ directory +-- +GitLab + diff --git a/Disable-unboxed-arrays.patch b/Disable-unboxed-arrays.patch new file mode 100644 index 0000000..4ccb16d --- /dev/null +++ b/Disable-unboxed-arrays.patch @@ -0,0 +1,10 @@ +--- ghc-8.8.0.20190721/libraries/containers/containers/include/containers.h~ 2019-06-26 20:39:26.000000000 +0000 ++++ ghc-8.8.0.20190721/libraries/containers/containers/include/containers.h 2019-07-27 08:55:10.747060247 +0000 +@@ -35,7 +35,6 @@ + + #ifdef __GLASGOW_HASKELL__ + # define USE_ST_MONAD 1 +-# define USE_UNBOXED_ARRAYS 1 + #endif + + #endif diff --git a/buildpath-abi-stability.patch b/buildpath-abi-stability.patch new file mode 100644 index 0000000..1d45c72 --- /dev/null +++ b/buildpath-abi-stability.patch @@ -0,0 +1,23 @@ +Forwarded to https://ghc.haskell.org/trac/ghc/ticket/10424 + +--- a/compiler/iface/MkIface.hs ++++ b/compiler/iface/MkIface.hs +@@ -681,7 +681,7 @@ addFingerprints hsc_env mb_old_fingerpri + iface_hash <- computeFingerprint putNameLiterally + (mod_hash, + ann_fn (mkVarOcc "module"), -- See mkIfaceAnnCache +- mi_usages iface0, ++ usages, + sorted_deps, + mi_hpc iface0) + +@@ -714,6 +714,9 @@ addFingerprints hsc_env mb_old_fingerpri + (non_orph_fis, orph_fis) = mkOrphMap ifFamInstOrph (mi_fam_insts iface0) + fix_fn = mi_fix_fn iface0 + ann_fn = mkIfaceAnnCache (mi_anns iface0) ++ -- Do not allow filenames to affect the interface ++ usages = [ case u of UsageFile _ fp -> UsageFile "" fp; _ -> u | u <- mi_usages iface0 ] ++ + + -- | Retrieve the orphan hashes 'mi_orphan_hash' for a list of modules + -- (in particular, the orphan modules which are transitively imported by the 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-9.2.1-hadrian-s390x-rts--qg.patch b/ghc-9.2.1-hadrian-s390x-rts--qg.patch new file mode 100644 index 0000000..ebdb8e3 --- /dev/null +++ b/ghc-9.2.1-hadrian-s390x-rts--qg.patch @@ -0,0 +1,9 @@ +--- ghc-9.2.1/hadrian/hadrian.cabal~ 2021-10-29 04:41:34.000000000 +0800 ++++ ghc-9.2.1/hadrian/hadrian.cabal 2021-11-01 15:02:49.625656704 +0800 +@@ -162,5 +162,5 @@ + -- 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 diff --git a/ghc-Cabal-install-PATH-warning.patch b/ghc-Cabal-install-PATH-warning.patch new file mode 100644 index 0000000..5f2baa7 --- /dev/null +++ b/ghc-Cabal-install-PATH-warning.patch @@ -0,0 +1,12 @@ +--- ghc/libraries/Cabal/Cabal/src/Distribution/Simple/Install.hs~ 2017-05-05 23:51:43.000000000 +0900 ++++ ghc/libraries/Cabal/Cabal/src/Distribution/Simple/Install.hs 2018-02-27 12:22:13.159432104 +0900 +@@ -215,8 +215,7 @@ + ++ " in " ++ binPref) + inPath <- isInSearchPath binPref + when (not inPath) $ +- warn verbosity ("The directory " ++ binPref +- ++ " is not in the system search path.") ++ warn verbosity ("Executable installed in " ++ binPref) + case compilerFlavor (compiler lbi) of + GHC -> GHC.installExe verbosity lbi binPref buildPref progFix pkg_descr exe + GHCJS -> GHCJS.installExe verbosity lbi binPref buildPref progFix pkg_descr exe diff --git a/ghc-armv7-VFPv3D16--NEON.patch b/ghc-armv7-VFPv3D16--NEON.patch new file mode 100644 index 0000000..1d6044e --- /dev/null +++ b/ghc-armv7-VFPv3D16--NEON.patch @@ -0,0 +1,11 @@ +--- ghc-9.2.1/m4/get_arm_isa.m4~ 2021-10-29 04:41:34.000000000 +0800 ++++ ghc-9.2.1/m4/get_arm_isa.m4 2021-12-30 23:21:15.637195477 +0800 +@@ -81,7 +81,7 @@ + fi], + [changequote(, )dnl + ARM_ISA=ARMv7 +- ARM_ISA_EXT="[VFPv3,NEON]" ++ ARM_ISA_EXT="[VFPv3D16]" + changequote([, ])dnl + ]) + ]) diff --git a/ghc-gen_contents_index-haddock-path.patch b/ghc-gen_contents_index-haddock-path.patch new file mode 100644 index 0000000..e6819ee --- /dev/null +++ b/ghc-gen_contents_index-haddock-path.patch @@ -0,0 +1,10 @@ +--- ghc-7.6.3/libraries/gen_contents_index~ 2013-04-19 06:22:46.000000000 +0900 ++++ ghc-7.6.3/libraries/gen_contents_index 2013-04-22 12:07:48.922152864 +0900 +@@ -60,6 +60,6 @@ + done + else +- HADDOCK=../../../../../bin/haddock ++ HADDOCK=/usr/bin/haddock + # We don't want the GHC API to swamp the index + HADDOCK_FILES=`ls -1 */*.haddock | grep -v '/ghc\.haddock' | sort` + HADDOCK_ARGS="-p prologue.txt" diff --git a/ghc-gen_contents_index-nodocs.patch b/ghc-gen_contents_index-nodocs.patch new file mode 100644 index 0000000..bb7f9a6 --- /dev/null +++ b/ghc-gen_contents_index-nodocs.patch @@ -0,0 +1,11 @@ +--- ghc-8.6.5/libraries/gen_contents_index~ 2020-02-24 15:02:26.318866694 +0800 ++++ ghc-8.6.5/libraries/gen_contents_index 2020-04-09 18:18:40.290722327 +0800 +@@ -47,6 +47,8 @@ + HADDOCK_ARGS="$HADDOCK_ARGS $HADDOCK_ARG" + done + else ++ if ! ls */*.haddock &>/dev/null; then exit 0; fi ++ + HADDOCK=/usr/bin/haddock + # We don't want the GHC API to swamp the index + HADDOCK_FILES=`ls -1 */*.haddock | grep -v '/ghc\.haddock' | sort` diff --git a/ghc-pkg.man b/ghc-pkg.man new file mode 100644 index 0000000..ccac8e4 --- /dev/null +++ b/ghc-pkg.man @@ -0,0 +1,228 @@ +.TH ghc-pkg 1 "2010-01-27" +.SH NAME +ghc-pkg \- GHC Haskell Cabal package manager +.SH SYNOPSIS +.B ghc-pkg +.I action +.RI [ OPTION ]... +.SH DESCRIPTION +A package is a library of Haskell modules known to the compiler. The +.B ghc-pkg +tool allows adding or removing them from a package database. By +default, the system-wide package database is modified, but +alternatively the user's local package database or another specified +file can be used. +.PP +To make a package available for +.BR ghc , +.B ghc-pkg +can be used to register it. Unregistering it removes it from the +database. Also, packages can be hidden, to make +.B ghc +ignore the package by default, without uninstalling it. Exposing a +package makes a hidden package available. Additionally, +.B ghc-pkg +has various commands to query the package database. +.PP +Where a package name is required, the package can be named in full +including the version number (e.g. +.BR network-1.0 ), +or without the version number. Naming a package without the version +number matches all versions of the package; the specified action will +be applied to all the matching packages. A package specifier that +matches all version of the package can also be written +.BR pkg-* , +to make it clearer that multiple packages are being matched. +.SH ACTIONS +.TP +\fBregister\fP \fIfilename\fP|\fB-\fP +Register the package using the specified installed package +description. +.TP +\fBupdate\fP \fIfilename\fP|\fB-\fP +Register the package, overwriting any other package with the same +name. +.TP +\fBunregister\fP \fIpkg-id\fP +Unregister the specified package. +.TP +\fBexpose\fP \fIpkg-id\fP +Expose the specified package. +.TP +\fBhide\fP \fIpkg-id\fP +Hide the specified package +.TP +\fBlist\fP \fR[\fIpkg\fR]...\fP +List registered packages in the global database, and also the user +database if +.B --user +is given. If a package name is given all the registered versions will +be listed in ascending order. Accepts the +.B --simple-output +flag. +.TP +.B dot +Generate a graph of the package dependencies in a form suitable for +input for the graphviz tools. For example, to generate a PDF of the +dependency graph: +.br +\fB dot \| tred \| dot -Tpdf >pkgs.pdf\fP +.TP +\fBfind-module\fP \fImodule\fP +List registered packages exposing module +.I module +in the global database, and also the user database if +.B --user +is given. All the registered versions will be listed in ascending +order. Accepts the +.B --simple-output +flag. +.TP +\fBlatest\fP \fIpkg-id\fP +Prints the highest registered version of a package. +.TP +.B check +Check the consistency of package dependencies and list broken +packages. Accepts the +.B --simple-output +flag. +.TP +\fBdescribe\fP \fIpkg\fP +Give the registered description for the +specified package. The description is returned in precisely the syntax +required by ghc-pkg register. +.TP +\fBfield\fP \fIpkg field\fP +Extract the specified field of the package description for the +specified package. Accepts comma-separated multiple fields. +.TP +.B dump +Dump the registered description for every package. This is like +.BR ghc-pkg\ describe\ '*' , +expect that it is intended to be used by tools that parse the results, +rather than humans. +.TP +.B recache +Regenerate the package database cache. This command should only be +necessary if you added a package to the database by dropping a file +into the database directory manyally. By default, the global DB is +recached; to recache a different DB use +.B --user +or +.B --package-conf +as appropriate. +.SH OPTIONS +When asked to modify a database +.RB ( register ,\ unregister ,\ update ,\ hide ,\ expose ,\ and\ also\ check ), +.B ghc-pkg +modifies the global database by +default. Specifying +.B --user +causes it to act on the user database, +or +.B --package-conf +can be used to act on another database +entirely. When multiple of these options are given, the rightmost +one is used as the database to act upon. +.PP +Commands that query the package database +.RB ( list ,\ latest ,\ describe ,\ field ) +operate on the list of databases specified by the flags +.BR --user ,\ --global , +and +.BR --package-conf . +If none of these flags are +given, the default is +.BR --global\ --user . +.TP +.B --user +Use the current user's package database. +.TP +.B --global +Use the global package database. +.TP +\fB-f\fP \fIFILE\fP, \fB--package-conf=\fIFILE\fP +Use the specified package config file. +.TP +.BI --global-conf= FILE +Location of the global package config. +.TP +.B --force +Ignore missing dependencies, directories, and libraries. +.TP +.B --force-files +Ignore missing directories and libraries only. +.TP +.BR -g ,\ --auto-ghc-libs +Automatically build libs for GHCi (with register). +.TP +.BR -? ,\ --help +Display a help message and exit. +.TP +.BR -V ,\ --version +Output version information and exit. +.TP +.B --simple-output +Print output in easy-to-parse format for some commands. +.TP +.B --names-only +Only print package names, not versions; can only be used with +.BR list\ --simple-output . +.TP +.B --ignore-case +Ignore case for substring matching. +.SH ENVIRONMENT VARIABLES +.TP +.B GHC_PACKAGE_PATH +The +.B GHC_PACKAGE_PATH +environment variable may be set to a +.BR : -separated +list of files containing package databases. This list of package +databases is used by +.B ghc +and +.BR ghc-pkg , +with earlier databases in the list overriding later ones. This order +was chosen to match the behaviour of the +.B PATH +environment variable; think of it as a list of package databases that +are searched left-to-right for packages. + +If +.B GHC_PACKAGE_PATH +ends in a separator, then the default user and system package +databases are appended, in that order. e.g. to augment the usual set +of packages with a database of your own, you could say: + +.br +\fB export GHC_PACKAGE_PATH=$HOME/.my-ghc-packages.conf:\fP +.br + +To check whether your +.B GHC_PACKAGE_PATH +setting is doing the right thing, +.B ghc-pkg list +will list all the databases in use, in the reverse order they are +searched. +.SH FILES +Both of these locations are changed for Debian. Upstream still keeps +these under +.IR /usr . +Some programs may refer to that, but look in +.I /var +instead. +.TP +.I /var/lib/ghc/package.conf +Global package.conf file. +.TP +.I /var/lib/ghc/package.conf.d/ +Directory for library specific package.conf files. These are added to +the global registry. +.SH "SEE ALSO" +.BR ghc (1), +.BR runghc (1), +.BR hugs (1). +.SH AUTHOR +This manual page was written by Kari Pahula , for the +Debian project (and may be used by others). diff --git a/ghc-warnings.mk-CC-Wall.patch b/ghc-warnings.mk-CC-Wall.patch new file mode 100644 index 0000000..f775eb3 --- /dev/null +++ b/ghc-warnings.mk-CC-Wall.patch @@ -0,0 +1,12 @@ +--- ghc-8.4.3/mk/warnings.mk~ 2018-02-04 02:30:11.000000000 +0900 ++++ ghc-8.4.3/mk/warnings.mk 2018-09-29 14:33:37.607884921 +0900 +@@ -1,6 +1,6 @@ + # See Note [Order of warning flags]. +-SRC_CC_OPTS += -Wall $(WERROR) ++#SRC_CC_OPTS += -Wall $(WERROR) + SRC_HC_OPTS += -Wall + # Don't add -Werror to SRC_HC_OPTS_STAGE0 (or SRC_HC_OPTS), because otherwise + # validate may unnecessarily fail when booting with an older compiler. + # It would be better to only exclude certain warnings from becoming errors + +Diff finished. Sat Sep 29 14:35:43 2018 diff --git a/ghc9.4.spec b/ghc9.4.spec new file mode 100644 index 0000000..5940263 --- /dev/null +++ b/ghc9.4.spec @@ -0,0 +1,914 @@ +# 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 +%bcond_with abicheck + +# use the Hadrian buildsystem +%bcond_without hadrian + +%global ghc_name ghc9.4 + +# to handle RCs +%global ghc_release 9.4.1-alpha1 + +%global base_ver 4.17.0.0 +%global ghc_compact_ver 0.1.0.0 +%global hpc_ver 0.6.1.0 + +# build profiling libraries +# build haddock +# perf production build (disable for quick build) +%if %{with quickbuild} +%undefine with_ghc_prof +%undefine with_haddock +%bcond_with perf_build +%undefine _enable_debug_packages +%else +%bcond_without ghc_prof +# https://gitlab.haskell.org/ghc/ghc/-/issues/19754 +# https://github.com/haskell/haddock/issues/1384 +%ifarch armv7hl +%undefine with_haddock +%else +%bcond_without haddock +%endif +%bcond_without perf_build +%endif + +%if %{with hadrian} +%bcond_with manual +%else +# 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} +%endif + +# no longer build testsuite (takes time and not really being used) +%bcond_with testsuite + +# 9.2 needs llvm 9-12 +%global llvm_major 12 +%if %{with hadrian} +%global ghc_llvm_archs armv7hl s390x +%global ghc_unregisterized_arches s390 %{mips} riscv64 +%else +%global ghc_llvm_archs armv7hl +%global ghc_unregisterized_arches s390 s390x %{mips} riscv64 +%endif + +Name: %{ghc_name} +Version: 9.4.0.20220501 +# 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: 10%{?dist} +Summary: Glasgow Haskell Compiler + +License: BSD and HaskellReport +URL: https://haskell.org/ghc/ +Source0: https://downloads.haskell.org/ghc/%{ghc_release}/ghc-%{version}-src.tar.lz +%if %{with testsuite} +Source1: https://downloads.haskell.org/ghc/%{ghc_release}/ghc-%{version}-testsuite.tar.lz +%endif +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 +Patch3: ghc-gen_contents_index-nodocs.patch +# https://phabricator.haskell.org/rGHC4eebc8016f68719e1ccdf460754a97d1f4d6ef05 +Patch6: ghc-8.6.3-sphinx-1.8.patch +## https://gitlab.haskell.org/ghc/ghc/-/issues/19684 +#Patch10: https://gitlab.haskell.org/ghc/ghc/-/commit/9aace0eaf6279f17368a1753b65afbdc466e8291.patch + +# armv7hl patches +Patch12: ghc-armv7-VFPv3D16--NEON.patch + +# for unregisterized +# https://ghc.haskell.org/trac/ghc/ticket/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://ghc.haskell.org/trac/ghc/ticket/15914 +# https://gitlab.haskell.org/ghc/ghc/issues/16973 +# https://bugzilla.redhat.com/show_bug.cgi?id=1733030 +Patch18: Disable-unboxed-arrays.patch + +# Debian patches: +Patch24: buildpath-abi-stability.patch +Patch26: no-missing-haddock-file-warning.patch + +# fedora ghc has been bootstrapped on +# %%{ix86} x86_64 ppc ppc64 armv7hl s390 s390x ppc64le aarch64 +# and retired arches: alpha sparcv9 armv5tel +# see also deprecated ghc_arches defined in ghc-srpm-macros +# /usr/lib/rpm/macros.d/macros.ghc-srpm + +BuildRequires: ghc-compiler > 8.10 +# for ABI hash checking +%if %{with abicheck} +BuildRequires: %{name} +%endif +BuildRequires: ghc-rpm-macros-extra +BuildRequires: ghc-binary-devel +BuildRequires: ghc-bytestring-devel +BuildRequires: ghc-containers-devel +BuildRequires: ghc-directory-devel +BuildRequires: ghc-pretty-devel +BuildRequires: ghc-process-devel +BuildRequires: ghc-stm-devel +BuildRequires: ghc-template-haskell-devel +BuildRequires: ghc-transformers-devel +BuildRequires: alex +BuildRequires: gmp-devel +%if %{without hadrian} +BuildRequires: libffi-devel +%endif +BuildRequires: lzip +BuildRequires: make +BuildRequires: gcc-c++ +# for terminfo +BuildRequires: ncurses-devel +BuildRequires: perl-interpreter +%if %{with testsuite} +BuildRequires: python3 +%endif +%if %{with manual} +BuildRequires: python3-sphinx +%endif +%ifarch %{ghc_llvm_archs} +%if 0%{?fedora} >= 34 +BuildRequires: llvm%{llvm_major} +%else +BuildRequires: llvm >= %{llvm_major} +%endif +%endif +%ifarch armv7hl +# patch12 +BuildRequires: autoconf, automake +%endif +%if %{with hadrian} +BuildRequires: ghc-Cabal-static +BuildRequires: ghc-QuickCheck-static +BuildRequires: ghc-base-static +BuildRequires: ghc-bytestring-static +BuildRequires: ghc-containers-static +BuildRequires: ghc-directory-static +BuildRequires: ghc-extra-static +BuildRequires: ghc-filepath-static +BuildRequires: ghc-mtl-static +BuildRequires: ghc-parsec-static +BuildRequires: ghc-shake-static +BuildRequires: ghc-stm-static +BuildRequires: ghc-transformers-static +BuildRequires: ghc-unordered-containers-static +BuildRequires: alex +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: happy +%endif +%if %{with hadrian} +Provides: bundled(libffi) = 3.3-rc2 +%endif +Requires: %{name}-compiler = %{version}-%{release} +Requires: %{name}-devel = %{version}-%{release} +Requires: %{name}-ghc-devel = %{version}-%{release} +Requires: %{name}-ghc-boot-devel = %{version}-%{release} +Requires: %{name}-ghc-compact-devel = %{ghc_compact_ver}-%{release} +Requires: %{name}-ghc-heap-devel = %{version}-%{release} +Requires: %{name}-ghci-devel = %{version}-%{release} +Requires: %{name}-hpc-devel = %{hpc_ver}-%{release} +Requires: %{name}-libiserv-devel = %{version}-%{release} +%if %{with haddock} +Suggests: %{name}-doc = %{version}-%{release} +Suggests: %{name}-doc-index = %{version}-%{release} +%endif +%if %{with manual} +Suggests: %{name}-manual = %{version}-%{release} +%endif +%if %{with ghc_prof} +Suggests: %{name}-prof = %{version}-%{release} +%endif +Recommends: %{name}-compiler-default = %{version}-%{release} + +%description +GHC is a state-of-the-art, open source, compiler and interactive environment +for the functional language Haskell. Highlights: + +- GHC supports the entire Haskell 2010 language plus a wide variety of + extensions. +- GHC has particularly good support for concurrency and parallelism, + including support for Software Transactional Memory (STM). +- GHC generates fast code, particularly for concurrent programs. + Take a look at GHC's performance on The Computer Language Benchmarks Game. +- GHC works on several platforms including Windows, Mac, Linux, + most varieties of Unix, and several different processor architectures. +- GHC has extensive optimisation capabilities, including inter-module + optimisation. +- GHC compiles Haskell code either directly to native code or using LLVM + as a back-end. GHC can also generate C code as an intermediate target for + porting to new platforms. The interactive environment compiles Haskell to + bytecode, and supports execution of mixed bytecode/compiled programs. +- Profiling is supported, both by time/allocation and various kinds of heap + profiling. +- GHC comes with several libraries, and thousands more are available on Hackage. + + +%package compiler +Summary: GHC compiler and utilities +License: BSD +Requires: gcc%{?_isa} +Requires: %{name}-base-devel%{?_isa} = %{base_ver}-%{release} +Requires: ghc-filesystem +%if %{without haddock} +Obsoletes: %{name}-doc-index < %{version}-%{release} +%endif +%ifarch %{ghc_llvm_archs} +%if 0%{?fedora} >= 34 +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 %{name}-devel. +To install all of ghc (including the ghc library), +install the main ghc package. + + +%package compiler-default +Summary: Makes %{name} default ghc +Requires: %{name}-compiler%{?_isa} = %{version}-%{release} +Conflicts: ghc-compiler + +%description compiler-default +The package contains symlinks to make %{name} the default GHC compiler. + + +%if %{with haddock} +%package doc +Summary: Haskell library documentation meta package +License: BSD + +%description doc +Installing this package causes %{name}-*-doc packages corresponding to +%{name}-*-devel packages to be automatically installed too. + + +%package doc-index +Summary: GHC library documentation indexing +License: BSD +Requires: %{name}-compiler = %{version}-%{release} +BuildArch: noarch + +%description doc-index +The package enables re-indexing of installed library documention. +%endif + + +%if %{with manual} +%package manual +Summary: GHC manual +License: BSD +BuildArch: noarch + +%description manual +This package provides the User Guide and Haddock manual. +%endif + + +# ghclibdir also needs ghc_version_override for bootstrapping +%global ghc_version_override %{version} + +%if %{with hadrian} +%package hadrian +Summary: GHC Hadrian buildsystem tool +License: MIT +Version: 0.1.0.0 + +%description hadrian +This provides the hadrian tool which can be used to build ghc. +%endif + +%global BSDHaskellReport %{quote:BSD and HaskellReport} + +# use "./libraries-versions.sh" to check versions +%if %{defined ghclibdir} +%ghc_lib_subpackage -d -l BSD Cabal-3.7.0.0 +%ghc_lib_subpackage -d -l %BSDHaskellReport array-0.5.4.0 +%if %{with hadrian} +%ghc_lib_subpackage -d -l %BSDHaskellReport -c gmp-devel%{?_isa} base-%{base_ver} +%else +%ghc_lib_subpackage -d -l %BSDHaskellReport -c gmp-devel%{?_isa},libffi-devel%{?_isa} base-%{base_ver} +%endif +%ghc_lib_subpackage -d -l BSD binary-0.8.9.0 +%ghc_lib_subpackage -d -l BSD bytestring-0.11.3.0 +%ghc_lib_subpackage -d -l %BSDHaskellReport containers-0.6.5.1 +%ghc_lib_subpackage -d -l %BSDHaskellReport deepseq-1.4.7.0 +%ghc_lib_subpackage -d -l %BSDHaskellReport directory-1.3.7.1 +%ghc_lib_subpackage -d -l %BSDHaskellReport exceptions-0.10.4 +%ghc_lib_subpackage -d -l BSD filepath-1.4.2.2 +# in ghc not ghc-libraries: +%ghc_lib_subpackage -d -x ghc-%{ghc_version_override} +# see below for ghc-bignum +%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 -x -l BSD ghc-compact-%{ghc_compact_ver} +%ghc_lib_subpackage -d -x -l BSD ghc-heap-%{ghc_version_override} +# see below for ghc-prim +%ghc_lib_subpackage -d -x -l BSD ghci-%{ghc_version_override} +%ghc_lib_subpackage -d -l BSD haskeline-0.8.2 +%ghc_lib_subpackage -d -x -l BSD hpc-%{hpc_ver} +# see below for integer-gmp +%ghc_lib_subpackage -d -x -l %BSDHaskellReport libiserv-%{ghc_version_override} +%ghc_lib_subpackage -d -l BSD mtl-2.2.2 +%ghc_lib_subpackage -d -l BSD parsec-3.1.15.0 +%ghc_lib_subpackage -d -l BSD pretty-1.1.3.6 +%ghc_lib_subpackage -d -l %BSDHaskellReport process-1.6.14.0 +%ghc_lib_subpackage -d -l BSD stm-2.5.1.0 +%ghc_lib_subpackage -d -l BSD template-haskell-2.18.0.0 +%ghc_lib_subpackage -d -l BSD -c ncurses-devel%{?_isa} terminfo-0.4.1.5 +%ghc_lib_subpackage -d -l BSD text-2.0 +%ghc_lib_subpackage -d -l BSD time-1.12.1 +%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} || %{with hadrian} +%ghc_lib_subpackage -d -l BSD xhtml-3000.2.2.1 +%endif +%endif + +%global version %{ghc_version_override} + +%package devel +Summary: GHC development libraries meta package +License: BSD and HaskellReport +Requires: %{name}-compiler = %{version}-%{release} +Obsoletes: %{name}-libraries < %{version}-%{release} +Provides: %{name}-libraries = %{version}-%{release} +%{?ghc_packages_list:Requires: %(echo %{ghc_packages_list} | sed -e "s/\([^ ]*\)-\([^ ]*\)/%{name}-\1-devel = \2-%{release},/g")} + +%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: %{name}-compiler = %{version}-%{release} + +%description prof +Installing this package causes %{name}-*-prof packages corresponding to +%{name}-*-devel packages to be automatically installed too. +%endif + + +%prep +%setup -q -n ghc-%{version} %{?with_testsuite:-b1} + +%patch1 -p1 -b .orig +%patch3 -p1 -b .orig + +%patch2 -p1 -b .orig +%patch6 -p1 -b .orig +#%%patch10 -p1 -b .orig + +%if %{without hadrian} +rm -r libffi-tarballs +%endif + +%ifarch armv7hl +%patch12 -p1 -b .orig +%endif + +# remove s390x after complete switching to llvm +%ifarch %{ghc_unregisterized_arches} s390x +%patch15 -p1 -b .orig +%patch16 -p1 -b .orig +%endif + +# bigendian +%ifarch s390x && %{without hadrian} +%patch18 -p1 -b .orig +%endif + +#debian +#%%patch24 -p1 -b .orig +%patch26 -p1 -b .orig + +%if %{with haddock} && %{without hadrian} +%global gen_contents_index gen_contents_index.orig +if [ ! -f "libraries/%{gen_contents_index}" ]; then + echo "Missing libraries/%{gen_contents_index}, needed at end of %%install!" + exit 1 +fi +%endif + +%if %{without hadrian} +# http://ghc.haskell.org/trac/ghc/wiki/Platforms +cat > mk/build.mk << EOF +%if %{with perf_build} +%ifarch %{ghc_llvm_archs} +BuildFlavour = perf-llvm +%else +BuildFlavour = perf +%endif +%else +%ifarch %{ghc_llvm_archs} +BuildFlavour = quick-llvm +%else +BuildFlavour = quick +%endif +%endif +GhcLibWays = v dyn %{?with_ghc_prof:p} +%if %{with haddock} +HADDOCK_DOCS = YES +EXTRA_HADDOCK_OPTS += --hyperlinked-source --hoogle --quickjump +%else +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 +%endif + +%build +autoupdate +./boot +# for patch12 +%ifarch armv7hl +autoreconf +%else +# alpha1 missing configure +autoconf +%endif + +%ghc_set_gcc_flags +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} \ + --datadir=%{_datadir} --includedir=%{_includedir} --libdir=%{_libdir} \ + --libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} \ + --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} \ + --docdir=%{_docdir}/%{name} \ +%if %{without hadrian} + --with-system-libffi \ +%endif +%ifarch %{ghc_unregisterized_arches} + --enable-unregisterised \ +%endif +%{nil} + +# avoid "ghc: hGetContents: invalid argument (invalid byte sequence)" +export LANG=C.utf8 +%if %{with hadrian} +%if %{defined _ghcdynlibdir} +%undefine _ghcdynlibdir +%endif +( +cd hadrian +%ghc_bin_build +) +%global hadrian hadrian/dist/build/hadrian/hadrian +%ifarch %{ghc_llvm_archs} +%global hadrian_llvm +llvm +%endif +%if %{with haddock} +# sphinx failing with "Undefined reference targets found in Sphinx log." +%define hadrian_docs --docs=%{?with_quickbuild:none}%{!?with_quickbuild:no-sphinx} +%else +%define hadrian_docs --docs=none +%endif +# quickest does not build shared libs +%{hadrian} %{?_smp_mflags} --flavour=%{?with_quickbuild:quick+no_profiled_libs}%{!?with_quickbuild:perf%{!?with_ghc_prof:+no_profiled_libs}}%{?hadrian_llvm} %{hadrian_docs} binary-dist-dir +%else +make %{?_smp_mflags} +%endif + + +%install +%if %{with hadrian} +( +cd hadrian +%ghc_bin_install +rm %{buildroot}%{_ghclicensedir}/%{name}/LICENSE +cp -p LICENSE ../LICENSE.hadrian +) +# https://gitlab.haskell.org/ghc/ghc/-/issues/20120#note_366872 +( +cd _build/bindist/ghc-%{version}-* +./configure --prefix=%{buildroot}%{ghclibdir} --bindir=%{buildroot}%{_bindir} --libdir=%{buildroot}%{_libdir} --mandir=%{buildroot}%{_mandir} --docdir=%{buildroot}%{_docdir}/%{name} +make install +) +%else +make DESTDIR=%{buildroot} install +%if %{defined _ghcdynlibdir} +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: %{_ghcdynlibdir}!' $i +done +sed -i -e 's!^library-dirs: %{ghclibdir}/rts!&\ndynamic-library-dirs: %{_ghcdynlibdir}!' %{buildroot}%{ghclibdir}/package.conf.d/rts.conf +%endif +%endif + +# containers src moved to a subdir +cp -p libraries/containers/containers/LICENSE libraries/containers/LICENSE + +# FIXME replace with ghc_subpackages_list +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 +echo "%%license libraries/$name/LICENSE" >> %{name}-$name.files +done + +echo "%%dir %{ghclibdir}" >> %{name}-base%{?_ghcdynlibdir:-devel}.files + +%ghc_gen_filelists ghc %{ghc_version_override} +%ghc_gen_filelists ghc-boot %{ghc_version_override} +%ghc_gen_filelists ghc-compact %{ghc_compact_ver} +%ghc_gen_filelists ghc-heap %{ghc_version_override} +%ghc_gen_filelists ghci %{ghc_version_override} +%ghc_gen_filelists hpc %{hpc_ver} +%ghc_gen_filelists libiserv %{ghc_version_override} + +%ghc_gen_filelists ghc-bignum 1.3 +%ghc_gen_filelists ghc-prim 0.9.0 +%ghc_gen_filelists integer-gmp 1.1 +%if %{with hadrian} +%ghc_gen_filelists rts 1.0.2 +%endif + +%define merge_filelist()\ +cat %{name}-%1.files >> %{name}-%2.files\ +cat %{name}-%1-devel.files >> %{name}-%2-devel.files\ +%if %{defined ghc_devel_prof}\ +cat %{name}-%1-doc.files >> %{name}-%2-doc.files\ +cat %{name}-%1-prof.files >> %{name}-%2-prof.files\ +%endif\ +if [ "%1" != "rts" ]; then\ +cp -p libraries/%1/LICENSE libraries/LICENSE.%1\ +echo "%%license libraries/LICENSE.%1" >> %{name}-%2.files\ +fi\ +%{nil} + +%merge_filelist ghc-bignum base +%merge_filelist ghc-prim base +%merge_filelist integer-gmp base +%if %{with hadrian} +%merge_filelist rts base +%endif + +# add rts libs +%if %{with hadrian} +for i in %{buildroot}%{ghclibplatform}/libHSrts*ghc%{ghc_version}.so %{buildroot}%{ghclibplatform}/libffi.so*; do +echo $i >> %{name}-base.files +done +%else +%if %{defined _ghcdynlibdir} +echo "%{ghclibdir}/rts" >> %{name}-base-devel.files +%else +echo "%%dir %{ghclibdir}/rts" >> %{name}-base.files +ls -d %{buildroot}%{ghclibdir}/rts/lib*.a >> %{name}-base-devel.files +%endif +ls %{buildroot}%{?_ghcdynlibdir}%{!?_ghcdynlibdir:%{ghclibdir}/rts}/libHSrts*.so >> %{name}-base.files +%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 >> %{name}-base-devel.files +%endif + +ls -d %{buildroot}%{ghclibdir}/include >> %{name}-base-devel.files + +%if %{with ghc_prof} +ls %{buildroot}%{ghclibdir}/bin/ghc-iserv-prof* >> %{name}-base-prof.files +%if %{with hadrian} +ls %{buildroot}%{ghclibdir}/lib/bin/ghc-iserv-prof >> %{name}-base-prof.files +%endif +%endif + +sed -i -e "s|^%{buildroot}||g" %{name}-base*.files +%if %{with hadrian} +sed -i -e "s|%{buildroot}||g" %{buildroot}%{_bindir}/* +%endif + +%if %{with haddock} && %{without hadrian} +# generate initial lib doc index +cd libraries +sh %{gen_contents_index} --intree --verbose +cd .. +%endif + +%if %{with haddock} && %{with hadrian} +rm %{buildroot}%{_pkgdocdir}/archives/libraries.html.tar.xz +%endif + +# we package the library license files separately +%if %{without hadrian} +find %{buildroot}%{ghc_html_libraries_dir} -name LICENSE -exec rm '{}' ';' +%endif + +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 +install -p -m 0644 %{SOURCE7} %{buildroot}%{_mandir}/man1/runghc.1 + +%ifarch armv7hl +export RPM_BUILD_NCPUS=1 +%endif + +%if %{with hadrian} +mv %{buildroot}%{_bindir}/hadrian{,-%{version}} +%else +for i in hp2ps hpc hsc2hs runhaskell; do + mv %{buildroot}%{_bindir}/$i{,-%{version}} + ln -s $i-%{version} %{buildroot}%{_bindir}/$i +done +%endif + +%if %{with hadrian} +rm %{buildroot}%{ghclibdir}/lib/package.conf.d/.stamp +rm %{buildroot}%{ghclibdir}/lib/package.conf.d/*.conf.copy + +(cd %{buildroot}%{ghclibdir}/lib/bin +for i in *; do +if [ -f %{buildroot}%{ghclibdir}/bin/$i ]; then +ln -sf ../../bin/$i +fi +done +) +%endif + + +%check +export LANG=C.utf8 +# stolen from ghc6/debian/rules: +%if %{with hadrian} +GHC=%{buildroot}%{ghclibdir}/bin/ghc +%else +GHC=inplace/bin/ghc-stage2 +%endif +# Do some very simple tests that the compiler actually works +rm -rf testghc +mkdir testghc +echo 'main = putStrLn "Foo"' > testghc/foo.hs +$GHC testghc/foo.hs -o testghc/foo +[ "$(testghc/foo)" = "Foo" ] +rm testghc/* +echo 'main = putStrLn "Foo"' > testghc/foo.hs +$GHC testghc/foo.hs -o testghc/foo -O2 +[ "$(testghc/foo)" = "Foo" ] +rm testghc/* +echo 'main = putStrLn "Foo"' > testghc/foo.hs +$GHC testghc/foo.hs -o testghc/foo -dynamic +[ "$(testghc/foo)" = "Foo" ] +rm testghc/* + +$GHC --info + +# check the ABI hashes +%if %{with abicheck} +if [ "%{version}" = "$(ghc --numeric-version)" ]; then + echo "Checking package ABI hashes:" + for i in %{ghc_packages_list}; do + old=$(ghc-pkg field $i id --simple-output || :) + if [ -n "$old" ]; then + new=$(/usr/lib/rpm/ghc-pkg-wrapper %{buildroot}%{ghclibdir} field $i id --simple-output) + if [ "$old" != "$new" ]; then + echo "ABI hash for $i changed!:" >&2 + echo " $old -> $new" >&2 + ghc_abi_hash_change=yes + else + echo "($old unchanged)" + fi + else + echo "($i not installed)" + fi + done + if [ "$ghc_abi_hash_change" = "yes" ]; then + echo "ghc ABI hash change: aborting build!" >&2 + exit 1 + fi +else + echo "ABI hash checks skipped: GHC changed from $(ghc --numeric-version) to %{version}" +fi +%endif + +%if %{with testsuite} +make test +%endif + + +%if %{defined ghclibdir} +%transfiletriggerin compiler -- %{ghcliblib}/package.conf.d +%ghc_pkg_recache +%end + +%transfiletriggerpostun compiler -- %{ghcliblib}/package.conf.d +%ghc_pkg_recache +%end + + +%if %{with haddock} && %{without hadrian} +%transfiletriggerin doc-index -- %{ghc_html_libraries_dir} +env -C %{ghc_html_libraries_dir} ./gen_contents_index +%end + +%transfiletriggerpostun doc-index -- %{ghc_html_libraries_dir} +env -C %{ghc_html_libraries_dir} ./gen_contents_index +%end +%endif +%endif + + +%files + +%files compiler +%license LICENSE +%doc README.md +%{_bindir}/ghc-%{version} +%{_bindir}/ghc-pkg-%{version} +%{_bindir}/ghci-%{version} +%{_bindir}/hp2ps-%{?with_hadrian:ghc-}%{version} +%{_bindir}/hpc-%{?with_hadrian:ghc-}%{version} +%{_bindir}/hsc2hs-%{?with_hadrian:ghc-}%{version} +%{_bindir}/runghc-%{version} +%{_bindir}/runhaskell-%{version} +%dir %{ghclibdir}/bin +%{ghclibdir}/bin/ghc +%{ghclibdir}/bin/ghc-iserv +%{ghclibdir}/bin/ghc-iserv-dyn +%{ghclibdir}/bin/ghc-pkg +%{ghclibdir}/bin/hpc +%{ghclibdir}/bin/hsc2hs +%{ghclibdir}/bin/runghc +%{ghclibdir}/bin/hp2ps +%{ghclibdir}/bin/unlit +%if %{with hadrian} +%{ghclibdir}/bin/ghc-%{version} +%{ghclibdir}/bin/ghc-iserv-ghc-%{version} +%{ghclibdir}/bin/ghc-iserv-dyn-ghc-%{version} +%{ghclibdir}/bin/ghc-pkg-%{version} +%{ghclibdir}/bin/haddock +%{ghclibdir}/bin/haddock-ghc-%{version} +%{ghclibdir}/bin/hp2ps-ghc-%{version} +%{ghclibdir}/bin/hpc-ghc-%{version} +%{ghclibdir}/bin/hsc2hs-ghc-%{version} +%{ghclibdir}/bin/runghc-%{version} +%{ghclibdir}/bin/runhaskell +%{ghclibdir}/bin/runhaskell-%{version} +%{ghclibdir}/bin/unlit-ghc-%{version} +%{ghclibdir}/lib/bin/ghc-iserv +%{ghclibdir}/lib/bin/ghc-iserv-dyn +%{ghclibdir}/lib/bin/unlit +%{ghclibdir}/lib/DerivedConstants.h +%{ghclibdir}/lib/ghcautoconf.h +%{ghclibdir}/lib/ghcplatform.h +%{ghclibdir}/lib/ghcversion.h +%endif +%{ghcliblib}/ghc-usage.txt +%{ghcliblib}/ghci-usage.txt +%{ghcliblib}/llvm-passes +%{ghcliblib}/llvm-targets +%dir %{ghcliblib}/package.conf.d +%ghost %{ghcliblib}/package.conf.d/package.cache +%{ghcliblib}/package.conf.d/package.cache.lock +%{ghcliblib}/settings +%{ghcliblib}/template-hsc.h +%{_mandir}/man1/ghc-pkg.1* +%{_mandir}/man1/haddock.1* +%{_mandir}/man1/runghc.1* + +%if %{with hadrian} || %{with haddock} +%{_bindir}/haddock-ghc-%{version} +%{ghcliblib}/html +%{ghcliblib}/latex +%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 +%verify(not size mtime) %{ghc_html_libraries_dir}/quick-jump.css +%verify(not size mtime) %{ghc_html_libraries_dir}/synopsis.png +%endif +%if %{with manual} +%{_mandir}/man1/ghc.1* +%endif + +%files compiler-default +%{_bindir}/ghc +%{_bindir}/ghc-pkg +%{_bindir}/ghci +%if %{with hadrian} || %{with haddock} +%{_bindir}/haddock +%endif +%{_bindir}/hp2ps +%{_bindir}/hpc +%{_bindir}/hsc2hs +%{_bindir}/runghc +%{_bindir}/runhaskell + +%files devel + +%if %{with haddock} +%files doc +%if %{with hadrian} +%{ghc_html_dir}/index.html +%endif + +%files doc-index +%if %{without hadrian} +%{ghc_html_libraries_dir}/gen_contents_index +%endif +%verify(not size mtime) %{ghc_html_libraries_dir}/doc-index*.html +%verify(not size mtime) %{ghc_html_libraries_dir}/index*.html +%endif + +%if %{with hadrian} +%files hadrian +%license LICENSE.hadrian +%{_bindir}/hadrian-%{version} +%endif + +%if %{with manual} +%files manual +## needs pandoc +#%%{ghc_html_dir}/Cabal +%if %{with haddock} +%{ghc_html_dir}/haddock +%if %{without hadrian} +%{ghc_html_dir}/index.html +%endif +%{ghc_html_dir}/users_guide +%endif +%endif + +%if %{with ghc_prof} +%files prof +%endif + + +%changelog +* Sun May 1 2022 Jens Petersen - 9.2.2-9 +- ghc9.2 now recommends ghc9.2-compiler-default +- recommends zlib-devel was moved to cabal-install/stack + +* Sat Mar 12 2022 Jens Petersen - 9.2.2-8 +- https://downloads.haskell.org/~ghc/9.2.2/docs/html/users_guide/9.2.2-notes.html +- use llvm12 for aarch64 and s390x + +* Thu Jan 20 2022 Fedora Release Engineering - 9.2.1-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Sat Jan 08 2022 Miro HronĨok - 9.2.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Changes/LIBFFI34 + +* Fri Dec 31 2021 Jens Petersen - 9.2.1-5 +- enable the armv7 VFPv3D16 patch + +* Wed Dec 29 2021 Jens Petersen - 9.2.1-4 +- place docs under ghc9.2, so they can also be parallel installed +- make hadrian perf build respect ghc_prof + +* Mon Dec 27 2021 Jens Petersen - 9.2.1-3 +- compiler-default subpackage can provide the unversioned bindir files + +* Mon Dec 20 2021 Jens Petersen - 9.2.1-2 +- build with ghc's Hadrian buildsystem +- s390x now uses the llvm backend +- manuals created by sphinx disabled for now +- ghc-iserv-prof now lives in ghc-base-prof +- add hadrian subpackage +- move the haddock index files into doc-index + +* Wed Dec 8 2021 Jens Petersen - 9.2.1-1 +- initial ghc9.2 package derived from the ghc:9.2 module +- https://downloads.haskell.org/ghc/9.2.1/docs/html/users_guide/9.2.1-notes.html +- see the Fedora ghc:9.2 branch for earlier packaging changes diff --git a/haddock.man b/haddock.man new file mode 100644 index 0000000..a30106b --- /dev/null +++ b/haddock.man @@ -0,0 +1,231 @@ +.TH HADDOCK 1 "July 2010" "Haddock, version 2.6.1" "Haddock documentation generator" + + +.SH NAME +haddock \- documentation tool for annotated Haskell source code + + +.SH SYNOPSIS +.B haddock +.RI [ options ] " file" ... + + +.SH DESCRIPTION +This manual page documents briefly the +.B haddock +command. +Extensive documentation is available in various other formats including DVI, +PostScript and HTML; see below. + +.PP +.I file +is a filename containing a Haskell source module. +All the modules specified on the command line will be processed together. +When one module refers to an entity in another module being processed, the +documentation will link directly to that entity. + +Entities that cannot be found, for example because they are in a module that +is not being processed as part of the current batch, simply will not be +hyperlinked in the generated documentation. +.B haddock +will emit warnings listing all the identifiers it could not resolve. + +The modules should not be mutually recursive, as +.B haddock +does not like swimming in circles. + + +.SH OPTIONS +The programs follow the usual GNU command line syntax, with long +options starting with two dashes (`--'). +A summary of options is included below. +For a complete description, see the other documentation. + +.TP +\fB\-o \fIDIR\fP, \-\-odir=\fIDIR\fP +directory in which to put the output files + +.TP +\fB\-i \fIFILE\fP, \-\-read-interface=\fIFILE\fP +read an interface from +.IR FILE . + +.TP +\fB\-D \fIFILE\fP, \-\-dump\-interface=\fIFILE\fP +dump an interface for these modules in +.IR FILE . + +.TP +\fB\-l \fIDIR\fP, \-\-lib=\fIDIR\fP +location of Haddock's auxiliary files + +.TP +.BR \-h ", " \-\-html +Generate documentation in HTML format. +Several files will be generated into the current directory (or the specified +directory if the +.B \-o +option is given), including the following: +.RS +.TP +.I index.html +The top level page of the documentation: +lists the modules available, using indentation to represent the hierarchy if +the modules are hierarchical. +.TP +.I haddock.css +The stylesheet used by the generated HTML. +Feel free to modify this to change the colors or layout, or even specify +your own stylesheet using the +.B \-\-css +option. +.TP +.I module.html +An HTML page for each module. +.TP +.IR doc-index.html ", " doc-index-XX.html +The index, split into two (functions/constructors and types/classes, as per +Haskell namespaces) and further split alphabetically. +.RE + +.TP +.B \-\-hoogle +output for Hoogle + +.TP +\fB\-\-html\-help=\fIformat +produce index and table of contents in mshelp, mshelp2 or devhelp format +(with \fI\-h\fP) + +.TP +\fB\-\-source\-base=\fPURL +Include links to the source files in the generated documentation, where URL +is the base URL where the source files can be found. + +.TP +\fB\-s \fPURL, \fB\-\-source\-module=\fPURL +Include links to the source files in the generated documentation, where URL +is a source code link for each module (using the %{FILE} or %{MODULE} vars). + +.TP +\fB\-\-source\-entity=\fPURL +Include links to the source files in the generated documentation, where URL +is a source code link for each entity (using the %{FILE}, %{MODULE} or %{NAME} vars). + +.TP +\fB\-\-comments\-base=\fPURL +URL for a comments link on the contents and index pages. +.TP +\fB\-\-comments\-module=\fPURL +URL for a comments link for each module (using the %{MODULE} var). +.TP +\fB\-\-comments\-entity=\fPURL +URL for a comments link for each entity (using the %{FILE}, %{MODULE} or %{NAME} vars). +.TP +.BI \-\-css= FILE +Use the CSS +.I FILE +instead of the default stylesheet that comes with +.B haddock +for HTML output. It should specify certain classes: see the default stylesheet for details. + +.TP +\fB\-p \fIFILE\fP, \-\-prologue=\fIFILE\fP +Specify a file containing prologue text. + +.TP +\fB\-t \fITITLE\fP, \-\-title=\fITITLE\fP +Use \fITITLE\fP as the page heading for each page in the documentation. +This will normally be the name of the library being documented. + +The title should be a plain string (no markup please!). + +.TP +\fB\-k \fINAME\fP, \-\-package=\fINAME\fP +Specify the package name (optional). + +.TP +.BR \-n ", " \-\-no\-implicit\-prelude +do not assume Prelude is imported + +.TP +.BR \-d ", " \-\-debug +Enable extra debugging output. + +.TP +.BR \-? ", " \-\-help +Display help. + +.TP +.BR \-V ", " \-\-version +Display version. + +.TP +.BR \-v ", " \-\-verbose +Verbose status reporting. + +.TP +\fB\-\-use\-contents=\fPURL +Use a separately-generated HTML contents page. + +.TP +.B \-\-gen\-contents +Generate an HTML contents from specified interfaces. + +.TP +\fB\-\-use\-index=\fPURL +Use a separately-generated HTML index. + +.TP +.B \-\-gen\-index +Generate an HTML index from specified interfaces. + +.TP +.B \-\-ignore\-all\-exports +Behave as if all modules have the ignore-exports atribute + +.TP +\fB\-\-hide=\fIMODULE +Behave as if \fIMODULE\fP has the hide attribute. + +.TP +\fB\-\-use\-package=\fIPACKAGE +The modules being processed depend on \fIPACKAGE\fP. + +.SH FILES +.I /usr/bin/haddock +.br +.I /usr/share/haddock-2.6.1/html/plus.gif +.br +.I /usr/share/haddock-2.6.1/html/minus.gif +.br +.I /usr/share/haddock-2.6.1/html/haskell_icon.gif +.br +.I /usr/share/haddock-2.6.1/html/haddock.js +.br +.I /usr/share/haddock-2.6.1/html/haddock.css +.br +.I /usr/share/haddock-2.6.1/html/haddock-DEBUG.css + +.SH SEE ALSO +.IR /usr/share/doc/haddock/ , +.br +the Haddock homepage +.UR http://haskell.org/haddock/ +(http://haskell.org/haddock/) +.UE + +.SH COPYRIGHT +Haddock version 2.6.1 + +Copyright 2006-2010 Simon Marlow , Dawid Waern . +All rights reserved. + + +.SH AUTHOR +This manual page was written by Michael Weber +for the Debian GNU/Linux system (but may be used by others). + +.\" Local variables: +.\" mode: nroff +.\" End: diff --git a/libraries-versions.sh b/libraries-versions.sh new file mode 100755 index 0000000..136c0fd --- /dev/null +++ b/libraries-versions.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +if [ ! -d libraries ]; then + echo Is CWD a ghc source tree? + exit 1 +fi + +cd libraries + +grep -i ^version: $(find * -name "*.cabal*" | sort) | grep -v -e "\(Win32\|cabal-\|gmp.old\|gmp2\|integer-simple\|tests\|bench\)" -e "@ProjectVersionMunged@" | grep -e '[0-9]\.' | sed -e "s!.*/\([^/]*\).cabal:[Vv]ersion: \+!\1-!" diff --git a/no-missing-haddock-file-warning.patch b/no-missing-haddock-file-warning.patch new file mode 100644 index 0000000..eac921e --- /dev/null +++ b/no-missing-haddock-file-warning.patch @@ -0,0 +1,22 @@ +Description: Do not emit a warning if the .haddock file is missing + As it is quite common on Debian installations to install the -dev package + without the -doc package. +Author: Joachim Breitner + +Index: ghc-8.0.2/utils/ghc-pkg/Main.hs +=================================================================== +--- ghc-8.0.2.orig/utils/ghc-pkg/Main.hs ++++ ghc-8.0.2/utils/ghc-pkg/Main.hs +@@ -1588,8 +1588,10 @@ + mapM_ (checkDir True "dynamic-library-dirs") (libraryDynDirs pkg) + mapM_ (checkDir True "include-dirs") (includeDirs pkg) + mapM_ (checkDir True "framework-dirs") (frameworkDirs pkg) +- mapM_ (checkFile True "haddock-interfaces") (haddockInterfaces pkg) +- mapM_ (checkDirURL True "haddock-html") (haddockHTMLs pkg) ++ -- In Debian, it is quite normal that the package is installed without the ++ -- documentation. Do not print a warning there. ++ -- mapM_ (checkFile True "haddock-interfaces") (haddockInterfaces pkg) ++ -- mapM_ (checkDirURL True "haddock-html") (haddockHTMLs pkg) + checkDuplicateModules pkg + checkExposedModules db_stack pkg + checkOtherModules pkg diff --git a/runghc.man b/runghc.man new file mode 100644 index 0000000..61a9076 --- /dev/null +++ b/runghc.man @@ -0,0 +1,45 @@ +.TH RUNGHC 1 "28 NOVEMBER 2007" +.SH NAME +runghc \- program to run Haskell programs without first having to compile them. +.SH SYNOPSIS +.B runghc +.RI +[runghc|flags] [GHC|flags] module [program|flags]... +.br +.SH DESCRIPTION +.B runghc +is considered a non-interactive interpreter and part of The Glasgow Haskell Compiler. +.B runghc +is a compiler that automatically runs its results at the end. +.PP +.SH OPTIONS +.TP +the flags are: +.TP +.B \-f +it tells runghc which GHC to use to run the program. If it is not given then runghc will search for GHC in the directories in the system search path. runghc -f /path/to/ghc +.TP +.B \-- +runghc will try to work out where the boundaries between [runghc flags] and [GHC flags], and [GHC flags] and module are, but you can use a -- flag if it doesn't get it right. For example, runghc -- -fglasgow-exts Foo +means runghc won't try to use glasgow-exts as the path to GHC, but instead will pass the flag to GHC. + +.SH EXAMPLES +.TP +.B runghc foo +.PP +.B runghc -f /path/to/ghc foo +.TP +.B runghc -- -fglasgow-exts Foo + +.SH SEE ALSO +.BR ghc (1), +.BR ghci (1). +.br + +.SH COPYRIGHT +Copyright 2002, The University Court of the University of Glasgow. All rights reserved. + +.SH AUTHOR +This manual page was written by Efrain Valles Pulgar . This is free documentation; see the GNU +General Public Licence version 2 or later for copying conditions. There is NO WARRANTY. + diff --git a/tests/smoke/runtest.sh b/tests/smoke/runtest.sh new file mode 100755 index 0000000..df42ac3 --- /dev/null +++ b/tests/smoke/runtest.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +echo 'main = return ()' > test.hs +ghc-9.2.1 test.hs && ./test + +ghc test.hs && ./test diff --git a/tests/smoke/test b/tests/smoke/test new file mode 100755 index 0000000..5393a75 Binary files /dev/null and b/tests/smoke/test differ diff --git a/tests/smoke/test.hi b/tests/smoke/test.hi new file mode 100644 index 0000000..f98b5fd Binary files /dev/null and b/tests/smoke/test.hi differ diff --git a/tests/smoke/test.hs b/tests/smoke/test.hs new file mode 100644 index 0000000..b3549c2 --- /dev/null +++ b/tests/smoke/test.hs @@ -0,0 +1 @@ +main = return () diff --git a/tests/smoke/test.o b/tests/smoke/test.o new file mode 100644 index 0000000..7ae5eef Binary files /dev/null and b/tests/smoke/test.o differ diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..1851c15 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,12 @@ +--- +- hosts: localhost + tags: + - classic + roles: + - role: standard-test-basic + required_packages: + - ghc9.2 + - ghc + tests: + - smoke +...