2012-03-10 09:45:18 +00:00
|
|
|
#!/bin/bash
|
2011-06-17 13:11:19 +00:00
|
|
|
|
2012-03-10 09:45:18 +00:00
|
|
|
# build debug/release x86/x86_64/ppc versions of mapster32 and eduke32 on OS X
|
2011-06-17 13:11:19 +00:00
|
|
|
|
2013-03-04 07:49:47 +00:00
|
|
|
cd ..
|
|
|
|
|
2012-03-10 09:45:18 +00:00
|
|
|
# Variable presets:
|
|
|
|
buildppc=1
|
|
|
|
build86=1
|
|
|
|
build64=1
|
2012-03-26 05:07:42 +00:00
|
|
|
buildmain=1
|
2012-03-14 06:27:45 +00:00
|
|
|
buildtools=0
|
2012-07-29 23:35:12 +00:00
|
|
|
installtools=0
|
2012-03-10 09:45:18 +00:00
|
|
|
builddebug=0
|
2012-08-24 18:49:13 +00:00
|
|
|
buildrelease=1
|
2012-03-26 05:07:42 +00:00
|
|
|
pack=1
|
2012-07-29 23:35:12 +00:00
|
|
|
iamhelix=0
|
2013-04-17 20:34:45 +00:00
|
|
|
dummy=0
|
2013-04-17 20:34:54 +00:00
|
|
|
doclean=0
|
2012-11-26 08:23:20 +00:00
|
|
|
package=package
|
2013-04-17 20:34:45 +00:00
|
|
|
lastrevision=
|
2012-03-10 09:45:18 +00:00
|
|
|
|
|
|
|
# Enforce OS:
|
2011-06-17 13:11:19 +00:00
|
|
|
if [ `uname -s` != Darwin ]; then
|
2012-03-10 09:45:18 +00:00
|
|
|
echo This script is for OS X only.
|
2011-06-17 13:11:19 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2012-03-10 09:45:18 +00:00
|
|
|
# Detect and account for OS X version:
|
|
|
|
darwinversion=`uname -r | cut -d . -f 1`
|
2011-06-17 13:11:19 +00:00
|
|
|
|
2012-03-10 09:45:18 +00:00
|
|
|
if [ `expr $darwinversion \< 9` == 1 ]; then
|
2012-03-12 04:57:06 +00:00
|
|
|
echo OS X 10.5 is the minimum requirement for building.
|
2012-03-12 04:45:17 +00:00
|
|
|
exit 1
|
2012-03-10 09:45:18 +00:00
|
|
|
fi
|
2012-03-26 05:07:42 +00:00
|
|
|
if [ `expr $darwinversion \< 10` == 1 ]; then
|
|
|
|
build64=0
|
|
|
|
# x86_64 is disabled by default on Leopard to avoid the additional hassles of getting libvpx installed into a PowerPC environment.
|
|
|
|
fi
|
2012-03-17 07:25:46 +00:00
|
|
|
if [ `expr $darwinversion \> 9` == 1 ]; then
|
2012-03-10 09:45:18 +00:00
|
|
|
buildppc=0
|
2012-03-26 05:07:42 +00:00
|
|
|
# PPC is disabled by default on Snow Leopard for ease of installation.
|
2011-06-17 13:11:19 +00:00
|
|
|
fi
|
2012-03-26 05:07:42 +00:00
|
|
|
# All defaults can be overridden with the command-line parameters.
|
2012-03-17 07:25:46 +00:00
|
|
|
|
2012-03-10 09:45:18 +00:00
|
|
|
# Parse arguments:
|
|
|
|
for i in $*; do
|
|
|
|
case $i in
|
2012-07-29 23:35:12 +00:00
|
|
|
# onlyzip, helix: For Helixhorned's convenience.
|
2012-03-10 09:45:18 +00:00
|
|
|
onlyzip)
|
2012-03-26 05:07:42 +00:00
|
|
|
buildmain=0
|
|
|
|
buildtools=0
|
|
|
|
pack=1
|
|
|
|
;;
|
2012-07-29 23:35:12 +00:00
|
|
|
helix)
|
|
|
|
iamhelix=1
|
|
|
|
buildppc=0
|
|
|
|
build86=1
|
|
|
|
build64=1
|
|
|
|
buildmain=1
|
|
|
|
buildtools=1
|
|
|
|
builddebug=0
|
|
|
|
pack=1
|
|
|
|
;;
|
2012-08-24 18:49:13 +00:00
|
|
|
debughelix)
|
|
|
|
iamhelix=1
|
|
|
|
buildppc=0
|
|
|
|
build86=0
|
|
|
|
build64=1
|
|
|
|
buildmain=1
|
|
|
|
buildtools=0
|
|
|
|
builddebug=1
|
|
|
|
buildrelease=0
|
|
|
|
pack=1
|
|
|
|
;;
|
2013-04-17 20:34:45 +00:00
|
|
|
dummyhelix)
|
|
|
|
iamhelix=1
|
|
|
|
buildppc=0
|
|
|
|
build86=0
|
|
|
|
build64=0
|
|
|
|
buildmain=0
|
|
|
|
buildtools=0
|
|
|
|
builddebug=0
|
|
|
|
buildrelease=0
|
|
|
|
pack=0
|
|
|
|
dummy=1
|
|
|
|
;;
|
2013-04-17 20:34:54 +00:00
|
|
|
clean)
|
|
|
|
buildppc=0
|
|
|
|
build86=0
|
|
|
|
build64=0
|
|
|
|
buildmain=0
|
|
|
|
buildtools=0
|
|
|
|
builddebug=0
|
|
|
|
buildrelease=0
|
|
|
|
pack=0
|
|
|
|
doclean=1
|
|
|
|
;;
|
2012-03-26 05:07:42 +00:00
|
|
|
# For the convenience of universal distributors:
|
|
|
|
dist)
|
|
|
|
buildppc=1
|
|
|
|
build86=1
|
|
|
|
build64=1
|
|
|
|
buildmain=1
|
|
|
|
buildtools=0
|
|
|
|
builddebug=1
|
|
|
|
pack=1
|
|
|
|
;;
|
|
|
|
disttools)
|
|
|
|
buildppc=1
|
|
|
|
build86=1
|
|
|
|
build64=1
|
|
|
|
buildmain=0
|
|
|
|
buildtools=1
|
|
|
|
builddebug=1
|
|
|
|
pack=0
|
|
|
|
;;
|
|
|
|
full)
|
|
|
|
buildppc=1
|
|
|
|
build86=1
|
|
|
|
build64=1
|
|
|
|
buildmain=1
|
|
|
|
buildtools=1
|
|
|
|
builddebug=1
|
|
|
|
pack=1
|
2012-03-10 09:45:18 +00:00
|
|
|
;;
|
|
|
|
|
2012-07-29 23:35:12 +00:00
|
|
|
# misc.
|
|
|
|
installtools)
|
|
|
|
buildppc=0
|
|
|
|
build86=0
|
|
|
|
build64=0
|
|
|
|
buildmain=0
|
|
|
|
buildtools=0
|
|
|
|
builddebug=0
|
|
|
|
pack=0
|
|
|
|
installtools=1
|
|
|
|
;;
|
|
|
|
|
2012-03-17 07:25:46 +00:00
|
|
|
--buildppc=*)
|
|
|
|
buildppc=${i#*=}
|
2012-03-10 09:45:18 +00:00
|
|
|
;;
|
2012-03-17 07:25:46 +00:00
|
|
|
--build86=*)
|
|
|
|
build86=${i#*=}
|
2012-03-10 09:45:18 +00:00
|
|
|
;;
|
2012-03-17 07:25:46 +00:00
|
|
|
--build64=*)
|
|
|
|
build64=${i#*=}
|
2012-03-10 09:45:18 +00:00
|
|
|
;;
|
|
|
|
|
2012-03-26 05:07:42 +00:00
|
|
|
--main=*)
|
|
|
|
buildmain=${i#*=}
|
|
|
|
;;
|
2012-03-17 07:25:46 +00:00
|
|
|
--tools=*)
|
|
|
|
buildtools=${i#*=}
|
2012-03-14 06:27:45 +00:00
|
|
|
;;
|
|
|
|
|
2012-03-10 09:45:18 +00:00
|
|
|
--debug=*)
|
|
|
|
builddebug=${i#*=}
|
|
|
|
;;
|
|
|
|
|
2012-03-26 05:07:42 +00:00
|
|
|
--pack=*)
|
|
|
|
pack=${i#*=}
|
|
|
|
;;
|
|
|
|
|
2013-04-17 20:34:45 +00:00
|
|
|
--lastrev=*)
|
|
|
|
lastrevision=${i#*=}
|
|
|
|
;;
|
|
|
|
|
2012-03-10 09:45:18 +00:00
|
|
|
*)
|
2012-03-26 05:07:42 +00:00
|
|
|
echo "usage: ./osxbuild.sh [options]"
|
|
|
|
echo "options:"
|
|
|
|
echo " [--buildppc=<0|1>] [--build86=<0|1>] [--build64=<0|1>]"
|
|
|
|
echo " [--debug=<0|1>]"
|
|
|
|
echo " [--main=<0|1>] [--tools=<0|1>]"
|
|
|
|
echo " [--pack=<0|1>]"
|
|
|
|
echo "presets:"
|
2012-07-29 23:35:12 +00:00
|
|
|
echo " [onlyzip] [dist] [disttools] [full] [installtools]"
|
2012-03-10 09:45:18 +00:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2012-03-26 05:07:42 +00:00
|
|
|
# Mandatory disabled settings enforced:
|
|
|
|
if [ `expr $darwinversion \< 9` == 1 ]; then
|
|
|
|
build64=0
|
|
|
|
# x86_64 support did not exist before Leopard.
|
|
|
|
fi
|
|
|
|
if [ `expr $darwinversion \> 10` == 1 ]; then
|
|
|
|
buildppc=0
|
|
|
|
# PPC is disabled on Lion and up because support has been removed from the SDKs.
|
|
|
|
fi
|
|
|
|
|
2012-03-10 09:45:18 +00:00
|
|
|
# Detect versioning systems and pull the revision number:
|
2012-07-29 23:35:12 +00:00
|
|
|
rev=$(svn info 2> /dev/null | grep Revision | awk '{ print $2 }')
|
2012-03-04 09:33:23 +00:00
|
|
|
vc=svn
|
2012-03-08 06:06:00 +00:00
|
|
|
if [ -z "$rev" ]; then
|
2012-03-04 09:33:23 +00:00
|
|
|
vc=git
|
2012-07-29 23:35:12 +00:00
|
|
|
rev=$(git log | grep 'git-svn-id:' | head -n 1 | sed -E 's/.*\@([0-9]+).*/\1/')
|
|
|
|
echo "Detected git repository, revision r$rev"
|
2012-03-04 09:33:23 +00:00
|
|
|
fi
|
|
|
|
|
2012-03-08 06:06:00 +00:00
|
|
|
if [ -n "$rev" ]; then
|
2012-03-04 09:33:23 +00:00
|
|
|
# throw the svn revision into a header. this is ugly.
|
2012-11-05 02:49:08 +00:00
|
|
|
echo "s_buildRev = \"r$rev\";" > source/rev.h
|
2012-03-04 09:33:23 +00:00
|
|
|
else
|
|
|
|
rev=unknown
|
|
|
|
vc=none
|
|
|
|
fi
|
|
|
|
|
2012-07-29 23:35:09 +00:00
|
|
|
function dobuildtools ()
|
|
|
|
{
|
|
|
|
make veryclean
|
|
|
|
local cmdline="$2"
|
|
|
|
eval $cmdline
|
|
|
|
if [ $? ]; then
|
|
|
|
echo buildtools: "$1" build succeeded.
|
|
|
|
else
|
|
|
|
echo buildtools: "$1" build failed.
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
function dobuildem() # build EDuke32 and Mapster32
|
|
|
|
{
|
|
|
|
make veryclean
|
|
|
|
local cmdline="$2"
|
|
|
|
eval $cmdline
|
|
|
|
if [ $? ]; then
|
|
|
|
echo $1 build succeeded.
|
|
|
|
cp "Mapster32.app/Contents/MacOS/mapster32" mapster32.$1
|
|
|
|
cp "EDuke32.app/Contents/MacOS/eduke32" eduke32.$1
|
|
|
|
else
|
|
|
|
echo $1 build failed.
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2012-03-17 07:25:46 +00:00
|
|
|
# A little factoring:
|
|
|
|
commonargs="OSX_STARTUPWINDOW=1 WITHOUT_GTK=1"
|
|
|
|
if [ $buildppc == 1 ]; then
|
|
|
|
commonargs="$commonargs DARWIN9=1"
|
|
|
|
fi
|
|
|
|
|
2013-04-17 20:34:54 +00:00
|
|
|
if [ $doclean == 1 ]; then
|
|
|
|
cd build
|
|
|
|
rm -f *{.x86,.x64,.ppc}
|
|
|
|
cd ..
|
|
|
|
fi
|
|
|
|
|
2012-03-14 06:27:45 +00:00
|
|
|
# Building the buildtools:
|
2012-07-29 23:35:12 +00:00
|
|
|
if [ $buildtools$installtools != 00 ] && [ -d "build" ]; then
|
2012-03-14 06:27:45 +00:00
|
|
|
cd build
|
|
|
|
|
2012-07-29 23:35:12 +00:00
|
|
|
makecmd="make -k"
|
2012-03-14 06:27:45 +00:00
|
|
|
|
2012-07-29 23:35:12 +00:00
|
|
|
if [ $buildtools == 1 ]; then
|
|
|
|
rm -f *{.x86,.x64,.ppc}
|
|
|
|
make veryclean
|
|
|
|
EXESUFFIX_OVERRIDE=.debug make veryclean
|
2012-03-14 06:27:45 +00:00
|
|
|
|
2012-07-29 23:35:12 +00:00
|
|
|
if [ $build64 == 1 ]; then
|
|
|
|
if [ $builddebug == 1 ]; then
|
|
|
|
dobuildtools "x86_64 debug" \
|
|
|
|
"ARCH='-arch x86_64' EXESUFFIX_OVERRIDE=.debug.x64 $commonargs RELEASE=0 BUILD32_ON_64=0 USE_LIBVPX=1 $makecmd utils"
|
|
|
|
fi
|
2012-03-14 06:27:45 +00:00
|
|
|
|
2012-07-29 23:35:12 +00:00
|
|
|
dobuildtools "x86_64 release" \
|
|
|
|
"ARCH='-arch x86_64' EXESUFFIX_OVERRIDE=.x64 $commonargs RELEASE=1 BUILD32_ON_64=0 USE_LIBVPX=1 $makecmd utils"
|
2012-03-14 06:27:45 +00:00
|
|
|
fi
|
|
|
|
|
2012-07-29 23:35:12 +00:00
|
|
|
if [ $build86 == 1 ]; then
|
|
|
|
if [ $builddebug == 1 ]; then
|
|
|
|
dobuildtools "x86 debug" \
|
|
|
|
"EXESUFFIX_OVERRIDE=.debug.x86 $commonargs RELEASE=0 BUILD32_ON_64=1 USE_LIBVPX=0 $makecmd utils"
|
|
|
|
fi
|
2012-03-14 06:27:45 +00:00
|
|
|
|
2012-07-29 23:35:12 +00:00
|
|
|
dobuildtools "x86 release" \
|
|
|
|
"EXESUFFIX_OVERRIDE=.x86 $commonargs RELEASE=1 BUILD32_ON_64=1 USE_LIBVPX=0 $makecmd utils"
|
2012-03-14 06:27:45 +00:00
|
|
|
fi
|
|
|
|
|
2012-07-29 23:35:12 +00:00
|
|
|
if [ $buildppc == 1 ]; then
|
|
|
|
if [ $builddebug == 1 ]; then
|
|
|
|
dobuildtools "PowerPC debug" \
|
|
|
|
"ARCH='-arch ppc' EXESUFFIX_OVERRIDE=.debug.ppc $commonargs RELEASE=0 BUILD32_ON_64=0 USE_LIBVPX=0 $makecmd utils"
|
2012-03-14 06:27:45 +00:00
|
|
|
fi
|
2012-07-29 23:35:12 +00:00
|
|
|
|
|
|
|
dobuildtools "PowerPC release" \
|
|
|
|
"ARCH='-arch ppc' EXESUFFIX_OVERRIDE=.ppc $commonargs RELEASE=1 BUILD32_ON_64=0 USE_LIBVPX=0 $makecmd utils"
|
2012-03-14 06:27:45 +00:00
|
|
|
fi
|
|
|
|
|
2012-07-29 23:35:12 +00:00
|
|
|
mkdir -p ../tools
|
|
|
|
|
|
|
|
echo buildtools: Creating fat binaries.
|
|
|
|
utils=`make printutils && EXESUFFIX_OVERRIDE=.debug make printutils`
|
2012-03-14 06:27:45 +00:00
|
|
|
for i in $utils; do
|
2012-07-29 23:35:12 +00:00
|
|
|
binaries=
|
|
|
|
for j in ${i}.{x86,x64,ppc}; do
|
|
|
|
if [ -f "$j" ]; then
|
|
|
|
binaries="$binaries $j"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if [ -n "$binaries" ]; then
|
|
|
|
lipo -create $binaries -output $i || exit 1
|
|
|
|
# ln -f -s ../build/$i ../tools/$i || exit 1
|
|
|
|
cp -f $i ../tools/$i || exit 1
|
2012-03-14 06:27:45 +00:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2012-07-29 23:35:12 +00:00
|
|
|
if [ $installtools == 1 ]; then
|
|
|
|
if [ -d "/opt/local/bin" ]; then
|
|
|
|
echo buildtools: Installing to MacPorts search path.
|
|
|
|
for i in $utils; do
|
|
|
|
if [ -f "$i" ]; then
|
|
|
|
cp -f "$i" "/opt/local/bin/" || exit 1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -d "/usr/local/bin" ]; then
|
|
|
|
echo buildtools: Installing to Homebrew search path.
|
|
|
|
for i in $utils; do
|
|
|
|
if [ -f "$i" ]; then
|
|
|
|
cp -f "$i" "/usr/local/bin/" || exit 1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
2012-03-14 06:27:45 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
fi
|
|
|
|
|
2013-04-17 20:34:54 +00:00
|
|
|
if [ $doclean == 1 ] || [ $buildmain == 1 ]; then
|
2012-03-10 09:45:18 +00:00
|
|
|
rm -f {eduke32,mapster32}{.debug,}{.x86,.x64,.ppc,}
|
2012-11-26 08:23:20 +00:00
|
|
|
rm -rf {$package/,}{EDuke32,Mapster32}{.debug,}.app
|
2013-04-17 20:34:54 +00:00
|
|
|
fi
|
2012-03-10 09:45:18 +00:00
|
|
|
|
2013-04-17 20:34:54 +00:00
|
|
|
# The build process itself:
|
|
|
|
if [ $buildmain == 1 ]; then
|
2012-07-29 23:35:12 +00:00
|
|
|
if [ $iamhelix == 1 ]; then
|
|
|
|
makecmd="make -j 2"
|
|
|
|
else
|
|
|
|
makecmd="make"
|
|
|
|
fi
|
|
|
|
|
2012-03-10 09:45:18 +00:00
|
|
|
if [ $build64 == 1 ]; then
|
|
|
|
if [ $builddebug == 1 ]; then
|
2012-07-29 23:35:12 +00:00
|
|
|
dobuildem debug.x64 "ARCH='-arch x86_64' $commonargs RELEASE=0 BUILD32_ON_64=0 $makecmd"
|
2012-03-10 09:45:18 +00:00
|
|
|
fi
|
|
|
|
|
2012-08-24 18:49:13 +00:00
|
|
|
if [ $buildrelease == 1 ]; then
|
|
|
|
dobuildem x64 "ARCH='-arch x86_64' $commonargs RELEASE=1 BUILD32_ON_64=0 $makecmd"
|
|
|
|
fi
|
2011-06-17 13:11:19 +00:00
|
|
|
fi
|
|
|
|
|
2012-03-10 09:45:18 +00:00
|
|
|
if [ $build86 == 1 ]; then
|
|
|
|
if [ $builddebug == 1 ]; then
|
2012-07-29 23:35:12 +00:00
|
|
|
dobuildem debug.x86 "$commonargs RELEASE=0 BUILD32_ON_64=1 USE_LIBPNG=0 USE_LIBVPX=0 $makecmd"
|
2012-03-10 09:45:18 +00:00
|
|
|
fi
|
|
|
|
|
2012-07-29 23:35:12 +00:00
|
|
|
dobuildem x86 "$commonargs RELEASE=1 BUILD32_ON_64=1 USE_LIBPNG=0 USE_LIBVPX=0 $makecmd"
|
2011-06-17 13:11:19 +00:00
|
|
|
fi
|
2011-07-20 23:04:20 +00:00
|
|
|
|
2012-03-10 09:45:18 +00:00
|
|
|
if [ $buildppc == 1 ]; then
|
|
|
|
if [ $builddebug == 1 ]; then
|
2012-07-29 23:35:12 +00:00
|
|
|
dobuildem debug.ppc "ARCH='-arch ppc' $commonargs RELEASE=0 BUILD32_ON_64=0 USE_LIBPNG=0 USE_LIBVPX=0 $makecmd"
|
2012-03-10 09:45:18 +00:00
|
|
|
fi
|
|
|
|
|
2012-07-29 23:35:12 +00:00
|
|
|
dobuildem ppc "ARCH='-arch ppc' $commonargs RELEASE=1 BUILD32_ON_64=0 USE_LIBPNG=0 USE_LIBVPX=0 $makecmd"
|
2012-03-08 19:16:30 +00:00
|
|
|
fi
|
2011-06-17 13:11:19 +00:00
|
|
|
fi
|
|
|
|
|
2012-03-04 09:33:23 +00:00
|
|
|
# clean up, clean up, everybody everywhere, clean up, clean up, everybody do your share
|
|
|
|
if [ "$vc" == "svn" ]; then
|
|
|
|
svn revert "source/rev.h"
|
|
|
|
elif [ "$vc" == "git" ]; then
|
|
|
|
git checkout "source/rev.h"
|
|
|
|
fi
|
|
|
|
|
2012-02-25 03:31:20 +00:00
|
|
|
# Duplicating .app bundles for debug build:
|
2012-07-29 23:35:12 +00:00
|
|
|
if [ $builddebug == 1 ] || [ $pack == 1 ]; then
|
2012-03-10 09:45:18 +00:00
|
|
|
for i in Mapster32 EDuke32; do
|
|
|
|
if [ -d "$i.app" ]; then
|
|
|
|
cp -RP "$i.app" "$i.debug.app"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
2012-02-25 03:31:20 +00:00
|
|
|
|
2012-03-10 09:45:18 +00:00
|
|
|
# Begin assembling archive contents:
|
|
|
|
echo Creating fat binaries.
|
2013-04-17 20:34:45 +00:00
|
|
|
|
|
|
|
success=$dummy
|
|
|
|
if [ $dummy == 0 ]; then
|
|
|
|
for i in {eduke32,mapster32}{.debug,}; do
|
|
|
|
binaries=
|
|
|
|
for j in ${i}.{x86,x64,ppc}; do
|
|
|
|
if [ -f "$j" ]; then
|
|
|
|
binaries="$binaries $j"
|
|
|
|
success=1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ -n "$binaries" ]; then
|
|
|
|
lipo -create $binaries -output $i
|
|
|
|
app=${i//eduke32/EDuke32}
|
|
|
|
app=${app//mapster32/Mapster32}.app
|
|
|
|
cp -f $i "$app/Contents/MacOS/${i%.debug}"
|
|
|
|
mv -f "$app" "$package/"
|
2012-03-10 09:45:18 +00:00
|
|
|
fi
|
|
|
|
done
|
2013-04-17 20:34:45 +00:00
|
|
|
fi
|
2012-02-25 03:31:20 +00:00
|
|
|
|
2012-03-10 09:45:18 +00:00
|
|
|
# Almost done...
|
|
|
|
if [ $success == 1 ]; then
|
2012-11-26 08:23:20 +00:00
|
|
|
cd $package
|
|
|
|
|
2012-07-29 23:35:12 +00:00
|
|
|
echo "Generating README.OSX and Changelog.txt"
|
2012-02-25 03:31:20 +00:00
|
|
|
|
2012-03-10 09:45:18 +00:00
|
|
|
# Output README.OSX:
|
|
|
|
let "darwinversion -= 4"
|
2011-06-17 13:11:19 +00:00
|
|
|
echo "This archive was produced from revision $rev by the osxbuild.sh script." > README.OSX
|
2012-03-10 09:45:18 +00:00
|
|
|
echo "Built on: Mac OS X 10.$darwinversion" >> README.OSX
|
2011-07-20 23:04:20 +00:00
|
|
|
echo "EDuke32 home: http://www.eduke32.com" >> README.OSX
|
2012-03-10 09:45:18 +00:00
|
|
|
echo "OS X build discussion on Duke4.net: http://forums.duke4.net/topic/4242-building-eduke-on-mac-os-x/" >> README.OSX
|
2011-11-17 21:10:18 +00:00
|
|
|
echo "The 64-bit build in this archive has LibVPX (http://www.webmproject.org/code/)" >> README.OSX
|
2012-07-29 23:35:12 +00:00
|
|
|
echo "from MacPorts (http://www.macports.org/) and" >> README.OSX
|
|
|
|
echo "LibPNG from Fink (http://www.finkproject.org/) statically linked into it." >> README.OSX
|
2012-03-10 09:45:18 +00:00
|
|
|
|
2012-03-12 04:45:17 +00:00
|
|
|
# Generate Changelog:
|
|
|
|
if [ -z $lastrevision ]; then
|
2013-04-17 20:34:45 +00:00
|
|
|
lastrevision=$(ls -A1 eduke32-osx* | tail -n1 | cut -d- -f3 | cut -d. -f1)
|
|
|
|
|
|
|
|
if [ -z $lastrevision ]; then
|
|
|
|
let lastrevision=rev-1
|
|
|
|
elif [ $lastrevision -lt $rev ]; then
|
|
|
|
let lastrevision+=1
|
|
|
|
else
|
|
|
|
let lastrevision=rev-1
|
|
|
|
fi
|
2012-03-12 04:45:17 +00:00
|
|
|
fi
|
|
|
|
|
2013-04-17 20:34:45 +00:00
|
|
|
echo "Using r$lastrevision as last revision for change log"
|
|
|
|
|
2012-03-12 04:45:17 +00:00
|
|
|
if [ "$vc" == "svn" ]; then
|
2012-07-29 23:35:12 +00:00
|
|
|
svn log -r $rev:$lastrevision > Changelog.txt
|
2012-03-12 04:45:17 +00:00
|
|
|
elif [ "$vc" == "git" ]; then
|
2012-07-29 23:35:12 +00:00
|
|
|
commitid=$(git log --grep="git-svn-id: .*@$lastrevision" -n 1 | grep -E '^commit ' | head -n 1 | awk '{print $2}')
|
|
|
|
# Get the commit messages and strip the email addresses
|
|
|
|
git log $commitid..HEAD | sed 's/<.*@.*>//g' > Changelog.txt
|
2012-03-12 04:45:17 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Package
|
2012-03-26 05:07:42 +00:00
|
|
|
if [ $pack == 1 ]; then
|
|
|
|
arfilename="eduke32-osx-$rev.zip"
|
2012-07-29 23:35:12 +00:00
|
|
|
echo "Packing distribution into $arfilename"
|
2012-03-26 05:07:42 +00:00
|
|
|
rm -f "$arfilename"
|
2012-11-26 08:23:20 +00:00
|
|
|
zip -r -y "$arfilename" * -x "*.svn*" "*.git*" "*.dll"
|
2012-03-26 05:07:42 +00:00
|
|
|
fi
|
2012-11-26 08:23:20 +00:00
|
|
|
cd ..
|
2011-06-17 13:11:19 +00:00
|
|
|
fi
|