Check that subversion AND (curl OR wget) are installed before downloading ffmpeg. Prevents running ./build.sh which fails if curl and wget are not installed and then running build.sh again which proceeds as if ffmpeg had been patched. Also add -j or --jobs option to pass to make. ./build -j3 works nicely. Now if someone wants to buy me one of those 16 context Macs, I would sure love to try -j17.

This commit is contained in:
Steve Checkoway
2009-03-21 05:53:52 +00:00
parent 736aa56b99
commit 415e464926
+20 -18
View File
@@ -51,20 +51,21 @@ usage () {
echo 'Build StepMania with a statically linked ffmpeg.' echo 'Build StepMania with a statically linked ffmpeg.'
echo "CONFIGURE_OPTIONS are passed to StepMania's configure." echo "CONFIGURE_OPTIONS are passed to StepMania's configure."
echo '' echo ''
echo ' -d, --download stop after ffmpeg download.' echo ' -d, --download stop after ffmpeg download.'
echo ' -f, --ffmpeg stop after building ffmpeg.' echo ' -f, --ffmpeg stop after building ffmpeg.'
echo ' -c, --configure stop after configuring StepMania.' echo ' -c, --configure stop after configuring StepMania.'
echo ' -s, --stepmania stop after building StepMania' echo ' -s, --stepmania stop after building StepMania'
echo ' (do not copy binaries).' echo ' (do not copy binaries).'
echo ' -h, --help print this help and exit.' echo ' -j#, --jobs=# pass -j# to make.'
echo ' -v, --verbose increase verbosity (up to 2).' echo ' -h, --help print this help and exit.'
echo ' -v, --verbose increase verbosity (up to 2).'
echo ' --version print version and exit.' echo ' --version print version and exit.'
exit $1 exit $1
} }
version () { version () {
echo 'build.sh (StepMania) 2.5' echo 'build.sh (StepMania) 2.6'
echo 'Copyright (C) 2006-2007 Steve Checkoway' echo 'Copyright (C) 2006-2009 Steve Checkoway'
echo 'StepMania is Copyright (C) 2001-2008 Chris Danford et al.' echo 'StepMania is Copyright (C) 2001-2008 Chris Danford et al.'
exit 0 exit 0
} }
@@ -77,13 +78,14 @@ fi
if which getopt >/dev/null 2>&1; then if which getopt >/dev/null 2>&1; then
set -- `getopt -l download,ffmpeg,configure,stepmania,help \ set -- `getopt -l download,ffmpeg,configure,stepmania,help \
-l verbose,version -- dfcshv $*` -l jobs::,verbose,version -- dfcshj::v $*`
fi fi
s_download= s_download=
s_ffmpeg= s_ffmpeg=
s_configure= s_configure=
s_stepmania= s_stepmania=
num_jobs=1
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
arg=$1 arg=$1
shift shift
@@ -93,6 +95,7 @@ while [ $# -gt 0 ]; do
-c|--configure) s_configure=yes ;; -c|--configure) s_configure=yes ;;
-s|--stepmania) s_stepmania=yes ;; -s|--stepmania) s_stepmania=yes ;;
-h|--help) usage 0 ;; -h|--help) usage 0 ;;
-j|--jobs) num_jobs=$1; shift ;;
-v|--verbose) verbose=$[verbose+1] ;; -v|--verbose) verbose=$[verbose+1] ;;
--version) version ;; --version) version ;;
--) break ;; --) break ;;
@@ -106,20 +109,19 @@ swscale_rev=26201
swscale_repo=svn://svn.mplayerhq.hu/mplayer/trunk/libswscale swscale_repo=svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
if [ ! -d $ffmpeg ]; then if [ ! -d $ffmpeg ]; then
message 'Downloading ffmpeg' message 'Downloading ffmpeg'
if which svn &>/dev/null; then if ! which svn &>/dev/null; then
call svn co --ignore-externals -r $revision $repository $ffmpeg
call svn co -r $swscale_rev $swscale_repo $ffmpeg/libswscale
else
failure 'Install subversion.' failure 'Install subversion.'
fi fi
message 'Downloading ffmpeg patch'
if which curl &>/dev/null; then if which curl &>/dev/null; then
get='curl -O' get='curl -O'
elif which wget &>/dev/null; then elif which wget &>/dev/null; then
get=wget get=wget
else else
failure 'Neither curl nor wget installed.' failure 'Install either curl or wget.'
fi fi
call svn co --ignore-externals -r $revision $repository $ffmpeg
call svn co -r $swscale_rev $swscale_repo $ffmpeg/libswscale
message 'Downloading ffmpeg patch'
cd $ffmpeg cd $ffmpeg
call $get http://stepmania.sourceforge.net/ffmpeg-r8448-avi.patch call $get http://stepmania.sourceforge.net/ffmpeg-r8448-avi.patch
message 'Patching ffmpeg' message 'Patching ffmpeg'
@@ -155,7 +157,7 @@ if [ ! -f $ffmpeg/_inst/lib/libavcodec.a ]; then
message 'Configuring ffmpeg' message 'Configuring ffmpeg'
call ./configure --prefix="`pwd`/_inst" $args call ./configure --prefix="`pwd`/_inst" $args
message 'Building ffmpeg' message 'Building ffmpeg'
call make install-libs install-headers call make --jobs="$num_jobs" install-libs install-headers
cd .. cd ..
fi fi
if [ -n "$s_ffmpeg" ]; then exit 0; fi if [ -n "$s_ffmpeg" ]; then exit 0; fi
@@ -170,7 +172,7 @@ if [ -n "$s_configure" ]; then exit 0; fi
if [ ! -f _build/src/stepmania ]; then if [ ! -f _build/src/stepmania ]; then
message 'Building StepMania' message 'Building StepMania'
cd _build || failure cd _build || failure
call make call make --jobs="$num_jobs"
cd .. cd ..
fi fi
if [ -n "$s_stepmania" ]; then exit 0; fi if [ -n "$s_stepmania" ]; then exit 0; fi
@@ -180,7 +182,7 @@ if [ ! -f stepmania -o ! -f GtkModule.so ]; then
fi fi
# (c) 2006-2007 Steve Checkoway # (c) 2006-2009 Steve Checkoway
# All rights reserved. # All rights reserved.
# #
# Permission is hereby granted, free of charge, to any person obtaining a # Permission is hereby granted, free of charge, to any person obtaining a