From 8db5cec1c637607ac6308e56a2600b2a030cecdc Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 5 Jan 2024 22:42:53 +0100 Subject: [PATCH] added triggers calling ghc_pkg_recache macro on package.conf.d dir change [release 9.4.8-4mamba;Sat Dec 02 2023] --- ghc-9.4.8-sphinx-7.0.1.patch | 26 +++++++ ghc.spec | 146 +++++++++++++++++++++++++---------- 2 files changed, 130 insertions(+), 42 deletions(-) create mode 100644 ghc-9.4.8-sphinx-7.0.1.patch diff --git a/ghc-9.4.8-sphinx-7.0.1.patch b/ghc-9.4.8-sphinx-7.0.1.patch new file mode 100644 index 0000000..0eb1dbd --- /dev/null +++ b/ghc-9.4.8-sphinx-7.0.1.patch @@ -0,0 +1,26 @@ +From 52d701b31dc4427b7e321a04be3f5f13a5fc271e Mon Sep 17 00:00:00 2001 +From: "mimi.vx" +Date: Wed, 24 May 2023 12:42:15 +0000 +Subject: [PATCH] Fix for Sphinx 7 removed style key + +Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/23444 +--- + docs/users_guide/rtd-theme/layout.html | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/docs/users_guide/rtd-theme/layout.html b/docs/users_guide/rtd-theme/layout.html +index 2a61142514a..7ffeff7befc 100644 +--- a/docs/users_guide/rtd-theme/layout.html ++++ b/docs/users_guide/rtd-theme/layout.html +@@ -64,7 +64,7 @@ + {%- endif %} + + {# CSS #} +- ++ + + {%- for css in css_files %} + {%- if css|attr("rel") %} +-- +GitLab + diff --git a/ghc.spec b/ghc.spec index a5e25fb..3da5d3a 100644 --- a/ghc.spec +++ b/ghc.spec @@ -1,73 +1,107 @@ -%ifnarch %{ix86} +%ifarch x86_64 i586 aarch64 %define bootstrap 1 %endif Name: ghc -Version: 7.6.3 -Release: 1mamba +Version: 9.4.8 +Release: 4mamba Summary: A compiler and interactive environment for the functional language Haskell. Group: Applications/Development Vendor: openmamba Distribution: openmamba Packager: Silvan Calarco -URL: http://www.haskell.org/ghc/ -Source: http://www.haskell.org/ghc/dist/%{version}/ghc-%{version}-src.tar.bz2 +URL: https://www.haskell.org/ghc/ +Source: https://downloads.haskell.org/ghc/%{version}/ghc-%{version}-src.tar.xz Patch0: ghc-7.6.3-pkgdir.patch +Patch1: ghc-9.4.8-sphinx-7.0.1.patch License: BSD ## AUTOBUILDREQ-BEGIN +BuildRequires: ghc-rpm-macros BuildRequires: glibc-devel -BuildRequires: libgcc +BuildRequires: libffi-devel BuildRequires: libgmp-devel BuildRequires: libncurses-devel +BuildRequires: libnuma-devel ## AUTOBUILDREQ-END %if "%{bootstrap}" == "1" -BuildRequires: ghc-bootstrap-compiler +BuildRequires: ghc-bin %else BuildRequires: ghc %endif -Conflicts: ghc-bootstrap-compiler -BuildRoot: %{_tmppath}/%{name}-%{version}-root +BuildRequires: alex +BuildRequires: happy +Provides: ghc-compiler +Requires: ghc-rpm-macros +Requires: %{name}-libs = %{version}-%{release} %description GHC is a state-of-the-art, open source, compiler and interactive environment for the functional language Haskell. -%debug_package +%package libs +Summary: Shared directories for Haskell documentation +Group: Documentation + +%description libs +This package provides some common directories used for Haskell libraries documentation. + +%package filesystem +Summary: Shared directories for Haskell documentation +Group: Documentation + +%description filesystem +This package provides some common directories used for Haskell libraries documentation. + +#% debug_package + +# Don't clean build at the end +%global __spec_rmbuild_cmd /bin/true %prep -%setup -q -#-D -T -%patch0 -p1 +%setup -q -D -T +:<< _EOF +%global __provides_exclude ^libffi.so.*$ +%global __requires_exclude ^.*libHS.*|libtinfo.so.6*$ -%define _use_internal_dependency_generator 0 -%define __find_provides %{_builddir}/%{name}-%{version}/find_provides.sh -cat > %{_builddir}/%{name}-%{version}/find_provides.sh <<_EOF -#! /bin/sh -%{_prefix}/lib/rpm/find-provides %{buildroot} %{_target_cpu} | \ -grep -v "libffi.so" -exit 0 -_EOF -chmod +x %{_builddir}/%{name}-%{version}/find_provides.sh - -%define __find_requires %{_builddir}/%{name}-%{version}/find_requires.sh -cat > %{_builddir}/%{name}-%{version}/find_requires.sh <<_EOF -#! /bin/sh -%{_prefix}/lib/rpm/find-requires %{buildroot} %{_target_cpu} 2>/dev/null -exit 0 -_EOF -chmod +x %{_builddir}/%{name}-%{version}/find_requires.sh +#%patch0 -p1 +%patch 1 -p1 -b .sphinx-7.0.1 %build -#:<< __EOF +#:<< _EOF +%if "%{bootstrap}" == "1" +export PATH="/opt/ghc/bin:$PATH" +%ifarch aarch64 +# ghc-bin 9.0.2 for aarch64 requires llvm 13 +export PATH="/var/autodist/clang+llvm-13.0.1-aarch64-linux-gnu/bin:$PATH" +%endif +%endif + ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir} -%make -#__EOF +# avoid "ghc: hGetContents: invalid argument (invalid byte sequence)" +export LANG=C.utf8 + +%make -j1 %install [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +%if "%{bootstrap}" == "1" +export PATH="/opt/ghc/bin:$PATH" +%endif + %makeinstall +install -d -m0755 %{buildroot}%{ghc_html_libraries_dir} + +# Triggers calling ghc-pkg recache +%transfiletriggerin -- %{ghcliblib}/package.conf.d +%ghc_pkg_recache +%end + +%transfiletriggerpostun -- %{ghcliblib}/package.conf.d +%ghc_pkg_recache +%end + %clean [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" @@ -87,18 +121,46 @@ chmod +x %{_builddir}/%{name}-%{version}/find_requires.sh %{_bindir}/runghc %{_bindir}/runghc-%{version} %{_bindir}/runhaskell -%dir %{_libdir}/ghc-%{version} -%{_libdir}/ghc-%{version}/* -%dir %{_datadir}/doc/ghc -%dir %{_datadir}/doc/ghc/html -%{_datadir}/doc/ghc/html/* -%{_datadir}/doc/ghc/haddock.pdf -%{_datadir}/doc/ghc/haddock.ps -%{_datadir}/doc/ghc/users_guide.pdf -%{_datadir}/doc/ghc/users_guide.ps +%dir %{_datadir}/doc/ghc-%{version} +%dir %{_datadir}/doc/ghc-%{version}/html +%{_datadir}/doc/ghc-%{version}/html/* +#%{_datadir}/doc/ghc/haddock.pdf +#%{_datadir}/doc/ghc/haddock.ps +%{_datadir}/doc/ghc-%{version}/users_guide.pdf +#%{_datadir}/doc/ghc/users_guide.ps %{_mandir}/man1/ghc.1* %doc LICENSE +%files libs +%defattr(-,root,root) +%dir %{_libdir}/ghc-%{version} +%{_libdir}/ghc-%{version}/* +%ghost %{ghcliblib}/package.conf.d/package.cache + +%files filesystem +%defattr(-,root,root) +%dir %{_ghc_doc_dir} +%dir %{ghc_html_dir} +%dir %{ghc_html_libraries_dir} + %changelog +* Sat Dec 02 2023 Silvan Calarco 9.4.8-4mamba +- added triggers calling ghc_pkg_recache macro on package.conf.d dir change + +* Tue Nov 14 2023 Silvan Calarco 9.4.8-3mamba +- added libs and filesystem subpackages; require ghc-rpm-macros and provide ghc-compiler + +* Mon Nov 13 2023 Silvan Calarco 9.4.8-2mamba +- rebuilt with gch-rpm-marcos + +* Sat Nov 11 2023 Silvan Calarco 9.4.8-1mamba +- update to 9.4.8 + +* Mon Jan 25 2016 Automatic Build System 7.10.3-1mamba +- automatic version update by autodist + +* Wed Jun 11 2014 Automatic Build System 7.8.2-1mamba +- automatic version update by autodist + * Sat Sep 07 2013 Silvan Calarco 7.6.3-1mamba - package created by silvan using the webbuild interface