From cb06e9e98f8a1025fa4912176fbd93929b5a5fcb Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Mon, 30 Oct 2023 19:02:40 -0400 Subject: [PATCH] Fix flatpak builds Packages to be installed into flatpaks are built with the /app prefix but build-only dependencies use the system packages in /usr. Since ghc falls into the latter category, installation path macros must not be used to reference their installed location. --- ghc-rpm-macros.spec | 5 ++++- macros.ghc | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec index b0a7f9a..a369e39 100644 --- a/ghc-rpm-macros.spec +++ b/ghc-rpm-macros.spec @@ -8,7 +8,7 @@ Name: ghc-rpm-macros Version: 2.6.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: RPM macros for building Haskell packages for GHC License: GPL-3.0-or-later @@ -185,6 +185,9 @@ mkdir -p %{buildroot}%{_docdir}/ghc/html/libraries %changelog +* Mon Oct 30 2023 Yaakov Selkowitz - 2.6.1-2 +- Fix flatpak builds + * Tue Oct 24 2023 Jens Petersen - 2.6.1-1 - ghc_gen_filelists: tweak pkgdir for ghc-9.8 short hash suffices diff --git a/macros.ghc b/macros.ghc index 3e5b7e9..58ff4f1 100644 --- a/macros.ghc +++ b/macros.ghc @@ -95,13 +95,13 @@ export LDFLAGS="${LDFLAGS:-%{?__global_ldflags}}"\ %cabal_configure\ %ghc_set_gcc_flags\ if ! [ -f Setup.hs -o -f Setup.lhs ]; then\ -cp %{_datadir}/ghc-rpm-macros/Setup.hs .\ +cp /usr/share/ghc-rpm-macros/Setup.hs .\ fi\ if [ -d "%{ghclibdir}/lib" ]; then\ subsubdir=/lib\ fi\ %cabal --version\ -%cabal configure %{!-W:%{?ghc_name:--with-compiler=%{_bindir}/ghc-%{ghc_version}}} --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_ghcdocdir} --libsubdir='$compiler'${subsubdir}/'$pkgid' --datasubdir='$pkgid' --libexecsubdir='$pkgid' --ghc --dynlibdir=%{?_ghcdynlibdir}%{?!_ghcdynlibdir:%{_libdir}/ghc-%{ghc_version}${subsubdir}} %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?with_tests:--enable-tests} %{?ghc_subpackaging:--user}%{!?ghc_subpackaging:--global} --ghc-options="${CFLAGS:+$(echo ' '$CFLAGS | sed -e 's/ / -optc/g')} ${LDFLAGS:+$(echo ' '$LDFLAGS | sed -e 's/ / -optl/g')} -fhide-source-paths" %{?cabal_configure_options} $cabal_configure_extra_options +%cabal configure %{!-W:%{?ghc_name:--with-compiler=/usr/bin/ghc-%{ghc_version}}} --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_ghcdocdir} --libsubdir='$compiler'${subsubdir}/'$pkgid' --datasubdir='$pkgid' --libexecsubdir='$pkgid' --ghc --dynlibdir=%{?_ghcdynlibdir}%{?!_ghcdynlibdir:%{_libdir}/ghc-%{ghc_version}${subsubdir}} %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?with_tests:--enable-tests} %{?ghc_subpackaging:--user}%{!?ghc_subpackaging:--global} --ghc-options="${CFLAGS:+$(echo ' '$CFLAGS | sed -e 's/ / -optc/g')} ${LDFLAGS:+$(echo ' '$LDFLAGS | sed -e 's/ / -optl/g')} -fhide-source-paths" %{?flatpak:--extra-lib-dirs=%{_libdir}} %{?cabal_configure_options} $cabal_configure_extra_options # install %cabal_install %cabal copy --destdir=%{buildroot} %{?cabal_install_options} @@ -302,7 +302,7 @@ done\ done\ %endif -%ghc_pkg_recache %{_bindir}/ghc-pkg-%{ghc_version} recache --no-user-package-db || : +%ghc_pkg_recache /usr/bin/ghc-pkg-%{ghc_version} recache --no-user-package-db || : # skip prof libs and documentation %ghc_quick_build\