insert a Setup.hs file if none shipped in package

current foundation and rio have no Setup.hs
This commit is contained in:
Jens Petersen 2018-07-31 01:30:50 +09:00
parent 5c4bfea95e
commit 8bce457cb2
3 changed files with 14 additions and 1 deletions

3
Setup.hs Normal file
View File

@ -0,0 +1,3 @@
import Distribution.Simple
main = defaultMain

View File

@ -10,7 +10,7 @@
#%%global without_hscolour 1
Name: ghc-rpm-macros
Version: 1.9.1
Version: 1.9.2
Release: 1%{?dist}
Summary: RPM macros for building Haskell packages for GHC
@ -27,6 +27,7 @@ Source6: macros.ghc-extra
Source7: ghc.attr
Source8: ghc-pkg-wrapper
Source9: macros.ghc-os
Source10: Setup.hs
Source11: cabal-tweak-drop-dep
Requires: redhat-rpm-config
# for ghc_version
@ -128,6 +129,8 @@ install -p -D -m 0755 %{SOURCE3} %{buildroot}/%{_prefix}/lib/rpm/ghc-deps.sh
install -p -D -m 0644 %{SOURCE7} %{buildroot}/%{_prefix}/lib/rpm/fileattrs/ghc.attr
%endif
install -p -D -m 0644 %{SOURCE10} %{buildroot}/%{_datadir}/%{name}/Setup.hs
install -p -D -m 0755 %{SOURCE4} %{buildroot}/%{_bindir}/cabal-tweak-dep-ver
install -p -D -m 0755 %{SOURCE5} %{buildroot}/%{_bindir}/cabal-tweak-flag
install -p -D -m 0755 %{SOURCE11} %{buildroot}/%{_bindir}/cabal-tweak-drop-dep
@ -154,6 +157,7 @@ EOF
%{_bindir}/cabal-tweak-dep-ver
%{_bindir}/cabal-tweak-drop-dep
%{_bindir}/cabal-tweak-flag
%{_datadir}/%{name}/Setup.hs
%files extra
@ -166,6 +170,9 @@ EOF
%changelog
* Tue Jul 31 2018 Jens Petersen <petersen@redhat.com> - 1.9.2-1
- inject a Setup.hs if none shipped
* Tue Jul 24 2018 Jens Petersen <petersen@redhat.com> - 1.9.1-1
- remove -Wall and -Werror=format-security separately (on aarch64 and s390x)

View File

@ -24,6 +24,9 @@ export CFLAGS\
%ghc_set_cflags\
%global _hardened_ldflags %{nil}\
LDFLAGS="${LDFLAGS:-%{?__global_ldflags}}"; export LDFLAGS\
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')}" %{?cabal_configure_options} $cabal_configure_extra_options