fix %ghc_fix_rpath for ghc-7.10

This commit is contained in:
Jens Petersen 2017-04-07 19:09:23 +09:00
parent 7855aaa8f1
commit 38f99a79b3
2 changed files with 10 additions and 2 deletions

View File

@ -36,6 +36,8 @@ Requires: ghc-compiler
Requires: hscolour
%endif
%endif
# this package could now be noarch again
#BuildArch: noarch
%description
A set of macros for building GHC packages following the Haskell Guidelines

View File

@ -172,8 +172,14 @@ for lib in %*; do\
rpath=$(chrpath $i | sed -e "s@^$i: R.*PATH=@@")\
case $rpath in\
*$PWD/$lib/dist/build*)\
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)\
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} --package-db=%{buildroot}%{ghclibdir}/package.conf.d field $pkgid library-dirs) ;;\
*)\
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")\
chrpath -r $newrpath $i\
;;\