diff options
author | Eric Hameleers <alien@slackware.com> | 2020-06-28 10:58:19 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2020-06-28 10:58:19 +0000 |
commit | dc947043d094ebbeb539ff865af1df3ce8ea58e3 (patch) | |
tree | a12d7d259547178cbdfeb5beb5051a1ec6fea157 /audacity/build | |
parent | dca34c83591f5cad07f9412ea7c444ef39d41f6a (diff) | |
download | asb-dc947043d094ebbeb539ff865af1df3ce8ea58e3.tar.gz asb-dc947043d094ebbeb539ff865af1df3ce8ea58e3.tar.xz |
audacity: updated to 2.4.2.
Diffstat (limited to 'audacity/build')
-rwxr-xr-x | audacity/build/audacity.SlackBuild | 190 |
1 files changed, 132 insertions, 58 deletions
diff --git a/audacity/build/audacity.SlackBuild b/audacity/build/audacity.SlackBuild index 394a3507..5b141563 100755 --- a/audacity/build/audacity.SlackBuild +++ b/audacity/build/audacity.SlackBuild @@ -43,6 +43,8 @@ # 2.4.1-1: 28/may/2020 by Eric Hameleers <alien@slackware.com> # * Update. Do not use the new 'cmake' configuration yet, # because it is way too buggy. +# 2.4.2-1: 27/jun/2020 by Eric Hameleers <alien@slackware.com> +# * Update. Use cmake, and an internal patched wxGTK3. # # Run 'sh audacity.SlackBuild' to build a Slackware package. # The package (.t?z) and .txt file as well as build logs are created in /tmp . @@ -51,7 +53,8 @@ # ----------------------------------------------------------------------------- PRGNAM=audacity -VERSION=${VERSION:-2.4.1} +VERSION=${VERSION:-2.4.2} +WX=${WX:-$(date +%Y%m%d)} # We clone git without history BUILD=${BUILD:-1} NUMJOBS=${NUMJOBS:-" -j$(nproc) "} TAG=${TAG:-alien} @@ -66,8 +69,53 @@ TMP=${TMP:-/tmp/build} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} -SOURCE="$SRCDIR/${PRGNAM^}-${VERSION}.tar.gz" -SRCURL="https://github.com/${PRGNAM}/${PRGNAM}/archive/${PRGNAM^}-${VERSION}.tar.gz" +SOURCE[0]="$SRCDIR/${PRGNAM^}-${VERSION}.tar.gz" +SRCURL[0]="https://github.com/${PRGNAM}/${PRGNAM}/archive/${PRGNAM^}-${VERSION}.tar.gz" + +SOURCE[1]="$SRCDIR/wxWidgets-${WX}git.tar.xz" +SRCURL[1]="" + +# Use the src_checkout() function if no downloadable tarball exists. +# Check out sources from GIT and create a tarball of them. +# Examples for GIT and SVN repositories are given below: +src_checkout() { + # Param #1 : index in the SOURCE[] array. + # Param #2 : full path to where SOURCE[$1] tarball should be created. + # Determine the tarball extension: + PEXT=$(echo "${2}" | sed -r -e 's/.*[^.].(tar.xz|tar.gz|tar.bz2|tgz).*/\1/') + case "$PEXT" in + "tar.xz") TARCOMP="J" ;; + "tar.gz") TARCOMP="z" ;; + "tgz") TARCOMP="z" ;; + "tar.bz2") TARCOMP="j" ;; + *) echo "Archive can only have extension 'tar.xz', '.tar.gz' '.tar.bz2' or '.tgz'" ; exit 1 ;; + esac + # Determine the directory name to create for the archive root: + PBASE=$(basename ${2} .${PEXT}) + # Determine the directory where we create our checkout: + CODIR=$(dirname ${2}) + case ${1} in + 1) # This example assumes a GIT checkout: + GITURI="https://github.com/audacity/wxWidgets" + RETDIR=$(pwd) + mkdir -p $CODIR/${PRGNAM}_temp_checkout_$$ \ + && cd $CODIR/${PRGNAM}_temp_checkout_$$ + mkdir ${PBASE} \ + && cd ${PBASE} \ + # Checkout code from a certain branch and/or date; this will take a + # long time because we have to clone the complete git-repository first: + echo "Checking out from '$GITURI':" + git clone --depth 1 --single-branch --recurse-submodules ${GITURI} . \ + && chown -R root:root . \ + && cd .. \ + && tar -${TARCOMP}cf ${2} ${PBASE} + cd $RETDIR + rm -rf $CODIR/${PRGNAM}_temp_checkout_$$ || true + ;; + *) # Do nothing + ;; + esac +} ## ## --- with a little luck, you won't have to edit below this point --- ## @@ -125,24 +173,32 @@ rm -rf $OUTPUT/{checkout,configure,make,install,error,makepkg,patch}-$PRGNAM.log # remove old log files # Source file availability: -if ! [ -f ${SOURCE} ]; then - echo "Source '$(basename ${SOURCE})' not available yet..." - # Check if the $SRCDIR is writable at all - if not, download to $OUTPUT - [ -w "$SRCDIR" ] || SOURCE="$OUTPUT/$(basename $SOURCE)" - if [ -f ${SOURCE} ]; then echo "Ah, found it!"; continue; fi - if ! [ "x${SRCURL}" == "x" ]; then - echo "Will download file to $(dirname $SOURCE)" - wget --no-check-certificate -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 +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[$i]="$OUTPUT/$(basename ${SOURCE[$i]})" + if [ -f ${SOURCE[$i]} ]; then echo "Ah, found it!"; continue; fi + if ! [ "x${SRCURL[$i]}" == "x" ]; then + echo "Will download file to $(dirname $SOURCE[$i])" + wget --no-check-certificate -nv -T 20 -O "${SOURCE[$i]}" "${SRCURL[$i]}" || true + if [ $? -ne 0 -o ! -s "${SOURCE[$i]}" ]; then + echo "Fail to download '$(basename ${SOURCE[$i]})'. Aborting the build." + mv -f "${SOURCE[$i]}" "${SOURCE[$i]}".FAIL + exit 1 + fi + else + # Try if we have a GIT download routine for ${SOURCE[$i]} + echo "Will checkout sources to $(dirname $SOURCE[$i])" + src_checkout $i "${SOURCE[$i]}" \ + 2>&1 > $OUTPUT/checkout-$(basename ${SOURCE[$i]}).log + 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." @@ -157,7 +213,7 @@ echo "++" cd $TMP/tmp-$PRGNAM echo "Extracting the source archive(s) for $PRGNAM..." -tar -xvf ${SOURCE} +tar -xvf ${SOURCE[0]} cd ${PRGNAM^}*-${VERSION} || cd ${PRGNAM}*-${VERSION} # Fix vamp plugin search path on x86_64 - thanks to B. Watson @@ -168,49 +224,64 @@ sed -e "s,lib/vamp,lib${LIBDIRSUFFIX}/vamp,g" \ cat $SRCDIR/patches/audacity-2.4.1_resize_crash.patch | patch -Np1 --verbose \ 2>&1 | tee $OUTPUT/patch-${PRGNAM}.log +# Fix detection of local wx libraries: +sed -i src/CMakeLists.txt \ + -e 's#${WXWIN}/lib#$ENV{MYBUILD}/lib#' \ + -e 's#-t ${_LIBDIR}#-t $ENV{MYBUILD}/bin/Release/${_LIBDIR}#' + chown -R root:root . chmod -R u+w,go+r-w,a+rX-st . echo Building ... -touch $OUTPUT/configure-${PRGNAM}.log -autoreconf -vif \ - 2>&1 | tee -a $OUTPUT/configure-${PRGNAM}.log - -WX_CONFIG="/usr/bin/wx-config-gtk3" \ -LDFLAGS="$SLKLDFLAGS" \ -CXXFLAGS="$SLKCFLAGS -DHAVE_VISIBILITY=1" \ -CFLAGS="$SLKCFLAGS" \ -./configure \ - --prefix=/usr \ - --libdir=/usr/lib${LIBDIRSUFFIX} \ - --mandir=/usr/man \ - --docdir=/usr/doc/$PRGNAM-$VERSION \ - --enable-shared \ - --enable-static-wx \ - --with-lib-preference="system local" \ - --with-expat=system \ - --with-ffmpeg=system \ - --with-lame=system \ - --with-libid3tag=system \ - --with-libmad=system \ - --with-libflac=system \ - --with-libsndfile=system \ - --with-libvorbis=system \ - --with-ladspa \ - --with-libsamplerate \ - --with-libsoxr \ - --with-libtwolame \ - --with-lv2 \ - --with-portaudio \ - --with-portmidi \ - --with-sbsms \ - --with-soundtouch \ - --with-vamp \ - 2>&1 | tee -a $OUTPUT/configure-${PRGNAM}.log - #--without-libresample \ - -make $NUMJOBS 2>&1 | tee $OUTPUT/make-${PRGNAM}.log -make DESTDIR=$PKG install 2>&1 | tee $OUTPUT/install-${PRGNAM}.log +mkdir build +cd build + # Put our git snapshot for wxwidgets in place: + mkdir -p cmake-proxies/wxWidgets + tar -xvf ${SOURCE[1]} -C cmake-proxies/wxWidgets/ + mv cmake-proxies/wxWidgets/{wxWidgets-${WX}git,wxwidgets} + export MYBUILD="$(pwd)" + + #WX_CONFIG="/usr/bin/wx-config-gtk3" \ + LDFLAGS="$SLKLDFLAGS -Wl,-rpath,/usr/lib${LIBDIRSUFFIX}/${PRGNAM}" \ + CXXFLAGS="$SLKCFLAGS" \ + CFLAGS="$SLKCFLAGS" \ + cmake .. \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_C_FLAGS_RELEASE:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS -DHAVE_VISIBILITY=1" \ + -DCMAKE_CXX_FLAGS_RELEASE:STRING="$SLKCFLAGS -DHAVE_VISIBILITY=1" \ + -DCMAKE_CXX_STANDARD=11 \ + -DCMAKE_INSTALL_DOCDIR=/usr/doc/$PRGNAM-$VERSION \ + -DCMAKE_INSTALL_LIBDIR=lib${LIBDIRSUFFIX} \ + -DCMAKE_INSTALL_MANDIR=/usr/man \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_VERBOSE_MAKEFILE:BOOL="ON" \ + -Daudacity_lib_preference="system" \ + -Daudacity_use_expat=system \ + -Daudacity_use_ffmpeg=linked \ + -Daudacity_use_flac=system \ + -Daudacity_use_id3tag=system \ + -Daudacity_use_ladspa:BOOL="ON" \ + -Daudacity_use_lame=system \ + -Daudacity_use_lv2=system \ + -Daudacity_use_mad=system \ + -Daudacity_use_ogg=system \ + -Daudacity_use_pa_alsa:BOOL="ON" \ + -Daudacity_use_pa_jack=linked \ + -Daudacity_use_portaudio=local \ + -Daudacity_use_sndfile=system \ + -Daudacity_use_soxr=local \ + -Daudacity_use_soundtouch=local \ + -Daudacity_use_twolame=system \ + -Daudacity_use_vamp=system \ + -Daudacity_use_vorbis=system \ + -Daudacity_use_wxwidgets=local \ + 2>&1 | tee $OUTPUT/configure-${PRGNAM}.log + + make $NUMJOBS 2>&1 | tee $OUTPUT/make-${PRGNAM}.log + make DESTDIR=$PKG install 2>&1 | tee $OUTPUT/install-${PRGNAM}.log +cd - # Install libnyquist plugins and related files, this is broken since 2.4.0: install -vDm 644 plug-ins/*.ny -t ${PKG}/usr/share/${PRGNAM}/plug-ins @@ -248,6 +319,9 @@ cat $SRCDIR/$(basename $0) > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild chown -R root:root $PKG/usr/doc/$PRGNAM-$VERSION find $PKG/usr/doc -type f -exec chmod 644 {} \; +# Remove superfluous copy in the wrong place: +rm -rf $PKG/usr/share/doc + # Compress the man page(s): if [ -d $PKG/usr/man ]; then find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \; |