Compare commits

...

141 Commits

Author SHA1 Message Date
David Abdurachmanov 71596b4763
Set ghc_smp_mflags to -j1
This might be enough to prevent segfaults on riscv64 for now.

Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
2023-06-23 21:30:33 +03:00
David Abdurachmanov 94bc45401f
Add modifications for riscv64
Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
2023-04-14 18:57:58 +03:00
Jens Petersen da8b6a2c9f f38: also obsolete regex-compat-tdfa 2023-03-27 22:36:45 +08:00
Jens Petersen b918424076 add obsoletes for F38 2023-03-26 14:31:31 +08:00
Jens Petersen 3a116c6a29 ghc.attr: include Hadrian lib/ subdir in .conf regex
otherwise lib packages fail to generate devel deps
2023-02-16 00:02:53 +08:00
Jens Petersen 6d69503ff3 ghc-dep.sh: check for *_p.a under Hadrian platform subdir as well 2023-02-15 22:53:07 +08:00
Jens Petersen fa4c615f86 2.5.1 2023-02-11 14:52:16 +08:00
Jens Petersen 2e806acfa1 ghc-deps.sh: remove whitespace before package name 2023-02-11 14:51:32 +08:00
Jens Petersen 18fd461ac2 make ghc-dep.sh and ghc-pkg-wrapper error if error occurs 2023-02-11 14:50:57 +08:00
Jens Petersen 90f14946a1 add %ghc_merge_filelist 2023-02-11 14:49:20 +08:00
Jens Petersen e429bfe81c macros.ghc: move ghc_*_build, ghc_*_install, cabal_pkg_conf earlier 2023-01-30 18:05:13 +08:00
Jens Petersen e71475ee24 changelog for 2.5.0 2023-01-29 18:46:41 +08:00
Jens Petersen 58f3979109 %ghc_delete_rpaths: need to remove local RPATH for subpackaged libs 2023-01-29 18:13:56 +08:00
Jens Petersen ce204c6b81 %cabal_configure: non-core shared libs go to %ghcliblib
use %base_ver to detect ghc (make) builds in %ghc_gen_filelists
2023-01-29 18:03:32 +08:00
Jens Petersen 7d2510b141 move with_ghc_prof to ghc-srpm-macros
so that prof BRs work in mock
2023-01-29 17:56:35 +08:00
Jens Petersen 0017f57fc4 setup _ghcdynlibdir from spec file for current releases 2023-01-29 17:56:35 +08:00
Jens Petersen 323880f227 only %ghc_delete_rpaths for _ghcdynlibdir 2023-01-29 17:56:35 +08:00
Jens Petersen 8400579198 handle hadrian lib/ subdir consistently for packages
- deprecate %ghclibplatform and introduce %ghcplatform
2023-01-29 17:56:35 +08:00
Jens Petersen dfacabb0d6 %ghc_lib_subpackage: with %ghc_obsoletes_name obsolete ghc%{ghc_major}-* 2023-01-29 17:56:35 +08:00
Jens Petersen e7cc30b58f %ghc_bin_build -W to ignore %ghc_name version in %cabal_configure 2023-01-29 17:56:35 +08:00
Jens Petersen 44501cb02b disable _ghcdynlibdir as default
We want to follow upstream libHS*.so paths going forward
2023-01-29 17:56:35 +08:00
Jens Petersen c6ebe00c11 use upstream paths for libHS*.so unless _ghcdynlibdir 2023-01-29 17:56:35 +08:00
Jens Petersen 3c68a12dbb remove ghc-info.sh again 2023-01-29 17:56:35 +08:00
Jens Petersen 030e119f14 cabal_configure: default dynlibdir to libdir/ghc-version 2023-01-29 17:56:35 +08:00
Jens Petersen fc5fb26e31 ghc_gen_filelists: define basepkg later
just suppressed warning if error encountered around echo
2023-01-29 17:56:35 +08:00
Jens Petersen 7e3e6494e2 ghc_gen_filelists: error if no .so file and not metapkg 2023-01-29 17:56:35 +08:00
Jens Petersen 668dd10c99 base ghc_version on compiler subpackage 2023-01-09 12:41:21 +08:00
Jens Petersen 4ac79fbdbd drop old rhel6 extra deps lines from ghc-deps.sh 2022-11-26 20:06:11 +08:00
Jens Petersen acff114c1d add ghc-info.sh to handle hadrian %ghclibdir/lib 2022-11-26 20:05:57 +08:00
Jens Petersen 1e680edbc7 ghc_configure and ghc_version now respect ghc_name for ghcX.Y 2022-11-26 20:05:57 +08:00
Jens Petersen dfe7e03c1c define ghc_smp_mflags to speed up package builds
suggested in https://github.com/fedora-haskell/ghc-rpm-macros/issues/10
2022-09-15 19:33:37 +08:00
Jens Petersen d5f701318c F36 obsoletes regex-applicative-text
actually stack-2.7.5 dropped it
2022-08-06 12:25:37 +08:00
Jens Petersen 70d2298b04 test-rebuild.sh: use rawhide branch 2022-07-31 02:35:28 +08:00
Jens Petersen eb63b71620 in 9.4.1 Hadrian html docdirs are versioned again
if using hadrian we also check for unversioned
2022-07-26 18:34:04 +08:00
Jens Petersen b6ba7540fe %ghc_gen_filelists: check pkg licensedir exists
prevents warning errors: eg for ghc9.4:

ls: cannot access '~/fedora/haskell/ghc9.4/BUILDROOT/ghc9.4-9.4.0.20220721-7.fc37.x86_64/usr/share/licenses/ghc9.4-Cabal': No such file or directory

etc, though not actually harmful
2022-07-26 18:33:57 +08:00
Fedora Release Engineering 0fd2441bc1 Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-21 05:43:26 +00:00
Jens Petersen b8cd891b77 in F37 ghc-filesystem is now a subpackage of ghc 2022-07-19 14:57:42 +08:00
Jens Petersen 4f552ad804 ghc_bin_build,ghc_lib_build: define ghc_debuginfo to really enable debuginfo 2022-07-19 13:57:00 +08:00
Jens Petersen 1facb30fc0 ghc_bin_build,ghc_lib_build: defining %ghc_debuginfo allows debuginfo
Needed for ghcX.Y which builds hadrian using %ghc_bin_build
which accidently disabled debuginfo as a side-effect,
which lead to ghcX.Y-compiler .build-id file conflicts:

Error: Transaction test error:
  file /usr/lib/.build-id/4e/f85f81abfd9c031a34af8117ab8e14fcbae536 from install of ghc9.4-compiler-9.4.0.20220623-5.fc36.x86_64 conflicts with file from package ghc9.2-compiler-9.2.3-10.fc36.x86_64

due to missing debuginfo data
2022-07-18 16:27:43 +08:00
Jens Petersen cfbb8bcbb7 ghc-deps.sh: ShellCheck tweaks and sort uniq output 2022-06-11 12:40:42 +08:00
Jens Petersen f6aa817b92 ghc-deps.sh: split off buildroot from the ghclibdir arg for more precise paths
This allows using the ghclibdir for checking for prof libs,
avoiding collisions with other ghcX.Y-*-prof files:

