%global llvm_major 15 %ifarch ppc64le %define longarch powerpc64le # something weird on ghc arch detection %define arch ppc64 %endif %ifarch s390x %define longarch s390x %define sysname ibm %define arch s390x %endif %ifarch aarch64 %define longarch aarch64 %define arch aarch64 %endif %ifarch x86_64 %define longarch x86_64 %define sysname unknown %define arch x86_64 %endif %ifarch riscv64 %define longarch riscv64 %define arch riscv64 %endif %ifarch ppc64le aarch64 riscv64 %define sysname unknown %endif Name: ghc-bootstrap Summary: Binary distributions of The Glasgow Haskell Compiler Version: 9.4.4 Release: 1%{?dist} License: BSD-3-Clause URL: https://build.opensuse.org/package/view_file/devel:languages:haskell:bootstrap Source1: README.openSUSE Source2: LICENSE Source3: ghc-9.4.4-powerpc64le-unknown-linux.tar.xz Source4: ghc-9.4.4-x86_64-unknown-linux.tar.xz Source5: ghc-9.4.4-s390x-ibm-linux.tar.xz Source6: ghc-9.4.4-aarch64-unknown-linux.tar.xz Source7: ghc-9.4.4-riscv64-unknown-linux.tar.xz BuildRequires: chrpath BuildRequires: fdupes BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: gmp-devel BuildRequires: libffi8 >= 3.4.4 BuildRequires: libncurses5 BuildRequires: pkgconfig BuildRequires: pkgconfig(libffi) Requires: gmp-devel Requires: libffi8 >= 3.4.4 Requires: libncurses5 # This package is not meant to be used outside of our build system # as it's not used in OBS for openSUSE either Requires: this-is-only-for-build-envs # Requires: pkgconfig(libffi) Provides: ghc-bootstrap-devel = 9.4.4-1 ExclusiveArch: ppc64le x86_64 s390x aarch64 riscv64 AutoReq: off %ifnarch s390x BuildRequires: libnuma-devel %endif %ifarch s390x riscv64 Requires: clang >=13 Requires: llvm >=13 %endif %ifnarch s390x Requires: libffi-devel Requires: libnuma-devel %endif %description This package contains a binary distribution of "The Glasgow Haskell Compilation System". See README.openSUSE on how the tarballs were produced. Do not install this package! Install 'ghc' instead. %prep cp %{SOURCE1} . cp %{SOURCE2} . cp %{SOURCE3} . cp %{SOURCE4} . cp %{SOURCE5} . cp %{SOURCE6} . cp %{SOURCE7} . %build tar Jxf ghc-%{version}-%{longarch}-%{sysname}-linux.tar.xz cd ghc-%{version}-%{longarch}-%{sysname}-linux %install cd ghc-%{version}-%{longarch}-%{sysname}-linux %configure --prefix=/opt mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d echo "/opt/lib/ghc-%{version}-%{longarch}-%{sysname}-linux/lib/%{arch}-linux-ghc-%{version}" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/ghc.conf %make_install %fdupes -s %{buildroot} for i in $(find %{buildroot} -type f -executable -exec sh -c "file {} | grep -q 'dynamically linked'" \; -print); do chrpath -d $i done rm %{buildroot}/opt/lib/ghc-%{version}-%{longarch}-%{sysname}-linux/lib/package.conf.d/.stamp (cd %{buildroot}/opt/lib/ghc-%{version}-%{longarch}-%{sysname}-linux/lib/package.conf.d/ for i in *.conf; do mv $i.copy $i done ) %post /usr/sbin/ldconfig /opt/bin/ghc-pkg recache %postun -p /usr/sbin/ldconfig %files %doc README.openSUSE %license LICENSE /opt/* %config %{_sysconfdir}/ld.so.conf.d/ghc.conf