Merge pull request #13129 from pchote/osx-packaging
Update OSX packaging for per-mod launchers.
This commit is contained in:
@@ -19,6 +19,10 @@ addons:
|
||||
- nsis-common
|
||||
- dpkg
|
||||
- markdown
|
||||
- zlib1g-dev
|
||||
- libbz2-dev
|
||||
- cmake
|
||||
- genisoimage
|
||||
|
||||
# Environment variables
|
||||
env:
|
||||
@@ -72,7 +76,7 @@ deploy:
|
||||
secure: "g/LU11f+mjqv+lj0sR1UliHwogXL4ofJUwoG5Dbqlvdf5UTLWytw/OWSCv8RGyuh10miyWeaoqHh1cn2C1IFhUEqN1sSeKKKOWOTvJ2FR5mzi9uH3d/MOBzG5icQ7Qh0fZ1YPz5RaJJhYu6bmfvA/1gD49GoaX2kxQL4J5cEBgg="
|
||||
file:
|
||||
- build/OpenRA-${TRAVIS_TAG}.exe
|
||||
- build/OpenRA-${TRAVIS_TAG}.zip
|
||||
- build/OpenRA-${TRAVIS_TAG}.dmg
|
||||
- build/openra_${DOTVERSION}_all.deb
|
||||
skip_cleanup: true
|
||||
on:
|
||||
|
||||
BIN
packaging/osx/DS_Store
Normal file
BIN
packaging/osx/DS_Store
Normal file
Binary file not shown.
BIN
packaging/osx/background.tiff
Normal file
BIN
packaging/osx/background.tiff
Normal file
Binary file not shown.
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
# OpenRA packaging script for Mac OSX
|
||||
|
||||
LAUNCHER_TAG="osx-launcher-20170211"
|
||||
LAUNCHER_TAG="osx-launcher-20170414"
|
||||
|
||||
if [ $# -ne "3" ]; then
|
||||
echo "Usage: `basename $0` tag files-dir outputdir"
|
||||
@@ -14,18 +14,73 @@ if [ -e "OpenRA.app" ]; then
|
||||
exit 2
|
||||
fi
|
||||
|
||||
TAG="$1"
|
||||
BUILTDIR="$2"
|
||||
OUTPUTDIR="$3"
|
||||
|
||||
modify_plist() {
|
||||
sed "s|$1|$2|g" "$3" > "$3.tmp" && mv "$3.tmp" "$3"
|
||||
}
|
||||
|
||||
# Copies the game files and sets metadata
|
||||
populate_template() {
|
||||
cp -r OpenRA.app "build/$1"
|
||||
cp -r $BUILTDIR/* "build/$1/Contents/Resources/" || exit 3
|
||||
cp "$2.icns" "build/$1/Contents/Resources/OpenRA.icns"
|
||||
modify_plist "{MOD_ID}" "$2" "build/$1/Contents/Info.plist"
|
||||
modify_plist "{MOD_NAME}" "$3" "build/$1/Contents/Info.plist"
|
||||
modify_plist "{JOIN_SERVER_URL_SCHEME}" "openra-$2-$TAG" "build/$1/Contents/Info.plist"
|
||||
}
|
||||
|
||||
# Deletes from the first argument's mod dirs all the later arguments
|
||||
delete_mods() {
|
||||
pushd "build/$1/Contents/Resources/mods" > /dev/null
|
||||
shift
|
||||
rm -rf $@
|
||||
pushd > /dev/null
|
||||
}
|
||||
|
||||
echo "Building libdmg-hfsplus"
|
||||
# Cloning is very slow, so fetch zip instead
|
||||
curl -s -L -O https://github.com/OpenRA/libdmg-hfsplus/archive/master.zip || exit 3
|
||||
unzip -qq master.zip
|
||||
rm master.zip
|
||||
pushd libdmg-hfsplus-master > /dev/null
|
||||
cmake . > /dev/null
|
||||
make > /dev/null
|
||||
popd > /dev/null
|
||||
|
||||
echo "Building launchers"
|
||||
curl -s -L -O https://github.com/OpenRA/OpenRALauncherOSX/releases/download/${LAUNCHER_TAG}/launcher.zip || exit 3
|
||||
unzip -qq launcher.zip
|
||||
rm launcher.zip
|
||||
mkdir -p build/.DropDMGBackground
|
||||
|
||||
# Copy the template to build the game package
|
||||
cp -r $2/* "OpenRA.app/Contents/Resources/" || exit 3
|
||||
# Background image is created from source svg in artsrc repository
|
||||
# exported to tiff at 72 + 144 DPI, then combined using
|
||||
# tiffutil -cathidpicheck bg.tiff bg2x.tiff -out background.tiff
|
||||
cp background.tiff build/.DropDMGBackground
|
||||
|
||||
# Set version string
|
||||
sed "s/{DEV_VERSION}/${1}/" OpenRA.app/Contents/Info.plist > OpenRA.app/Contents/Info.plist.tmp
|
||||
mv OpenRA.app/Contents/Info.plist.tmp OpenRA.app/Contents/Info.plist
|
||||
# Finder metadata created using free trial of DropDMG
|
||||
cp DS_Store build/.DS_Store
|
||||
|
||||
# Package app bundle into a zip and clean up
|
||||
zip OpenRA-$1 -r -9 OpenRA.app --quiet --symlinks
|
||||
mv OpenRA-$1.zip $3
|
||||
rm -rf OpenRA.app
|
||||
ln -s /Applications/ build/Applications
|
||||
|
||||
modify_plist "{DEV_VERSION}" "${1}" "OpenRA.app/Contents/Info.plist"
|
||||
modify_plist "{FAQ_URL}" "http://wiki.openra.net/FAQ" "OpenRA.app/Contents/Info.plist"
|
||||
|
||||
populate_template "OpenRA - Red Alert.app" "ra" "Red Alert"
|
||||
delete_mods "OpenRA - Red Alert.app" "cnc" "d2k"
|
||||
|
||||
populate_template "OpenRA - Tiberian Dawn.app" "cnc" "Tiberian Dawn"
|
||||
delete_mods "OpenRA - Tiberian Dawn.app" "ra" "d2k"
|
||||
|
||||
populate_template "OpenRA - Dune 2000.app" "d2k" "Dune 2000"
|
||||
delete_mods "OpenRA - Dune 2000.app" "ra" "cnc"
|
||||
|
||||
echo "Packaging disk image"
|
||||
genisoimage -V OpenRA -D -R -apple -no-pad -o build.dmg build
|
||||
libdmg-hfsplus-master/dmg/dmg dmg ./build.dmg "$3/OpenRA-$1.dmg"
|
||||
|
||||
# Clean up
|
||||
rm -rf OpenRA.app build.dmg libdmg-hfsplus-master build
|
||||
|
||||
BIN
packaging/osx/cnc.icns
Normal file
BIN
packaging/osx/cnc.icns
Normal file
Binary file not shown.
BIN
packaging/osx/d2k.icns
Normal file
BIN
packaging/osx/d2k.icns
Normal file
Binary file not shown.
BIN
packaging/osx/ra.icns
Normal file
BIN
packaging/osx/ra.icns
Normal file
Binary file not shown.
@@ -80,7 +80,7 @@ fi
|
||||
popd >/dev/null
|
||||
|
||||
pushd osx >/dev/null
|
||||
echo "Zipping OS X package"
|
||||
echo "Building OS X package"
|
||||
./buildpackage.sh "$TAG" "$BUILTDIR" "$OUTPUTDIR"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "OS X package build failed."
|
||||
|
||||
Reference in New Issue
Block a user