2013-04-13 23:09:40 -07:00
#!/bin/sh
2016-05-25 17:21:05 +00:00
# Script to produce an OS X installer .pkg and .app(.zip)
2019-11-28 11:37:43 -08:00
VERSION = $( git describe --always --dirty 2>/dev/null)
2013-04-13 23:09:40 -07:00
if test -z " $VERSION " ; then
2016-04-20 14:34:12 +08:00
echo "Could not get version from git"
2019-02-28 21:08:02 +08:00
if test -f version; then
2019-11-28 11:37:43 -08:00
VERSION = $( cat version)
2019-02-28 21:08:02 +08:00
fi
2013-04-13 23:09:40 -07:00
fi
echo " Version is $VERSION "
set -x
2012-05-10 02:11:28 -07:00
2013-04-13 23:09:40 -07:00
#Exit on error
set -e
2019-11-28 11:37:43 -08:00
PKGDIR = $( mktemp -d)
2012-05-30 00:27:50 -07:00
2019-01-25 16:45:06 -08:00
SRC_DIR = $PWD
2016-05-25 17:21:05 +00:00
OUTPUT_PATH = ${ FISH_ARTEFACT_PATH :- ~/fish_built }
2019-11-28 11:37:43 -08:00
mkdir -p " $PKGDIR /build " " $PKGDIR /root " " $PKGDIR /intermediates " " $PKGDIR /dst "
{ cd " $PKGDIR /build " && cmake -DCMAKE_BUILD_TYPE= RelWithDebInfo " $SRC_DIR " && make -j 4 && env DESTDIR = " $PKGDIR /root/ " make install; }
pkgbuild --scripts build_tools/osx_package_scripts --root " $PKGDIR /root/ " --identifier 'com.ridiculousfish.fish-shell-pkg' --version " $VERSION " " $PKGDIR /intermediates/fish.pkg "
2016-05-25 17:11:02 +00:00
2019-11-28 11:37:43 -08:00
productbuild --package-path " $PKGDIR /intermediates " --distribution build_tools/osx_distribution.xml --resources build_tools/osx_package_resources/ " $OUTPUT_PATH /fish- $VERSION .pkg "
2013-10-05 17:06:22 -07:00
# Make the app
2019-11-28 11:37:43 -08:00
{ cd " $PKGDIR /build " && make fish_macapp && zip -r " $OUTPUT_PATH /fish- $VERSION .app.zip " fish.app; }
2016-05-25 17:11:02 +00:00
2019-11-28 11:37:43 -08:00
rm -r " $PKGDIR "