extend and simplify bcond for build configuration
- move manuals to ghc-manual.noarch - rename ghc-doc-index to ghc-doc-cron.noarch - drop bootstrap builds and do ABI hash checks unless ghc version changed - no longer need autotools on aarch64
This commit is contained in:
parent
d42cad8307
commit
8a638fc974
151
ghc.spec
151
ghc.spec
@ -1,19 +1,20 @@
|
|||||||
# To bootstrap build a new version of ghc, comment out this line:
|
# perf production build (disable for quick build)
|
||||||
%global perf_build 1
|
%bcond_without perf_build
|
||||||
|
|
||||||
|
# make sure ghc libraries' ABI hashes unchanged
|
||||||
|
%bcond_without abicheck
|
||||||
|
|
||||||
|
# run testsuite
|
||||||
|
%bcond_without testsuite
|
||||||
|
# build profiling libraries
|
||||||
|
%bcond_without prof
|
||||||
|
# build manual
|
||||||
|
%bcond_without manual
|
||||||
|
# build library documentation
|
||||||
|
%bcond_without haddock
|
||||||
|
|
||||||
# to handle RCs
|
# to handle RCs
|
||||||
%global ghc_release 8.2.2
|
%global ghc_release %{version}
|
||||||
|
|
||||||
%if %{undefined perf_build}
|
|
||||||
%bcond_with testsuite
|
|
||||||
%bcond_with prof
|
|
||||||
%{?ghc_bootstrap}
|
|
||||||
### uncomment to generate haddocks for bootstrap
|
|
||||||
#%%undefine without_haddock
|
|
||||||
%else
|
|
||||||
%bcond_without testsuite
|
|
||||||
%bcond_without prof
|
|
||||||
%endif
|
|
||||||
|
|
||||||
Name: ghc
|
Name: ghc
|
||||||
# ghc must be rebuilt after a version bump to avoid ABI change problems
|
# ghc must be rebuilt after a version bump to avoid ABI change problems
|
||||||
@ -22,7 +23,7 @@ Version: 8.2.2
|
|||||||
# - release can only be reset if *all* library versions get bumped simultaneously
|
# - release can only be reset if *all* library versions get bumped simultaneously
|
||||||
# (sometimes after a major release)
|
# (sometimes after a major release)
|
||||||
# - minor release numbers for a branch should be incremented monotonically
|
# - minor release numbers for a branch should be incremented monotonically
|
||||||
Release: 66%{?dist}
|
Release: 67%{?dist}
|
||||||
Summary: Glasgow Haskell Compiler
|
Summary: Glasgow Haskell Compiler
|
||||||
|
|
||||||
License: BSD and HaskellReport
|
License: BSD and HaskellReport
|
||||||
@ -58,7 +59,7 @@ Patch28: ghc-Debian-x32-use-native-x86_64-insn.patch
|
|||||||
# and retired arches: alpha sparcv9 armv5tel
|
# and retired arches: alpha sparcv9 armv5tel
|
||||||
# see also deprecated ghc_arches defined in /etc/rpm/macros.ghc-srpm by redhat-rpm-macros
|
# see also deprecated ghc_arches defined in /etc/rpm/macros.ghc-srpm by redhat-rpm-macros
|
||||||
|
|
||||||
%if %{defined perf_build}
|
%if %{with abicheck}
|
||||||
BuildRequires: ghc-compiler = %{version}
|
BuildRequires: ghc-compiler = %{version}
|
||||||
# for ABI hash checking
|
# for ABI hash checking
|
||||||
BuildRequires: ghc = %{version}
|
BuildRequires: ghc = %{version}
|
||||||
@ -79,25 +80,25 @@ BuildRequires: perl-interpreter
|
|||||||
%if %{with testsuite}
|
%if %{with testsuite}
|
||||||
BuildRequires: python3
|
BuildRequires: python3
|
||||||
%endif
|
%endif
|
||||||
%if %{undefined without_manual}
|
%if %{with manual}
|
||||||
BuildRequires: python3-sphinx
|
BuildRequires: python3-sphinx
|
||||||
%endif
|
%endif
|
||||||
%ifarch armv7hl aarch64
|
%ifarch armv7hl aarch64
|
||||||
BuildRequires: llvm%{llvm_major}
|
BuildRequires: llvm%{llvm_major}
|
||||||
%endif
|
%endif
|
||||||
%ifarch armv7hl aarch64
|
%ifarch armv7hl
|
||||||
# patch12
|
# patch12
|
||||||
BuildRequires: autoconf, automake
|
BuildRequires: autoconf, automake
|
||||||
%endif
|
%endif
|
||||||
Requires: ghc-compiler = %{version}-%{release}
|
Requires: ghc-compiler = %{version}-%{release}
|
||||||
%if %{undefined without_manual}
|
%if %{with haddock}
|
||||||
Requires: ghc-doc = %{version}-%{release}
|
Requires: ghc-doc-cron = %{version}-%{release}
|
||||||
%endif
|
%endif
|
||||||
%if %{undefined without_haddock}
|
|
||||||
Requires: ghc-doc-index = %{version}-%{release}
|
|
||||||
%endif
|
|
||||||
Requires: ghc-libraries = %{version}-%{release}
|
|
||||||
Requires: ghc-ghc-devel = %{version}-%{release}
|
Requires: ghc-ghc-devel = %{version}-%{release}
|
||||||
|
Requires: ghc-libraries = %{version}-%{release}
|
||||||
|
%if %{with manual}
|
||||||
|
Requires: ghc-manual = %{version}-%{release}
|
||||||
|
%endif
|
||||||
|
|
||||||
%description
|
%description
|
||||||
GHC is a state-of-the-art, open source, compiler and interactive environment
|
GHC is a state-of-the-art, open source, compiler and interactive environment
|
||||||
@ -130,7 +131,11 @@ Requires: ghc-base-devel%{?_isa}
|
|||||||
# for alternatives
|
# for alternatives
|
||||||
Requires(post): chkconfig
|
Requires(post): chkconfig
|
||||||
Requires(postun): chkconfig
|
Requires(postun): chkconfig
|
||||||
%if %{defined without_haddock}
|
# added in f14
|
||||||
|
Obsoletes: ghc-doc < 6.12.3-4
|
||||||
|
%if %{without haddock}
|
||||||
|
Obsoletes: ghc-doc-cron < %{version}-%{release}
|
||||||
|
# added in f28
|
||||||
Obsoletes: ghc-doc-index < %{version}-%{release}
|
Obsoletes: ghc-doc-index < %{version}-%{release}
|
||||||
%endif
|
%endif
|
||||||
%ifarch armv7hl aarch64
|
%ifarch armv7hl aarch64
|
||||||
@ -145,30 +150,33 @@ To install all of ghc (including the ghc library),
|
|||||||
install the main ghc package.
|
install the main ghc package.
|
||||||
|
|
||||||
|
|
||||||
%if %{undefined without_manual}
|
%if %{with haddock}
|
||||||
%package doc
|
%package doc-cron
|
||||||
Summary: GHC documentation
|
Summary: GHC library documentation indexing cronjob
|
||||||
License: BSD
|
|
||||||
BuildArch: noarch
|
|
||||||
|
|
||||||
%description doc
|
|
||||||
This package provides the User Guide and Haddock manual.
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%if %{undefined without_haddock}
|
|
||||||
%package doc-index
|
|
||||||
Summary: GHC library development documentation indexing
|
|
||||||
License: BSD
|
License: BSD
|
||||||
Requires: ghc-compiler = %{version}-%{release}
|
Requires: ghc-compiler = %{version}-%{release}
|
||||||
Requires: crontabs
|
Requires: crontabs
|
||||||
|
# added in f28
|
||||||
|
Obsoletes: ghc-doc-index < %{version}-%{release}
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
%description doc-index
|
%description doc-cron
|
||||||
The package provides a cronjob for re-indexing installed library development
|
The package provides a cronjob for re-indexing installed library development
|
||||||
documention.
|
documention.
|
||||||
%endif
|
%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
|
# ghclibdir also needs ghc_version_override for bootstrapping
|
||||||
%global ghc_version_override %{version}
|
%global ghc_version_override %{version}
|
||||||
|
|
||||||
@ -213,7 +221,7 @@ documention.
|
|||||||
%ghc_lib_subpackage -d -l BSD time-1.8.0.2
|
%ghc_lib_subpackage -d -l BSD time-1.8.0.2
|
||||||
%ghc_lib_subpackage -d -l BSD transformers-0.5.2.0
|
%ghc_lib_subpackage -d -l BSD transformers-0.5.2.0
|
||||||
%ghc_lib_subpackage -d -l BSD unix-2.7.2.2
|
%ghc_lib_subpackage -d -l BSD unix-2.7.2.2
|
||||||
%if %{undefined without_haddock}
|
%if %{with haddock}
|
||||||
%ghc_lib_subpackage -d -l BSD xhtml-3000.2.2
|
%ghc_lib_subpackage -d -l BSD xhtml-3000.2.2
|
||||||
%endif
|
%endif
|
||||||
%endif
|
%endif
|
||||||
@ -259,7 +267,7 @@ rm -r libffi-tarballs
|
|||||||
%patch28 -p1 -b .orig
|
%patch28 -p1 -b .orig
|
||||||
|
|
||||||
%global gen_contents_index gen_contents_index.orig
|
%global gen_contents_index gen_contents_index.orig
|
||||||
%if %{undefined without_haddock}
|
%if %{with haddock}
|
||||||
if [ ! -f "libraries/%{gen_contents_index}" ]; then
|
if [ ! -f "libraries/%{gen_contents_index}" ]; then
|
||||||
echo "Missing libraries/%{gen_contents_index}, needed at end of %%install!"
|
echo "Missing libraries/%{gen_contents_index}, needed at end of %%install!"
|
||||||
exit 1
|
exit 1
|
||||||
@ -271,7 +279,7 @@ fi
|
|||||||
# http://hackage.haskell.org/trac/ghc/wiki/Platforms
|
# http://hackage.haskell.org/trac/ghc/wiki/Platforms
|
||||||
# cf https://github.com/gentoo-haskell/gentoo-haskell/tree/master/dev-lang/ghc
|
# cf https://github.com/gentoo-haskell/gentoo-haskell/tree/master/dev-lang/ghc
|
||||||
cat > mk/build.mk << EOF
|
cat > mk/build.mk << EOF
|
||||||
%if %{defined perf_build}
|
%if %{with perf_build}
|
||||||
%ifarch armv7hl aarch64
|
%ifarch armv7hl aarch64
|
||||||
BuildFlavour = perf-llvm
|
BuildFlavour = perf-llvm
|
||||||
%else
|
%else
|
||||||
@ -285,11 +293,11 @@ BuildFlavour = quick
|
|||||||
%endif
|
%endif
|
||||||
%endif
|
%endif
|
||||||
GhcLibWays = v dyn %{?with_prof:p}
|
GhcLibWays = v dyn %{?with_prof:p}
|
||||||
%if %{defined without_haddock}
|
%if %{without haddock}
|
||||||
HADDOCK_DOCS = NO
|
HADDOCK_DOCS = NO
|
||||||
%endif
|
%endif
|
||||||
EXTRA_HADDOCK_OPTS += --hyperlinked-source
|
EXTRA_HADDOCK_OPTS += --hyperlinked-source
|
||||||
%if %{undefined without_manual}
|
%if %{with manual}
|
||||||
BUILD_MAN = yes
|
BUILD_MAN = yes
|
||||||
%else
|
%else
|
||||||
BUILD_MAN = no
|
BUILD_MAN = no
|
||||||
@ -302,7 +310,7 @@ EOF
|
|||||||
## (http://ghc.haskell.org/trac/ghc/wiki/Debugging/RuntimeSystem)
|
## (http://ghc.haskell.org/trac/ghc/wiki/Debugging/RuntimeSystem)
|
||||||
#EXTRA_HC_OPTS=-debug
|
#EXTRA_HC_OPTS=-debug
|
||||||
|
|
||||||
%ifarch armv7hl aarch64
|
%ifarch armv7hl
|
||||||
autoreconf
|
autoreconf
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@ -412,10 +420,11 @@ done
|
|||||||
|
|
||||||
%ghc_strip_dynlinked
|
%ghc_strip_dynlinked
|
||||||
|
|
||||||
%if %{undefined without_haddock}
|
%if %{with haddock}
|
||||||
mkdir -p %{buildroot}%{_sysconfdir}/cron.hourly
|
mkdir -p %{buildroot}%{_sysconfdir}/cron.hourly
|
||||||
install -p --mode=0755 %SOURCE3 %{buildroot}%{_sysconfdir}/cron.hourly/ghc-doc-index
|
install -p --mode=0755 %SOURCE3 %{buildroot}%{_sysconfdir}/cron.hourly/ghc-doc-index
|
||||||
mkdir -p %{buildroot}%{_localstatedir}/lib/ghc
|
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
|
install -p --mode=0755 %SOURCE4 %{buildroot}%{_bindir}/ghc-doc-index
|
||||||
|
|
||||||
# generate initial lib doc index
|
# generate initial lib doc index
|
||||||
@ -427,8 +436,6 @@ cd ..
|
|||||||
# we package the library license files separately
|
# we package the library license files separately
|
||||||
find %{buildroot}%{ghc_html_libraries_dir} -name LICENSE -exec rm '{}' ';'
|
find %{buildroot}%{ghc_html_libraries_dir} -name LICENSE -exec rm '{}' ';'
|
||||||
|
|
||||||
touch %{buildroot}%{_localstatedir}/lib/ghc/pkg-dir.cache{,.new}
|
|
||||||
|
|
||||||
|
|
||||||
%check
|
%check
|
||||||
export LANG=en_US.utf8
|
export LANG=en_US.utf8
|
||||||
@ -451,12 +458,10 @@ echo 'main = putStrLn "Foo"' > testghc/foo.hs
|
|||||||
$GHC testghc/foo.hs -o testghc/foo -dynamic
|
$GHC testghc/foo.hs -o testghc/foo -dynamic
|
||||||
[ "$(testghc/foo)" = "Foo" ]
|
[ "$(testghc/foo)" = "Foo" ]
|
||||||
rm testghc/*
|
rm testghc/*
|
||||||
%if %{with testsuite}
|
|
||||||
make test
|
|
||||||
%endif
|
|
||||||
|
|
||||||
# check the ABI hashes
|
# check the ABI hashes
|
||||||
%if %{defined perf_build}
|
%if %{with abicheck}
|
||||||
|
if [ "%{version}" = "$(ghc --numeric-version)" ]; then
|
||||||
echo "Checking package ABI hashes:"
|
echo "Checking package ABI hashes:"
|
||||||
for i in %{ghc_packages_list}; do
|
for i in %{ghc_packages_list}; do
|
||||||
old=$(ghc-pkg field $i id --simple-output || :)
|
old=$(ghc-pkg field $i id --simple-output || :)
|
||||||
@ -477,6 +482,11 @@ if [ "$ghc_abi_hash_change" = "yes" ]; then
|
|||||||
echo "ghc ABI hash change: aborting build!" >&2
|
echo "ghc ABI hash change: aborting build!" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%if %{with testsuite}
|
||||||
|
make test
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
|
||||||
@ -549,14 +559,14 @@ fi
|
|||||||
%{ghclibdir}/template-hsc.h
|
%{ghclibdir}/template-hsc.h
|
||||||
%dir %{_docdir}/ghc
|
%dir %{_docdir}/ghc
|
||||||
%dir %{ghc_html_dir}
|
%dir %{ghc_html_dir}
|
||||||
%if %{undefined without_haddock}
|
%if %{with haddock}
|
||||||
%{_bindir}/ghc-doc-index
|
%{_bindir}/ghc-doc-index
|
||||||
%{_bindir}/haddock
|
%{_bindir}/haddock
|
||||||
%{_bindir}/haddock-ghc-%{version}
|
%{_bindir}/haddock-ghc-%{version}
|
||||||
%{ghclibdir}/bin/haddock
|
%{ghclibdir}/bin/haddock
|
||||||
%{ghclibdir}/html
|
%{ghclibdir}/html
|
||||||
%{ghclibdir}/latex
|
%{ghclibdir}/latex
|
||||||
%if %{undefined without_manual}
|
%if %{with manual}
|
||||||
# https://ghc.haskell.org/trac/ghc/ticket/12939
|
# https://ghc.haskell.org/trac/ghc/ticket/12939
|
||||||
#%%{_mandir}/man1/ghc.*
|
#%%{_mandir}/man1/ghc.*
|
||||||
%endif
|
%endif
|
||||||
@ -571,10 +581,21 @@ fi
|
|||||||
%ghost %{ghc_html_dir}/libraries/ocean.css
|
%ghost %{ghc_html_dir}/libraries/ocean.css
|
||||||
%ghost %{ghc_html_dir}/libraries/plus.gif
|
%ghost %{ghc_html_dir}/libraries/plus.gif
|
||||||
%ghost %{ghc_html_dir}/libraries/synopsis.png
|
%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
|
%endif
|
||||||
|
|
||||||
%if %{undefined without_manual}
|
%if %{with haddock}
|
||||||
%files doc
|
%files doc-cron
|
||||||
|
%config(noreplace) %{_sysconfdir}/cron.hourly/ghc-doc-index
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%files libraries
|
||||||
|
|
||||||
|
|
||||||
|
%if %{with manual}
|
||||||
|
%files manual
|
||||||
## needs pandoc
|
## needs pandoc
|
||||||
#%%{ghc_html_dir}/Cabal
|
#%%{ghc_html_dir}/Cabal
|
||||||
%{ghc_html_dir}/haddock
|
%{ghc_html_dir}/haddock
|
||||||
@ -582,22 +603,16 @@ fi
|
|||||||
%{ghc_html_dir}/users_guide
|
%{ghc_html_dir}/users_guide
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{undefined without_haddock}
|
|
||||||
%files doc-index
|
|
||||||
%config(noreplace) %{_sysconfdir}/cron.hourly/ghc-doc-index
|
|
||||||
%dir %{_localstatedir}/lib/ghc
|
|
||||||
%ghost %{_localstatedir}/lib/ghc/pkg-dir.cache
|
|
||||||
%ghost %{_localstatedir}/lib/ghc/pkg-dir.cache.new
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%files libraries
|
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Wed May 2 2018 Jens Petersen <petersen@redhat.com> - 8.2.2-67
|
* Thu May 24 2018 Jens Petersen <petersen@redhat.com> - 8.2.2-67
|
||||||
- move manuals to ghc-doc
|
- move manuals to ghc-manual.noarch
|
||||||
|
- rename ghc-doc-index to ghc-doc-cron.noarch
|
||||||
- ghost the ghc-doc-index local state files
|
- ghost the ghc-doc-index local state files
|
||||||
- ghost some newer libraries index files
|
- ghost some newer libraries index files
|
||||||
|
- simplify and extend bcond for build configuration
|
||||||
|
- drop bootstrap builds and do ABI hash checks unless ghc version changed
|
||||||
|
- no longer need autotools on aarch64
|
||||||
|
|
||||||
* Tue Apr 10 2018 Jens Petersen <petersen@redhat.com> - 8.2.2-66
|
* Tue Apr 10 2018 Jens Petersen <petersen@redhat.com> - 8.2.2-66
|
||||||
- ghc-pkg: silence the abi-depends warnings
|
- ghc-pkg: silence the abi-depends warnings
|
||||||
|
Loading…
Reference in New Issue
Block a user