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
epel9
Jens Petersen 8 years ago
parent 83eef9382a
commit 411d61ddf0

@ -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)" ;;

@ -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 $*

@ -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 <petersen@redhat.com> - 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 <petersen@redhat.com> - 1.6.8-1
- set Cabal docdir to licensedir so licenses end up in right place

@ -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}\

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

Loading…
Cancel
Save