blob: 064cd719af7ec52c0a660fe7388c2af594634a66 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#!/bin/sh
# GHC does not recognize any environment variable, unlike with GCC which honors
# CFLAGS. This hook is a workaround for this flaw and introduces an HCFLAGS
# variable.
CABAL=Pandoc.cabal
BUILDINFO=${CABAL%%.cabal}.buildinfo
[ -f $BUILDINFO.in ] || {
echo >&2 "==> No $BUILDINFO.in exists; skipping $BUILDINFO creation."
exit 0
}
if [ "${HCFLAGS-UNDEFINED}" = "UNDEFINED" ]; then
echo >&2 "==> No HCFLAGS defined; skipping $BUILDINFO creation."
exit 0
fi
sed -e "s#@HCFLAGS@#$HCFLAGS#g" $BUILDINFO.in >$BUILDINFO
|