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
This commit is contained in:
Jens Petersen 2011-02-11 00:33:37 +10:00
parent 1f4312aeaa
commit 30f51fc80d
2 changed files with 17 additions and 3 deletions

View File

@ -2,12 +2,12 @@
# see https://fedoraproject.org/wiki/PackagingDrafts/Haskell for more details # see https://fedoraproject.org/wiki/PackagingDrafts/Haskell for more details
# "cabal" # "cabal"
%cabal [ -x Setup ] || ghc --make -dynamic Setup\ %cabal [ -x Setup ] || ghc --make %{!?without_shared:%{!?without_dynamic:-dynamic}} Setup\
./Setup ./Setup
# configure # configure
%cabal_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 # install
%cabal_install %cabal copy --destdir=%{buildroot} -v %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
%ghc_bin_build\ %ghc_bin_build\
%ifnarch %{ix86} x86_64\
%global without_dynamic 1\
%global without_shared 1\
%endif\
%cabal_configure\ %cabal_configure\
%cabal build %cabal build
# ghc_lib_build [name] [version] # ghc_lib_build [name] [version]
%ghc_lib_build()\ %ghc_lib_build()\
%{?1:cd %1-%2}\ %{?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_configure %{!?without_prof:-p} %{?1:--docdir=%{_docdir}/ghc-%1-%2 --htmldir=%{ghclibdocdir}/%1-%2}\
%cabal build\ %cabal build\
%{!?without_haddock:%cabal haddock %{!?without_hscolour:--hyperlink-source}}\ %{!?without_haddock:%cabal haddock %{!?without_hscolour:--hyperlink-source}}\

View File

@ -1,5 +1,5 @@
Name: ghc-rpm-macros Name: ghc-rpm-macros
Version: 0.11.7 Version: 0.11.8
Release: 1%{?dist} Release: 1%{?dist}
Summary: Macros for building packages for GHC Summary: Macros for building packages for GHC
@ -47,6 +47,12 @@ install -p %{SOURCE3} ${RPM_BUILD_ROOT}/%{_prefix}/lib/rpm
%changelog %changelog
* Thu Feb 10 2011 Jens Petersen <petersen@redhat.com> - 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 <petersen@redhat.com> - 0.11.7-1 * Thu Feb 10 2011 Jens Petersen <petersen@redhat.com> - 0.11.7-1
- fix ghc-deps.sh for without_shared libraries - fix ghc-deps.sh for without_shared libraries