diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec index 004c7e3..0da784c 100644 --- a/ghc-rpm-macros.spec +++ b/ghc-rpm-macros.spec @@ -149,6 +149,7 @@ EOF %changelog * Wed Feb 22 2017 Jens Petersen - 1.6.16-1 - fix generation of haddock's +- fix fixing of rpaths for subpackages * Tue Feb 14 2017 Jens Petersen - 1.6.15-2 - do not set CFLAGS on ppc64 or ppc64le due to -Wunused-label noise diff --git a/macros.ghc b/macros.ghc index 2ecf58c..2816c60 100644 --- a/macros.ghc +++ b/macros.ghc @@ -162,15 +162,14 @@ find %{buildroot} -type f -exec sh -c "file {} | grep -q 'dynamically linked'" \ %ghc_fix_rpath()\ %if %{undefined ghc_without_dynamic}\ if ! type chrpath > /dev/null; then exit 1; fi\ -pdir=$(pwd)\ -for lib in %*; do\ for i in $(find %{buildroot} -type f -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\ - *$pdir/$lib/*)\ + *$PWD/$lib/dist/build*)\ syspath=$(%{_rpmconfigdir}/ghc-pkg-wrapper %{buildroot}%{ghclibdir} --package-db=%{buildroot}%{ghclibdir}/package.conf.d field $lib library-dirs)\ - NEWRPATH=$(echo $rpath | sed -e "s@$pdir/$lib/dist/build@${syspath}@g")\ + newrpath=$(echo $rpath | sed -e "s@$PWD/$lib/dist/build@${syspath}@g")\ chrpath -r $newrpath $i\ ;;\ esac\