From 3f7e41039a835aba48894c0c663bf97871ceb49f Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Fri, 17 Dec 2021 18:11:29 +0800 Subject: [PATCH] ghc_gen_filelists: support ghc Hadrian install --- ghc-rpm-macros.spec | 5 ++++- macros.ghc | 14 ++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec index 73bfd97..73af020 100644 --- a/ghc-rpm-macros.spec +++ b/ghc-rpm-macros.spec @@ -7,7 +7,7 @@ %endif Name: ghc-rpm-macros -Version: 2.3.0 +Version: 2.3.1 Release: 1%{?dist} Summary: RPM macros for building Haskell packages for GHC @@ -184,6 +184,9 @@ EOF %changelog +* Fri Dec 17 2021 Jens Petersen - 2.3.1-1 +- ghc_gen_filelists: support ghc Hadrian install + * Wed Dec 8 2021 Jens Petersen - 2.3.0-1 - support fileattrs dependency generation for ghc9.2 - drop dependency generation for rhel6 diff --git a/macros.ghc b/macros.ghc index e2543cd..e18da4e 100644 --- a/macros.ghc +++ b/macros.ghc @@ -70,8 +70,10 @@ fi\ %define pkgver %{?2}%{!?2:%{version}}\ %define pkgnamever %{pkgname}-%{pkgver}\ %define basepkg %{?ghc_name}%{!?ghc_name:ghc}-%{pkgname}\ -if [ -z "$(ls %{buildroot}%{ghclibdir}/package.conf.d/%{pkgnamever}*.conf)" ]; then\ -echo '%{buildroot}%{ghclibdir}/package.conf.d/%{pkgnamever}*.conf not found'\ +%define ghcliblib %{ghclibdir}%{?with_hadrian:/lib}\ +%define ghclibplatform %{ghcliblib}%{?with_hadrian:/%{_arch}-linux-ghc-%{ghc_version}}\ +if [ -z "$(ls %{buildroot}%{ghcliblib}/package.conf.d/%{pkgnamever}*.conf)" ]; then\ +echo '%{buildroot}%{ghcliblib}/package.conf.d/%{pkgnamever}*.conf not found'\ exit 1\ fi\ rm -f %{basepkg}.files %{basepkg}-doc.files\ @@ -81,21 +83,21 @@ for i in $(ls %{buildroot}%{_ghclicensedir}/%{basepkg}); do\ echo "%%license %{pkgnamever}/$i" >> %{basepkg}.files\ done\ %endif\ -for i in %{buildroot}%{_ghcdynlibdir}/libHS%{pkgnamever}-*ghc%{ghc_version}.so; do\ +for i in %{buildroot}%{?_ghcdynlibdir}%{!?_ghcdynlibdir:%{ghclibplatform}}/libHS%{pkgnamever}-*ghc%{ghc_version}.so; do\ if [ -x "$i" ]; then\ echo $i >> %{basepkg}.files\ else\ -echo 'Warning: %{buildroot}%{_ghcdynlibdir}/libHS%{pkgnamever}-*ghc%{ghc_version}.so not found'\ +echo 'Warning: %{buildroot}%{?_ghcdynlibdir}%{!?_ghcdynlibdir:%{ghclibplatform}}/libHS%{pkgnamever}-*ghc%{ghc_version}.so not found'\ fi\ done\ -pkgdir="%{ghclibdir}/%{pkgnamever}"\ +pkgdir="%{ghclibplatform}/%{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}%{ghclibdir}/package.conf.d/%{pkgnamever}*.conf >> %{basepkg}-devel.files\ +ls %{buildroot}%{ghcliblib}/package.conf.d/%{pkgnamever}*.conf >> %{basepkg}-devel.files\ %if %{with haddock}\ if [ -d %{buildroot}%{ghc_html_libraries_dir}/%{pkgnamever} ]; then\ echo %{ghc_html_libraries_dir}/%{pkgnamever} >> %{basepkg}-doc.files\