fix ghc-deps.sh when bootstrapping a new ghc version

ie do not assume bindir/ghc is the same ghc version just built
This commit is contained in:
Jens Petersen 2013-09-09 23:17:35 +09:00
parent db486c2fbb
commit 0cd6abba00
2 changed files with 7 additions and 6 deletions

View File

@ -8,6 +8,8 @@
[ $# -ne 2 ] && echo "Usage: `basename $0` [--provides|--requires] %{buildroot}%{ghclibdir}" && exit 1 [ $# -ne 2 ] && echo "Usage: `basename $0` [--provides|--requires] %{buildroot}%{ghclibdir}" && exit 1
#set -x
MODE=$1 MODE=$1
PKGBASEDIR=$2 PKGBASEDIR=$2
PKGCONFDIR=$PKGBASEDIR/package.conf.d PKGCONFDIR=$PKGBASEDIR/package.conf.d
@ -29,12 +31,8 @@ if [ -d "$PKGBASEDIR" ]; then
SHARED=$(find $PKGBASEDIR -type f -name '*.so') SHARED=$(find $PKGBASEDIR -type f -name '*.so')
fi fi
GHCVERSION=$(ghc --numeric-version)
files=$(cat) files=$(cat)
#set -x
for i in $files; do for i in $files; do
LIB_FILE=$(echo $i | grep /libHS | egrep -v "/libHSrts") LIB_FILE=$(echo $i | grep /libHS | egrep -v "/libHSrts")
if [ "$LIB_FILE" ]; then if [ "$LIB_FILE" ]; then
@ -68,7 +66,7 @@ for i in $files; do
fi fi
elif [ "$MODE" = "--requires" ]; then elif [ "$MODE" = "--requires" ]; then
if file $i | grep -q 'executable, .* dynamically linked'; then if file $i | grep -q 'executable, .* dynamically linked'; then
BIN_DEPS=$(objdump -p $i | grep NEEDED | grep libHS | grep -v libHSrts | sed -e "s%^ NEEDED *libHS\(.*\)-ghc${GHCVERSION}.so%\1%") BIN_DEPS=$(objdump -p $i | grep NEEDED | grep libHS | grep -v libHSrts | sed -e "s%^ *NEEDED *libHS\(.*\)-ghc${GHC_VER}.so%\1%")
if [ -d "$PKGCONFDIR" ]; then if [ -d "$PKGCONFDIR" ]; then
PACKAGE_CONF_OPT="--package-conf=$PKGCONFDIR" PACKAGE_CONF_OPT="--package-conf=$PKGCONFDIR"
fi fi

View File

@ -6,7 +6,7 @@
#%%global without_hscolour 1 #%%global without_hscolour 1
Name: ghc-rpm-macros Name: ghc-rpm-macros
Version: 1.1.1 Version: 1.1.2
Release: 1%{?dist} Release: 1%{?dist}
Summary: RPM macros for building packages for GHC Summary: RPM macros for building packages for GHC
@ -90,6 +90,9 @@ EOF
%changelog %changelog
* Mon Sep 9 2013 Jens Petersen <petersen@redhat.com> - 1.1.2-1
- fix ghc-deps.sh when bootstrapping a new ghc version
* Mon Sep 9 2013 Jens Petersen <petersen@redhat.com> - 1.1.1-1 * Mon Sep 9 2013 Jens Petersen <petersen@redhat.com> - 1.1.1-1
- use objdump -p instead of ldd to read executable dependencies - use objdump -p instead of ldd to read executable dependencies