diff --git a/ghc-deps.sh b/ghc-deps.sh index c21e4d6..ee96ddd 100755 --- a/ghc-deps.sh +++ b/ghc-deps.sh @@ -22,7 +22,7 @@ for i in $files; do # exclude builtin_rts.conf $PKGCONFDIR/*-*.conf) PKGVER=$(echo $i | sed -e "s%$PKGCONFDIR/\(.\+\)-.\+.conf%\1%") - OUT=$(/usr/lib/rpm/ghc-pkg-wrapper $PKGBASEDIR field $PKGVER $FIELD | sed -e "s/^depends: \+//" -e "s/rts//" -e "s/bin-package-db-[^ ]\+//") + OUT=$(/usr/lib/rpm/ghc-pkg-wrapper $PKGBASEDIR field $PKGVER $FIELD | sed -e "s/rts//" -e "s/bin-package-db-[^ ]\+//") for d in $OUT; do case $d in *-*) echo "ghc-devel($d)" ;; diff --git a/ghc-pkg-wrapper b/ghc-pkg-wrapper index 6cfd4f3..cd3778c 100755 --- a/ghc-pkg-wrapper +++ b/ghc-pkg-wrapper @@ -29,4 +29,4 @@ else GHC_PKG="/usr/bin/ghc-pkg-${GHC_VER} -f $PKGCONFDIR" fi -$GHC_PKG --global $* +$GHC_PKG -v0 --simple-output --global $* diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec index 920166e..5c81bab 100644 --- a/ghc-rpm-macros.spec +++ b/ghc-rpm-macros.spec @@ -10,7 +10,7 @@ #%%global without_hscolour 1 Name: ghc-rpm-macros -Version: 1.6.8 +Version: 1.6.9 Release: 1%{?dist} Summary: RPM macros for building packages for GHC @@ -135,6 +135,11 @@ EOF %changelog +* Tue Sep 27 2016 Jens Petersen - 1.6.9-1 +- new ghc_fix_rpath macro deprecates ghc_fix_dynamic_rpath +- ghc-pkg-wrapper: quieter and simple output +- ghc_libs_install now runs ghc_fix_rpath to fix subpackage rpaths + * Tue Sep 6 2016 Jens Petersen - 1.6.8-1 - set Cabal docdir to licensedir so licenses end up in right place diff --git a/macros.ghc b/macros.ghc index a06299a..d4bb2a2 100644 --- a/macros.ghc +++ b/macros.ghc @@ -153,6 +153,32 @@ find %{buildroot} -type f -exec sh -c "file {} | grep -q 'dynamically linked'" \ %{!?1:%ghc_strip_dynlinked}\ %{nil} +# ghc_fix_rpath lib-ver ... +%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\ + if [ -x "$i" ]; then\ + RPATH=$(chrpath $i | sed -e "s@^$i: R.*PATH=@@")\ + case $RPATH in\ + *$PDIR/$lib/*)\ + SYSPATH=$(%{_rpmconfigdir}/ghc-pkg-wrapper %{buildroot}%{ghclibdir} --package-db=%{buildroot}%{ghclibdir}/package.conf.d field $lib library-dirs | uniq)\ + NEWRPATH=$(echo $RPATH | sed -e "s@$PDIR/$lib/dist/build@${SYSPATH}@g")\ + chrpath -r $NEWRPATH $i\ + ;;\ + esac\ + else\ + echo "%%ghc_fix_rpath: no $i executable"\ + exit 1\ + fi\ +done\ +done\ +%endif\ +%{nil} + +# Deprecated by ghc_fix_rpath: # ghc_fix_dynamic_rpath prog ... %ghc_fix_dynamic_rpath()\ %if %{undefined ghc_without_dynamic}\ diff --git a/macros.ghc-extra b/macros.ghc-extra index 329a547..6c810b2 100644 --- a/macros.ghc-extra +++ b/macros.ghc-extra @@ -87,12 +87,14 @@ done\ # ghc_sublib_install [name-version] ... %ghc_libs_install()\ HOME=$PWD\ -for i in %*; do\ +args="%*"\ +for i in $args; do\ +cd $i\ name=$(echo $i | sed -e "s/\\(.*\\)-.*/\\1/")\ ver=$(echo $i | sed -e "s/.*-\\(.*\\)/\\1/")\ -cd $name-$ver\ %ghc_lib_install $name $ver\ mv *.files ..\ cd ..\ done\ +%ghc_fix_rpath $args\ %{nil}