should be working, needs testing

This commit is contained in:
Guard13007 2014-11-11 00:12:52 -08:00
parent 2754c9a130
commit 94a78756f4
7 changed files with 254 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
build/*

75
Info.plist Normal file
View File

@ -0,0 +1,75 @@
<?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>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>
<key>CFBundleIdentifier</key>
<string>YOUR.OWN.UNIQUE.IDENTIFIER</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>YOUR PROGRAM NAME</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>YOUR.CURRENT.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>© YEAR You</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>

View File

@ -2,3 +2,83 @@ LovePackaging
=============
Scripts to create Love2d packages.
Should be working for Linux but is untested as I am too tired right now.
Dunno if the shell script is compatible with Mac OS X at all.
The Windows batch file hasn't been made at all really, not yet.
Installation
------------
ToDo: Explain how install and use.
Troubleshooting
---------------
Screenshots are great if you're reporting a problem. But in any case, common
problems listed below, all one of them!
#### What does "WARN: Mac packaging disabled." mean?
It means you have not edited the config file to specify that you have fixed the
Info.plist for your program. To fix this, first open the Info.plist file in the
same directory as this README file and edit the values on lines 43, 47, and 51.
They look like this by default:
```xml
<string>YOUR.OWN.UNIQUE.IDENTIFIER</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>YOUR PROGRAM NAME</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>YOUR.CURRENT.VERSION</string>
```
An example of what they should look like:
```xml
<string>com.example.package</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Example Program by You</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.1.0</string>
```
Also line 71:
```xml
<key>NSHumanReadableCopyright</key>
<string>© YEAR You</string>
```
Something like:
```xml
<key>NSHumanReadableCopyright</key>
<string>© 2013-2014 Guard13007</string>
```
Once you have fixed that, open config.txt and change the line:
```bash
# Only change this if you know what you're doing (Read the README.md file).
macInfoPlistFixed=false
```
To this:
```bash
# Only change this if you know what you're doing (Read the README.md file).
macInfoPlistFixed=true
```
This will get rid of that error and start building Mac OS X packages. Sorry
this part isn't more streamlined (yet). I am a bit of a noob.

4
build.bat Normal file
View File

@ -0,0 +1,4 @@
@ECHO OFF
FOR /F "eol=# tokens=1,2 delims==" %%i,%%j in (config.txt) DO (
rem stuff
)

67
build.sh Normal file
View File

@ -0,0 +1,67 @@
#!/bin/bash
# get config
source ./config.txt
# remove old versions of package?
if [ $removeOld = true ]; then
rm -f $outputDir/$packageName*
fi
# move to source dir
originalDir=$(pwd)
cd $sourceDir
# build .love file
echo "Building $packageName (version $version)... (.love file)"
zip -r $outputDir/$packageName-$version.love ./*
# check if executables (their directories) exist, if not, download them
if [ ! -d $wind32Dir ]; then
mkdir -p $wind32Dir
echo "Downloading wind32src..."
wget -nv -O $wind32Dir/love32.zip https://bitbucket.org/rude/love/downloads/love-0.9.1-win32.zip
unzip $wind32Dir/love32.zip -d $wind32Dir
fi
if [ ! -d $win64Dir ]; then
mkdir -p $win64Dir
echo "Downloading win64src..."
wget -nv -O $win64Dir/love64.zip https://bitbucket.org/rude/love/downloads/love-0.9.1-win64.zip
unzip $win64Dir/love64.zip -d $win64Dir
fi
if [ ! -d $osx10Dir ]; then
mkdir -p $osx10Dir
echo "Downloading osx10src..."
wget -nv -O $osx10Dir/loveOSX.zip https://bitbucket.org/rude/love/downloads/love-0.9.1-macosx-x64.zip
unzip $osx10Dir/loveOSX.zip -d $osx10Dir
#delete Mac crap
rm -rf $osx10Dir/__MACOSX
#the Info.plist is overwritten each time the app is built, so it is not fixed here.
fi
# build executables and zip files for them
echo "Building $packageName (version $version)... (win32 zip)"
cat $wind32Dir/love-0.9.1-win32/love.exe $outputDir/$packageName-$version.love > $wind32Dir/$packageName.exe
zip -r $outputDir/$packageName-$version_win32.zip $wind32Dir/$packageName.exe $wind32Dir/love-0.9.1-win32/*.dll $wind32Dir/love-0.9.1-win32/license.txt $includes
echo "Building $packageName (version $version)... (win64 zip)"
cat $win64Dir/love-0.9.1-win64/love.exe $outputDir/$packageName-$version.love > $win64Dir/$packageName.exe
zip -r $outputDir/$packageName-$version_win64.zip $win64Dir/$packageName.exe $win64Dir/love-0.9.1-win64/*.dll $win64Dir/love-0.9.1-win64/license.txt $includes
if [ $macInfoPlistFixed = true ]; then
echo "Building $packageName (version $version)... (OS X zip)"
if [ -f $osx10Dir ]; then
rm -f $osx10Dir/love.app/Contents/Resources/$packageName.love
fi
cp $outputDir/$packageName-$version.love $osx10Dir/love.app/Contents/Resources/$packageName.love
cp $originalDir/Info.plist $osx10Dir/love.app/Contents/Info.plist
zip -r $outputDir/$packageName-$version_osx.zip $osx10Dir/love.app $includes
else
echo "WARN: Mac packaging disabled."
fi
echo "Build complete. Unless there are errors above. Check your files."

25
config.txt Normal file
View File

@ -0,0 +1,25 @@
# The name of the resulting executable.
packageName="LovePackagingExample"
# Where to place the resulting executable.
outputDir="$(pwd)/build"
# 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.)
# Do not include a "license.txt" file. Name your license something else.
includes="$(pwd)/includes"
# Who made this? (Yes, change this to your name.)
author="Guard13007"
# Current version (of your program)
version="0.1"
# Remove old packages?
removeOld=true
# Where unzipped executables to make packages out of will be kept
win32Dir="$build/win32src"
win64Dir="$build/win64src"
osx10Dir="$build/osx10src"
# Only change this if you know what you're doing (Read the README.md file).
macInfoPlistFixed=false

View File

@ -0,0 +1,2 @@
This package created with LovePackaging!
http://www.github.com/Guard13007/LovePackaging