ghc/ghc.spec

167 lines
4.4 KiB
RPMSpec
Raw Normal View History

%ifarch x86_64 i586 aarch64
%define bootstrap 1
%endif
Name: ghc
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 <silvan.calarco@mambasoft.it>
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: libffi-devel
BuildRequires: libgmp-devel
BuildRequires: libncurses-devel
BuildRequires: libnuma-devel
## AUTOBUILDREQ-END
%if "%{bootstrap}" == "1"
BuildRequires: ghc-bin
%else
BuildRequires: ghc
%endif
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.
%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
:<< _EOF
%global __provides_exclude ^libffi.so.*$
%global __requires_exclude ^.*libHS.*|libtinfo.so.6*$
#%patch0 -p1
%patch 1 -p1 -b .sphinx-7.0.1
%build
#:<< _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}
# 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}"
%files
%defattr(-,root,root)
%{_bindir}/ghc
%{_bindir}/ghc-%{version}
%{_bindir}/ghc-pkg
%{_bindir}/ghc-pkg-%{version}
%{_bindir}/ghci
%{_bindir}/ghci-%{version}
%{_bindir}/haddock
%{_bindir}/haddock-ghc-%{version}
%{_bindir}/hp2ps
%{_bindir}/hpc
%{_bindir}/hsc2hs
%{_bindir}/runghc
%{_bindir}/runghc-%{version}
%{_bindir}/runhaskell
%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 <silvan.calarco@mambasoft.it> 9.4.8-4mamba
- added triggers calling ghc_pkg_recache macro on package.conf.d dir change
* Tue Nov 14 2023 Silvan Calarco <silvan.calarco@mambasoft.it> 9.4.8-3mamba
- added libs and filesystem subpackages; require ghc-rpm-macros and provide ghc-compiler
* Mon Nov 13 2023 Silvan Calarco <silvan.calarco@mambasoft.it> 9.4.8-2mamba
- rebuilt with gch-rpm-marcos
* Sat Nov 11 2023 Silvan Calarco <silvan.calarco@mambasoft.it> 9.4.8-1mamba
- update to 9.4.8
* Mon Jan 25 2016 Automatic Build System <autodist@mambasoft.it> 7.10.3-1mamba
- automatic version update by autodist
* Wed Jun 11 2014 Automatic Build System <autodist@mambasoft.it> 7.8.2-1mamba
- automatic version update by autodist
* Sat Sep 07 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 7.6.3-1mamba
- package created by silvan using the webbuild interface