restore %ghc_fix_rpath for compat and drop it from %ghc_libs_install

epel9
Jens Petersen 4 years ago
parent a1c1188a52
commit 192fd2f9c3

@ -10,7 +10,7 @@
#%%global without_hscolour 1
Name: ghc-rpm-macros
Version: 2.2.1
Version: 2.2.2
Release: 1%{?dist}
Summary: RPM macros for building Haskell packages for GHC
@ -190,6 +190,10 @@ EOF
%changelog
* Tue Jun 8 2021 Jens Petersen <petersen@redhat.com> - 2.2.2-1
- restore ghc_fix_rpath for now for backward compatibility
and drop it from ghc_libs_install
* Tue Jun 8 2021 Jens Petersen <petersen@redhat.com> - 2.2.1-1
- ghc-rpm-macros needs to require chrpath now instead of ghc-rpm-macros-extra

@ -196,6 +196,46 @@ for i in $(find %{buildroot} -type f -executable -exec sh -c "file {} | grep -q
done\
%endif
# deprecated by ghc_delete_rpaths in F35
%ghc_fix_rpath()\
%if %{undefined disable_ghc_fix_rpath}\
if ! type chrpath > /dev/null; then exit 1; fi\
echo "ghc_fix_rpath %*"\
for i in $(find %{buildroot} -type f -executable -exec sh -c "file {} | grep -q 'dynamically linked'" \\; -print); do\
for lib in %*; do\
if [ -x "$i" ]; then\
rpath=$(chrpath $i | sed -e "s@^$i: R.*PATH=@@")\
case $rpath in\
*$PWD/$lib/dist/build*)\
case %{ghc_version} in\
7.10.*)\
pkgid=$(cd %{buildroot}%{ghclibdir}/package.conf.d; ls ${lib}* | sed -e "s/.conf$//")\
syspath=$(%{_rpmconfigdir}/ghc-pkg-wrapper %{buildroot}%{ghclibdir} --global --package-db=%{buildroot}%{ghclibdir}/package.conf.d field $pkgid library-dirs) ;;\
8.0)\
pkgid=$(cd %{buildroot}%{ghclibdir}; echo ${lib}*)\
syspath=$(%{_rpmconfigdir}/ghc-pkg-wrapper %{buildroot}%{ghclibdir} --global --package-db=%{buildroot}%{ghclibdir}/package.conf.d field $lib library-dirs | grep $pkgid) ;;\
*)\
syspath="" ;;\
esac\
newrpath=$(echo $rpath | sed -e "s@$PWD/$lib/dist/build@${syspath}@g" -e "s/::/:/" -e "s/^://" -e "s/:$//")\
if [ "$newrpath" = "%{_libdir}" ]; then\
chrpath -d $i\
else\
chrpath -r $newrpath $i\
fi\
;;\
%{_libdir})\
chrpath -d $i\
;;\
esac\
else\
echo "%%ghc_fix_rpath: no $i executable"\
exit 1\
fi\
done\
done\
%endif
# deprecated for f31
%ghc_pkg_recache %{_bindir}/ghc-pkg-%{ghc_version} recache --no-user-package-db || :

@ -119,5 +119,4 @@ ver=$(echo $i | sed -e "s/.*-\\(.*\\)/\\1/")\
%ghc_lib_install $name $ver\
cd ..\
done\
%ghc_fix_rpath $args\
%{nil}

Loading…
Cancel
Save