2010-05-13 00:57:30 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for portmidi
|
|
|
|
|
2010-06-14 07:34:14 +02:00
|
|
|
# Copyright 2009 David Woodfall <dave@dawoodfall.net>
|
2010-05-13 00:57:30 +02:00
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use of this script, with or without modification, is
|
|
|
|
# permitted provided that the following conditions are met:
|
|
|
|
#
|
|
|
|
# 1. Redistributions of this script must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
|
|
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
|
|
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
|
|
|
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
|
|
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
|
|
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
|
|
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
|
|
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
2010-03-03 21:12:07 +01:00
|
|
|
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
2010-05-13 00:57:30 +02:00
|
|
|
|
2010-10-17 20:37:54 +02:00
|
|
|
# Modified by SlackBuilds.org
|
|
|
|
|
2010-05-13 00:57:30 +02:00
|
|
|
PRGNAM=portmidi
|
2010-11-05 23:46:15 +01:00
|
|
|
VERSION=${VERSION:-217}
|
2018-03-27 10:11:09 +02:00
|
|
|
BUILD=${BUILD:-5}
|
2010-05-13 00:57:30 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
2010-06-04 07:00:31 +02:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2018-03-27 10:11:09 +02:00
|
|
|
i?86) ARCH=i586 ;;
|
2010-06-04 07:00:31 +02:00
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2010-05-13 00:57:30 +02:00
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2018-03-27 10:11:09 +02:00
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
2010-05-13 00:57:30 +02:00
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
LIBDIRSUFFIX="64"
|
2010-06-04 07:00:31 +02:00
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-13 00:57:30 +02:00
|
|
|
fi
|
|
|
|
|
2010-03-03 21:12:07 +01:00
|
|
|
set -e
|
2010-05-13 00:57:30 +02:00
|
|
|
|
|
|
|
rm -rf $PKG
|
2010-03-03 21:12:07 +01:00
|
|
|
mkdir -p $TMP $PKG/usr/lib$LIBDIRSUFFIX $OUTPUT
|
2010-05-13 00:57:30 +02:00
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM
|
|
|
|
unzip $CWD/$PRGNAM-src-$VERSION.zip
|
|
|
|
cd $PRGNAM
|
|
|
|
|
|
|
|
chown -R root:root .
|
2013-11-22 08:37:19 +01:00
|
|
|
find -L . \
|
|
|
|
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
|
2010-05-13 00:57:30 +02:00
|
|
|
-exec chmod 755 {} \; -o \
|
|
|
|
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
|
|
|
|
-exec chmod 644 {} \;
|
|
|
|
|
2010-10-17 20:37:54 +02:00
|
|
|
# cmake install dir & 64 bit fixes
|
2010-11-05 23:46:15 +01:00
|
|
|
patch --verbose -p1 -i $CWD/portmidi-cmake.patch
|
2010-05-13 00:57:30 +02:00
|
|
|
|
|
|
|
cmake . \
|
|
|
|
-DCMAKE_C_FLAGS="$SLKCFLAGS" \
|
|
|
|
-DCMAKE_CXX_FLAGS="$SLKCFLAGS" \
|
2010-03-03 21:12:07 +01:00
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
2010-10-17 20:37:54 +02:00
|
|
|
-DLIB_SUFFIX="$LIBDIRSUFFIX" \
|
2010-06-14 07:34:14 +02:00
|
|
|
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=$PKG/usr/bin \
|
|
|
|
-DJAVA_AWT_INCLUDE_PATH="/usr/lib$LIBDIRSUFFIX/java/include" \
|
|
|
|
-DJAVA_INCLUDE_PATH="/usr/lib$LIBDIRSUFFIX/java/include" \
|
|
|
|
-DJAVA_INCLUDE_PATH2="/usr/lib$LIBDIRSUFFIX/java/include/linux" \
|
2011-01-11 04:55:59 +01:00
|
|
|
-DCMAKE_CACHEFILE_DIR=$(pwd) \
|
2010-06-14 07:34:14 +02:00
|
|
|
-DJAVA_JVM_LIBRARY="/usr/lib$LIBDIRSUFFIX/libjvm.so"
|
2010-03-03 21:12:07 +01:00
|
|
|
|
2012-07-25 12:55:36 +02:00
|
|
|
# some wrong paths expose with openjdk, fix them
|
|
|
|
# https://bugs.archlinux.org/task/29214
|
|
|
|
sed -i "s|pm_java/pm_java|pm_java|" pm_java/CMakeFiles/pmdefaults_target.dir/build.make
|
|
|
|
|
2011-01-11 04:55:59 +01:00
|
|
|
make all \
|
2018-03-27 10:11:09 +02:00
|
|
|
CFLAGS="$SLKCFLAGS" \
|
2012-09-12 18:10:24 +02:00
|
|
|
PMFLAGS="-DNEWBUFFER" -j1
|
2010-05-13 00:57:30 +02:00
|
|
|
make install DESTDIR=$PKG
|
2010-10-17 20:37:54 +02:00
|
|
|
|
2011-06-11 11:52:52 +02:00
|
|
|
cd $PKG/usr/lib$LIBDIRSUFFIX
|
|
|
|
rm -f libportmidi_s.a
|
|
|
|
ln -s libportmidi.so libporttime.so
|
|
|
|
cd -
|
2010-03-03 21:12:07 +01:00
|
|
|
|
|
|
|
# I think this may cause problems unless it's renamed
|
|
|
|
mv $PKG/usr/bin/test $PKG/usr/bin/portmiditest
|
|
|
|
|
2010-06-14 07:34:14 +02:00
|
|
|
install -m 0644 -D pm_common/pmutil.h $PKG/usr/include
|
|
|
|
install -m 0644 -D $CWD/pmdefaults.desktop $PKG/usr/share/applications/pmdefaults.desktop
|
2010-05-13 00:57:30 +02:00
|
|
|
|
2010-06-14 07:34:14 +02:00
|
|
|
install -m 0644 -D pm_java/pmdefaults/pmdefaults-icon.png \
|
2010-10-17 20:37:54 +02:00
|
|
|
$PKG/usr/share/icons/hicolor/128x128/apps/pmdefaults-icon.png
|
2010-05-13 00:57:30 +02:00
|
|
|
|
2010-05-19 08:31:25 +02:00
|
|
|
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
|
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
2010-05-13 00:57:30 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a CHANGELOG.txt README.txt $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
2010-06-14 07:34:14 +02:00
|
|
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
2010-05-13 00:57:30 +02:00
|
|
|
|
|
|
|
cd $PKG
|
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|