|
|
|
@ -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 || :
|
|
|
|
|
|
|
|
|
|