From f47ac1e07c0a1af3876e5d11bc886435907992f3 Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Tue, 20 Sep 2022 21:12:23 +0000 Subject: portsmf: downgraded to 234, since that is the most recent release audacity will link against successfully. --- portsmf/build/portsmf.SlackBuild | 104 ++++++++++++++++++++++++++++----------- 1 file changed, 75 insertions(+), 29 deletions(-) (limited to 'portsmf') diff --git a/portsmf/build/portsmf.SlackBuild b/portsmf/build/portsmf.SlackBuild index df4d7295..883c601a 100755 --- a/portsmf/build/portsmf.SlackBuild +++ b/portsmf/build/portsmf.SlackBuild @@ -33,6 +33,8 @@ # Changelog: # 239-1: 19/sep/2022 by Eric Hameleers # * Initial build. +# 234-1: 20/sep/2022 by Eric Hameleers +# * Downgrade needed for audacity. # # Run 'sh portsmf.SlackBuild' to build a Slackware package. # The package (.t?z) and .txt file as well as build logs are created in /tmp . @@ -41,7 +43,7 @@ # ----------------------------------------------------------------------------- PRGNAM=portsmf -VERSION=${VERSION:-239} +VERSION=${VERSION:-234} BUILD=${BUILD:-1} NUMJOBS=${NUMJOBS:-" -j$(nproc) "} TAG=${TAG:-alien} @@ -57,8 +59,46 @@ PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} SOURCE="$SRCDIR/${PRGNAM}-${VERSION}.tar.gz" -SRCURL="https://github.com/tenacityteam/${PRGNAM}/archive/refs/tags/${VERSION}.tar.gz" +#SRCURL="https://github.com/tenacityteam/${PRGNAM}/archive/refs/tags/${VERSION}.tar.gz" +SRCURL="" +# Use the src_checkout() function if no downloadable tarball exists. +# Check out sources from SVN/GIT and create a tarball of them. +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 + 0) RETDIR=$(pwd) + mkdir -p $CODIR/${PRGNAM}_temp_checkout_$$ \ + && cd $CODIR/${PRGNAM}_temp_checkout_$$ + mkdir ${PBASE} \ + && cd ${PBASE} \ + && svn checkout --revision=$VERSION "https://svn.code.sf.net/p/portmedia/code/${PRGNAM}/trunk" . \ + && find . -type d -name '.svn' -depth | xargs rm -rf \ + && 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 --- ## ## @@ -111,25 +151,30 @@ mkdir -p $TMP/tmp-$PRGNAM # location to build the source mkdir -p $PKG # place for the package to be built rm -rf $PKG/* # always erase old package's contents rm -rf $TMP/tmp-$PRGNAM/* # remove the remnants of previous build -rm -rf $OUTPUT/{checkout,configure,make,install,error,makepkg,patch}-$PRGNAM.log +rm -rf $OUTPUT/{autoreconf,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)" + [ -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." + echo "Fail to download '$(basename ${SOURCE})'. Aborting the build." mv -f "${SOURCE}" "${SOURCE}".FAIL exit 1 fi else - echo "File '$(basename ${SOURCE})' not available... aborting the build." + # Try if we have a SVN/CVS download routine for ${SOURCE} + echo "Will checkout sources to $(dirname $SOURCE)" + src_checkout 0 "${SOURCE}" 2>&1 > $OUTPUT/checkout-$(basename ${SOURCE}).log + fi + if [ ! -f "${SOURCE}" -o ! -s "${SOURCE}" ]; then + echo "File '$(basename ${SOURCE})' not available. Aborting the build." exit 1 fi fi @@ -150,10 +195,6 @@ echo "Extracting the source archive(s) for $PRGNAM..." tar -xvf ${SOURCE} cd ${PRGNAM}-${VERSION} -# Fix a 64bit libdir issue: -sed -i CMakeLists.txt \ - -e 's,set(PORTSMF_INSTALL_CMAKEDIR "lib/,set(PORTSMF_INSTALL_CMAKEDIR "lib'${LIBDIRSUFFIX}'/,' - ## Build shared libraries: #cat $SRCDIR/patches/portsmf_sharedlib.patch | patch -p1 --verbose \ # 2>&1 | tee $OUTPUT/patch-${PRGNAM}.log @@ -166,25 +207,30 @@ export LDFLAGS="$SLKLDFLAGS" export CXXFLAGS="$SLKCFLAGS" export CFLAGS="$SLKCFLAGS" -mkdir -p build-${PRGNAM} -cd build-${PRGNAM} - cmake .. \ - -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ - -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ - -DCMAKE_C_FLAGS_RELEASE:STRING="$SLKCFLAGS" \ - -DCMAKE_CXX_FLAGS_RELEASE:STRING="$SLKCFLAGS" \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DCMAKE_INSTALL_LIBDIR=lib${LIBDIRSUFFIX} \ - -DCMAKE_INSTALL_MANDIR=/usr/man \ - -DCMAKE_INSTALL_SYSCONFDIR=/etc \ - -DLIB_SUFFIX=${LIBDIRSUFFIX} \ - -DPORTSMF_INSTALL_CMAKEDIR=lib${LIBDIRSUFFIX}/cmake/PortSMF \ - -DBUILD_SHARED_LIBS:BOOL="OFF" \ - 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 - 1>/dev/null +autoreconf -vif \ + 2>&1 | tee $OUTPUT/autoreconf-${PRGNAM}.log + +# For some reason, configure script is not executable: +chmod 755 configure +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --mandir=/usr/man \ + --docdir=/usr/doc/$PRGNAM-$VERSION \ + --includedir=/usr/include/$PRGNAM \ + --localstatedir=/var \ + --sysconfdir=/etc \ + --program-prefix= \ + --program-suffix= \ + --build=$TARGET \ + 2>&1 | tee $OUTPUT/configure-${PRGNAM}.log + +make $NUMJOBS 2>&1 | tee $OUTPUT/make-${PRGNAM}.log +make DESTDIR=$PKG includedir=/usr/include/$PRGNAM install \ + 2>&1 | tee $OUTPUT/install-${PRGNAM}.log + +# The pkg-config file needs to be installed manually: +install -D -m0644 portSMF.pc -t ${PKG}/usr/lib${LIBDIRSUFFIX}/pkgconfig/ # Add documentation: mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -- cgit v1.2.3-65-gdbad