From 496a436b80bd037c8a4528b9562510fba594626d Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Tue, 23 Jun 2009 22:52:13 +0000 Subject: New handbrake which uses webkitgtk --- handbrake/build/handbrake.SlackBuild | 105 +++++++++++++++++++++++------------ 1 file changed, 70 insertions(+), 35 deletions(-) (limited to 'handbrake/build') diff --git a/handbrake/build/handbrake.SlackBuild b/handbrake/build/handbrake.SlackBuild index 0d377696..884c41f2 100755 --- a/handbrake/build/handbrake.SlackBuild +++ b/handbrake/build/handbrake.SlackBuild @@ -28,7 +28,7 @@ # For: handbrake # Descr: video transcoder and ripper # URL: http://handbrake.fr/ -# Needs: jam,yasm (only during compilation) +# Needs: yasm (only during compilation) # vlc or libdvdcss (to read encrypted DVD's) # Changelog: # 0.9.3-1: 23/Jun/2009 by Eric Hameleers, Eindhoven, NL @@ -46,10 +46,10 @@ # Set initial variables: PRGNAM=handbrake -VERSION=${VERSION:-0.9.3} +#VERSION=${VERSION:-0.9.3} +VERSION=${VERSION:-r2606} ARCH=${ARCH:-x86_64} BUILD=${BUILD:-1} -NUMJOBS=${NUMJOBS:" -j4 "} TAG=${TAG:-alien} DOCS="AUTHORS BUILD COPYING* CREDITS NEWS THANKS TRANSLATIONS" @@ -63,8 +63,9 @@ TMP=${TMP:-/tmp/build} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} -SOURCE="$SRCDIR/HandBrake-${VERSION}.tar.gz" -SRCURL="http://handbrake.fr/rotation.php?file=HandBrake-${VERSION}.tar.gz" +SOURCE[0]="$SRCDIR/HandBrake-${VERSION}.tar.gz" +#SRCURL[0]="http://handbrake.fr/rotation.php?file=HandBrake-${VERSION}.tar.gz" +SRCURL[0]="" ## ## --- with a little luck, you won't have to edit below this point --- ## @@ -104,24 +105,64 @@ rm -rf $TMP/tmp-$PRGNAM/* # remove the remnants of previous build rm -rf $OUTPUT/{configure,make,install,error,makepkg}-$PRGNAM.log # remove old log files -# Source file availability: -if ! [ -f ${SOURCE} ]; then - if ! [ "x${SRCURL}" == "x" ]; then +# Use the src_checkout() function if no downloadable tarball exists. +# This function checks out sources from SVN/CVS and creates a tarball of them. +src_checkout() { + # Param #1 : index in the SOURCE[] array. + # Param #2 : full path to where SOURCE[$i] tarball should be created. + # Determine the tarball extension: + PEXT=$(echo "${2}" | sed -r -e 's/.*[^.].(tar.gz|tar.bz2|tgz).*/\1/') + if [ "$PEXT" == "${2}" ]; then # we did not find a allowed extension + echo "Archive can only have extension '.tar.gz' '.tar.bz2' or '.tgz'" + exit 1 + else + [ "$PEXT" = "tar.bz2" ] && TARCOMP="j" || TARCOMP="z" + fi + case ${1} in + 0) # HandBrake-${VERSION} + if [ "$(echo ${VERSION}|cut -c1)" == 'r' ]; then # revision instead of date + REV=$(echo ${VERSION} | cut -c2-) + else + REV="{${VERSION}}" + fi + mkdir HandBrake-${VERSION} \ + && cd HandBrake-${VERSION} \ + && svn co --revision $REV svn://svn.handbrake.fr/HandBrake/trunk . \ + && find . -type d -name '.svn' -depth | xargs rm -rf \ + && chown -R root:root . \ + && cd .. \ + && tar -${TARCOMP}cf ${2} HandBrake-${VERSION} + rm -rf HandBrake-${VERSION} + ;; + *) # Do nothing + ;; + esac +} + +# Regular URL downloads follow: +for (( i = 0; i < ${#SOURCE[*]}; i++ )) ; do + if ! [ -f ${SOURCE[$i]} ]; then + echo "Source '$(basename ${SOURCE[$i]})' not available yet..." # Check if the $SRCDIR is writable at all - if not, download to $OUTPUT - [ -w "$SRCDIR" ] || SOURCE="$OUTPUT/$(basename $SOURCE)" - echo "Source '$(basename ${SOURCE})' not available yet..." - echo "Will download file to $(dirname $SOURCE)" - wget -nv -T 20 -O "${SOURCE}" "${SRCURL}" || true - if [ $? -ne 0 -o ! -s "${SOURCE}" ]; then - echo "Downloading '$(basename ${SOURCE})' failed... aborting the build." - mv -f "${SOURCE}" "${SOURCE}".FAIL + [ -w "$SRCDIR" ] || SOURCE[$i]="$OUTPUT/$(basename ${SOURCE[$i]})" + if ! [ "x${SRCURL[$i]}" == "x" ]; then + echo "Will download file to $(dirname $SOURCE[$i])" + if ! $(wget -nv -T 20 -O "${SOURCE[$i]}" "${SRCURL[$i]}"); then + echo "Downloading '$(basename ${SOURCE[$i]})' failed.. aborting the build." + mv -f "${SOURCE[$i]}" "${SOURCE[$i]}".FAIL + exit 1 + fi + else + # Try if we have a SVN/CVS download routine for ${SOURCE[$i]} + echo "Will checkout sources to $(dirname $SOURCE[$i])" + src_checkout $i "${SOURCE[$i]}" + fi + if [ ! -f "${SOURCE[$i]}" -o ! -s "${SOURCE[$i]}" ]; then + echo "File '$(basename ${SOURCE[$i]})' not available.. aborting the build." exit 1 fi - else - echo "File '$(basename ${SOURCE})' not available... aborting the build." - exit 1 fi -fi +done if [ "$P1" == "--download" ]; then echo "Download complete." @@ -136,7 +177,7 @@ echo "++" cd $TMP/tmp-$PRGNAM echo "Extracting the source archive(s) for $PRGNAM..." -tar -xvf ${SOURCE} +tar -xvf ${SOURCE[0]} cd HandBrake-${VERSION} chown -R root:root . chmod -R u+w,go+r-w,a-s . @@ -148,27 +189,21 @@ if ! which yasm 1>/dev/null 2>&1 ; then fi echo Building ... -# This will use jam to build the commandline program - note: this compilation -# will download many dependency lbraries and compile then statically into -# the application. +# This will build the commandline and GTK programs +# - note: this compilation will download many dependency lbraries +# and compile then statically into the application. +./configure --prefix=/usr --launch --launch-jobs=0 make 2>&1 | tee $OUTPUT/make-${PRGNAM}.log +# Install the GTK gui: +( cd build + make install DESTDIR=$PKG +) + # Install the commandline client: mkdir -p $PKG/usr/bin install -m755 HandBrakeCLI $PKG/usr/bin -# Next, build the GTK gui: -( cd gtk - ./autogen.sh \ - --prefix=/usr \ - --libdir=/usr/lib${LIBDIRSUFFIX} \ - --sysconfdir=/etc \ - --build=$ARCH-slackware-linux \ - 2>&1 | tee $OUTPUT/configure-${PRGNAM}_gtk.log - jam 2>&1 | tee $OUTPUT/make-${PRGNAM}_gtk.log - DESTDIR=$PKG jam install 2>&1 | tee $OUTPUT/install-${PRGNAM}_gtk.log -) - # Remove this cache file, it will get in our way: rm $PKG/usr/share/icons/hicolor/icon-theme.cache -- cgit v1.2.3-80-g2a13