From 58f39791096126f4fc01304693e62a23592fb2e1 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Sun, 29 Jan 2023 18:13:56 +0800 Subject: [PATCH] %ghc_delete_rpaths: need to remove local RPATH for subpackaged libs --- macros.ghc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/macros.ghc b/macros.ghc index 6510fc4..1ca0947 100644 --- a/macros.ghc +++ b/macros.ghc @@ -218,19 +218,25 @@ fi\ # ghc_delete_rpaths %ghc_delete_rpaths\ -%if %{defined _ghcdynlibdir}\ %if %{undefined disable_ghc_delete_rpaths}\ echo "running ghc_delete_rpaths:"\ if ! type chrpath > /dev/null; then exit 1; fi\ for i in $(find %{buildroot} -type f -executable -exec sh -c "file {} | grep -q 'dynamically linked'" \\; -print); do\ if [ -x "$i" ]; then\ - chrpath -d $i\ +%if %{defined _ghcdynlibdir}\ + chrpath -d $i\ +%else\ + rpath=$(chrpath $i | sed -e "s@^$i: R.*PATH=@@")\ + case "$rpath" in\ + *$PWD/*) chrpath -r "%{ghclibdir}/lib:%{ghclibdir}/lib/%{ghcplatform}" $i ;;\ + *) ;;\ + esac\ +%endif\ else\ echo "%%ghc_delete_rpath: no $i executable"\ exit 1\ fi\ done\ -%endif\ %endif # deprecated by ghc_delete_rpaths in F35