%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 loongarch64 %define longarch loongarch64 %define arch loongarch64 %endif %ifarch ppc64le aarch64 riscv64 loongarch64 %define sysname unknown %endif Name: ghc-bootstrap Version: 9.10.1 Release: %mkrel 1 Summary: Binary distributions of Glasgow Haskell Compiler License: BSD-3-Clause URL: https://build.opensuse.org/package/view_file/devel:languages:haskell:bootstrap Source0: ghc-%{version}-x86_64-unknown-linux.tar.xz Source1: ghc-%{version}-powerpc64le-unknown-linux.tar.xz Source2: ghc-%{version}-s390x-ibm-linux.tar.xz Source3: ghc-%{version}-aarch64-unknown-linux.tar.xz Source4: ghc-%{version}-riscv64-unknown-linux.tar.xz Source5: README.openSUSE Source6: LICENSE # I don't have any loongarch64 machine/worker #Source20: ghc-%%{version}-loongarch64-unknown-linux.tar.xz BuildRequires: chrpath BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: gmp-devel BuildRequires: libffi8 >= 3.4.4 BuildRequires: libncurses6 BuildRequires: pkgconfig BuildRequires: pkgconfig(libffi) Requires: gmp-devel Requires: libffi8 >= 3.4.4 Requires: libncurses6 Requires: pkgconfig(libffi) Conflicts: ghc-base Provides: ghc-bootstrap-devel = %{version}-%{release} ExclusiveArch: ppc64le x86_64 s390x aarch64 riscv64 loongarch64 AutoReq: yes %ifnarch s390x BuildRequires: libnuma-devel %endif Requires: clang >= 15 Requires: libffi-devel Requires: libnuma-devel Requires: llvm >= 15 %description This package contains a binary distribution of "The Glorious Glasgow Haskell Compilation System". See README.openSUSE on how the tarballs were produced. Do not install this package! Install 'ghc' instead. %prep %autosetup -p1 cp %{SOURCE5} . cp %{SOURCE6} . %build %{nil} %install cd ghc-%{version}-%{longarch}-%{sysname}-linux %configure --prefix=/opt mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d echo "/opt/lib/ghc-%{version}/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}/lib/package.conf.d/.stamp (cd %{buildroot}/opt/lib/ghc-%{version}/lib/package.conf.d/ for i in *.conf; do mv $i.copy $i done ) %post /sbin/ldconfig /opt/bin/ghc-pkg recache %postun -p /sbin/ldconfig %files %doc README.openSUSE %license LICENSE /opt/* %config %{_sysconfdir}/ld.so.conf.d/ghc.conf