7b45c3d854
The content of this branch was automatically imported from Fedora ELN with the following as its source: https://src.fedoraproject.org/rpms/ghc-rpm-macros#78bda0dce526795284ef1644e7d0dd6e0b3511dc
33 lines
846 B
Bash
Executable File
33 lines
846 B
Bash
Executable File
#!/bin/sh
|
|
|
|
[ $# -lt 1 ] && echo "Usage: `basename $0` %{buildroot}%{ghclibdir} ..." && exit 1
|
|
|
|
set +x
|
|
|
|
PKGBASEDIR=$1
|
|
shift
|
|
PKGCONFDIR=$PKGBASEDIR/package.conf.d
|
|
GHC_VER=$(basename $PKGBASEDIR | sed -e s/ghc-//)
|
|
|
|
# for a ghc build use the new ghc-pkg
|
|
INPLACE_GHCPKG=$PKGBASEDIR/../../bin/ghc-pkg-$GHC_VER
|
|
|
|
if [ -x "$INPLACE_GHCPKG" ]; then
|
|
case $GHC_VER in
|
|
7.4.*)
|
|
GHC_PKG="$PKGBASEDIR/ghc-pkg --global-conf=$PKGCONFDIR"
|
|
;;
|
|
7.6.*)
|
|
GHC_PKG="$PKGBASEDIR/ghc-pkg --global-package-db=$PKGCONFDIR"
|
|
;;
|
|
# 7.8 and 7.10
|
|
*)
|
|
GHC_PKG="env LD_LIBRARY_PATH=$(dirname $PKGBASEDIR) $PKGBASEDIR/bin/ghc-pkg --global-package-db=$PKGCONFDIR"
|
|
;;
|
|
esac
|
|
else
|
|
GHC_PKG="/usr/bin/ghc-pkg-${GHC_VER} -f $PKGCONFDIR"
|
|
fi
|
|
|
|
$GHC_PKG -v0 --simple-output $* | uniq
|