From 8aab0d7f780f443fd2d09fa3faabefad48d5b157 Mon Sep 17 00:00:00 2001 From: ZipFile Date: Sun, 9 Oct 2011 05:46:50 +0200 Subject: [PATCH] Added fallbak code to build with old ffmpeg (0.6.1). Centered gtk loading window. --- Utils/build.sh | 49 +++++++++++++++++-- .../LoadingWindow/LoadingWindow_GtkModule.cpp | 2 +- 2 files changed, 47 insertions(+), 4 deletions(-) diff --git a/Utils/build.sh b/Utils/build.sh index 8ee222410e..12c37f0e2f 100755 --- a/Utils/build.sh +++ b/Utils/build.sh @@ -7,6 +7,7 @@ s_configure= s_stepmania= s_data= s_rebuild= +s_ffmpeg= num_jobs=1 @@ -20,6 +21,7 @@ usage () { echo ' (do not copy binaries).' echo ' -d, --data generate GameData.smzip.' echo ' -r, --rebuild rebuild StepMania (soft).' + echo ' -f, --ffmpeg build with ffmpeg 0.6.1.' echo ' -j#, --jobs=# pass -j# to make.' echo ' -h, --help print this help and exit.' echo ' -v, --verbose increase verbosity (up to 2).' @@ -33,8 +35,8 @@ if which notify-send >/dev/null 2>&1; then fi if which getopt >/dev/null 2>&1; then - set -- `getopt -l configure,stepmania,data,rebuild,help \ - -l jobs::,verbose,version -- drcshj::v $*` + set -- `getopt -l configure,stepmania,data,rebuild,ffmpeg,help \ + -l jobs::,verbose,version -- drfcshj::v $*` fi while [ $# -gt 0 ]; do @@ -45,6 +47,7 @@ while [ $# -gt 0 ]; do -s|--stepmania) s_stepmania=yes ;; -d|--data) s_data=yes ;; -r|--rebuild) s_rebuild=yes ;; + -f|--ffmpeg) s_ffmpeg=yes ;; -h|--help) usage 0 ;; -j|--jobs) num_jobs=$1; shift ;; -v|--verbose) verbose=$[verbose+1] ;; @@ -128,11 +131,51 @@ if [ -n "$s_data" ]; then exit 0 fi +if [ -n "$s_ffmpeg" ]; then + ffversion=0.6.1 + ffmpeg=ffmpeg-$ffversion + if [ ! -d $ffmpeg ]; then + message 'Downloading ffmpeg' + if which bzip2 &>/dev/null; then + zipcommand=jxf + ffmarc=$ffmpeg.tar.bz2 + elif which gzip &>/dev/null; then + zipcommand=zxf + ffmarc=$ffmpeg.tar.gz + else + failure 'Install either bzip2 or gzip.' + fi + if which wget &>/dev/null; then + get=wget + elif which curl &>/dev/null; then + get='curl -O' + else + failure 'Install either curl or wget.' + fi + call $get "http://ffmpeg.org/releases/$ffmarc" + message 'Extracting ffmpeg' + call tar -$zipcommand $ffmarc + message 'Cleaning up temporary files' +# call rm $ffmarc + fi + args="--enable-static --enable-gpl --enable-version3 --enable-nonfree --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libxvid --disable-debug --enable-memalign-hack --disable-network --enable-small --disable-encoders --disable-ffserver --extra-cflags=-Dattribute_deprecated=" + cd $ffmpeg + message 'Configuring ffmpeg' + call ./configure --prefix="`pwd`/_inst" $args + message 'Building ffmpeg' + call make --jobs="$num_jobs" install-libs install-headers + cd .. +fi + if [ ! -f _build/src/config.h ] || [ -n "$s_rebuild" ]; then message 'Configuring StepMania' mkdir -p _build cd _build - call ../configure "$@" + if [ -n "$s_ffmpeg" ]; then + call ../configure --with-ffmpeg=../$ffmpeg/_inst "$@" + else + call ../configure "$@" + fi cd .. fi if [ -n "$s_configure" ]; then exit 0; fi diff --git a/src/arch/LoadingWindow/LoadingWindow_GtkModule.cpp b/src/arch/LoadingWindow/LoadingWindow_GtkModule.cpp index 21e5e70637..f28dbfe0cb 100644 --- a/src/arch/LoadingWindow/LoadingWindow_GtkModule.cpp +++ b/src/arch/LoadingWindow/LoadingWindow_GtkModule.cpp @@ -22,7 +22,7 @@ extern "C" const char *Init( int *argc, char ***argv ) return "Couldn't initialize gtk (cannot open display)"; window = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_window_set_position( GTK_WINDOW(window), GTK_WIN_POS_CENTER ); + gtk_window_set_position( GTK_WINDOW(window), GTK_WIN_POS_CENTER_ALWAYS ); gtk_window_set_default_size( GTK_WINDOW(window), 512,96 ); //gtk_window_set_icon( GTK_WINDOW(window), ); gtk_widget_realize(window);