|
|
|
@ -22,10 +22,7 @@ proceeding, to avoid dependency ABI breakage from a future ghc rebuild."\
|
|
|
|
|
%endif\
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# configure
|
|
|
|
|
%cabal_configure\
|
|
|
|
|
%ghc_check_bootstrap\
|
|
|
|
|
%global _hardened_ldflags %{nil}\
|
|
|
|
|
%ghc_set_cflags\
|
|
|
|
|
# -Wunused-label is extremely noisy\
|
|
|
|
|
%ifarch aarch64 s390x\
|
|
|
|
|
CFLAGS="${CFLAGS:-$(echo %optflags | sed -e 's/-Wall -Werror=format-security //')}"\
|
|
|
|
@ -33,6 +30,13 @@ CFLAGS="${CFLAGS:-$(echo %optflags | sed -e 's/-Wall -Werror=format-security //'
|
|
|
|
|
CFLAGS="${CFLAGS:-%optflags}"\
|
|
|
|
|
%endif\
|
|
|
|
|
export CFLAGS\
|
|
|
|
|
%{nil}
|
|
|
|
|
|
|
|
|
|
# configure
|
|
|
|
|
%cabal_configure\
|
|
|
|
|
%ghc_check_bootstrap\
|
|
|
|
|
%ghc_set_cflags\
|
|
|
|
|
%global _hardened_ldflags %{nil}\
|
|
|
|
|
LDFLAGS="${LDFLAGS:-%{?__global_ldflags}}"; export LDFLAGS\
|
|
|
|
|
%cabal --version\
|
|
|
|
|
%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_ghcdocdir} --libsubdir='$compiler/$pkgkey' --datasubdir='$pkgid' --ghc %{!?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
|
|
|
|
@ -88,9 +92,7 @@ touch %{basepkg}.files %{basepkg}-devel.files\
|
|
|
|
|
echo ${pkgconf} >> %{basepkg}-devel.files\
|
|
|
|
|
if [ -d "%{buildroot}${pkgdir}" ]; then\
|
|
|
|
|
echo "%%dir ${pkgdir}" >> %{basepkg}.files\
|
|
|
|
|
%if %{undefined ghc_without_shared}\
|
|
|
|
|
echo "%%attr(755,root,root) ${pkgdir}/libHS*-ghc%{ghc_version}.so" >> %{basepkg}.files\
|
|
|
|
|
%endif\
|
|
|
|
|
find %{buildroot}${pkgdir} -mindepth 1 -type d | sed "s/^/%dir /" >> %{basepkg}-devel.files\
|
|
|
|
|
find %{buildroot}${pkgdir} ! \\( -type d -o -name "libHS*.so" \\) >> %{basepkg}-devel.files\
|
|
|
|
|
fi\
|
|
|
|
@ -131,7 +133,7 @@ install -D --mode=0644 %{pkgnamever}.conf %{buildroot}%{ghclibdir}/package.conf.
|
|
|
|
|
%if 0%{?rhel} && 0%{?rhel} < 8\
|
|
|
|
|
licensedirversion=%{?2:-%2}\
|
|
|
|
|
%endif\
|
|
|
|
|
%cabal_configure %{!?without_prof:-p} %{!?ghc_without_shared:--enable-shared} %{?ghc_without_shared:--disable-shared} %{?pkg_name:--htmldir=%{ghclibdocdir}/%{pkg_name}-%{version}} %{?1:--docdir=%{_ghclicensedir}/ghc-%1${licensedirversion} --htmldir=%{ghclibdocdir}/%1-%2} %{?ghc_subpackaging:--user}%{!?ghc_subpackaging:--global} %{?ghc_with_lib_for_ghci:--enable-library-for-ghci}\
|
|
|
|
|
%cabal_configure %{!?without_prof:-p} --enable-shared %{?pkg_name:--htmldir=%{ghclibdocdir}/%{pkg_name}-%{version}} %{?1:--docdir=%{_ghclicensedir}/ghc-%1${licensedirversion} --htmldir=%{ghclibdocdir}/%1-%2} %{?ghc_subpackaging:--user}%{!?ghc_subpackaging:--global} %{?ghc_with_lib_for_ghci:--enable-library-for-ghci}\
|
|
|
|
|
%cabal build %{?ghc_smp_mflags} %{?cabal_build_options}\
|
|
|
|
|
%{nil}
|
|
|
|
|
|
|
|
|
@ -192,7 +194,7 @@ for lib in %*; do\
|
|
|
|
|
pkgid=$(cd %{buildroot}%{ghclibdir}; echo ${lib}*)\
|
|
|
|
|
syspath=$(%{_rpmconfigdir}/ghc-pkg-wrapper %{buildroot}%{ghclibdir} --package-db=%{buildroot}%{ghclibdir}/package.conf.d field $lib library-dirs | grep $pkgid) ;;\
|
|
|
|
|
esac\
|
|
|
|
|
newrpath=$(echo $rpath | sed -e "s@$PWD/$lib/dist/build@${syspath}@g")\
|
|
|
|
|
newrpath=$(echo $rpath | sed -e "s@$PWD/$lib/dist/build@${syspath}@g" -e "s/::/:/" -e "s/^://" -e "s/:$//")\
|
|
|
|
|
chrpath -r $newrpath $i\
|
|
|
|
|
;;\
|
|
|
|
|
esac\
|
|
|
|
@ -234,8 +236,7 @@ done\
|
|
|
|
|
|
|
|
|
|
%ghc_pkg_recache %{_bindir}/ghc-pkg-%{ghc_version} recache --no-user-package-db || :
|
|
|
|
|
|
|
|
|
|
# - without_hscolour, without_testsuite, and ghc_bootstrapping
|
|
|
|
|
# need to be set locally in the spec file
|
|
|
|
|
# without_hscolour and without_testsuite need to be set locally in the spec file
|
|
|
|
|
|
|
|
|
|
# skip prof libs and documentation
|
|
|
|
|
%ghc_bootstrap\
|
|
|
|
|