mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Initial Mercurial commit.
This commit is contained in:
@@ -0,0 +1,128 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# This script gets all needed packages, builds LOVE, makes deb and tar.gz
|
||||
# and optionally uploads them to servers.
|
||||
#
|
||||
# Note: this script must be called in the same directory as the love
|
||||
# folder resides. It also assumes that love has been checked out previously.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# autobuild [action [revision [version]]]
|
||||
#
|
||||
# action:
|
||||
#
|
||||
# There are only two recognized actions:
|
||||
#
|
||||
# build -- Causes files to be uploaded to tehlol servers.
|
||||
# release -- Coming soon.
|
||||
#
|
||||
# All other actions will be ignored, so if you don not wish to upload
|
||||
# files (but still build LOVE), you can write "test", for instance.
|
||||
#
|
||||
# revision:
|
||||
#
|
||||
# The SVN revision that should be built. Should be a valid revision
|
||||
# number or HEAD. If not specified, it defaults to HEAD.
|
||||
#
|
||||
# version:
|
||||
#
|
||||
# The display version that will appear in files, eg. love-version.tar.gz.
|
||||
# If not specified, the script defaults to use the SVN revision number.
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
# autobuild
|
||||
# (Builds HEAD, but does not upload)
|
||||
#
|
||||
# autobuild build
|
||||
# (Builds HEAD and uploads to tehlol server with the current svn rev. as
|
||||
# version number)
|
||||
#
|
||||
# autobuild build HEAD 1.0
|
||||
# (Builds HEAD and uploads it using the version 1.0)
|
||||
#
|
||||
#
|
||||
# Passwords for servers must be in these external files:
|
||||
#
|
||||
# tehlol.com: pwtehlol
|
||||
# sourceforge.net: pwsourceforge
|
||||
#
|
||||
|
||||
cd ../..
|
||||
|
||||
# Get required packages.
|
||||
sudo apt-get -y install subversion build-essential liblua5.1-dev \
|
||||
libopenal-dev libsdl1.2-dev libsdl-sound1.2-dev libfreetype6-dev \
|
||||
libphysfs-dev libdevil-dev libtiff4-dev libalut-dev libmng-dev \
|
||||
liblcms1-dev ftp-upload libmpg123-dev libmodplug-dev libpng12-dev
|
||||
|
||||
# Check which revision to build.
|
||||
if [ -z $2 ]; then
|
||||
buildrev="HEAD"
|
||||
else
|
||||
buildrev=$2
|
||||
fi
|
||||
|
||||
# Upload to the appropriate revision.
|
||||
svn up -r $buildrev
|
||||
|
||||
# Set the displayversion.
|
||||
if [ -z $3 ]; then
|
||||
if [ "$buildrev" == "HEAD" ]; then
|
||||
# Get the current SVN version, use sed to remove any non-numbers.
|
||||
currentsvnversion=`svnversion | sed 's/[a-zA-Z: ]//g'`
|
||||
displayversion="r$currentsvnversion"
|
||||
else
|
||||
# The revision is already specified, so we'll use that as the
|
||||
# display version.
|
||||
displayversion="r$buildrev"
|
||||
fi
|
||||
else
|
||||
# If the param is present, it overrides everything else.
|
||||
displayversion=$3
|
||||
fi
|
||||
|
||||
# Update version in configure.
|
||||
# cat configure.in | sed "s/LOVE_VERSION/$displayversion/g" > configure.in
|
||||
head -c 15 configure.in > configure.in.tmp
|
||||
echo " [$displayversion])" >> configure.in.tmp
|
||||
tail -n +2 configure.in >> configure.in.tmp
|
||||
cp configure.in.tmp configure.in
|
||||
rm configure.in.tmp
|
||||
|
||||
# Build ... BUILD!
|
||||
sh platform/unix/gen-makefile
|
||||
sh platform/unix/automagic
|
||||
./configure
|
||||
make
|
||||
make dist
|
||||
|
||||
# Move and rename the tar.
|
||||
tar="love-$displayversion-linux-src.tar.gz"
|
||||
mv "love-$displayversion.tar.gz" platform/unix/$tar
|
||||
|
||||
# Create the deb.
|
||||
cd platform/unix
|
||||
sh make-package deb $displayversion
|
||||
|
||||
# Move and rename the deb.
|
||||
deb="love-$displayversion-ubuntu-x86.deb"
|
||||
mv "love-$displayversion.deb" $deb
|
||||
|
||||
# Copy and rename the binary.
|
||||
binary="love-$displayversion"
|
||||
cp ../../src/love $binary
|
||||
|
||||
# Deal with uploading.
|
||||
if [ "$1" == "build" ]; then
|
||||
pass=`cat pwtehlol`
|
||||
ftp-upload -u tehloejc --password $pass -h tehlol.com -d public_html/love2d/builds/ $deb
|
||||
ftp-upload -u tehloejc --password $pass -h tehlol.com -d public_html/love2d/builds/ $tar
|
||||
ftp-upload -u tehloejc --password $pass -h tehlol.com -d public_html/love2d/builds/ $binary
|
||||
fi
|
||||
|
||||
if [ "$1" == "release" ]; then
|
||||
echo "release"
|
||||
fi
|
||||
Reference in New Issue
Block a user