2011-01-08 06:38:39 +08:00
|
|
|
#!/bin/sh
|
2011-01-10 06:49:52 +08:00
|
|
|
|
2012-01-19 03:45:21 +08:00
|
|
|
if [ "$WORKSPACE" == "" ]; then
|
|
|
|
echo "ERROR: Missing WORKSPACE environment variable."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-09-17 00:21:46 +08:00
|
|
|
cmakeGenerator=Ninja
|
|
|
|
cmakeCommonArgs="-DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/dist -DCMAKE_BUILD_TYPE=RelWithDebInfo"
|
2020-07-03 16:27:07 +08:00
|
|
|
VERSION=`cat flightgear/flightgear-version`
|
2013-02-09 18:34:26 +08:00
|
|
|
|
2017-12-26 01:04:47 +08:00
|
|
|
#####################################################################################
|
|
|
|
# ensure fgrcc can run when linked against libSimGearCore, for example
|
|
|
|
export LD_LIBRARY_PATH=$WORKSPACE/dist/lib64:$WORKSPACE/dist/lib:$LD_LIBRARY_PATH
|
|
|
|
|
2012-01-19 03:45:21 +08:00
|
|
|
#####################################################################################
|
2012-01-18 07:32:16 +08:00
|
|
|
# remove old and create fresh build directories
|
2015-03-15 05:43:18 +08:00
|
|
|
cd $WORKSPACE
|
2012-01-18 07:32:16 +08:00
|
|
|
mkdir -p sgBuild
|
|
|
|
mkdir -p fgBuild
|
|
|
|
mkdir -p output
|
|
|
|
rm -rf output/*
|
|
|
|
|
2012-01-19 03:45:21 +08:00
|
|
|
#####################################################################################
|
2012-01-18 07:32:16 +08:00
|
|
|
echo "Starting on SimGear"
|
|
|
|
cd sgBuild
|
2020-09-17 00:21:46 +08:00
|
|
|
cmake -G $cmakeGenerator $cmakeCommonArgs ../simgear
|
2012-01-18 07:32:16 +08:00
|
|
|
|
|
|
|
# compile
|
2020-09-17 00:21:46 +08:00
|
|
|
ninja
|
2011-01-10 06:49:52 +08:00
|
|
|
|
|
|
|
if [ $? -ne '0' ]; then
|
|
|
|
echo "make simgear failed"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-09-17 00:21:46 +08:00
|
|
|
ninja install
|
2011-01-10 06:49:52 +08:00
|
|
|
|
2012-01-18 07:32:16 +08:00
|
|
|
# build source package and copy to output
|
2020-09-17 00:21:46 +08:00
|
|
|
ninja package_source
|
2012-01-18 07:32:16 +08:00
|
|
|
cp simgear-*.tar.bz2 ../output/.
|
|
|
|
|
2012-01-19 03:45:21 +08:00
|
|
|
#####################################################################################
|
2011-01-10 06:49:52 +08:00
|
|
|
echo "Starting on FlightGear"
|
2012-01-18 07:32:16 +08:00
|
|
|
cd ../fgBuild
|
2020-09-17 00:21:46 +08:00
|
|
|
cmake -G $cmakeGenerator $cmakeCommonArgs -DENABLE_SWIFT:BOOL=ON -DFG_BUILD_TYPE=Release ../flightgear
|
2012-01-18 06:43:12 +08:00
|
|
|
|
2012-01-18 07:32:16 +08:00
|
|
|
# compile
|
2020-09-17 00:21:46 +08:00
|
|
|
ninja
|
2011-01-10 06:49:52 +08:00
|
|
|
|
|
|
|
if [ $? -ne '0' ]; then
|
|
|
|
echo "make flightgear failed"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-09-17 00:21:46 +08:00
|
|
|
ninja install
|
2012-01-18 06:43:12 +08:00
|
|
|
|
2012-01-18 07:32:16 +08:00
|
|
|
# build source package and copy to output
|
2020-09-17 00:21:46 +08:00
|
|
|
ninja package_source
|
2012-01-18 08:08:33 +08:00
|
|
|
cp flightgear-*.tar.bz2 ../output/.
|
2012-01-18 07:32:16 +08:00
|
|
|
|
2015-01-19 07:37:19 +08:00
|
|
|
#####################################################################################
|
|
|
|
|
2020-09-23 01:24:15 +08:00
|
|
|
if which sentry-cli >/dev/null; then
|
|
|
|
echo "Uploading symbols"
|
|
|
|
|
|
|
|
export SENTRY_ORG=flightgear
|
|
|
|
export SENTRY_PROJECT=flightgear
|
|
|
|
|
|
|
|
# set in the Jenkins environment for the builder
|
|
|
|
# export SENTRY_AUTH_TOKEN=YOUR_AUTH_TOKEN
|
|
|
|
|
|
|
|
ERROR=$(sentry-cli upload-dif --include-sources "$WORKSPACE/dist/bin/fgfs" 2>&1 >/dev/null)
|
|
|
|
if [ ! $? -eq 0 ]; then
|
|
|
|
echo "warning: sentry-cli - $ERROR"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases"
|
|
|
|
fi
|
|
|
|
|
2020-09-28 23:29:32 +08:00
|
|
|
# now we uploaded symnbols, strip the binaries
|
|
|
|
|
|
|
|
strip --strip-debug $WORKSPACE/dist/bin/fgfs
|
|
|
|
strip --strip-debug $WORKSPACE/dist/bin/fgviewer
|
|
|
|
strip --strip-debug $WORKSPACE/dist/bin/fgjs
|
2020-09-23 01:24:15 +08:00
|
|
|
|