[ghc-rpm-macros/f19] backport changes from 1.0.7.3
Jens Petersen
petersen at fedoraproject.org
Wed Mar 26 08:58:58 UTC 2014
commit 933ac5650d02626419ce1b46e4a670cf7494c547
Author: Jens Petersen <petersen at redhat.com>
Date: Wed Mar 26 17:58:50 2014 +0900
backport changes from 1.0.7.3
- ghc_fix_dynamic_rpath: abort for non-existent executable name with error msg
- cabal-tweak-flag: add manual field to enforce flag changes
- fix ghc-deps.sh when bootstrapping a new ghc version
- use objdump -p instead of ldd to read executable dependencies
- add --global to cabal_configure if not subpackaging libs
move --htmldir (should be no-op)
cabal-tweak-flag | 2 +-
ghc-deps.sh | 12 +++++-------
ghc-rpm-macros.ghc | 23 ++++++++++++++---------
ghc-rpm-macros.spec | 9 ++++++++-
4 files changed, 28 insertions(+), 18 deletions(-)
---
diff --git a/cabal-tweak-flag b/cabal-tweak-flag
index 2db3a72..a357bd3 100755
--- a/cabal-tweak-flag
+++ b/cabal-tweak-flag
@@ -47,4 +47,4 @@ if [ ! -f $CABALFILE.orig ]; then
BACKUP=.orig
fi
-sed -i$BACKUP -e "/[Ff]lag *$FLAG/,/[Dd]efault: *$OLD/ s/\([Dd]efault: *\)$OLD/\1$NEW/" $CABALFILE
+sed -i$BACKUP -e "/[Ff]lag *$FLAG/,/[Dd]efault: *$OLD/ s/\( \+\)\([Dd]efault:[ \t]*\)$OLD/\1\2$NEW\n\1manual: True/" $CABALFILE
diff --git a/ghc-deps.sh b/ghc-deps.sh
index 761cb5f..85c4488 100755
--- a/ghc-deps.sh
+++ b/ghc-deps.sh
@@ -8,15 +8,17 @@
[ $# -ne 2 ] && echo "Usage: `basename $0` [--provides|--requires] %{buildroot}%{ghclibdir}" && exit 1
+set +x
+
MODE=$1
PKGBASEDIR=$2
PKGCONFDIR=$PKGBASEDIR/package.conf.d
GHC_VER=$(basename $PKGBASEDIR | sed -e s/ghc-//)
-if [ ! -x "/usr/bin/ghc-pkg-${GHC_VER}" -a -x "$PKGBASEDIR/ghc-pkg" ]; then
+if [ -x "$PKGBASEDIR/ghc-pkg" ]; then
GHC_PKG="$PKGBASEDIR/ghc-pkg --global-conf=$PKGCONFDIR"
else
- GHC_PKG="/usr/bin/ghc-pkg"
+ GHC_PKG="/usr/bin/ghc-pkg-${GHC_VER}"
fi
case $MODE in
@@ -29,12 +31,8 @@ if [ -d "$PKGBASEDIR" ]; then
SHARED=$(find $PKGBASEDIR -type f -name '*.so')
fi
-GHCVERSION=$(ghc --numeric-version)
-
files=$(cat)
-#set -x
-
for i in $files; do
LIB_FILE=$(echo $i | grep /libHS | egrep -v "$PKGBASEDIR/libHS")
if [ "$LIB_FILE" ]; then
@@ -68,7 +66,7 @@ for i in $files; do
fi
elif [ "$MODE" = "--requires" ]; then
if file $i | grep -q 'executable, .* dynamically linked'; then
- BIN_DEPS=$(ldd $i | grep libHS | grep -v libHSrts | sed -e "s%^\\tlibHS\(.*\)-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
PACKAGE_CONF_OPT="--package-conf=$PKGCONFDIR"
fi
diff --git a/ghc-rpm-macros.ghc b/ghc-rpm-macros.ghc
index 17a1c97..265cc23 100644
--- a/ghc-rpm-macros.ghc
+++ b/ghc-rpm-macros.ghc
@@ -21,7 +21,7 @@ fi
# configure
%cabal_configure\
%ghc_check_bootstrap\
-%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_pkgdocdir} %{?pkg_name:--htmldir=%{ghclibdocdir}/%{pkg_name}-%{version}} --libsubdir='$compiler/$pkgid' --ghc %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?cabal_configure_options} $cabal_configure_extra_options
+%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_pkgdocdir} --libsubdir='$compiler/$pkgid' --ghc %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?cabal_configure_options} $cabal_configure_extra_options
# install
%cabal_install %cabal copy --destdir=%{buildroot} -v
@@ -222,7 +222,7 @@ This package contains the development files.
# ghc_lib_build_without_haddock [name] [version]
%ghc_lib_build_without_haddock()\
%global debug_package %{nil}\
-%cabal_configure %{!?without_prof:-p} %{!?ghc_without_shared:--enable-shared} %{?1:--docdir=%{_docdir}/ghc-%1-%2 --htmldir=%{ghclibdocdir}/%1-%2} %{?ghc_with_lib_for_ghci:--enable-library-for-ghci}\
+%cabal_configure %{!?without_prof:-p} %{!?ghc_without_shared:--enable-shared} %{?pkg_name:--htmldir=%{ghclibdocdir}/%{pkg_name}-%{version}} %{?1:--docdir=%{_docdir}/ghc-%1-%2 --htmldir=%{ghclibdocdir}/%1-%2} %{!?1:--global} %{?ghc_with_lib_for_ghci:--enable-library-for-ghci}\
%cabal build\
%{nil}
@@ -273,13 +273,18 @@ fi
PDIR=$(cd ..; pwd)\
for i in %*; do\
PROG=%{buildroot}%{_bindir}/$i\
- RPATH=$(chrpath $PROG| sed -e "s@^$PROG: RPATH=@@")\
- case $RPATH in\
- *$PDIR*)\
- NEWRPATH=$(echo $RPATH | sed -e "s@$PDIR@%{ghclibdir}@g" -e "s@/dist/build@@g")\
- chrpath -r $NEWRPATH $PROG\
- ;;\
- esac\
+ if [ -x "$PROG" ]; then\
+ RPATH=$(chrpath $PROG| sed -e "s@^$PROG: RPATH=@@")\
+ case $RPATH in\
+ *$PDIR*)\
+ NEWRPATH=$(echo $RPATH | sed -e "s@$PDIR@%{ghclibdir}@g" -e "s@/dist/build@@g")\
+ chrpath -r $NEWRPATH $PROG\
+ ;;\
+ esac\
+ else\
+ echo "%%ghc_fix_dynamic_rpath: no such file $PROG"\
+ exit 1\
+ fi\
done\
%endif\
%{nil}
diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec
index c57be96..18178bb 100644
--- a/ghc-rpm-macros.spec
+++ b/ghc-rpm-macros.spec
@@ -6,7 +6,7 @@
#%%global without_hscolour 1
Name: ghc-rpm-macros
-Version: 0.98.5
+Version: 0.98.6
Release: 1%{?dist}
Summary: RPM macros for building packages for GHC
@@ -76,6 +76,13 @@ EOF
%changelog
+* Wed Mar 26 2014 Jens Petersen <petersen at redhat.com> - 0.98.6-1
+- ghc_fix_dynamic_rpath: abort for non-existent executable name with error msg
+- cabal-tweak-flag: add manual field to enforce flag changes
+- fix ghc-deps.sh when bootstrapping a new ghc version
+- use objdump -p instead of ldd to read executable dependencies
+- add --global to cabal_configure if not subpackaging libs
+
* Fri Oct 25 2013 Jens Petersen <petersen at redhat.com> - 0.98.5-1
- add versioned ghcpkgdocdir
- drop ghc_docdir in favor of _pkgdocdir
More information about the scm-commits
mailing list