Processing files: ghc-doctemplates-prof-0.9-7.fc37.x86_64
/usr/lib/rpm/ghc-deps.sh: line 60: [: too many arguments
/usr/lib/rpm/ghc-deps.sh: line 60: [: too many arguments
/usr/lib/rpm/ghc-deps.sh: line 60: [: too many arguments
2022-06-10 14:36:23 +08:00
Jens Petersen bb41ad6f7b add missing changelog entry for _ghc_doc_dir 2022-06-08 21:01:34 +08:00
Jens Petersen e780fd088d add %_ghc_doc_dir
used for filesystem
2022-06-08 18:14:29 +08:00
Jens Petersen 051b51f30f define ghc_prefix (used for ghcX.Y packaging) 2022-06-08 17:12:57 +08:00
Jens Petersen 7f9cbd873d drop ghc-compiler requires to allow using ghcX.Y-compiler-default 2022-04-27 10:59:30 +08:00
Jens Petersen 0b9d47c300 update license and use https for subpackage url (Tim Landscheidt,#2) 2022-04-27 10:54:18 +08:00
Jens Petersen 57481f9394 ghc_set_gcc_flags: disable brp-strip-lto to avoid strip timestamp warnings 2022-03-10 13:13:54 +08:00
Jens Petersen b47d44f086 %ghc_set_gcc_flags: always sed CFLAGS whether pre-set or not
Needed for F36 https://fedoraproject.org/wiki/Changes/SetBuildFlagsBuildCheck
2022-02-12 14:18:51 +08:00
Jens Petersen 9a341be0e1 ghc_set_gcc_flags disable _lto_cflags for all archs 2022-02-08 13:28:27 +08:00
Jens Petersen 22d34de16e disable package notes, which break all Haskell packages (#2043092)
occurred during F36 mass rebuild
2022-01-21 22:17:01 +08:00
Fedora Release Engineering db4b6534d4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-20 05:28:00 +00:00
Jens Petersen 6bd7262956 ghc-deps.sh: also match 'rts' if first, last, or only output 2022-01-05 15:13:52 +08:00
Jens Petersen bff7a5f6ac ghc-deps.sh: fix the rts deps erasure cleanly
was breaking ghc-ghci-devel deps:
ghc*-devel(ghc-heap-8.10.7template-haskell-2.16.0.0)
for non-Hadrian
2022-01-05 14:48:15 +08:00
Jens Petersen 6a30ca822b put docs/haddocks under %ghc_name if defined 2021-12-29 10:15:58 +08:00
Jens Petersen 9e7ffdac88 ghc-deps.sh: only exclude unversioned rts.conf
- Hadrian's rts.conf is versioned
- bin-package-db disappeared in ghc7

This change prevents:
nothing provides ghc-9.2.1-devel(ghc-prim-0.8.0-1.0.2) needed by ghc9.2-base-devel-4.16.0.0-2.fc36.x86_64
2021-12-20 14:23:29 +08:00
Jens Petersen 400c117550 _arch fits Cabal better for ghclibplatform 2021-12-20 13:45:07 +08:00
Jens Petersen ad76ca4d4c ghclibplatform: Cabal calls i686 as i386 2021-12-20 03:07:56 +08:00
Jens Petersen 5136c98a2f fix Hadrian ghc dependency generation 2021-12-20 01:36:16 +08:00
Jens Petersen f5f72c49ec %ghc_pkg_recache is not deprecated 2021-12-20 00:56:20 +08:00
Jens Petersen f8ff148f18 Hadrian haddock dirs are not versioned 2021-12-19 15:08:17 +08:00
Jens Petersen f75a976e04 move Cabal_arch into ghclibplatform macro 2021-12-19 10:47:11 +08:00
Jens Petersen 8b135f0a25 fixup ghc_arch renaming it to Cabal_arch 2021-12-19 10:05:10 +08:00
Jens Petersen 430af17a2c define %ghcliblib and %ghclibplatform globally 2021-12-19 01:29:32 +08:00
Jens Petersen ac98514a64 use ghcliblib/ghclibplatform paths for Hadrian dependency generation 2021-12-19 01:19:56 +08:00
Jens Petersen 839272fa3a Cabal uses ppc64 in paths instead of ppc64le 2021-12-19 00:55:27 +08:00
Jens Petersen 3f7e41039a ghc_gen_filelists: support ghc Hadrian install 2021-12-17 18:11:29 +08:00
Jens Petersen b3062773f5 for ghcMAJOR generate ghc-VERSION-devel(pkg-ver-hash) metadata
also fix lowercase typo of PKGCONFDIR which just happened to work by glob
2021-12-09 11:54:32 +08:00
Jens Petersen 12a6c28236 drop dependency generation for rhel6 2021-12-08 19:26:00 +08:00
Jens Petersen 16df5d8f6d cabal_configure: add -fhide-source-paths to ghc-options 2021-09-09 18:32:06 +08:00
Jens Petersen 269ffdc10b F35 obsoletes for attempt 2021-08-23 02:03:55 +08:00
Jens Petersen bb8b4e4972 add F35 obsoletes for base-noprelude and failure 2021-08-23 01:14:38 +08:00
Jens Petersen 28c34c93e5 add f35 obsoletes 2021-08-17 00:55:18 +08:00
Fedora Release Engineering c796532ce5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-22 01:11:08 +00:00
Jens Petersen 6684a6e9bb drop old obsoletes haskell-platform GL libs and cabal-plan 2021-07-14 09:03:26 +08:00
Jens Petersen db0d821b08 fix ghc_fix_doc_perms only to touch files not dirs
testcase: MissingH announcements/
2021-07-10 01:37:03 +08:00
Jens Petersen ce5d10cf61 haddock has not used hscolour for a long time 2021-06-17 18:28:02 +08:00
Jens Petersen 192fd2f9c3 restore %ghc_fix_rpath for compat and drop it from %ghc_libs_install 2021-06-08 21:20:51 +08:00
Jens Petersen a1c1188a52 ghc-rpm-macros needs to require chrpath now 2021-06-08 00:10:36 +08:00
Jens Petersen cc8736d28d rename %ghc_fix_rpaths to %ghc_delete_rpaths 2021-06-07 23:37:42 +08:00
Jens Petersen 9e31d7dd7d change %ghc_fix_rpath %{subpkgs} to %ghc_fix_rpaths for all executables
needed for
https://fedoraproject.org/wiki/Changes/Broken_RPATH_will_fail_rpmbuild
and rpminspect runpath DT_RUNPATH errors
2021-06-07 23:24:42 +08:00
Jens Petersen d2347fa858 changelog for 2.1.0-1 2021-04-08 12:26:45 +08:00
Jens Petersen 63e6e932d7 %ghc_fix_doc_perms: quote backslashes in the regexp 2021-04-08 12:22:24 +08:00
Jens Petersen a49534372d make this package noarch for all OS versions (drop lower bounds) 2021-04-08 12:21:43 +08:00
Jens Petersen ee20904695 .spec: s!%{buildroot}/!%{buildroot}! 2021-04-08 12:21:43 +08:00
Jens Petersen 979c94a42e update url to dist-git 2021-04-08 12:21:43 +08:00
Jens Petersen 708a38ba61 add ghc-filesystem subpkg for ghc doc dirs 2021-04-08 12:21:43 +08:00
Jens Petersen 2e3afbabaf drop obsoletes from older than f29 2021-03-24 01:26:58 +08:00
Jens Petersen cc769c3d44 2.0.15 2021-02-16 20:57:30 +08:00
Jens Petersen 8ed58df419 %ghc_fix_doc_perms to workaround Cabal extra-source-files perm issue 2021-02-16 20:56:22 +08:00
Jens Petersen 34a277046d extra: add %ghc_subpackages_list
can be used by ghc etc for metapkg to depend on all subpackages
2021-02-16 20:56:22 +08:00
Fedora Release Engineering 523769efa9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-26 07:40:30 +00:00
Jens Petersen 78bda0dce5 ghc-deps.sh: be careful when filtering out rts (#1873687) 2020-08-29 15:37:00 +08:00
Jens Petersen d1ee98d635 obsolete ghc-iwlib (xmobar) 2020-08-26 09:23:57 +08:00
Jens Petersen 4b53d0e949 disable LTO on (unregisterised) s390x (#1863601) 2020-08-04 01:13:50 +08:00
Fedora Release Engineering 177eee41fb - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-07-27 19:36:16 +00:00
Jens Petersen 0dc8c9a01a obsoletes for easytest (hledger-lib), EdisonAPI & EdisonCore (Agda) 2020-07-22 12:32:28 +08:00
Jens Petersen 2e40c5d979 make doc subpackages noarch for subpackaging 2020-07-21 18:18:02 +08:00
Jens Petersen 2c8bb831fa obsoletes for ghc-gtksourceview2 (and drop ghc-cabal-helper) 2020-07-21 18:15:30 +08:00
Jens Petersen 11c86f82ec revert last change "don't bother creating a source dir"
it break koji (mock) build

need to move to tarball releases anyway
2020-07-15 10:48:24 +08:00
Jens Petersen 5beed1f49f don't bother creating a source dir 2020-07-13 12:02:19 +08:00
Jens Petersen 338a2e11bc %ghc_lib_subpackage -m for meta subpackages 2020-07-13 12:01:44 +08:00
Jens Petersen bc06ab77b4 only add dynlib to filelist if found to allow for metapkg subpackage
eg base-noprelude subpackage of pandoc
2020-06-24 19:00:44 +08:00
Jens Petersen 31a55c3bc9 cabal-tweak-*: output errors to stderr with scriptname 2020-06-18 11:08:33 +08:00
Jens Petersen 0bb1bc2091 doc subpackages should own %{_docdir}/ghc/html/libraries/ and parents (#1795526) 2020-06-04 12:45:56 +08:00
Jens Petersen 1f6b86fa4b ghc-deps.sh: ignore internal libraries (#1822444) 2020-05-10 21:49:27 +08:00
Jens Petersen 0957e8f99b obsolete ghc-here 2020-05-08 19:11:35 +08:00
Jens Petersen 3e574ed460 use -package Cabal to build Setup 2020-04-27 21:42:47 +08:00
Jens Petersen 2e646e6ade obsolete cabal-helper and ghc-derive, and unobsolete hgettext 2020-03-03 23:49:28 +08:00
Jens Petersen 640d44dbc6 ghc-deps.sh: fix prof deps for subpackages 2020-02-10 18:54:19 +08:00
Fedora Release Engineering 94dd010461 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-01-28 21:18:19 +00:00
Jens Petersen 7d23ad27b7 obsolete FTBFS ghc-hgettext 2020-01-27 17:57:00 +08:00
Jens Petersen 55f3bb578e Revert "add %ghc_devel_prof config to handle devel/prof lib BRs"
This reverts commit f5201b70db.

Could define it in ghc-srpm-macros
2019-09-27 23:45:23 +08:00
Jens Petersen f5201b70db add %ghc_devel_prof config to handle devel/prof lib BRs 2019-09-27 18:06:47 +08:00
Jens Petersen bf725e3e8b fix ghc-deps.sh generation of prof deps
broken in 2.0.3 - now should correctly glob for installed prof libs
2019-08-27 16:45:37 +03:00
Jens Petersen f4b0280742 add cabal-tweak-remove-upperbound 2019-08-13 17:31:29 +02:00
Jens Petersen 8532ad674a ghc-deps.sh: only depend on ghc-prof(pkgid) if libHS*_p.a exists
testcase: haskell-gi-overloading dummy package
2019-08-10 22:46:33 +02:00
Jens Petersen a11ad68d65 check if doc haddock dir exists 2019-08-07 14:07:56 +02:00
Jens Petersen c0416597f5 ghc_lib_subpackage: provide static with isa suffix 2019-08-05 18:51:19 +08:00
Jens Petersen aa3330b0d6 fixup changelog dates 2019-07-31 10:16:47 +00:00
Jens Petersen 25cfe11f3d fix deps generation for devel package.conf and prof libHS*_p.a 2019-07-31 10:05:10 +00:00
Jens Petersen 6dd89e3044 output args to %ghc_fix_rpath 2019-07-31 10:05:10 +00:00
Jens Petersen 4288e26af9 %ghc_gen_filelists: condition haddock 2019-07-31 10:05:10 +00:00
Jens Petersen 75b540630f %ghc_gen_filelists: fix listing of libHS*.so 2019-07-31 10:05:10 +00:00
Jens Petersen f14f1387ec drop verbose output for Cabal install 2019-07-31 10:05:10 +00:00
Jens Petersen 8e03288604 revert to handling subpackage license in %ghc_gen_filelists 2019-07-31 10:05:10 +00:00
Jens Petersen 35cd9d015e switch from without_prof/haddock to with_ghc_prof/haddock
We now have build config consistent with standard bcond across our packages
2019-07-31 10:05:10 +00:00
Jens Petersen a848de7b31 add pkg-doc.files
initial use-case: adding ghc-prim and integer-gmp to base
2019-07-31 10:05:10 +00:00
Jens Petersen 1d408a6bad static provides 2019-07-31 10:05:10 +00:00
Jens Petersen 1862405783 %ghc_fix_rpath: remove _libdir 2019-07-31 10:05:10 +00:00
Jens Petersen e046298ce0 update deps generation for prof subpackages 2019-07-31 10:05:10 +00:00
Jens Petersen 7c7ff554ce implement doc and prof subpackages 2019-07-31 10:05:10 +00:00
Jens Petersen 6cca56615f bump to version 1.10 2019-07-31 10:05:10 +00:00
Jens Petersen 2dafbc455d drop devel %post and %postun (replaced by triggers in ghc-compiler)
No longer use %ghc_pkg_c_deps hack to require ghc-compiler = ver-rel
- check for ghc_version_override instead
2019-07-31 10:03:52 +00:00
Jens Petersen 07a1493141 drop deprecated %ghc_fix_dynamic_rpath
deprecated since Sept 2016
2019-07-31 10:03:52 +00:00
Fedora Release Engineering a7912ec0d8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-07-25 02:56:16 +00:00
Jens Petersen aeff5cde90 obsolete ghc-conduit-combinators base package already in f30 2019-05-18 15:57:21 +08:00
Jens Petersen 945207835e add remaining f30 obsoletes 2019-05-11 01:02:09 +08:00
Jens Petersen 03ef976954 strip with Cabal again; obsolete ghc-hoopl
unfortunately libs and exe's were not getting stripped by rpm
2019-04-15 18:15:27 +08:00
Jens Petersen 5a531e47b6 re-instate ghc_without_shared since useful for standalone builds 2019-04-09 19:21:22 +08:00
Jens Petersen 14a65baa2a %ghc_fix_rpath was a no-op for ghc_without_dynamic 2019-02-24 13:53:26 +08:00
Jens Petersen fcee7ff4cb always build Setup with -no-user-package-db 2019-02-16 13:07:12 +08:00
13 changed files with 771 additions and 311 deletions

View File

@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
<https://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@ -2,11 +2,15 @@
set -e +x
function fail {
echo "$0: $1" >&2
exit 1
}
USAGE="Usage: $0 dep old new"
if [ $# -ne 3 ]; then
echo "$USAGE"
exit 1
fail "$USAGE"
fi
DEP=$1
@ -16,15 +20,13 @@ NEW=$3
CABALFILE=$(ls *.cabal)
if [ $(echo $CABALFILE | wc -w) -ne 1 ]; then
echo "There needs to be one .cabal file in the current dir!"
exit 1
fail "There needs to be one .cabal file in the current dir!"
fi
BREAK=[^[:alnum:]-]
if ! grep -q "$BREAK$DEP$BREAK[^,]*$OLD" $CABALFILE; then
echo "$CABALFILE does not match: $DEP $OLD"
exit 1
fail "$CABALFILE does not match: $DEP $OLD"
fi
if [ ! -f $CABALFILE.orig ]; then

View File

@ -2,11 +2,15 @@
set -e +x
function fail {
echo "$0: $1" >&2
exit 1
}
USAGE="Usage: $0 dep"
if [ $# -ne 1 ]; then
echo "$USAGE"
exit 1
fail "$USAGE"
fi
DEP=$1
@ -14,8 +18,7 @@ DEP=$1
CABALFILE=$(ls *.cabal)
if [ $(echo $CABALFILE | wc -w) -ne 1 ]; then
echo "There needs to be one .cabal file in the current dir!"
exit 1
fail "There needs to be one .cabal file in the current dir!"
fi
if [ ! -f $CABALFILE.orig ]; then
@ -23,8 +26,7 @@ if [ ! -f $CABALFILE.orig ]; then
fi
if grep "$DEP" $CABALFILE | sed -e "s/$DEP//" | grep -q -e "[A-Za-z]"; then
echo "$0: deleting whole $DEP lines not safe - try more precise pattern"
exit 1
fail "$0: deleting whole $DEP lines not safe - try more precise pattern"
fi
sed -i$BACKUP -e "/$DEP/d" $CABALFILE

View File

@ -5,11 +5,15 @@
set -e +x
function fail {
echo "$0: $1" >&2
exit 1
}
USAGE="Usage: $0 FLAG [True|False]"
if [ $# -ne 2 ]; then
echo "$USAGE"
exit 1
fail "$USAGE"
fi
FLAG=$1
@ -24,23 +28,19 @@ esac
CABALFILE=$(ls *.cabal)
if [ $(echo $CABALFILE | wc -w) -ne 1 ]; then
echo "There needs to be one .cabal file in the current dir!"
exit 1
fail "There needs to be one .cabal file in the current dir!"
fi
if ! grep -q -i "^flag *$FLAG" $CABALFILE; then
echo "$CABALFILE does not have flag $FLAG"
exit 1
fail "$CABALFILE does not have flag $FLAG"
fi
if ! grep -A3 -i "^flag *$FLAG" $CABALFILE | grep -q -i "default:"; then
echo "$CABALFILE: $FLAG flag might not have a default"
exit 1
fail "$CABALFILE: $FLAG flag might not have a default"
fi
if ! grep -A3 -i "^flag *$FLAG" $CABALFILE | grep -q -i "default: *$OLD"; then
echo "$CABALFILE: $FLAG flag already defaults to $NEW"
exit 1
fail "$CABALFILE: $FLAG flag already defaults to $NEW"
fi
if [ ! -f $CABALFILE.orig ]; then

39
cabal-tweak-remove-upperbound Executable file
View File

@ -0,0 +1,39 @@
#!/bin/sh
set -e +x
function fail {
echo "$0: $1" >&2
exit 1
}
USAGE="Usage: $0 dep"
if [ $# -ne 1 ]; then
fail "$USAGE"
fi
DEP=$1
CABALFILE=$(ls *.cabal)
if [ $(echo $CABALFILE | wc -w) -ne 1 ]; then
fail "There needs to be one .cabal file in the current dir!"
fi
BREAK=[^[:alnum:]-]
if ! grep -q "$BREAK$DEP$BREAK[^,]*" $CABALFILE; then
fail "$CABALFILE does not match: $DEP"
fi
if [ ! -f $CABALFILE.orig ]; then
BACKUP=.orig
fi
if grep -q "$BREAK$DEP$BREAK[^,]*&&" $CABALFILE; then
sed -i$BACKUP -e "s/\($BREAK$DEP$BREAK[^&,]*[^ ]\+\) *&&[^,]*/\1/g" $CABALFILE
fi
if grep -q "$BREAK$DEP$BREAK[^,]*==" $CABALFILE; then
sed -i$BACKUP -e "s/\($BREAK$DEP$BREAK[^=,]*\)==\([^,*]*\)\.\*/\1>=\2/g" $CABALFILE
fi

View File

@ -1,43 +1,71 @@
#!/bin/sh
# find rpm provides and requires for Haskell GHC libraries
[ $# -ne 2 ] && echo "Usage: $(basename $0) [--provides|--requires] %{buildroot}%{ghclibdir}" && exit 1
[ $# -lt 3 ] && echo "Usage: $(basename "$0") [--provides|--requires] %{buildroot} %{ghclibdir} [ghc-version]" && exit 1
set +x
set +x -e
mode=$1
pkgbasedir=$2
pkgconfdir=$pkgbasedir/package.conf.d
MODE=$1
BUILDROOT=$2
PKGBASEDIR=$3
if [ -z "$4" ];
then GHCPREFIX=ghc
else GHCPREFIX=$4
fi
if [ -d "$BUILDROOT$PKGBASEDIR/lib" ];
then PKGBASELIB=$PKGBASEDIR/lib
else PKGBASELIB=$PKGBASEDIR
fi
PKGCONFDIR=$PKGBASELIB/package.conf.d
ghc_pkg="/usr/lib/rpm/ghc-pkg-wrapper $pkgbasedir"
GHC_PKG="/usr/lib/rpm/ghc-pkg-wrapper $BUILDROOT$PKGBASEDIR"
case $mode in
case $MODE in
--provides) field=id ;;
--requires) field=depends ;;
*) echo "$(basename $0): Need --provides or --requires"
*) echo "$(basename "$0"): Need --provides or --requires"
exit 1
;;
esac
ghc_ver=$(basename $pkgbasedir | sed -e s/ghc-//)
files=$(cat)
(
for i in $files; do
case $i in
# exclude builtin_rts.conf
$pkgconfdir/*-*.conf)
name=$(grep "^name: " $i | sed -e "s/name: //")
ids=$($ghc_pkg field $name $field | sed -e "s/rts//" -e "s/bin-package-db-[^ ]\+//")
# exclude rts.conf
$BUILDROOT$PKGCONFDIR/*-*.conf)
name=$(grep "^name: " "$i" | sed -e "s/name: *//")
ids=$($GHC_PKG field "$name" "$field" | sed -e "s/\(^\| \)rts\( \|$\)/ /")
for d in $ids; do
case $d in
*-*) echo "ghc-devel($d)" ;;
*-*-internal) ;;
*-*) echo "$GHCPREFIX-devel($d)" ;;
*) ;;
esac
done
;;
*)
*/libHS*_p.a)
pkgver=$(basename "$(dirname "$i")")
ids=$($GHC_PKG field "$pkgver" "$field" | sed -e "s/\(^\| \)rts\( \|$\)/ /" -e "s/bin-package-db-[^ ]\+//")
for d in $ids; do
case $d in
*-*-internal) ;;
*-*)
case $field in
id)
echo "$GHCPREFIX-prof($d)"
;;
*)
if [ -f "$PKGBASELIB"/*/libHS"${d}"_p.a -o -f "$BUILDROOT$PKGBASELIB"/*/libHS"${d}"_p.a -o -f "$PKGBASELIB"/*/*/libHS"${d}"_p.a -o -f "$BUILDROOT$PKGBASELIB"/*/*/libHS"${d}"_p.a ]; then
echo "$GHCPREFIX-prof($d)"
fi
;;
esac
;;
esac
done
;;
esac
done
) | sort | uniq

View File

@ -2,30 +2,21 @@
[ $# -lt 1 ] && echo "Usage: `basename $0` %{buildroot}%{ghclibdir} ..." && exit 1
set +x
set +x -e
PKGBASEDIR=$1
shift
PKGCONFDIR=$PKGBASEDIR/package.conf.d
GHC_VER=$(basename $PKGBASEDIR | sed -e s/ghc-//)
if [ -d $PKGBASEDIR/lib ];
then PKGCONFDIR=$PKGBASEDIR/lib/package.conf.d
else PKGCONFDIR=$PKGBASEDIR/package.conf.d
fi
# for a ghc build use the new ghc-pkg
INPLACE_GHCPKG=$PKGBASEDIR/../../bin/ghc-pkg-$GHC_VER
if [ -x "$INPLACE_GHCPKG" ]; then
case $GHC_VER in
7.4.*)
GHC_PKG="$PKGBASEDIR/ghc-pkg --global-conf=$PKGCONFDIR"
;;
7.6.*)
GHC_PKG="$PKGBASEDIR/ghc-pkg --global-package-db=$PKGCONFDIR"
;;
# 7.8 and 7.10
*)
GHC_PKG="env LD_LIBRARY_PATH=$(dirname $PKGBASEDIR) $PKGBASEDIR/bin/ghc-pkg --global-package-db=$PKGCONFDIR"
;;
esac
if [ -x "$PKGBASEDIR/bin/ghc-pkg" ]; then
GHC_PKG="env LD_LIBRARY_PATH=$(dirname $PKGBASEDIR) $PKGBASEDIR/bin/ghc-pkg --global-package-db=$PKGCONFDIR"
else
GHC_VER=$(basename $PKGBASEDIR | sed -e s/ghc-//)
GHC_PKG="/usr/bin/ghc-pkg-${GHC_VER} -f $PKGCONFDIR"
fi

View File

@ -6,17 +6,14 @@
%global macros_dir %{_sysconfdir}/rpm
%endif
# uncomment to bootstrap without hscolour
#%%global without_hscolour 1
Name: ghc-rpm-macros
Version: 1.9.6
Release: 1%{?dist}
Version: 2.5.2
Release: 3.1.riscv64%{?dist}
Summary: RPM macros for building Haskell packages for GHC
License: GPLv3+
URL: https://github.com/fedora-haskell/ghc-rpm-macros
# Currently source is only in git but tarballs could be made if it helps
# Currently source is only in pkg git but tarballs could be made if it helps
URL: https://src.fedoraproject.org/rpms/ghc-rpm-macros/
Source0: macros.ghc
Source1: COPYING
Source2: AUTHORS
@ -29,84 +26,102 @@ Source8: ghc-pkg-wrapper
Source9: macros.ghc-os
Source10: Setup.hs
Source11: cabal-tweak-drop-dep
Source12: cabal-tweak-remove-upperbound
Requires: redhat-rpm-config
# for ghc_version
Requires: ghc-compiler
%if %{undefined without_hscolour}
Requires: hscolour
%endif
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
BuildArch: noarch
%endif
# ghc_version needs ghc-compiler or ghcX.Y-compiler-default
Requires: chrpath
BuildArch: noarch
%description
A set of macros for building GHC packages following the Haskell Guidelines
of the Fedora Haskell SIG. ghc needs to be installed in order to make use of
these macros.
of the Fedora Haskell SIG.
%package extra
Summary: Extra RPM macros for building Haskell library subpackages
Requires: %{name} = %{version}-%{release}
Requires: chrpath
%description extra
Extra macros used for subpackaging of Haskell libraries,
for example in ghc and haskell-platform.
%if 0%{?fedora} < 37
%package -n ghc-filesystem
Summary: Shared directories for Haskell documentation
%description -n ghc-filesystem
This package provides some common directories used for
Haskell libraries documentation.
%endif
# ideally packages should be obsoleted by some relevant package
# this is a last resort when there is no such appropriate package
%package -n ghc-obsoletes
Summary: Dummy package to obsolete deprecated Haskell packages
%if 0%{?fedora} >= 22
# these 3 no longer build with ghc-7.8
Obsoletes: ghc-ForSyDe < 3.1.2, ghc-ForSyDe-devel < 3.1.2
Obsoletes: ghc-parameterized-data < 0.1.6
Obsoletes: ghc-parameterized-data-devel < 0.1.6
Obsoletes: ghc-type-level < 0.2.5, ghc-type-level-devel < 0.2.5
Obsoletes: leksah < 0.14, ghc-leksah < 0.14, ghc-leksah-devel < 0.14
# dropped from HP 2014.2
Obsoletes: ghc-cgi < 3001.1.8, ghc-cgi-devel < 3001.1.8
%endif
%if 0%{?fedora} >= 24
Obsoletes: ghc-citeproc-hs < 0.3.10-3, ghc-citeproc-hs-devel < 0.3.10-3
Obsoletes: ghc-hakyll < 4.5.4.0-6, ghc-hakyll-devel < 4.5.4.0-6
Obsoletes: ghc-leksah-server < 0.14.3.1-4, ghc-leksah-server-devel < 0.14.3.1-4
%endif
%if 0%{?fedora} >= 25
Obsoletes: ghc-cmdtheline <= 0.2.3, ghc-cmdtheline-devel <= 0.2.3
Obsoletes: ghc-concrete-typerep <= 0.1.0.2, ghc-concrete-typerep-devel <= 0.1.0.2
Obsoletes: ghc-glade <= 0.12.5.0, ghc-glade-devel <= 0.12.5.0
Obsoletes: bluetile <= 0.6, bluetile-core <= 0.6
Obsoletes: ghc-lambdabot-utils <= 4.2.2, ghc-lambdabot-utils-devel <= 4.2.2
Obsoletes: haddock <= 2.14.3, ghc-haddock <= 2.14.3, ghc-haddock-devel <= 2.14.3
Obsoletes: ghc-monad-unify <= 0.2.2, ghc-monad-unify-devel <= 0.2.2
Obsoletes: idris <= 0.9.9.1
Obsoletes: ghc-editline < 0.2.1.1-13, ghc-editline-devel < 0.2.1.1-13
Obsoletes: ghc-hashed-storage < 0.5.11-4, ghc-hashed-storage-devel < 0.5.11-4
Obsoletes: ghc-nats <= 0.2, ghc-nats-devel <= 0.2
Obsoletes: ghc-primes <= 0.2.1.0-11, ghc-primes-devel <= 0.2.1.0-11
%endif
%if 0%{?fedora} >= 26
Obsoletes: ghc-geniplate <= 0.6.0.5, ghc-geniplate-devel <= 0.6.0.5
Obsoletes: ghc-sized-types <= 0.3.4.0, ghc-sized-types-devel <= 0.3.4.0
# dropped from HP 8.0.2
Obsoletes: ghc-cgi < 3001.2.2.2-5, ghc-cgi-devel < 3001.2.2.2-5
Obsoletes: ghc-multipart < 0.1.2-5, ghc-multipart-devel < 0.1.2-5
%endif
%if 0%{?fedora} >= 27
Obsoletes: ghc-webkit <= 0.14.2.1, ghc-webkit-devel <= 0.14.2.1
%endif
%if 0%{?fedora} >= 28
Obsoletes: ghc-fail < 4.9.0.0-2, ghc-fail-devel < 4.9.0.0-2
Obsoletes: ghc-ltk < 0.16, ghc-ltk-devel < 0.16
%endif
%if 0%{?fedora} >= 29
Obsoletes: ghc-content-store < 0.2.1-3, ghc-content-store-devel < 0.2.1-3
Obsoletes: ghc-bdcs < 0.6.1-3, ghc-bdcs-devel < 0.6.1-3
Obsoletes: ghc-bdcs-api < 0.1.3-3, ghc-bdcs-api-devel < 0.1.3-3
%endif
%if 0%{?fedora} >= 30
# ghc
Obsoletes: ghc-hoopl < 3.10.2.2-74, ghc-hoopl-devel < 3.10.2.2-74
# language-ecmascript
Obsoletes: ghc-tagshare < 0.0-10, ghc-tagshare-devel < 0.0-10
Obsoletes: ghc-testing-feat < 0.4.0.3-10, ghc-testing-feat-devel < 0.4.0.3-10
# enumerator
Obsoletes: ghc-enumerator < 0.4.20-12, ghc-enumerator-devel < 0.4.20-12
Obsoletes: ghc-attoparsec-enumerator < 0.3.4-10, ghc-attoparsec-enumerator-devel < 0.3.4-10
Obsoletes: ghc-blaze-builder-enumerator < 0.2.1.0-8, ghc-blaze-builder-enumerator-devel < 0.2.1.0-8
Obsoletes: ghc-zlib-enum < 0.2.3.1-12, ghc-zlib-enum-devel < 0.2.3.1-12
# Agda
Obsoletes: ghc-monadplus < 1.4.2-17, ghc-monadplus-devel < 1.4.2-17
# conduit-combinators
Obsoletes: ghc-conduit-combinators < 1.3.1
%endif
%if 0%{?fedora} >= 31
# base package obsoleted above in f30
Obsoletes: ghc-conduit-combinators-devel < 1.3.1
%endif
%if 0%{?fedora} >= 32
Obsoletes: ghc-derive < 2.6.5-5, ghc-derive-devel < 2.6.5-5, ghc-derive-prof < 2.6.5-5
Obsoletes: ghc-here < 1.2.13-17, ghc-here-devel < 1.2.13-17, ghc-here-prof < 1.2.13-17
%endif
%if 0%{?fedora} >= 33
Obsoletes: ghc-easytest < 0.2.1-4, ghc-easytest-devel < 0.2.1-4, ghc-easytest-prof < 0.2.1-4,
Obsoletes: ghc-EdisonAPI < 1.3.1-23, ghc-EdisonAPI-devel < 1.3.1-23, ghc-EdisonAPI-prof < 1.3.1-23
Obsoletes: ghc-EdisonCore < 1.3.2.1-23, ghc-EdisonCore-devel < 1.3.2.1-23, ghc-EdisonCore-prof < 1.3.2.1-23
Obsoletes: ghc-gtksourceview2 < 0.13.3.1-14, ghc-gtksourceview2-devel < 0.13.3.1-14, ghc-gtksourceview2-prof < 0.13.3.1-14
%endif
Obsoletes: ghc-iwlib < 0.1.0-16, ghc-iwlib-devel < 0.1.0-16, ghc-iwlib-prof < 0.1.0-16
%if 0%{?fedora} >= 35
Obsoletes: pandoc-citeproc < 0.18, ghc-pandoc-citeproc < 0.18, ghc-pandoc-citeproc-devel < 0.18, ghc-pandoc-citeproc-doc < 0.18, ghc-pandoc-citeproc-prof < 0.18, pandoc-citeproc-common < 0.18
Obsoletes: ghc-base-noprelude < 4.13.0.1, ghc-base-noprelude-devel < 4.13.0.1, ghc-base-noprelude-doc < 4.13.0.1, ghc-base-noprelude-prof < 4.13.0.1
Obsoletes: ghc-HsYAML-aeson < 0.2.0.1, ghc-HsYAML-aeson-devel < 0.2.0.1, ghc-HsYAML-aeson-doc < 0.2.0.1, ghc-HsYAML-aeson-prof < 0.2.0.1
Obsoletes: ghc-chalmers-lava2000 < 1.6.2, ghc-chalmers-lava2000-devel < 1.6.2, ghc-chalmers-lava2000-doc < 1.6.2, ghc-chalmers-lava2000-prof < 1.6.2
Obsoletes: ghc-codec-rpm < 0.2.3, ghc-codec-rpm-devel < 0.2.3, ghc-codec-rpm-doc < 0.2.3, ghc-codec-rpm-prof < 0.2.3
Obsoletes: ghc-cpio-conduit < 0.7.1, ghc-cpio-conduit-devel < 0.7.1, ghc-cpio-conduit-doc < 0.7.1, ghc-cpio-conduit-prof < 0.7.1
Obsoletes: ghc-failure < 0.2.0.4, ghc-failure-devel < 0.2.0.4, ghc-failure-doc < 0.2.0.4, ghc-failure-prof < 0.2.0.4
Obsoletes: ghc-attempt < 0.4.0.2, ghc-attempt-devel < 0.4.0.2, ghc-attempt-doc < 0.4.0.2, ghc-attempt-prof < 0.4.0.2
%endif
%if 0%{?fedora} >= 36
Obsoletes: ghc-regex-applicative-text < 0.1.0.1-16, ghc-regex-applicative-text-devel < 0.1.0.1-16, ghc-regex-applicative-text-doc < 0.1.0.1-16, ghc-regex-applicative-text-prof < 0.1.0.1-16
%endif
%if 0%{?fedora} >= 38
Obsoletes: ghc-bytestring-show < 0.3.5.7, ghc-bytestring-show-devel < 0.3.5.7, ghc-bytestring-show-doc < 0.3.5.7, ghc-bytestring-show-prof < 0.3.5.7
Obsoletes: ghc-djinn-ghc < 0.1, ghc-djinn-ghc-devel < 0.1, ghc-djinn-ghc-doc < 0.1, ghc-djinn-ghc-prof < 0.1
Obsoletes: ghc-ghc-mtl < 1.2.2, ghc-ghc-mtl-devel < 1.2.2, ghc-ghc-mtl-doc < 1.2.2, ghc-ghc-mtl-prof < 1.2.2
Obsoletes: ghc-ghc-syb-utils < 0.3.1, ghc-ghc-syb-utils-devel < 0.3.1, ghc-ghc-syb-utils-doc < 0.3.1, ghc-ghc-syb-utils-prof < 0.3.1
Obsoletes: ghc-cabal-helper < 1.2, ghc-cabal-helper-devel < 1.2, ghc-cabal-helper-doc < 1.2, ghc-cabal-helper-prof < 1.2
Obsoletes: ghc-cabal-plan < 0.8, ghc-cabal-plan-devel < 0.8, ghc-cabal-plan-doc < 0.8, ghc-cabal-plan-prof < 0.8
Obsoletes: ghc-optics-core < 0.4, ghc-optics-core-devel < 0.4, ghc-optics-core-doc < 0.4, ghc-optics-core-prof < 0.4
Obsoletes: ghc-semialign < 1.2, ghc-semialign-devel < 1.2, ghc-semialign-doc < 1.2, ghc-semialign-prof < 1.2
Obsoletes: ghc-topograph < 1.0.0.2, ghc-topograph-devel < 1.0.0.2, ghc-topograph-doc < 1.0.0.2, ghc-topograph-prof < 1.0.0.2
Obsoletes: ghc-indexed-profunctors < 0.1.1-18, ghc-indexed-profunctors-devel < 0.1.1-18, ghc-indexed-profunctors-doc < 0.1.1-18, ghc-indexed-profunctors-prof < 0.1.1-18
Obsoletes: ghc-regex-compat-tdfa < 0.95.1.4-38, ghc-regex-compat-tdfa-devel < 0.95.1.4-38, ghc-regex-compat-tdfa-doc < 0.95.1.4-38, ghc-regex-compat-tdfa-prof < 0.95.1.4-38
%endif
%description -n ghc-obsoletes
Meta package for obsoleting deprecated Haskell packages.
@ -120,32 +135,34 @@ cp %{SOURCE1} %{SOURCE2} .
%build
echo no build stage needed
echo no build stage
%install
install -p -D -m 0644 %{SOURCE0} %{buildroot}/%{macros_dir}/macros.ghc
install -p -D -m 0644 %{SOURCE6} %{buildroot}/%{macros_dir}/macros.ghc-extra
install -p -D -m 0644 %{SOURCE9} %{buildroot}/%{macros_dir}/macros.ghc-os
install -p -D -m 0644 %{SOURCE0} %{buildroot}%{macros_dir}/macros.ghc
install -p -D -m 0644 %{SOURCE6} %{buildroot}%{macros_dir}/macros.ghc-extra
install -p -D -m 0644 %{SOURCE9} %{buildroot}%{macros_dir}/macros.ghc-os
install -p -D -m 0755 %{SOURCE3} %{buildroot}/%{_prefix}/lib/rpm/ghc-deps.sh
%if 0%{?fedora} || 0%{?rhel} >= 7
install -p -D -m 0644 %{SOURCE7} %{buildroot}/%{_prefix}/lib/rpm/fileattrs/ghc.attr
%if 0%{?fedora} < 38
echo -e "\n%%_ghcdynlibdir %%{_libdir}" >> %{buildroot}%{macros_dir}/macros.ghc-os
%endif
install -p -D -m 0644 %{SOURCE10} %{buildroot}/%{_datadir}/%{name}/Setup.hs
install -p -D -m 0755 %{SOURCE3} %{buildroot}%{_prefix}/lib/rpm/ghc-deps.sh
install -p -D -m 0755 %{SOURCE4} %{buildroot}/%{_bindir}/cabal-tweak-dep-ver
install -p -D -m 0755 %{SOURCE5} %{buildroot}/%{_bindir}/cabal-tweak-flag
install -p -D -m 0755 %{SOURCE11} %{buildroot}/%{_bindir}/cabal-tweak-drop-dep
install -p -D -m 0755 %{SOURCE8} %{buildroot}/%{_prefix}/lib/rpm/ghc-pkg-wrapper
%if 0%{?fedora} || 0%{?rhel} >= 7
install -p -D -m 0644 %{SOURCE7} %{buildroot}%{_prefix}/lib/rpm/fileattrs/ghc.attr
%endif
%if 0%{?rhel} && 0%{?rhel} < 7
cat >> %{buildroot}/%{_prefix}/lib/rpm/ghc-deps.sh <<EOF
install -p -D -m 0644 %{SOURCE10} %{buildroot}%{_datadir}/%{name}/Setup.hs
echo \$files | tr [:blank:] '\n' | %{_rpmconfigdir}/rpmdeps --requires
EOF
install -p -D -m 0755 %{SOURCE4} %{buildroot}%{_bindir}/cabal-tweak-dep-ver
install -p -D -m 0755 %{SOURCE5} %{buildroot}%{_bindir}/cabal-tweak-flag
install -p -D -m 0755 %{SOURCE11} %{buildroot}%{_bindir}/cabal-tweak-drop-dep
install -p -D -m 0755 %{SOURCE12} %{buildroot}%{_bindir}/cabal-tweak-remove-upperbound
install -p -D -m 0755 %{SOURCE8} %{buildroot}%{_prefix}/lib/rpm/ghc-pkg-wrapper
%if 0%{?fedora} < 37
mkdir -p %{buildroot}%{_docdir}/ghc/html/libraries
%endif
@ -162,6 +179,7 @@ EOF
%{_bindir}/cabal-tweak-dep-ver
%{_bindir}/cabal-tweak-drop-dep
%{_bindir}/cabal-tweak-flag
%{_bindir}/cabal-tweak-remove-upperbound
%{_datadir}/%{name}/Setup.hs
@ -169,12 +187,304 @@ EOF
%{macros_dir}/macros.ghc-extra
%if 0%{?fedora} >= 22
%if 0%{?fedora} < 37
%files -n ghc-filesystem
%dir %{_docdir}/ghc
# %%{ghc_html_dir}
%dir %{_docdir}/ghc/html
# %%{ghc_html_libraries_dir}
%dir %{_docdir}/ghc/html/libraries
%endif
%if 0%{?fedora} >= 29
%files -n ghc-obsoletes
%endif
%changelog
* Fri Jun 23 2023 David Abdurachmanov <davidlt@rivosinc.com> - 2.5.2-3.1.riscv64
- Clean up
- Set ghc_smp_mflags to -j1 for now (riscv64)
* Fri Apr 14 2023 David Abdurachmanov <davidlt@rivosinc.com> - 2.5.2-3.0.riscv64
- Add modifications for riscv64
* Mon Mar 27 2023 Jens Petersen <petersen@redhat.com> - 2.5.2-3
- f38: also obsolete regex-compat-tdfa
* Sun Mar 26 2023 Jens Petersen <petersen@redhat.com> - 2.5.2-2
- add obsoletes for F38
* Wed Feb 15 2023 Jens Petersen <petersen@redhat.com> - 2.5.2-1
- ghc-dep.sh: check for *_p.a under Hadrian platform subdir as well
- ghc.attr: include Hadrian lib/ subdir in .conf regex
* Sat Feb 11 2023 Jens Petersen <petersen@redhat.com> - 2.5.1-1
- add ghc_merge_filelist
* Sun Jan 29 2023 Jens Petersen <petersen@redhat.com> - 2.5.0-1
- define ghc_smp_mflags to speed up package builds
- ghc_configure and ghc_version now respect ghc_name for ghcX.Y (via rpmquery)
- base ghc_version on compiler subpackage
- ghc_gen_filelists: error if no .so file and not -m metapkg
- use ghc upstream paths for libHS*.so unless using _ghcdynlibdir
- F38: disable _ghcdynlibdir as default
- ghc_bin_build -W to ignore ghc_name version in cabal_configure
- ghc_lib_subpackage: with ghc_obsoletes_name obsolete ghc{ghc_major}-*
- handle hadrian lib/ subdir consistently for packages
- move with_ghc_prof to ghc-srpm-macros
- cabal_configure: non-core shared libs go to ghcliblib
- ghc_delete_rpaths: need to remove local RPATH for subpackaged libs
* Sat Aug 6 2022 Jens Petersen <petersen@redhat.com> - 2.4.4-2
- F36 obsoletes regex-applicative-text
* Tue Jul 26 2022 Jens Petersen <petersen@redhat.com> - 2.4.4-1
- ghc_gen_filelists: check pkg licensedir exists
- in 9.4.1 Hadrian html docdirs are versioned again (breaks older Hadrian)
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Tue Jul 19 2022 Jens Petersen <petersen@redhat.com> - 2.4.3-1
- in F37 ghc-filesystem is now a subpackage of ghc
* Tue Jul 19 2022 Jens Petersen <petersen@redhat.com> - 2.4.2-1
- ghc_bin_build,ghc_lib_build: define ghc_debuginfo to really enable debuginfo
* Sun Jul 17 2022 Jens Petersen <petersen@redhat.com> - 2.4.1-1
- ghc_bin_build,ghc_lib_build: use ghc_debuginfo to enable debuginfo
* Fri Jun 10 2022 Jens Petersen <petersen@redhat.com> - 2.4.0-1
- change ghc-deps.sh, splitting buildroot path from ghclibdir
so that the ghc version can be used more precisely
* Wed Jun 8 2022 Jens Petersen <petersen@redhat.com> - 2.3.16-1
- define ghc_prefix (used for ghcX.Y packaging)
- add _ghc_doc_dir
* Wed Apr 27 2022 Jens Petersen <petersen@redhat.com> - 2.3.15-2
- drop ghc-compiler requires to allow using ghcX.Y-compiler-default
* Wed Apr 27 2022 Tim Landscheidt <tim@tim-landscheidt.de>
- Update license from https://www.gnu.org/licenses/
- Use https for subpackage URLs
* Thu Mar 10 2022 Jens Petersen <petersen@redhat.com> - 2.3.15-1
- ghc_set_gcc_flags: disable brp-strip-lto to avoid strip timestamp warnings
* Sat Feb 12 2022 Jens Petersen <petersen@redhat.com> - 2.3.14-1
- ghc_set_gcc_flags: also sed CFLAGS when preset in F36
because of https://fedoraproject.org/wiki/Changes/SetBuildFlagsBuildCheck
* Tue Feb 8 2022 Jens Petersen <petersen@redhat.com> - 2.3.13-1
- ghc_set_gcc_flags: disable _lto_cflags for all archs
to address missing symbol linking errors across packages
(particularly those using FFI)
* Fri Jan 21 2022 Jens Petersen <petersen@redhat.com> - 2.3.12-1
- disable package notes which broke all Haskell package builds (#2043092)
https://fedoraproject.org/wiki/Changes/Package_information_on_ELF_objects
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.11-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Wed Jan 5 2022 Jens Petersen <petersen@redhat.com> - 2.3.11-1
- ghc-deps.sh: fix the rts deps erasure cleanly
* Wed Dec 29 2021 Jens Petersen <petersen@redhat.com> - 2.3.10-1
- ghc_html_dir: use ghc_name for ghcX.Y docs
* Mon Dec 20 2021 Jens Petersen <petersen@redhat.com> - 2.3.9-1
- ghc-deps.sh: only exclude unversioned rts.conf
* Mon Dec 20 2021 Jens Petersen <petersen@redhat.com> - 2.3.8-1
- _arch fits Cabal better for ghclibplatform
* Mon Dec 20 2021 Jens Petersen <petersen@redhat.com> - 2.3.7-1
- ghclibplatform: Cabal uses i386 for i686
* Mon Dec 20 2021 Jens Petersen <petersen@redhat.com> - 2.3.6-1
- fix missing Hadrian ghc dependency generation
* Sun Dec 19 2021 Jens Petersen <petersen@redhat.com> - 2.3.5-1
- Hadrian haddock dirs are not versioned
* Sun Dec 19 2021 Jens Petersen <petersen@redhat.com> - 2.3.4-1
- move Cabal_arch into ghclibplatform macro
* Sun Dec 19 2021 Jens Petersen <petersen@redhat.com> - 2.3.3-1
- fixup ghc_arch renaming it to Cabal_arch
* Sat Dec 18 2021 Jens Petersen <petersen@redhat.com> - 2.3.2-1
- define ghcliblib and ghclibplatform globally
- fix ghc-deps.sh dependency generation for Hadrian
- Cabal uses ppc64 in paths for ppc64le
* Fri Dec 17 2021 Jens Petersen <petersen@redhat.com> - 2.3.1-1
- ghc_gen_filelists: support ghc Hadrian install
* Wed Dec 8 2021 Jens Petersen <petersen@redhat.com> - 2.3.0-1
- support fileattrs dependency generation for ghc9.2
- drop dependency generation for rhel6
* Thu Sep 9 2021 Jens Petersen <petersen@redhat.com> - 2.2.4-1
- cabal_configure: add -fhide-source-paths to ghc-options
(works for ghc-8.2 and above)
* Mon Aug 23 2021 Jens Petersen <petersen@redhat.com> - 2.2.3-6
- F35 obsoletes for attempt
* Mon Aug 23 2021 Jens Petersen <petersen@redhat.com> - 2.2.3-5
- add F35 obsoletes for base-noprelude and failure
* Tue Aug 17 2021 Jens Petersen <petersen@redhat.com> - 2.2.3-4
- F35 obsoletes for pandoc-citeproc, HsYAML-aeson, chalmers-lava2000,
cpio-conduit, and codec-rpm
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Wed Jul 14 2021 Jens Petersen <petersen@redhat.com> - 2.2.3-2
- drop obsoletes for haskell-platform GL graphics libraries
which have been packaged and cabal-plan
* Sat Jul 10 2021 Jens Petersen <petersen@redhat.com> - 2.2.3-1
- fix ghc_fix_doc_perms only to touch files not dirs
* Thu Jun 17 2021 Jens Petersen <petersen@redhat.com> - 2.2.2-2
- haddock has not used hscolour for a long time
* Tue Jun 8 2021 Jens Petersen <petersen@redhat.com> - 2.2.2-1
- restore ghc_fix_rpath for now for backward compatibility
and drop it from ghc_libs_install
* Tue Jun 8 2021 Jens Petersen <petersen@redhat.com> - 2.2.1-1
- ghc-rpm-macros needs to require chrpath now instead of ghc-rpm-macros-extra
* Mon Jun 7 2021 Jens Petersen <petersen@redhat.com> - 2.2.0-1
- ghc_delete_rpaths macro replaces ghc_fix_rpath(), needed for
https://fedoraproject.org/wiki/Changes/Broken_RPATH_will_fail_rpmbuild
* Wed Mar 24 2021 Jens Petersen <petersen@redhat.com> - 2.1.0-1
- add ghc-filesystem subpackage to own /usr/share/doc/ghc/{,html/{,libraries/}}
(#1926757)
- drop obsoletes from before f29
- update url
- fix ghc_fix_doc_perms grep regexp quoting
* Sat Jan 30 2021 Jens Petersen <petersen@redhat.com> - 2.0.15-1
- add ghc_fix_doc_perms and use it in ghc_bin_build and ghc_lib_build
- ghc_lib_subpackage: define ghc_subpackages_list
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.14-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Sat Aug 29 2020 Jens Petersen <petersen@redhat.com> - 2.0.14-1
- ghc-deps.sh: be careful when filtering out rts (#1873687)
* Wed Aug 26 2020 Jens Petersen <petersen@redhat.com> - 2.0.13-2
- obsolete ghc-iwlib (xmobar)
* Tue Aug 4 2020 Jens Petersen <petersen@redhat.com> - 2.0.13-1
- disable LTO on (unregisterised) s390x (#1863601)
to prevent linker warning flood for prof libraries
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.12-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Jul 22 2020 Jens Petersen <petersen@redhat.com> - 2.0.12-2
- obsoletes for ghc-EdisonAPI, ghc-EdisonCore, ghc-easytest
* Tue Jul 21 2020 Jens Petersen <petersen@redhat.com> - 2.0.12-1
- make doc packages noarch for subpackaging
- obsoletes for ghc-gtksourceview2
* Wed Jun 24 2020 Jens Petersen <petersen@redhat.com> - 2.0.11-1
- handle meta subpackages:
- ghc_lib_subpackage -m
- only add dynlib to file-list if it exists
* Thu Jun 18 2020 Jens Petersen <petersen@redhat.com> - 2.0.10-1
- cabal-tweak script now output errors to stderr
* Thu Jun 4 2020 Jens Petersen <petersen@redhat.com> - 2.0.9-1
- doc subpackages should own /usr/share/doc/ghc/, /usr/share/doc/ghc/html/,
and /usr/share/doc/ghc/html/libraries/ (#1795526)
* Sun May 10 2020 Jens Petersen <petersen@redhat.com> - 2.0.8-1
- ghc-deps.sh: ignore internal libraries (#1822444)
* Fri May 8 2020 Jens Petersen <petersen@redhat.com> - 2.0.7-2
- obsolete ghc-here (dropped from hledger)
* Mon Apr 27 2020 Jens Petersen <petersen@redhat.com> - 2.0.7-1
- use -package Cabal to build Setup
* Tue Mar 3 2020 Jens Petersen <petersen@redhat.com> - 2.0.6-2
- obsolete ghc-cabal-helper, ghc-cabal-plan, ghc-derive
- unobsolete ghc-hgettext
* Mon Feb 10 2020 Jens Petersen <petersen@redhat.com> - 2.0.6-1
- ghc-deps.sh: fix prof deps for subpackages
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.5-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Mon Jan 27 2020 Jens Petersen <petersen@redhat.com> - 2.0.5-4
- obsolete ghc-hgettext
* Fri Sep 27 2019 Jens Petersen <petersen@redhat.com> - 2.0.5-3
- ghc_devel_prof macro not available early enough in koji
* Fri Sep 27 2019 Jens Petersen <petersen@redhat.com> - 2.0.5-2
- define ghc_devel_prof
* Tue Aug 27 2019 Jens Petersen <petersen@redhat.com> - 2.0.5-1
- ghc-deps.sh: fix generation of prof deps
* Tue Aug 13 2019 Jens Petersen <petersen@redhat.com> - 2.0.4-1
- add cabal-tweak-remove-upperbound script
* Sat Aug 10 2019 Jens Petersen <petersen@redhat.com> - 2.0.3-1
- only depend on ghc-prof(pkgid) if libHSpkgid_p.a exists
* Tue Aug 6 2019 Jens Petersen <petersen@redhat.com> - 2.0.2-1
- check if doc haddock dir exists
* Mon Aug 5 2019 Jens Petersen <petersen@redhat.com> - 2.0.1-1
- ghc_lib_subpackage: provide static with isa suffix
* Wed Jul 31 2019 Jens Petersen <petersen@redhat.com> - 2.0-1
- bring back doc and prof subpackages
- ghc_lib_subpackage: provide static
* Fri Jul 26 2019 Jens Petersen <petersen@redhat.com> - 1.10.0-1
- drop devel subpackage scriplets (replaced by ghc-compiler triggers)
- remove deprecated ghc_fix_dynamic_rpath
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.9-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Sat May 18 2019 Jens Petersen <petersen@redhat.com> - 1.9.9-3
- ghc-conduit-combinators base package obsoleted in f30
* Fri May 10 2019 Jens Petersen <petersen@redhat.com> - 1.9.9-2
- obsoletes for f30 deprecated packages
(including haskell-platform subpackaged libraries and enumerator)
* Mon Apr 15 2019 Jens Petersen <petersen@redhat.com> - 1.9.9-1
- cabal_configure: re-enable stripping by Cabal
(remove --disable-executable-stripping --disable-library-stripping)
- obsolete hoopl
* Tue Apr 9 2019 Jens Petersen <petersen@redhat.com> - 1.9.8-1
- re-instate ghc_without_shared since useful for standalone builds
* Sun Feb 24 2019 Jens Petersen <petersen@redhat.com> - 1.9.7-1
- ghc_fix_rpath was a noop when ghc_without_dynamic
* Fri Feb 1 2019 Jens Petersen <petersen@redhat.com> - 1.9.6-1
- disable debuginfo by undefining _enable_debug_packages
- leave stripping to generic rpm macros
@ -1183,4 +1493,3 @@ EOF
* Mon May 4 2009 Yaakov M. Nemoy <ghc@hexago.nl> - 0.1-1
- creation of package

View File

@ -1,3 +1,3 @@
%__ghc_provides %{_rpmconfigdir}/ghc-deps.sh --provides %{buildroot}%{ghclibdir}
%__ghc_requires %{_rpmconfigdir}/ghc-deps.sh --requires %{buildroot}%{ghclibdir}
%__ghc_path ^%{ghclibdir}/package.conf.d/.*\.conf$
%__ghc_provides %{_rpmconfigdir}/ghc-deps.sh --provides %{buildroot} %{ghclibdir} %{?ghc_name:ghc-%{ghc_version}}
%__ghc_requires %{_rpmconfigdir}/ghc-deps.sh --requires %{buildroot} %{ghclibdir} %{?ghc_name:ghc-%{ghc_version}}
%__ghc_path ^(%{ghcliblib}/(lib/)?package.conf.d/.*\.conf|%{ghclibplatform}/.*/libHS.*\_p.a)$

View File

@ -2,22 +2,88 @@
# see https://fedoraproject.org/wiki/Packaging:Haskell for more details
# "cabal"
%cabal [ -x Setup ] || ghc --make %{!?ghc_user_conf:-no-user-package-db} %{!?ghc_static_setup:-dynamic} Setup\
%cabal [ -x Setup ] || ghc --make -package Cabal -no-user-package-db %{!?ghc_static_setup:-dynamic} Setup\
LANG=C.utf8\
./Setup
# compiler version
%ghc_version %{!?ghc_version_override:%(ghc --numeric-version)}%{?ghc_version_override}
%ghc_version %{?ghc_version_override}%{!?ghc_version_override:%(rpm -q --qf %%{version} %{?ghc_name}%{!?ghc_name:ghc}-compiler)}
# ghc_bin_build: -W: use default ghc (ie ignore ghc_name)
%ghc_bin_build(W)\
%ghc_fix_doc_perms\
%{?!ghc_debuginfo:%undefine _enable_debug_packages}\
%cabal_configure\
%cabal build %{?ghc_smp_mflags} %{?cabal_build_options}
# ghc_lib_build_without_haddock [name] [version]
%ghc_lib_build_without_haddock()\
%ghc_fix_doc_perms\
%{?!ghc_debuginfo:%undefine _enable_debug_packages}\
%if 0%{?rhel} && 0%{?rhel} < 8\
licensedirversion=%{?2:-%2}\
%endif\
%cabal_configure %{?with_ghc_prof:-p} %{!?ghc_without_shared:--enable-shared} %{?ghc_without_shared:--disable-shared} %{?pkg_name:--htmldir=%{ghclibdocdir}/%{pkg_name}-%{version}} %{?1:--docdir=%{_ghclicensedir}/ghc-%1${licensedirversion} --htmldir=%{ghclibdocdir}/%1-%2} %{?ghc_subpackaging:--user}%{!?ghc_subpackaging:--global} %{?ghc_with_lib_for_ghci:--enable-library-for-ghci}\
%cabal build %{?ghc_smp_mflags} %{?cabal_build_options}\
%{nil}
# ghc_lib_build [name] [version]
%ghc_lib_build()\
%ghc_lib_build_without_haddock %{?1} %{?2}\
%if %{with haddock}\
%define pkgname %{?1}%{!?1:%{pkg_name}}\
%define pkgver %{?2}%{!?2:%{version}}\
if [ -n dist/build/libHS%{pkgname}-%{pkgver}*.so ]; then\
%cabal haddock --html --hyperlink-source --hoogle %{?cabal_haddock_options}\
fi\
%endif\
%{nil}
# install bin package
%ghc_bin_install()\
%cabal_install\
%ghc_delete_rpaths\
%{nil}
# ghc_lib_install [name] [version]
%ghc_lib_install(m)\
%cabal_install\
%cabal_pkg_conf %{?1} %{?2}\
%ghc_gen_filelists %{-m} %{?1} %{?2}\
%ghc_delete_rpaths\
%{nil}
# create and install package.conf file
# cabal_pkg_conf [name] [version]
%cabal_pkg_conf()\
%define pkgname %{?1}%{!?1:%{pkg_name}}\
%define pkgver %{?2}%{!?2:%{version}}\
%define pkgnamever %{pkgname}-%{pkgver}\
%cabal register --gen-pkg-config\
if [ -d "%{ghclibdir}/lib" ]; then\
subsubdir=/lib\
fi\
if [ -d %{pkgnamever}.conf ]; then\
for i in $(ls "%{pkgnamever}.conf/"); do\
sub=$(echo $i | sed -e "s/^[0-9]\\+-//")\
install -D --mode=0644 %{pkgnamever}.conf/${i} %{buildroot}%{ghcliblib}${subsubdir}/package.conf.d/${sub}.conf\
done\
else\
install -D --mode=0644 %{pkgnamever}.conf %{buildroot}%{ghcliblib}${subsubdir}/package.conf.d/%{pkgnamever}.conf\
fi\
%{nil}
%ghc_set_gcc_flags\
%global _lto_cflags %{nil}\
%global __brp_strip_lto %{nil}\
# -Wunused-label is extremely noisy\
%ifarch s390x\
CFLAGS="${CFLAGS:-$(echo %optflags | sed -e 's/-Wall //' -e 's/-Werror=format-security //')}"\
%ifarch s390x riscv64\
CFLAGS="$(echo ${CFLAGS:-%optflags} | sed -e 's/-Wall //' -e 's/-Werror=format-security //')"\
%else\
CFLAGS="${CFLAGS:-%optflags}"\
%endif\
export CFLAGS\
%undefine _package_note_flags\
%global _hardened_ldflags %{nil}\
export LDFLAGS="${LDFLAGS:-%{?__global_ldflags}}"\
%{nil}
@ -28,8 +94,11 @@ export LDFLAGS="${LDFLAGS:-%{?__global_ldflags}}"\
if ! [ -f Setup.hs -o -f Setup.lhs ]; then\
cp %{_datadir}/ghc-rpm-macros/Setup.hs .\
fi\
if [ -d "%{ghclibdir}/lib" ]; then\
subsubdir=/lib\
fi\
%cabal --version\
%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_ghcdocdir} --libsubdir='$compiler/$pkgid' --datasubdir='$pkgid' --libexecsubdir='$pkgid' --ghc %{?_ghcdynlibdir:--dynlibdir=%{_ghcdynlibdir}} %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?with_tests:--enable-tests} %{?ghc_subpackaging:--user}%{!?ghc_subpackaging:--global} --ghc-options="${CFLAGS:+$(echo ' '$CFLAGS | sed -e 's/ / -optc/g')} ${LDFLAGS:+$(echo ' '$LDFLAGS | sed -e 's/ / -optl/g')}" --disable-executable-stripping --disable-library-stripping %{?cabal_configure_options} $cabal_configure_extra_options
%cabal configure %{!-W:%{?ghc_name:--with-compiler=%{_bindir}/ghc-%{ghc_version}}} --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_ghcdocdir} --libsubdir='$compiler'${subsubdir}/'$pkgid' --datasubdir='$pkgid' --libexecsubdir='$pkgid' --ghc --dynlibdir=%{?_ghcdynlibdir}%{?!_ghcdynlibdir:%{_libdir}/ghc-%{ghc_version}${subsubdir}} %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?with_tests:--enable-tests} %{?ghc_subpackaging:--user}%{!?ghc_subpackaging:--global} --ghc-options="${CFLAGS:+$(echo ' '$CFLAGS | sed -e 's/ / -optc/g')} ${LDFLAGS:+$(echo ' '$LDFLAGS | sed -e 's/ / -optl/g')} -fhide-source-paths" %{?cabal_configure_options} $cabal_configure_extra_options
# install
%cabal_install %cabal copy --destdir=%{buildroot} %{?cabal_install_options}
@ -43,8 +112,14 @@ fi\
# no _pkgdocdir in EPEL <= 7
%ghc_pkgdocdir %{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}}
# library package prefix
%ghc_prefix %{?ghc_name}%{!?ghc_name:ghc}
# top ghcdocdir
%_ghc_doc_dir %{_docdir}/%{ghc_prefix}
# root dir for ghc docs (used by ghc.spec)
%ghc_html_dir %{_docdir}/ghc/html
%ghc_html_dir %{_ghc_doc_dir}/html
# deprecates
%ghcdocbasedir %ghc_html_dir
@ -61,117 +136,131 @@ fi\
# top library dir
%ghclibdir %{_libdir}/ghc-%{ghc_version}
%ghcliblib %{ghclibdir}%{?with_hadrian:/lib}
%_ghclicensedir %{?_defaultlicensedir}%{!?_defaultlicensedir:%_docdir}
# ghc_gen_filelists [name] [version]
%ghc_gen_filelists()\
# deprecated
%ghclibplatform %{ghcliblib}%{?with_hadrian:/%{ghcplatform}}
# Cabal has specific arch names
%ghcplatform %(echo %{_arch} | sed -e "s/ppc64le/ppc64/")-linux-ghc-%{ghc_version}
# ghc_gen_filelists [-m] [name] [version]
%ghc_gen_filelists(m)\
%define pkgname %{?1}%{!?1:%{pkg_name}}\
%define pkgver %{?2}%{!?2:%{version}}\
%define pkgnamever %{pkgname}-%{pkgver}\
%define basepkg %{?ghc_name}%{!?ghc_name:ghc}-%{pkgname}\
%define docdir %{ghclibdocdir}/%{pkgnamever}\
if [ -z "$(ls %{buildroot}%{ghclibdir}/package.conf.d/)" ]; then\
echo "%{buildroot}%{ghclibdir}/package.conf.d/*.conf not found"\
%if %{without hadrian}\
if [ -d "%{ghclibdir}/lib" ]; then\
subsubdir=/lib\
fi\
%endif\
if [ -z "$(ls %{buildroot}%{ghcliblib}${subsubdir}/package.conf.d/%{pkgnamever}*.conf)" ]; then\
echo "%{buildroot}%{ghcliblib}${subsubdir}/package.conf.d/%{pkgnamever}*.conf not found"\
exit 1\
fi\
rm -f %{basepkg}.files %{basepkg}-devel.files\
touch %{basepkg}.files %{basepkg}-devel.files\
ls %{buildroot}%{ghclibdir}/package.conf.d/%{pkgnamever}*.conf >> %{basepkg}-devel.files\
pkgdir="%{ghclibdir}/%{pkgnamever}"\
if [ -d "%{buildroot}${pkgdir}" ]; then\
%if %{defined _ghcdynlibdir}\
echo "${pkgdir}" >> %{basepkg}-devel.files\
%else\
echo "%%dir ${pkgdir}" >> %{basepkg}.files\
find %{buildroot}${pkgdir} -mindepth 1 -type d | sed "s/^/%dir /" >> %{basepkg}-devel.files\
find %{buildroot}${pkgdir} ! \\( -type d -o -name "libHS*.so" \\) >> %{basepkg}-devel.files\
%endif\
echo "%%attr(755,root,root) %{?_ghcdynlibdir}%{!?_ghcdynlibdir:${pkgdir}}/libHS%{pkgnamever}-*ghc%{ghc_version}.so" >> %{basepkg}.files\
fi\
if [ -d "%{buildroot}%{docdir}" ]; then\
echo "%{docdir}" >> %{basepkg}-devel.files\
fi\
%define basepkg %{ghc_prefix}-%{pkgname}\
rm -f %{basepkg}.files %{basepkg}-doc.files\
touch %{basepkg}.files %{basepkg}-doc.files\
%if 0%{?1:1}\
for i in $(ls %{buildroot}%{_ghclicensedir}/%{!?1:%{name}}%{?1:%{basepkg}}); do\
echo "%%license %{?1:%{pkgnamever}/}$i" >> %{basepkg}.files\
if [ -d "%{buildroot}%{_ghclicensedir}/%{basepkg}" ]; then\
for i in $(ls %{buildroot}%{_ghclicensedir}/%{basepkg}); do\
echo "%%license %{pkgnamever}/$i" >> %{basepkg}.files\
done\
fi\
%endif\
for i in %{basepkg}.files %{basepkg}-devel.files; do\
for i in %{buildroot}%{?_ghcdynlibdir}%{!?_ghcdynlibdir:%{ghcliblib}${subsubdir}%{?with_hadrian:/%{ghcplatform}}%{!?with_hadrian:%{?base_ver:/%{pkgnamever}}}}/libHS%{pkgnamever}-*ghc%{ghc_version}.so; do\
if [ -x "$i" ]; then\
echo $i >> %{basepkg}.files\
else\
echo $i: not found\
%if 0%{!-m:1}\
exit 1\
%endif\
fi\
done\
pkgdir="%{ghcliblib}${subsubdir}%{?with_hadrian:/%{ghcplatform}}/%{pkgnamever}"\
if [ -d "%{buildroot}${pkgdir}" ]; then\
find %{buildroot}${pkgdir} -type d -fprintf %{basepkg}-devel.files '%%%%dir %p\\n' -o \\( -name '*.p_hi' -o -name 'libHS*_p.a' \\) -fprint %{basepkg}-prof.files -o -fprint %{basepkg}-devel.files\
else\
rm -f %{basepkg}-devel.files %{basepkg}-prof.files\
touch %{basepkg}-devel.files %{basepkg}-prof.files\
fi\
ls %{buildroot}%{ghcliblib}${subsubdir}/package.conf.d/%{pkgnamever}*.conf >> %{basepkg}-devel.files\
%if %{with haddock}\
haddock_dir=%{ghc_html_libraries_dir}/%{pkgnamever}\
if [ -d %{buildroot}$haddock_dir ]; then\
echo $haddock_dir >> %{basepkg}-doc.files\
%if %{with hadrian}\
# for < 9.4.1-rc1\
else\
haddock_dir=%{ghc_html_libraries_dir}/%{pkgname}\
if [ -d %{buildroot}$haddock_dir ]; then\
echo $haddock_dir >> %{basepkg}-doc.files\
fi\
%endif\
fi\
%endif\
for i in %{basepkg}.files %{basepkg}-devel.files %{basepkg}-doc.files %{basepkg}-prof.files; do\
if [ -f "$i" ]; then\
sed -i -e "s!%{buildroot}!!g" $i\
fi\
done\
%{nil}
# create and install package.conf file
# cabal_pkg_conf [name] [version]
%cabal_pkg_conf()\
%define pkgname %{?1}%{!?1:%{pkg_name}}\
%define pkgver %{?2}%{!?2:%{version}}\
%define pkgnamever %{pkgname}-%{pkgver}\
%cabal register --gen-pkg-config\
if [ -d %{pkgnamever}.conf ]; then\
for i in $(ls "%{pkgnamever}.conf/"); do\
sub=$(echo $i | sed -e "s/^[0-9]\\+-//")\
install -D --mode=0644 %{pkgnamever}.conf/${i} %{buildroot}%{ghclibdir}/package.conf.d/${sub}.conf\
# from ghc.spec merge_filelist
%ghc_merge_filelist()\
cat %{name}-%1.files >> %{name}-%2.files\
cat %{name}-%1-devel.files >> %{name}-%2-devel.files\
%if %{with haddock}\
cat %{name}-%1-doc.files >> %{name}-%2-doc.files\
%endif\
%if %{with ghc_prof}\
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}
# workaround Cabal bug causing executable extra-source-files
%ghc_fix_doc_perms\
for f in $(ls | grep -i -e '^\\(ANNOUNCE\\|AUTHORS\\|CHANGELOG\\|CHANGES\\|CONTRIBUTORS\\|README\\|TODO\\)'); do\
if [ -f $f -a -x $f ]; then chmod a-x $f; fi\
done\
else\
install -D --mode=0644 %{pkgnamever}.conf %{buildroot}%{ghclibdir}/package.conf.d/%{pkgnamever}.conf\
fi\
%{nil}
# ghc_bin_build
%ghc_bin_build\
%undefine _enable_debug_packages\
%cabal_configure\
%cabal build %{?ghc_smp_mflags} %{?cabal_build_options}
# ghc_lib_build_without_haddock [name] [version]
%ghc_lib_build_without_haddock()\
%undefine _enable_debug_packages\
%if 0%{?rhel} && 0%{?rhel} < 8\
licensedirversion=%{?2:-%2}\
%endif\
%cabal_configure %{!?without_prof:-p} --enable-shared %{?pkg_name:--htmldir=%{ghclibdocdir}/%{pkg_name}-%{version}} %{?1:--docdir=%{_ghclicensedir}/ghc-%1${licensedirversion} --htmldir=%{ghclibdocdir}/%1-%2} %{?ghc_subpackaging:--user}%{!?ghc_subpackaging:--global} %{?ghc_with_lib_for_ghci:--enable-library-for-ghci}\
%cabal build %{?ghc_smp_mflags} %{?cabal_build_options}\
%{nil}
# ghc_lib_build [name] [version]
%ghc_lib_build()\
%ghc_lib_build_without_haddock %{?1} %{?2}\
%if %{undefined without_haddock}\
%define pkgname %{?1}%{!?1:%{pkg_name}}\
%define pkgver %{?2}%{!?2:%{version}}\
if [ -n dist/build/libHS%{pkgname}-%{pkgver}*.so ]; then\
%cabal haddock --html --hyperlink-source --hoogle %{?cabal_haddock_options}\
fi\
%endif\
%{nil}
# install bin package
%ghc_bin_install()\
%{!?_fileattrsdir:%global _use_internal_dependency_generator 0}\
%{!?_fileattrsdir:%global __find_requires %{_rpmconfigdir}/ghc-deps.sh %{buildroot}%{ghclibdir}}\
%cabal_install\
%{?ghc_subpackaging:%ghc_fix_rpath %{subpkgs}}\
%{nil}
# ghc_lib_install [name] [version]
%ghc_lib_install()\
%{!?_fileattrsdir:%global _use_internal_dependency_generator 0}\
%{!?_fileattrsdir:%global __find_provides %{_rpmconfigdir}/rpmdeps --provides}\
%{!?_fileattrsdir:%global __find_requires %{_rpmconfigdir}/ghc-deps.sh %{buildroot}%{ghclibdir}}\
%cabal_install\
%cabal_pkg_conf %{?1} %{?2}\
%ghc_gen_filelists %{?1} %{?2}\
%{?ghc_subpackaging:%ghc_fix_rpath %{subpkgs}}\
%{nil}
# ghc_fix_rpath lib-ver ...
%ghc_fix_rpath()\
%if %{undefined ghc_without_dynamic}\
# ghc_delete_rpaths
%ghc_delete_rpaths\
%if %{undefined disable_ghc_delete_rpaths}\
echo "running ghc_delete_rpaths:"\
if ! type chrpath > /dev/null; then exit 1; fi\
for i in $(find %{buildroot} -type f -exec sh -c "file {} | grep -q 'dynamically linked'" \\; -print); do\
for i in $(find %{buildroot} -type f -executable -exec sh -c "file {} | grep -q 'dynamically linked'" \\; -print); do\
if [ -x "$i" ]; then\
%if %{defined _ghcdynlibdir}\
chrpath -d $i\
%else\
rpath=$(chrpath $i | sed -e "s@^$i: R.*PATH=@@")\
case "$rpath" in\
*$PWD/*) chrpath -r "%{ghclibdir}/lib:%{ghclibdir}/lib/%{ghcplatform}" $i ;;\
*) ;;\
esac\
%endif\
else\
echo "%%ghc_delete_rpath: no $i executable"\
exit 1\
fi\
done\
%endif
# deprecated by ghc_delete_rpaths in F35
%ghc_fix_rpath()\
%if %{undefined disable_ghc_fix_rpath}\
if ! type chrpath > /dev/null; then exit 1; fi\
echo "ghc_fix_rpath %*"\
for i in $(find %{buildroot} -type f -executable -exec sh -c "file {} | grep -q 'dynamically linked'" \\; -print); do\
for lib in %*; do\
if [ -x "$i" ]; then\
rpath=$(chrpath $i | sed -e "s@^$i: R.*PATH=@@")\
@ -179,16 +268,23 @@ for lib in %*; do\
*$PWD/$lib/dist/build*)\
case %{ghc_version} in\
7.10.*)\
pkgid=$(cd %{buildroot}%{ghclibdir}/package.conf.d; ls ${lib}* | sed -e "s/.conf$//")\
syspath=$(%{_rpmconfigdir}/ghc-pkg-wrapper %{buildroot}%{ghclibdir} --global --package-db=%{buildroot}%{ghclibdir}/package.conf.d field $pkgid library-dirs) ;;\
pkgid=$(cd %{buildroot}%{ghcliblib}/package.conf.d; ls ${lib}* | sed -e "s/.conf$//")\
syspath=$(%{_rpmconfigdir}/ghc-pkg-wrapper %{buildroot}%{ghcliblib} --global --package-db=%{buildroot}%{ghcliblib}/package.conf.d field $pkgid library-dirs) ;;\
8.0)\
pkgid=$(cd %{buildroot}%{ghclibdir}; echo ${lib}*)\
syspath=$(%{_rpmconfigdir}/ghc-pkg-wrapper %{buildroot}%{ghclibdir} --global --package-db=%{buildroot}%{ghclibdir}/package.conf.d field $lib library-dirs | grep $pkgid) ;;\
syspath=$(%{_rpmconfigdir}/ghc-pkg-wrapper %{buildroot}%{ghcliblib} --global --package-db=%{buildroot}%{ghcliblib}/package.conf.d field $lib library-dirs | grep $pkgid) ;;\
*)\
syspath="" ;;\
esac\
newrpath=$(echo $rpath | sed -e "s@$PWD/$lib/dist/build@${syspath}@g" -e "s/::/:/" -e "s/^://" -e "s/:$//")\
chrpath -r $newrpath $i\
if [ "$newrpath" = "%{_libdir}" ]; then\
chrpath -d $i\
else\
chrpath -r $newrpath $i\
fi\
;;\
%{_libdir})\
chrpath -d $i\
;;\
esac\
else\
@ -197,45 +293,11 @@ for lib in %*; do\
fi\
done\
done\
%endif\
%{nil}
# Deprecated by ghc_fix_rpath:
# ghc_fix_dynamic_rpath prog ...
%ghc_fix_dynamic_rpath()\
%if %{undefined ghc_without_dynamic}\
if ! type chrpath > /dev/null; then exit 1; fi\
pdir=$(pwd)\
for i in %*; do\
case $i in\
/*) prog=%{buildroot}$i ;;\
*) prog=%{buildroot}%{_bindir}/$i ;;\
esac\
if [ -x "$prog" ]; then\
rpath=$(chrpath $prog | sed -e "s@^$prog: R.*PATH=@@")\
case $rpath in\
*$pdir*)\
newrpath=$(echo $rpath | sed -e "s@$pdir/dist/build@%{ghclibdir}/%{pkg_name}-%{version}@g")\
chrpath -r $newrpath $prog\
;;\
esac\
else\
echo "%%ghc_fix_dynamic_rpath: no such file $prog"\
exit 1\
fi\
done\
%endif\
%{nil}
%endif
%ghc_pkg_recache %{_bindir}/ghc-pkg-%{ghc_version} recache --no-user-package-db || :
# deprecated
%ghc_bootstrap\
%global without_prof 1\
%global without_haddock 1\
%global without_manual 1
# skip prof libs and documentation
%ghc_quick_build\
%global without_prof 1\
%global without_haddock 1
%undefine with_ghc_prof\
%undefine with_haddock

View File

@ -1,8 +1,8 @@
# RPM Macros for packaging Haskell packages with multiple libs -*-rpm-spec-*-
# ghc_lib_subpackage [-c cdepslist] [-d] [-l licensetag] [-x] [name-version]
# ghc_lib_subpackage [-c cdepslist] [-d] [-l licensetag] [-m] [-x] [name-version]
# for backward compat also support: ghc_lib_subpackage name version
%ghc_lib_subpackage(c:dl:x)\
%ghc_lib_subpackage(c:dl:mx)\
%define pkgname %{?2:%{1}}%{!?2:%{lua:\
local pv = rpm.expand("%1")\
local _, _, name = string.find(pv, "^([%a%d-]+)-")\
@ -12,56 +12,82 @@ print(name)\
local pv = rpm.expand("%1")\
print(string.sub(pv, string.find(pv, "[%d.]+$")))\
}}\
%global ghc_subpackages_list %{?ghc_subpackages_list} %{pkgname}-%{pkgver}\
%{!-x:%{?1:%global ghc_packages_list %{?ghc_packages_list} %{pkgname}-%{pkgver}}}\
%define ghc_prefix %{?ghc_name}%{!?ghc_name:ghc}\
%define basepkg %{ghc_prefix}-%{pkgname}\
%if 0%{!-m:1}\
%package -n %{basepkg}\
Summary: Haskell %{pkgname} library\
%if 0%{?rhel} && 0%{?rhel} < 6\
Group: System/Libraries\
%endif\
%{?1:Version: %{pkgver}}\
%{-l:License: %{-l*}}\
Url: http://hackage.haskell.org/package/%{pkgname}\
Url: https://hackage.haskell.org/package/%{pkgname}\
%{?ghc_pkg_obsoletes:Obsoletes: %(echo "%{ghc_pkg_obsoletes}" | sed -e "s/\\(%{ghc_prefix}-[^, ]*\\)-devel/\\1/g")}\
%{?ghc_obsoletes_name:Obsoletes: %{ghc_obsoletes_name}-%{pkgname} < %{pkgver}-%{release}}\
\
%description -n %{basepkg}\
This package provides the Haskell %{pkgname} library.\
\
%endif\
%package -n %{basepkg}-devel\
Summary: Haskell %{pkgname} library development files\
%if 0%{?rhel} && 0%{?rhel} < 6\
Group: Development/Languages/Other\
%endif\
%{?1:Version: %{pkgver}}\
%{-l:License: %{-l*}}\
Requires(post): %{ghc_prefix}-compiler = %{ghc_version}\
Requires(postun): %{ghc_prefix}-compiler = %{ghc_version}\
Provides: %{basepkg}-static = %{pkgver}-%{release}\
Provides: %{basepkg}-static%{?_isa} = %{pkgver}-%{release}\
Requires: %{ghc_prefix}-compiler = %{ghc_version}%{?ghc_version_override:-%{release}}\
%if 0%{!-m:1}\
Requires: %{ghc_prefix}-%{pkgname}%{?_isa} = %{pkgver}-%{release}\
%endif\
%{?ghc_pkg_c_deps:Requires: %{ghc_pkg_c_deps}}\
%{-c:Requires: %{-c*}}\
%{?ghc_obsoletes_name:Obsoletes: %{ghc_obsoletes_name}-%{pkgname}-devel < %{pkgver}-%{release}}\
%{?ghc_pkg_obsoletes:Obsoletes: %{ghc_pkg_obsoletes}}\
\
%description -n %{basepkg}-devel\
This package provides the Haskell %{pkgname} library development files.\
\
%post -n %{basepkg}-devel\
%ghc_pkg_recache\
%if 0%{!-m:1}\
%if %{with haddock}\
%package -n %{basepkg}-doc\
Summary: Haskell %{pkgname} library documentation\
%{?1:Version: %{pkgver}}\
%{-l:License: %{-l*}}\
BuildArch: noarch\
Requires: %{ghc_prefix}-filesystem\
%{?ghc_obsoletes_name:Obsoletes: %{ghc_obsoletes_name}-%{pkgname}-doc < %{pkgver}-%{release}}\
Supplements: (%{basepkg}-devel and %{ghc_prefix}-doc)\
\
%postun -n %{basepkg}-devel\
%ghc_pkg_recache\
%description -n %{basepkg}-doc\
This package provides the Haskell %{pkgname} library documentation.\
%endif\
\
%if %{with ghc_prof}\
%package -n %{basepkg}-prof\
Summary: Haskell %{pkgname} profiling library\
%{?1:Version: %{pkgver}}\
%{-l:License: %{-l*}}\
Requires: %{ghc_prefix}-%{pkgname}-devel%{?_isa} = %{pkgver}-%{release}\
%{?ghc_obsoletes_name:Obsoletes: %{ghc_obsoletes_name}-%{pkgname}-prof < %{pkgver}-%{release}}\
Supplements: (%{basepkg}-devel and %{ghc_prefix}-prof)\
\
%description -n %{basepkg}-prof\
This package provides the Haskell %{pkgname} profiling library.\
%endif\
\
%files -n %{basepkg} -f %{!-d:%{pkgname}-%{pkgver}/}%{basepkg}.files\
%if 0%{?rhel} && 0%{?rhel} < 6\
%defattr(-,root,root,-)\
%endif\
%{?base_doc_files:%doc %base_doc_files}\
\
%files -n %{basepkg}-devel -f %{!-d:%{pkgname}-%{pkgver}/}%{basepkg}-devel.files\
%if 0%{?rhel} && 0%{?rhel} < 6\
%defattr(-,root,root,-)\
%endif\
%{?devel_doc_files:%doc %devel_doc_files}\
%files -n %{basepkg}-devel -f %{!-d:%{pkgname}-%{pkgver}/}%{basepkg}-devel.files\
%if 0%{!-m:1}\
\
%if %{with haddock}\
%files -n %{basepkg}-doc -f %{!-d:%{pkgname}-%{pkgver}/}%{basepkg}-doc.files\
%endif\
\
%if %{with ghc_prof}\
%files -n %{basepkg}-prof -f %{!-d:%{pkgname}-%{pkgver}/}%{basepkg}-prof.files\
%endif\
%endif\
%{nil}
# ghc_libs_build [name-version] ...
@ -96,5 +122,4 @@ ver=$(echo $i | sed -e "s/.*-\\(.*\\)/\\1/")\
%ghc_lib_install $name $ver\
cd ..\
done\
%ghc_fix_rpath $args\
%{nil}

View File

@ -2,8 +2,10 @@
%_ghcdocdir %{_ghclicensedir}/%{name}
%_ghcdynlibdir %{_libdir}
%ghc_without_dynamic 1
%cabal_install_options -v
# enable library documentation in doc subpkgs
%with_haddock 1
# %%{?_smp_ncpus_max:--jobs=%%{?_smp_ncpus_max}}
%ghc_smp_mflags -j1

View File

@ -28,7 +28,7 @@ if [ -f /etc/os-release ]; then
else
case $VERSION_ID in
7.*) BRANCH=epel7 ;;
*) BRANCH=master ;;
*) BRANCH=rawhide ;;
esac
fi
else