2015-01-25 17:34:52 +01:00
|
|
|
source $stdenv/setup
|
|
|
|
|
|
|
|
preConfigure() {
|
|
|
|
. $GNUSTEP_MAKEFILES/GNUstep.sh
|
|
|
|
}
|
|
|
|
|
|
|
|
wrapGSMake() {
|
|
|
|
local program="$1"
|
|
|
|
local config="$2"
|
|
|
|
local wrapped="$(dirname $program)/.$(basename $program)-wrapped"
|
|
|
|
|
|
|
|
mv "$program" "$wrapped"
|
|
|
|
|
|
|
|
cat > "$program"<<EOF
|
|
|
|
#! $SHELL -e
|
|
|
|
|
|
|
|
export GNUSTEP_CONFIG_FILE="$config"
|
|
|
|
|
2019-09-11 00:52:53 +02:00
|
|
|
exec "$wrapped" "\$@"
|
2015-01-25 17:34:52 +01:00
|
|
|
EOF
|
|
|
|
chmod +x "$program"
|
|
|
|
}
|
|
|
|
|
|
|
|
postInstall() {
|
|
|
|
local conf="$out/share/.GNUstep.conf"
|
|
|
|
|
|
|
|
mkdir -p "$out/share"
|
|
|
|
touch $conf
|
|
|
|
|
|
|
|
# add the current package to the paths
|
|
|
|
local tmp="$out/lib/GNUstep/Applications"
|
|
|
|
if [ -d "$tmp" ] && case "$NIX_GNUSTEP_SYSTEM_APPS" in *"${tmp}"*) false;; *) true;; esac; then
|
2021-11-14 03:54:33 +01:00
|
|
|
addToSearchPath NIX_GNUSTEP_SYSTEM_APPS "$tmp"
|
2015-01-25 17:34:52 +01:00
|
|
|
fi
|
|
|
|
tmp="$out/lib/GNUstep/Applications"
|
|
|
|
if [ -d "$tmp" ] && case "$NIX_GNUSTEP_SYSTEM_ADMIN_APPS" in *"${tmp}"*) false;; *) true;; esac; then
|
2021-11-14 03:54:33 +01:00
|
|
|
addToSearchPath NIX_GNUSTEP_SYSTEM_ADMIN_APPS "$tmp"
|
2015-01-25 17:34:52 +01:00
|
|
|
fi
|
|
|
|
tmp="$out/lib/GNUstep/WebApplications"
|
|
|
|
if [ -d "$tmp" ] && case "$NIX_GNUSTEP_SYSTEM_WEB_APPS" in *"${tmp}"*) false;; *) true;; esac; then
|
2021-11-14 03:54:33 +01:00
|
|
|
addToSearchPath NIX_GNUSTEP_SYSTEM_WEB_APPS "$tmp"
|
2015-01-25 17:34:52 +01:00
|
|
|
fi
|
|
|
|
tmp="$out/bin"
|
|
|
|
if [ -d "$tmp" ] && case "$NIX_GNUSTEP_SYSTEM_TOOLS" in *"${tmp}"*) false;; *) true;; esac; then
|
2021-11-14 03:54:33 +01:00
|
|
|
addToSearchPath NIX_GNUSTEP_SYSTEM_TOOLS "$tmp"
|
2015-01-25 17:34:52 +01:00
|
|
|
fi
|
|
|
|
tmp="$out/sbin"
|
|
|
|
if [ -d "$tmp" ] && case "$NIX_GNUSTEP_SYSTEM_ADMIN_TOOLS" in *"${tmp}"*) false;; *) true;; esac; then
|
2021-11-14 03:54:33 +01:00
|
|
|
addToSearchPath NIX_GNUSTEP_SYSTEM_ADMIN_TOOLS "$tmp"
|
2015-01-25 17:34:52 +01:00
|
|
|
fi
|
|
|
|
tmp="$out/lib/GNUstep"
|
|
|
|
if [ -d "$tmp" ] && case "$NIX_GNUSTEP_SYSTEM_LIBRARY" in *"${tmp}"*) false;; *) true;; esac; then
|
2021-11-14 03:54:33 +01:00
|
|
|
addToSearchPath NIX_GNUSTEP_SYSTEM_LIBRARY "$tmp"
|
2015-01-25 17:34:52 +01:00
|
|
|
fi
|
|
|
|
tmp="$out/include"
|
|
|
|
if [ -d "$tmp" ] && case "$NIX_GNUSTEP_SYSTEM_HEADERS" in *"${tmp}"*) false;; *) true;; esac; then
|
2021-11-14 03:54:33 +01:00
|
|
|
if [ -z "$NIX_GNUSTEP_SYSTEM_HEADERS" ]; then
|
|
|
|
export NIX_GNUSTEP_SYSTEM_HEADERS="$tmp"
|
|
|
|
else
|
|
|
|
export NIX_GNUSTEP_SYSTEM_HEADERS+=" $tmp"
|
|
|
|
fi
|
2015-01-25 17:34:52 +01:00
|
|
|
fi
|
|
|
|
tmp="$out/lib"
|
|
|
|
if [ -d "$tmp" ] && case "$NIX_GNUSTEP_SYSTEM_LIBRARIES" in *"${tmp}"*) false;; *) true;; esac; then
|
2021-11-14 03:54:33 +01:00
|
|
|
addToSearchPath NIX_GNUSTEP_SYSTEM_LIBRARIES "$tmp"
|
2015-01-25 17:34:52 +01:00
|
|
|
fi
|
|
|
|
tmp="$out/share/GNUstep/Documentation"
|
|
|
|
if [ -d "$tmp" ] && case "$NIX_GNUSTEP_SYSTEM_DOC" in *"${tmp}"*) false;; *) true;; esac; then
|
2021-11-14 03:54:33 +01:00
|
|
|
addToSearchPath NIX_GNUSTEP_SYSTEM_DOC "$tmp"
|
2015-01-25 17:34:52 +01:00
|
|
|
fi
|
|
|
|
tmp="$out/share/man"
|
|
|
|
if [ -d "$tmp" ] && case "$NIX_GNUSTEP_SYSTEM_DOC_MAN" in *"${tmp}"*) false;; *) true;; esac; then
|
2021-11-14 03:54:33 +01:00
|
|
|
addToSearchPath NIX_GNUSTEP_SYSTEM_DOC_MAN "$tmp"
|
2015-01-25 17:34:52 +01:00
|
|
|
fi
|
|
|
|
tmp="$out/share/info"
|
|
|
|
if [ -d "$tmp" ] && case "$NIX_GNUSTEP_SYSTEM_DOC_INFO" in *"${tmp}"*) false;; *) true;; esac; then
|
2021-11-14 03:54:33 +01:00
|
|
|
addToSearchPath NIX_GNUSTEP_SYSTEM_DOC_INFO "$tmp"
|
2015-01-25 17:34:52 +01:00
|
|
|
fi
|
2021-11-14 03:54:33 +01:00
|
|
|
|
2015-01-25 17:34:52 +01:00
|
|
|
# write the config file
|
|
|
|
echo GNUSTEP_MAKEFILES=$GNUSTEP_MAKEFILES >> $conf
|
|
|
|
if [ -n "$NIX_GNUSTEP_SYSTEM_APPS" ]; then
|
2021-11-14 03:54:33 +01:00
|
|
|
echo NIX_GNUSTEP_SYSTEM_APPS="$NIX_GNUSTEP_SYSTEM_APPS"
|
2015-01-25 17:34:52 +01:00
|
|
|
fi
|
|
|
|
if [ -n "$NIX_GNUSTEP_SYSTEM_ADMIN_APPS" ]; then
|
2021-11-14 03:54:33 +01:00
|
|
|
echo NIX_GNUSTEP_SYSTEM_ADMIN_APPS="$NIX_GNUSTEP_SYSTEM_ADMIN_APPS" >> $conf
|
2015-01-25 17:34:52 +01:00
|
|
|
fi
|
|
|
|
if [ -n "$NIX_GNUSTEP_SYSTEM_WEB_APPS" ]; then
|
2021-11-14 03:54:33 +01:00
|
|
|
echo NIX_GNUSTEP_SYSTEM_WEB_APPS="$NIX_GNUSTEP_SYSTEM_WEB_APPS" >> $conf
|
2015-01-25 17:34:52 +01:00
|
|
|
fi
|
|
|
|
if [ -n "$NIX_GNUSTEP_SYSTEM_TOOLS" ]; then
|
2021-11-14 03:54:33 +01:00
|
|
|
echo NIX_GNUSTEP_SYSTEM_TOOLS="$NIX_GNUSTEP_SYSTEM_TOOLS" >> $conf
|
2015-01-25 17:34:52 +01:00
|
|
|
fi
|
|
|
|
if [ -n "$NIX_GNUSTEP_SYSTEM_ADMIN_TOOLS" ]; then
|
2021-11-14 03:54:33 +01:00
|
|
|
echo NIX_GNUSTEP_SYSTEM_ADMIN_TOOLS="$NIX_GNUSTEP_SYSTEM_ADMIN_TOOLS" >> $conf
|
2015-01-25 17:34:52 +01:00
|
|
|
fi
|
|
|
|
if [ -n "$NIX_GNUSTEP_SYSTEM_LIBRARY" ]; then
|
2021-11-14 03:54:33 +01:00
|
|
|
echo NIX_GNUSTEP_SYSTEM_LIBRARY="$NIX_GNUSTEP_SYSTEM_LIBRARY" >> $conf
|
2015-01-25 17:34:52 +01:00
|
|
|
fi
|
|
|
|
if [ -n "$NIX_GNUSTEP_SYSTEM_HEADERS" ]; then
|
2021-11-14 03:54:33 +01:00
|
|
|
echo NIX_GNUSTEP_SYSTEM_HEADERS="$NIX_GNUSTEP_SYSTEM_HEADERS" >> $conf
|
2015-01-25 17:34:52 +01:00
|
|
|
fi
|
|
|
|
if [ -n "$NIX_GNUSTEP_SYSTEM_LIBRARIES" ]; then
|
2021-11-14 03:54:33 +01:00
|
|
|
echo NIX_GNUSTEP_SYSTEM_LIBRARIES="$NIX_GNUSTEP_SYSTEM_LIBRARIES" >> $conf
|
2015-01-25 17:34:52 +01:00
|
|
|
fi
|
|
|
|
if [ -n "$NIX_GNUSTEP_SYSTEM_DOC" ]; then
|
2021-11-14 03:54:33 +01:00
|
|
|
echo NIX_GNUSTEP_SYSTEM_DOC="$NIX_GNUSTEP_SYSTEM_DOC" >> $conf
|
2015-01-25 17:34:52 +01:00
|
|
|
fi
|
|
|
|
if [ -n "$NIX_GNUSTEP_SYSTEM_DOC_MAN" ]; then
|
2021-11-14 03:54:33 +01:00
|
|
|
echo NIX_GNUSTEP_SYSTEM_DOC_MAN="$NIX_GNUSTEP_SYSTEM_DOC_MAN" >> $conf
|
2015-01-25 17:34:52 +01:00
|
|
|
fi
|
|
|
|
if [ -n "$NIX_GNUSTEP_SYSTEM_DOC_INFO" ]; then
|
2021-11-14 03:54:33 +01:00
|
|
|
echo NIX_GNUSTEP_SYSTEM_DOC_INFO="$NIX_GNUSTEP_SYSTEM_DOC_INFO" >> $conf
|
2015-01-25 17:34:52 +01:00
|
|
|
fi
|
2021-11-14 03:54:33 +01:00
|
|
|
|
2015-01-25 17:34:52 +01:00
|
|
|
for i in $out/bin/*; do
|
2021-11-14 03:54:33 +01:00
|
|
|
echo "wrapping $(basename $i)"
|
|
|
|
wrapGSMake "$i" "$out/share/.GNUstep.conf"
|
2015-01-25 17:34:52 +01:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
genericBuild
|