diff options
Diffstat (limited to 'portmidi/build')
-rwxr-xr-x | portmidi/build/portmidi.SlackBuild | 118 |
1 files changed, 33 insertions, 85 deletions
diff --git a/portmidi/build/portmidi.SlackBuild b/portmidi/build/portmidi.SlackBuild index 9ac91ece..e7484281 100755 --- a/portmidi/build/portmidi.SlackBuild +++ b/portmidi/build/portmidi.SlackBuild @@ -1,6 +1,6 @@ #!/bin/sh # $Id$ -# Copyright 2019, 2020 Eric Hameleers, Eindhoven, NL +# Copyright 2019, 2020, 2022 Eric Hameleers, Eindhoven, NL # All rights reserved. # # Permission to use, copy, modify, and distribute this software for @@ -27,7 +27,7 @@ # By: Eric Hameleers <alien@slackware.com> # For: portmidi # Descr: cross-platform library for realtime MIDI I/O -# URL: http://portmedia.sourceforge.net/ +# URL: https://github.com/PortMidi/portmidi # Build needs: openjdk # Needs: openjre # Changelog: @@ -36,6 +36,12 @@ # thanks Dave Woodfall. # 217-2: 10/oct/2020 by Eric Hameleers <alien@slackware.com> # * Add 'X-DAW' category to the desktop file (for liveslak). +# 2.0.3-1: 18/sep/2022 by Eric Hameleers <alien@slackware.com> +# * Updated now that the maintainer is active again. +# All programs that depend on portmidi need to be recompiled +# against this new release. +# The pmdefaults program is not packaged anymore, +# as per advice from the maintainer. # # Run 'sh portmidi.SlackBuild' to build a Slackware package. # The package (.t?z) and .txt file as well as build logs are created in /tmp . @@ -44,12 +50,12 @@ # ----------------------------------------------------------------------------- PRGNAM=portmidi -VERSION=${VERSION:-217} -BUILD=${BUILD:-2} +VERSION=${VERSION:-"2.0.3"} +BUILD=${BUILD:-1} NUMJOBS=${NUMJOBS:-" -j$(nproc) "} TAG=${TAG:-alien} -DOCS="CHANGELOG.txt README.txt" +DOCS="CHANGELOG.txt README.md README.txt license.txt pm_linux/README_LINUX.txt" # Where do we look for sources? SRCDIR=$(cd $(dirname $0); pwd) @@ -59,8 +65,8 @@ TMP=${TMP:-/tmp/build} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} -SOURCE="$SRCDIR/${PRGNAM}-${VERSION}.zip" -SRCURL="https://downloads.sourceforge.net/project/portmedia/${PRGNAM}/${VERSION}/${PRGNAM}-src-${VERSION}.zip" +SOURCE="$SRCDIR/${PRGNAM}-${VERSION}.tar.gz" +SRCURL="https://github.com/PortMidi/${PRGNAM}/archive/refs/tags/v${VERSION}.tar.gz" ## ## --- with a little luck, you won't have to edit below this point --- ## @@ -150,22 +156,8 @@ echo "++" cd $TMP/tmp-$PRGNAM echo "Extracting the source archive(s) for $PRGNAM..." -unzip ${SOURCE} -cd ${PRGNAM} - -touch $OUTPUT/patch-${PRGNAM}.log -# Fix the build (thanks to ArchLinux's Lukas Fleischer): -mkdir -p pm_java/Release -cat $SRCDIR/patches/portmidi-217_buildfix.patch | patch -p1 --verbose \ - 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log - -# Fix install locations: -sed -i CMakeLists.txt */CMakeLists.txt pm_python/setup.py \ - -e 's,/usr/local/lib,${CMAKE_INSTALL_PREFIX}/lib'${LIBDIRSUFFIX}',g' \ - -e 's,/usr/local/include,${CMAKE_INSTALL_PREFIX}/include,g' \ - -e 's,/usr/local/bin,${CMAKE_INSTALL_PREFIX}/bin,g' \ - -e 's,/usr/share/java,${CMAKE_INSTALL_PREFIX}/share/java,g' \ - +tar -xvf ${SOURCE} +cd ${PRGNAM}-${VERSION} chown -R root:root . chmod -R u+w,go+r-w,a+rX-st . @@ -173,68 +165,24 @@ echo Building ... export LDFLAGS="$SLKLDFLAGS" export CXXFLAGS="$SLKCFLAGS" export CFLAGS="$SLKCFLAGS" -# Does not work in a 'build' subdirectory: -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_ARCHIVE_OUTPUT_DIRECTORY=Release \ - -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=Release \ - -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=Release \ - 2>&1 | tee $OUTPUT/configure-${PRGNAM}.log -make -j1 2>&1 | tee $OUTPUT/make-${PRGNAM}.log -make DESTDIR=$PKG install 2>&1 | tee $OUTPUT/install-${PRGNAM}.log - -# Remove static library from the package: -rm -f $PKG/usr/lib${LIBDIRSUFFIX}/libportmidi_s.a - -# Fix missing symlink for libporttime.so (again thanks to ArchLinux): -ln -s libportmidi.so $PKG/usr/lib${LIBDIRSUFFIX}/libporttime.so - -# Add a missing header file: -install -m 0644 -D pm_common/pmutil.h $PKG/usr/include - -# Add a desktop file and an icon: -install -m 0644 -D pm_java/pmdefaults/pmdefaults-icon.png \ - $PKG/usr/share/icons/hicolor/128x128/apps/pmdefaults-icon.png -mkdir -p $PKG/usr/share/applications -cat <<EOT >$PKG/usr/share/applications/pmdefaults.desktop -[Desktop Entry] -Comment=Set default input and output devices for PortMidi -GenericName=PortMidi Settings -Exec=pmdefaults -Icon=pmdefaults-icon -Name=PortMidi Defaults -NoDisplay=false -StartupNotify=true -Terminal=false -Type=Application -Categories=X-DAW;Audio;AudioVideo; -EOT - -# Add this to the doinst.sh: -mkdir -p $PKG/install -cat <<EOINS >> $PKG/install/doinst.sh -# Update the desktop database: -if [ -x usr/bin/update-desktop-database ]; then - chroot . /usr/bin/update-desktop-database usr/share/applications > /dev/null 2>&1 -fi - -# Update hicolor theme cache: -if [ -d usr/share/icons/hicolor ]; then - if [ -x /usr/bin/gtk-update-icon-cache ]; then - chroot . /usr/bin/gtk-update-icon-cache -f -t usr/share/icons/hicolor 1> /dev/null 2> /dev/null - fi -fi - -# Update the mime database: -if [ -x usr/bin/update-mime-database ]; then - chroot . /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1 -fi -EOINS +mkdir 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 \ + -DBUILD_JAVA_NATIVE_INTERFACE:BOOL="ON" \ + -DBUILD_PMDEFAULTS:BOOL="OFF" \ + -DBUILD_SHARED_LIBS:BOOL="ON" \ + -DPM_USE_STATIC_RUNTIME:BOOL="ON" \ + .. \ + 2>&1 | tee $OUTPUT/configure-${PRGNAM}.log + make -j1 2>&1 | tee $OUTPUT/make-${PRGNAM}.log + make DESTDIR=$PKG install 2>&1 | tee $OUTPUT/install-${PRGNAM}.log +cd - 1>/dev/null # Add documentation: mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION |