LovePackaging installed (note: conf broken)

This commit is contained in:
Paul Liverman III
2016-05-04 13:48:27 -07:00
parent 62efb2fa46
commit 46f48d9628
6 changed files with 362 additions and 0 deletions

5
.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
!builds/
builds/*
!builds/latest/
!builds/build.number
tmp/

65
build-config.sh Normal file
View File

@@ -0,0 +1,65 @@
# The name of the resulting executables.
packageName="FADE"
# User-friendly package name.
friendlyPackageName="$packageName"
# Who made this? (Yes, change this to your name.)
author="Guard13007"
# Copyright year (ex 2014-2015 or 2015)
copyrightYear="2016"
# A unique identifier for your package.
# (It should be fine to leave this as its default.)
identifier="com.$author.$packageName"
# Current version (of your program)
version="0.1.0"
###### Important! ONLY USE ABSOLUATE PATHS ######
# Where to place the resulting executables.
outputDir="$(pwd)/builds"
# Where the source code is. (This should be where your main.lua file is.)
sourceDir="$(pwd)/src"
# Files to include in ZIP packages. (ReadMe's, licenses, etc.)
includes="$(pwd)/build-includes"
# Where unzipped executables to make packages out of will be kept
# (This is also where LOVE executables will be kept before modifications to make your packages)
win32Dir="$outputDir/win32src"
win64Dir="$outputDir/win64src"
osx10Dir="$outputDir/osx10src"
# Specify what version of love to use
loveVersion="0.10.1"
# Modified love executables (optional)
# (The default values are where the default exe's will be extracted)
win32exe="$win32Dir/love-$loveVersion-win32/love.exe"
win64exe="$win64Dir/love-$loveVersion-win64/love.exe"
# Mac icns files for package icon
# (It's best to just specify the same file for both?
# I don't think both are needed, but I am not very familiar with the Mac system.)
osxIconsDirectory="$osx10Dir/love.app/Contents/Resources"
osxFileIcon="LoveDocument.icns"
osxBundleIcon="Love.icns"
# Remove old packages?
removeOld=true
# Allow overwrite? NOT IMPLEMENTED
# If this is false, LovePackaging will quit if you try to build with the same version number twice.
allowOverwrite=false
#NOTE to self: if autoNumberBuilds, this setting doesn't matter
# Auto-number builds?
# An "-buildN" will be added to the end of ZIP package names, with N being the Nth time this project was built.
# (To do this, a build.number file is stored in $outputDir, so watch out for that.)
autoNumberBuilds=true
# Place latest builds in builds/latest?
# (This is a copy, not a move.)
latestBuilds=true
latestBuildsDir="$outputDir/latest"
# Use curl or wget?
# (One of these lines should be commented out, the other not)
#download="curl -o"
download="wget --progress=bar:force -O"

View File

@@ -0,0 +1,15 @@
Controls:
- Click and drag to draw (alternately, using touch works).
- Right-click and hold to draw with a white line instead of the currently selected color.
- Scroll the mousewheel to cycle through the colors available.
- Escape closes the window.
- P will take a screenshot.
- B will toggle between black and white and color modes.
- C will clear the canvas.
Screenshots are saved in:
- On Windows: %APPDATA%/LOVE/FADE
- On Linux: ~/.local/share/love/FADE
- On OS X: ~/.local/share/love/FADE

View File

@@ -0,0 +1,81 @@
#!/bin/bash
mkdir -p ./tmp
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
<plist version=\"1.0\">
<dict>
<key>BuildMachineOSBuild</key>
<string>13D65</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFile</key>
<string>$osxFileIcon</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>$osxBundleIcon</string>
<key>CFBundleIdentifier</key>
<string>$identifier</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$friendlyPackageName</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$version</string>
<key>CFBundleSignature</key>
<string>LoVe</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>5B1008</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>13C64</string>
<key>DTSDKName</key>
<string>macosx10.9</string>
<key>DTXcode</key>
<string>0511</string>
<key>DTXcodeBuild</key>
<string>5B1008</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.games</string>
<key>NSHumanReadableCopyright</key>
<string>© $copyrightYear $author</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>" > ./tmp/Info.plist
echo " Info.plist generated."

195
build.sh Executable file
View File

@@ -0,0 +1,195 @@
#!/bin/bash
# keep unset variables from breaking everything
set -o nounset
# exit on error instead of continuing
set -o errexit
# get config
#if [ ! -z "$1" ]; then
# # has a command-line option, which should be the config file to load from
# source "$1"
#else
source ./build-config.sh
#fi
# make $outputDir if it doesn't exist
if [ ! -d "$outputDir" ]; then mkdir -p "$outputDir"; fi
# append -buildN build numbers
# (build.number file stored in $outputDir)
if [ $autoNumberBuilds = true ]; then
# get the number if file exists, else use 1
if [ -r "$outputDir/build.number" ]; then
source "$outputDir/build.number"
((build++))
else
build=1
fi
# store the current build number
echo "build=$build" > "$outputDir/build.number"
# set version to use new build number
version=$version-$build
fi
# check that zip and unzip are accessible
# not sure if this is the best way to do this or not
if ! which zip > /dev/null 2>&1; then
echo "zip not installed"
exit 2;
fi
if ! which unzip > /dev/null 2>&1; then
echo "unzip not installed"
exit 3;
fi
# remove old versions of package?
if [ $removeOld = true ]; then
rm -f "$outputDir/$packageName*"
fi
# move to source dir and store original for later use
# (this is to make a zip command work)
originalDir=$(pwd)
cd "$sourceDir"
# build .love file
echo "Building $packageName (version $version)... (.love file)"
zip -r -X -q "$outputDir/$packageName-$version.love" ./*
echo " Done."
# check if executables exist, if not, download them
# (assumes if the exe exists, everything else does too)
if [ ! -r "$win32Dir/love-$loveVersion-win32/love.exe" ]; then
mkdir -p "$win32Dir"
echo "Downloading win32src..."
$download "$win32Dir/love32.zip" https://bitbucket.org/rude/love/downloads/love-$loveVersion-win32.zip
echo " Done."
echo "Extracting win32src..."
unzip -q "$win32Dir/love32.zip" -d "$win32Dir"
echo " Done."
echo "Deleting ZIP file..."
rm -f "$win32Dir/love32.zip"
echo " Done."
fi
if [ ! -r "$win64Dir/love-$loveVersion-win64/love.exe" ]; then
mkdir -p "$win64Dir"
echo "Downloading win64src..."
$download "$win64Dir/love64.zip" https://bitbucket.org/rude/love/downloads/love-$loveVersion-win64.zip
echo " Done."
echo "Extracting win64src..."
unzip -q "$win64Dir/love64.zip" -d "$win64Dir"
echo " Done."
echo "Deleting ZIP file..."
rm -f "$win64Dir/love64.zip"
echo " Done."
fi
if [ ! -d "$osx10Dir/love.app" ]; then
mkdir -p "$osx10Dir"
echo "Downloading osx10src..."
$download "$osx10Dir/loveOSX.zip" https://bitbucket.org/rude/love/downloads/love-$loveVersion-macosx-x64.zip
echo " Done."
echo "Extracting osx10src..."
unzip -q "$osx10Dir/loveOSX.zip" -d "$osx10Dir"
# delete Mac crap (for some reason can't not unzip it *shrugs*)
rm -rf "$osx10Dir/__MACOSX"
# the Info.plist is generated each time a package is built, we don't need a copy here
rm -f "$osx10Dir/love.app/Contents/Info.plist"
echo " Done."
echo "Deleting ZIP file..."
rm -f "$osx10Dir/loveOSX.zip"
echo " Done."
fi
# build executables and zip files for them
echo "Building $packageName (version $version)... (win32 zip)"
# EXE with ZIP at end
cat "$win32exe" "$outputDir/$packageName-$version.love" > "$win32Dir/$packageName.exe"
cd "$win32Dir"
# ZIP up the EXE
zip -r -X -q "$outputDir/$packageName-${version}_win32.zip" "./$packageName.exe"
cd ./love-$loveVersion-win32
# ZIP up the required DLLs
zip -r -X -q "$outputDir/$packageName-${version}_win32.zip" ./*.dll
cp ./license.txt ./LOVE-license.txt
# ZIP up the LOVE license
zip -r -X -q "$outputDir/$packageName-${version}_win32.zip" ./LOVE-license.txt
# ZIP up extra included files
if [ "$(ls -A $includes)" ]; then
cd "$includes"
zip -r -X -q "$outputDir/$packageName-${version}_win32.zip" ./*
fi
echo " Done."
echo "Building $packageName (version $version)... (win64 zip)"
# EXE with ZIP at end
cat "$win64exe" "$outputDir/$packageName-$version.love" > "$win64Dir/$packageName.exe"
cd "$win64Dir"
# ZIP up the EXE
zip -r -X -q "$outputDir/$packageName-${version}_win64.zip" "./$packageName.exe"
cd ./love-$loveVersion-win64
# ZIP up the required DLLs
zip -r -X -q "$outputDir/$packageName-${version}_win64.zip" ./*.dll
cp ./license.txt ./LOVE-license.txt
# ZIP up the LOVE license
zip -r -X -q "$outputDir/$packageName-${version}_win64.zip" ./LOVE-license.txt
# ZIP up extra included files
if [ "$(ls -A $includes)" ]; then
cd "$includes"
zip -r -X -q "$outputDir/$packageName-${version}_win64.zip" ./*
fi
echo " Done."
echo "Building $packageName (version $version)... (OS X zip)"
cd "$osx10Dir"
# Make a fresh copy of the .app directory
cp -r ./love.app "./$packageName.app"
# Copy in our .love file
cp "$outputDir/$packageName-$version.love" "$osx10Dir/$packageName.app/Contents/Resources/$packageName.love"
# Copy in our icons
cp "$osxIconsDirectory/$osxFileIcon" "$osx10Dir/$packageName.app/Contents/Resources/$osxFileIcon"
cp "$osxIconsDirectory/$osxBundleIcon" "$osx10Dir/$packageName.app/Contents/Resources/$osxBundleIcon"
# Create an Info.plist and copy it in
cd "$originalDir"
source "$originalDir/build-scripts/Info.plist-maker.sh"
cd "$osx10Dir"
cp "$originalDir/tmp/Info.plist" "$osx10Dir/$packageName.app/Contents/Info.plist"
rm -rf "$originalDir/tmp"
# ZIP up the .app directory
zip -r -X -q "$outputDir/$packageName-${version}_osx.zip" "./$packageName.app"
# ZIP up the extra included files
if [ "$(ls -A $includes)" ]; then
cd "$includes"
zip -r -X -q "$outputDir/$packageName-${version}_osx.zip" ./*
fi
echo " Done."
echo "Building $packageName (version $version)... (Linux zip)"
cd "$outputDir"
# ZIP up the .love file
zip -r -X -q "./$packageName-${version}_linux.zip" "./$packageName-$version.love"
cp "$win64Dir/love-$loveVersion-win64/LOVE-license.txt" ./LOVE-license.txt
# ZIP up the LOVE license
zip -r -X -q "./$packageName-${version}_linux.zip" ./LOVE-license.txt
# ZIP up the extra included files
if [ "$(ls -A $includes)" ]; then
cd "$includes"
zip -r -X -q "$outputDir/$packageName-${version}_linux.zip" ./*
fi
echo " Done."
if [ $latestBuilds = true ]; then
mkdir -p "$latestBuildsDir"
rm -f "$latestBuildsDir/*"
cp "$outputDir/$packageName-${version}_win32.zip" "$latestBuildsDir"
cp "$outputDir/$packageName-${version}_win64.zip" "$latestBuildsDir"
cp "$outputDir/$packageName-${version}_osx.zip" "$latestBuildsDir"
cp "$outputDir/$packageName-${version}_linux.zip" "$latestBuildsDir"
fi
echo "Builds complete. Unless there are errors above. Double check your files."
echo
if which fortune > /dev/null 2>&1; then fortune; fi

1
builds/build.number Normal file
View File

@@ -0,0 +1 @@
build=1