Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add build script

  • Loading branch information...
commit 8007b2d644f8994ea59f9d68d323331258dae69a 1 parent 6faa87d
@TomK32 TomK32 authored
Showing with 170 additions and 0 deletions.
  1. +2 −0  .gitignore
  2. +72 −0 build.sh
  3. +96 −0 build/osx.patch
View
2  .gitignore
@@ -0,0 +1,2 @@
+build/*zip
+.DS_Store
View
72 build.sh
@@ -0,0 +1,72 @@
+#!/bin/bash
+
+# https://github.com/TomK32/kollum/blob/master/build.sh
+# based on https://github.com/josefnpat/LD24/blob/master/build.sh
+# Configure this, and also ensure you have the build/osx.patch ready.
+NAME="Rogue Beach, CA"
+
+# Version is {last tag}-{commits since last tag}.
+# e.g: 0.1.2-3
+GAME_VERSION=`git tag|tail -1`
+REVISION=`git log ${GAME_VERSION}..HEAD --pretty=format:'' | wc -l | sed -e 's/ //g'`
+
+FILENAME="$NAME-$GAME_VERSION-$REVISION"
+VERSION=0.8.0
+BUILD="`pwd`/build"
+mkdir -p "${BUILD}"
+
+# download love files
+for ARCH in "win-x86" "win-x64" "macosx-ub"
+do
+ if [ ! -f "$BUILD/love-${VERSION}-${ARCH}.zip" ];
+ then
+ wget "https://bitbucket.org/rude/love/downloads/love-${VERSION}-${ARCH}.zip" -P "${BUILD}"
+ fi
+done
+
+# Take HEAD make an archive of it
+git archive HEAD -o "$BUILD/$FILENAME.zip"
+
+echo "game = {}; game.version = '${GAME_VERSION}-${REVISION}'" > "version.lua"
+# Add the version file
+zip -q "$BUILD/$FILENAME.zip" "version.lua"
+mv "$BUILD/$FILENAME.zip" "$BUILD/$FILENAME.love"
+
+GAME="$BUILD/$FILENAME.love"
+
+echo "Building $FILENAME"
+
+# For windows, just append our love file and zip it
+for arch in 'win-x86' 'win-x64'
+do
+ A="$BUILD/love-$VERSION-$arch"
+ if [ -f "$BUILD/$A" ]; then rm "$BUILD/$A"; fi
+ unzip -q -d "$BUILD" "$A.zip"
+ cat "$GAME" >> "$A/love.exe"
+
+ mv "$A" "$BUILD/${FILENAME}_$arch"
+ R_PWD=`pwd`
+ cd "$BUILD/${FILENAME}_$arch"
+
+ echo "$BUILD/${FILENAME}_$arch.zip"
+ if [ -f "$BUILD/${FILENAME}_$arch.zip" ]; then rm "$BUILD/${FILENAME}_$arch.zip"; fi
+ zip -q -r "$BUILD/${FILENAME}_$arch.zip" .
+ rm -R "$BUILD/${FILENAME}_$arch"
+ cd "$R_PWD"
+done
+
+# OS X needs more work, unzip, copy love file into it, apply the patch
+# and zip it up again
+echo "$BUILD/${FILENAME}.app.zip"
+if [ -d "$BUILD/love.app" ]; then rm -R "$BUILD/love.app"; fi
+unzip -q -d "$BUILD" "$BUILD/love-$VERSION-macosx-ub.zip"
+mv "$BUILD/love.app" "$BUILD/${FILENAME}.app"
+cp "$BUILD/$FILENAME.love" "$BUILD/$FILENAME.app/Contents/Resources/"
+patch "$BUILD/${FILENAME}.app/Contents/Info.plist" -i "$BUILD/osx.patch"
+R_PWD=`pwd`
+cd "$BUILD"
+if [ -f "${FILENAME}_macosx.zip" ]; then rm "${FILENAME}_macosx.zip"; fi
+zip -q -r "${FILENAME}_macosx.zip" "${FILENAME}.app"
+cd $R_PWD
+rm -rf "$BUILD/$FILENAME.app"
+
View
96 build/osx.patch
@@ -0,0 +1,96 @@
+--- build/Kollum.app/Contents/Info.plist 2012-04-02 22:35:23.000000000 +0200
++++ Info.plist 2012-12-01 23:52:41.000000000 +0100
+@@ -6,49 +6,20 @@
+ <string>11D50b</string>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+- <key>CFBundleDocumentTypes</key>
+- <array>
+- <dict>
+- <key>CFBundleTypeIconFile</key>
+- <string>LoveDocument.icns</string>
+- <key>CFBundleTypeName</key>
+- <string>LÖVE Project</string>
+- <key>CFBundleTypeRole</key>
+- <string>Viewer</string>
+- <key>LSHandlerRank</key>
+- <string>Owner</string>
+- <key>LSItemContentTypes</key>
+- <array>
+- <string>org.love2d.love-game</string>
+- </array>
+- </dict>
+- <dict>
+- <key>CFBundleTypeName</key>
+- <string>Folder</string>
+- <key>CFBundleTypeOSTypes</key>
+- <array>
+- <string>fold</string>
+- </array>
+- <key>CFBundleTypeRole</key>
+- <string>Viewer</string>
+- <key>LSHandlerRank</key>
+- <string>None</string>
+- </dict>
+- </array>
+ <key>CFBundleExecutable</key>
+ <string>love</string>
+ <key>CFBundleIconFile</key>
+- <string>Love.icns</string>
++ <string>Love.icns</string>
+ <key>CFBundleIdentifier</key>
+- <string>org.love2d.love</string>
++ <string>com.ananasblau.rogue-beach</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+- <string>LÖVE</string>
++ <string>Rogue Beach, CA</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+- <string>0.8.0</string>
++ <string>0.0.1</string>
+ <key>CFBundleSignature</key>
+ <string>LoVe</string>
+ <key>DTCompiler</key>
+@@ -66,38 +37,10 @@
+ <key>DTXcodeBuild</key>
+ <string>4E2002</string>
+ <key>NSHumanReadableCopyright</key>
+- <string>© 2006-2012 LÖVE Development Team</string>
++ <string>© 2012-2013 Thomas R. Koll</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+- <key>UTExportedTypeDeclarations</key>
+- <array>
+- <dict>
+- <key>UTTypeConformsTo</key>
+- <array>
+- <string>com.pkware.zip-archive</string>
+- </array>
+- <key>UTTypeDescription</key>
+- <string>LÖVE Project</string>
+- <key>UTTypeIconFile</key>
+- <string>LoveDocument.icns</string>
+- <key>UTTypeIdentifier</key>
+- <string>org.love2d.love-game</string>
+- <key>UTTypeReferenceURL</key>
+- <string>http://love2d.org/wiki/Game_Distribution</string>
+- <key>UTTypeTagSpecification</key>
+- <dict>
+- <key>com.apple.ostype</key>
+- <string>LOVE</string>
+- <key>public.filename-extension</key>
+- <array>
+- <string>love</string>
+- </array>
+- <key>public.mime-type</key>
+- <string>application/x-love-game</string>
+- </dict>
+- </dict>
+- </array>
+ </dict>
+ </plist>
Please sign in to comment.
Something went wrong with that request. Please try again.