#!/bin/bash # # ardour.SlackBuild is free software; you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or any later version. # # ardour.SlackBuild is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place - Suite 330, Boston, MA 02111-1307, USA # # default settings PACKAGE="ardour" PACKAGE_EXT="xz" VERSION=${VERSION:=8.12} GITTAG=$(echo $VERSION |cut -d. -f1,2) MAJVER=$(echo $VERSION |cut -d. -f1) BUILD=${BUILD:=1} ARCH=$(uname -m) if [ -f ~/.slackbuildrc ]; then . ~/.slackbuildrc elif [ -f ../../runtime/slackbuildrc ]; then . ../../runtime/slackbuildrc fi check_required SRC="$PACKAGE-midi-$VERSION.zip" URL="http://stuff.ardour.org/loops/ArdourBundledMedia.zip" get_source $SRC $URL SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT" if [ ! -f $CWD/$SRC ]; then cd $TMP rm -rf ${PACKAGE}* mkdir -p ${PACKAGE}_temp_checkout_$$ && cd ${PACKAGE}_temp_checkout_$$ PBASE=${PACKAGE}-${VERSION} mkdir ${PBASE} && cd ${PBASE} || exit 1 echo "Checking out $GITTAG from 'https://github.com/$PACKAGE/$PACKAGE':" git clone https://github.com/$PACKAGE/$PACKAGE . \ && git checkout ${GITTAG} \ && APPVER=$(git describe) \ && APPDATE=$(git log -1 --pretty=format:%ci HEAD |cut -d' ' -f1) \ && echo -e "#include \"ardour/revision.h\"\nnamespace ARDOUR { const char* revision = \"${APPVER}\"; const char* date = \"${APPDATE}\"; }" > libs/ardour/revision.cc \ && chown -R root:root . \ && cd .. \ && tar --exclude .git -Jcf "$CWD/$SRC" "${PACKAGE}-${VERSION}" cd $TMP rm -rf ${PACKAGE}_temp_checkout_$$ cd $CWD fi case "$ARCH" in arm*) TARGET=$ARCH-slackware-linux-gnueabi ;; *) TARGET=$ARCH-slackware-linux ;; esac unpack_source $SRC ardour-$VERSION export LDFLAGS="$SLKLDFLAGS" export LINKFLAGS="$SLKLDFLAGS" export CXXFLAGS="$SLKCFLAGS" export CFLAGS="$SLKCFLAGS" python3 ./waf configure \ --prefix=/usr \ --configdir=/etc \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --mandir=/usr/man \ --docdir=/usr/doc/$PACKAGE-$VERSION \ --cxx11 \ --freedesktop \ --with-backends="alsa,dummy,jack,pulseaudio" \ --libjack=weak \ --no-phone-home \ --optimize \ --ptformat python3 waf build python3 waf i18n python3 waf install --destdir=$PKG # Fix an incorrect Categorization (thanks to SBo and bkw): sed -i $PKG/usr/share/applications/ardour$MAJVER.desktop \ -e 's/AudioEditing;/X-&/' # Install application icons (thanks SBo): for isize in 16 22 32 48 ; do mkdir -p $PKG/usr/share/icons/hicolor/${isize}x${isize}/apps cp gtk2_ardour/icons/application-x-ardour_${isize}px.png \ $PKG/usr/share/icons/hicolor/${isize}x${isize}/apps/ardour$MAJVER.png done # There's an appdata file: mkdir -p $PKG/usr/share/appdata cp build/gtk2_ardour/ardour$MAJVER.appdata.xml $PKG/usr/share/appdata/ # Install the MIDI files: mkdir -p $PKG/usr/share/${PACKAGE}${MAJVER}/media/ unzip $CWD/$PACKAGE-midi-$VERSION.zip -d $PKG/usr/share/${PACKAGE}${MAJVER}/media/ # Add the man page manually: install -Dm 0644 ${PACKAGE}.1 -t ${PKG}/usr/man/man1/ cp $CWD/doinst.sh.in $CWD/doinst.sh # Do not overwrite user-customized configurationfiles: cd $PKG/etc/${PACKAGE}${MAJVER} for myfile in $(find . -type f) ; do mv $myfile $myfile.new echo "config etc/${PACKAGE}${MAJVER}/$myfile.new" \ >> $CWD/doinst.sh done cd - 1>/dev/null mkdir -p $DOCS cp -a COPYING PACKAGER_README README TRANSLATORS $DOCS fixup_package $PKG rm -f $CWD/doinst.sh # Clean up the extra stuff: set +u if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$PACKAGE-$VERSION rm -rf $PKG fi