From 30f51fc80d5846ca48f0e8f7289aebeee03d18c2 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Fri, 11 Feb 2011 00:33:37 +1000 Subject: [PATCH] more non-shared fixes to avoid dynamic and shared on secondary archs - only link Setup dynamically if without_shared and without_dynamic not set - set without_shared and without_dynamic by default on secondary archs in cabal_bin_build and cabal_lib_build - add cabal_configure_options to pass extra options to cabal_configure --- ghc-rpm-macros.ghc | 12 ++++++++++-- ghc-rpm-macros.spec | 8 +++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ghc-rpm-macros.ghc b/ghc-rpm-macros.ghc index f2d229b..88410b3 100644 --- a/ghc-rpm-macros.ghc +++ b/ghc-rpm-macros.ghc @@ -2,12 +2,12 @@ # see https://fedoraproject.org/wiki/PackagingDrafts/Haskell for more details # "cabal" -%cabal [ -x Setup ] || ghc --make -dynamic Setup\ +%cabal [ -x Setup ] || ghc --make %{!?without_shared:%{!?without_dynamic:-dynamic}} Setup\ ./Setup # configure %cabal_configure\ -%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_docdir}/%{name}-%{version} --htmldir=%{ghclibdocdir}/%{pkg_name}-%{version} --libsubdir='$compiler/$pkgid' --ghc %{!?without_shared:--enable-shared} %{!?without_dynamic:--enable-executable-dynamic} +%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_docdir}/%{name}-%{version} --htmldir=%{ghclibdocdir}/%{pkg_name}-%{version} --libsubdir='$compiler/$pkgid' --ghc %{!?without_shared:--enable-shared} %{!?without_dynamic:--enable-executable-dynamic} %{?cabal_configure_options} # install %cabal_install %cabal copy --destdir=%{buildroot} -v @@ -201,12 +201,20 @@ find %{buildroot} -type f -exec sh -c "file {} | grep -q 'dynamically linked'" \ # ghc_bin_build %ghc_bin_build\ +%ifnarch %{ix86} x86_64\ +%global without_dynamic 1\ +%global without_shared 1\ +%endif\ %cabal_configure\ %cabal build # ghc_lib_build [name] [version] %ghc_lib_build()\ %{?1:cd %1-%2}\ +%ifnarch %{ix86} x86_64\ +%global without_dynamic 1\ +%global without_shared 1\ +%endif\ %cabal_configure %{!?without_prof:-p} %{?1:--docdir=%{_docdir}/ghc-%1-%2 --htmldir=%{ghclibdocdir}/%1-%2}\ %cabal build\ %{!?without_haddock:%cabal haddock %{!?without_hscolour:--hyperlink-source}}\ diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec index 036a487..4561fdf 100644 --- a/ghc-rpm-macros.spec +++ b/ghc-rpm-macros.spec @@ -1,5 +1,5 @@ Name: ghc-rpm-macros -Version: 0.11.7 +Version: 0.11.8 Release: 1%{?dist} Summary: Macros for building packages for GHC @@ -47,6 +47,12 @@ install -p %{SOURCE3} ${RPM_BUILD_ROOT}/%{_prefix}/lib/rpm %changelog +* Thu Feb 10 2011 Jens Petersen - 0.11.8-1 +- only link Setup dynamically if without_shared and without_dynamic not set +- add cabal_configure_options to pass extra options to cabal_configure +- set without_shared and without_dynamic by default on secondary archs + in cabal_bin_build and cabal_lib_build + * Thu Feb 10 2011 Jens Petersen - 0.11.7-1 - fix ghc-deps.sh for without_shared libraries