From 1e680edbc782aab9b079c12049d99d81b4e21e44 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Thu, 15 Sep 2022 19:35:06 +0800 Subject: [PATCH] ghc_configure and ghc_version now respect ghc_name for ghcX.Y --- ghc-rpm-macros.spec | 1 + macros.ghc | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec index 909ee81..b15c0ea 100644 --- a/ghc-rpm-macros.spec +++ b/ghc-rpm-macros.spec @@ -195,6 +195,7 @@ EOF %changelog * Thu Sep 15 2022 Jens Petersen - 2.4.5-1 - define ghc_smp_mflags to speed up package builds +- ghc_configure and ghc_version now respect ghc_name for ghcX.Y (via rpmquery) * Sat Aug 6 2022 Jens Petersen - 2.4.4-2 - F36 obsoletes regex-applicative-text diff --git a/macros.ghc b/macros.ghc index 77d226b..3c45135 100644 --- a/macros.ghc +++ b/macros.ghc @@ -7,8 +7,7 @@ LANG=C.utf8\ ./Setup # compiler version -%ghc_version %{!?ghc_version_override:%(ghc --numeric-version)}%{?ghc_version_override} - +%ghc_version %{?ghc_version_override}%{!?ghc_version_override:%(rpm -q --qf %%{version} %{?ghc_name}%{!?ghc_name:ghc})} %ghc_set_gcc_flags\ %global _lto_cflags %{nil}\ @@ -32,7 +31,7 @@ if ! [ -f Setup.hs -o -f Setup.lhs ]; then\ cp %{_datadir}/ghc-rpm-macros/Setup.hs .\ fi\ %cabal --version\ -%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_ghcdocdir} --libsubdir='$compiler/$pkgid' --datasubdir='$pkgid' --libexecsubdir='$pkgid' --ghc %{?_ghcdynlibdir:--dynlibdir=%{_ghcdynlibdir}} %{!?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 %{?ghc_name:--with-compiler=%{_bindir}/ghc-%{ghc_version}} --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_ghcdocdir} --libsubdir='$compiler/$pkgid' --datasubdir='$pkgid' --libexecsubdir='$pkgid' --ghc %{?_ghcdynlibdir:--dynlibdir=%{_ghcdynlibdir}} %{!?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 # install %cabal_install %cabal copy --destdir=%{buildroot} %{?cabal_install_options}