ready for ghc-7.8: no longer need execstack hack nor disable dyn on non-intel

This commit is contained in:
Jens Petersen 2014-08-03 23:29:14 +09:00
parent 88337f50f5
commit 8598900333
2 changed files with 11 additions and 35 deletions

View File

@ -6,8 +6,8 @@
#%%global without_hscolour 1
Name: ghc-rpm-macros
Version: 1.2.13
Release: 2%{?dist}
Version: 1.3.0
Release: 1%{?dist}
Summary: RPM macros for building packages for GHC
License: GPLv3+
@ -32,10 +32,6 @@ Requires: redhat-rpm-config > 20-1.fc21
Requires: hscolour
%endif
%endif
# for execstack (hack not needed for ghc-7.8)
%ifnarch ppc64le aarch64
Requires: prelink
%endif
%description
A set of macros for building GHC packages following the Haskell Guidelines
@ -70,17 +66,6 @@ install -p -D -m 0755 %{SOURCE3} %{buildroot}/%{_prefix}/lib/rpm/ghc-deps.sh
install -p -D -m 0755 %{SOURCE4} %{buildroot}/%{_bindir}/cabal-tweak-dep-ver
install -p -D -m 0755 %{SOURCE5} %{buildroot}/%{_bindir}/cabal-tweak-flag
# this is why this package is now arch-dependent:
# turn off shared libs and dynamic linking on secondary archs
%ifnarch %{ix86} x86_64
cat >> %{buildroot}/%{macros_dir}/macros.ghc <<EOF
# shared libraries are only supported on primary intel archs
%%ghc_without_dynamic 1
%%ghc_without_shared 1
EOF
%endif
%files
%doc COPYING AUTHORS
@ -95,6 +80,11 @@ EOF
%changelog
* Sat Aug 2 2014 Jens Petersen <petersen@redhat.com> - 1.3.0-1
- shared libs available for all archs in ghc-7.8
- cabal_configure --disable-shared with ghc_without_shared
- ghc_clear_execstack no longer needed
* Fri Jun 27 2014 Jens Petersen <petersen@redhat.com> - 1.2.13-2
- ghc-srpm-macros is now a separate source package

View File

@ -87,7 +87,7 @@ install -D --mode=0644 %{pkgnamever}.conf %{buildroot}%{ghclibdir}/package.conf.
# ghc_lib_build_without_haddock [name] [version]
%ghc_lib_build_without_haddock()\
%global debug_package %{nil}\
%cabal_configure %{!?without_prof:-p} %{!?ghc_without_shared:--enable-shared} %{?pkg_name:--htmldir=%{ghclibdocdir}/%{pkg_name}} %{?1:--docdir=%{_docdir}/ghc-%1%{!?fedora:-%2} --htmldir=%{ghclibdocdir}/%1} %{!?1:--global} %{?ghc_with_lib_for_ghci:--enable-library-for-ghci}\
%cabal_configure %{!?without_prof:-p} %{?ghc_without_shared:--disable-shared} %{?pkg_name:--htmldir=%{ghclibdocdir}/%{pkg_name}} %{?1:--docdir=%{_docdir}/ghc-%1%{!?fedora:-%2} --htmldir=%{ghclibdocdir}/%1} %{!?1:--global} %{?ghc_with_lib_for_ghci:--enable-library-for-ghci}\
%cabal build\
%{nil}
@ -105,19 +105,12 @@ install -D --mode=0644 %{pkgnamever}.conf %{buildroot}%{ghclibdir}/package.conf.
find %{buildroot} -type f -exec sh -c "file {} | grep -q 'dynamically linked'" \\; -exec strip "{}" \\;\
%endif
# ghc_clear_execstack
%ghc_clear_execstack\
if [ -d "%{buildroot}%{_bindir}" -a -x "%{_bindir}/execstack" ]; then\
find %{buildroot}%{_bindir} -type f -exec sh -c "file {} | grep -q ' ELF '" \\; -exec %{_bindir}/execstack -c "{}" \\;\
fi
# install bin package
%ghc_bin_install()\
%global _use_internal_dependency_generator 0\
%global __find_requires %{_rpmconfigdir}/ghc-deps.sh --requires %{buildroot}%{ghclibdir}\
%cabal_install\
%{!?1:%ghc_strip_dynlinked}\
%{!?1:%ghc_clear_execstack}\
%{nil}
# ghc_lib_install [name] [version]
@ -129,11 +122,10 @@ fi
%cabal_pkg_conf\
%ghc_gen_filelists\
%{!?1:%ghc_strip_dynlinked}\
%{!?1:%ghc_clear_execstack}\
%{nil}
# ghc_fix_dynamic_rpath prog ...
# (assumes cwd = pkg_name!)
# (assumes cwd = pkg_name !)
%ghc_fix_dynamic_rpath()\
%if %{undefined ghc_without_dynamic}\
if ! type chrpath > /dev/null; then exit 1; fi\
@ -161,14 +153,8 @@ done\
# - without_hscolour, without_testsuite, and ghc_bootstrapping
# need to be set locally in the spec file
# skip prof libs, and documentation
%ghc_test\
# skip prof libs and documentation
%ghc_bootstrap\
%global without_prof 1\
%global without_haddock 1\
%global without_manual 1
# skip shared and prof libs, documentation, and testsuite
%ghc_bootstrap\
%global ghc_without_shared 1\
%global ghc_without_dynamic 1\
%ghc_test