2010-05-11 20:01:23 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for Pure Data
|
|
|
|
|
2011-10-23 19:50:55 +02:00
|
|
|
# Modified by by Ilya Dmitrichenko <errordeveloper-AT-gmail-DOT-com>
|
2010-05-11 20:01:23 +02:00
|
|
|
# Modified by Robby Workman <rworkman@slackbuilds.org> with minor stuff:
|
|
|
|
# -fix makefile patch to use DESTDIR correctly
|
|
|
|
# -miscellanous script tweaks
|
|
|
|
# No additional license terms
|
2011-10-23 19:50:55 +02:00
|
|
|
# Modified by Michales Michaloudes <korgie@gmail.com> (2011)
|
|
|
|
# - version bump
|
|
|
|
# - desktop icon
|
|
|
|
# - enable jack and portmidi
|
2011-12-12 00:54:57 +01:00
|
|
|
# - include all .h files
|
2017-03-24 14:38:16 +01:00
|
|
|
# - added SRCVERSION (2017)
|
|
|
|
# - correct .desktop Exec (2017)
|
2010-05-11 20:01:23 +02:00
|
|
|
|
|
|
|
PRGNAM=pd
|
2020-04-09 19:20:21 +02:00
|
|
|
VERSION=${VERSION:-0.50_2}
|
2018-05-13 04:00:43 +02:00
|
|
|
SRCVERSION=$(echo $VERSION | tr _ -)
|
2013-11-16 20:02:07 +01:00
|
|
|
BUILD=${BUILD:-1}
|
2010-05-11 20:01:23 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
2011-10-25 03:03:33 +02:00
|
|
|
|
2011-12-12 00:54:57 +01:00
|
|
|
|
2010-06-04 07:00:29 +02:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2017-03-24 14:38:16 +01:00
|
|
|
i?86) ARCH=i586 ;;
|
2010-06-04 07:00:29 +02:00
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
2011-10-25 03:03:33 +02:00
|
|
|
|
2010-05-11 20:01:23 +02:00
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2017-03-24 14:38:16 +01:00
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
2010-05-13 00:21:57 +02:00
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 20:01:23 +02:00
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
2010-05-13 00:21:57 +02:00
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
LIBDIRSUFFIX="64"
|
2010-06-04 07:00:29 +02:00
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 20:01:23 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
2011-12-12 00:54:57 +01:00
|
|
|
rm -rf $PRGNAM-$SRCVERSION
|
|
|
|
tar xvf $CWD/$PRGNAM-$SRCVERSION.src.tar.gz
|
|
|
|
cd $PRGNAM-$SRCVERSION
|
2010-05-11 20:01:23 +02:00
|
|
|
chown -R root:root .
|
2013-11-16 20:02:07 +01:00
|
|
|
find -L . \
|
|
|
|
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
|
|
|
|
-o -perm 511 \) -exec chmod 755 {} \; -o \
|
|
|
|
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
|
|
|
|
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
|
|
|
|
|
|
|
|
./autogen.sh
|
|
|
|
|
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--datadir=/usr/share/pd \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--enable-alsa \
|
|
|
|
--enable-setuid \
|
|
|
|
--enable-jack \
|
|
|
|
--disable-portaudio \
|
|
|
|
--disable-portmidi
|
|
|
|
make
|
|
|
|
make install DESTDIR=$PKG
|
2010-05-11 20:01:23 +02:00
|
|
|
|
2011-10-23 19:50:55 +02:00
|
|
|
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
|
2010-05-19 08:31:24 +02:00
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
2010-05-11 20:01:23 +02:00
|
|
|
|
2011-10-23 19:50:55 +02:00
|
|
|
# create and cp KDE desktop icon
|
|
|
|
mkdir -p $PKG/usr/share/applications
|
|
|
|
mkdir -p $PKG/usr/share/$PRGNAM
|
2017-03-24 14:38:16 +01:00
|
|
|
|
|
|
|
# Change the .desktop to point in correct executable.
|
|
|
|
sed "s+Exec=pd+Exec=/usr/lib${LIBDIRSUFFIX}/$PRGNAM/bin/$PRGNAM+" $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
|
|
|
|
|
2020-04-09 19:20:21 +02:00
|
|
|
convert $TMP/$PRGNAM-$SRCVERSION/tcl/pd.ico $TMP/${PRGNAM}\_${SRCVERSION}.xpm
|
|
|
|
cp $TMP/${PRGNAM}\_${SRCVERSION}-3.xpm $PKG/usr/share/$PRGNAM/${PRGNAM}\_${SRCVERSION}-3.xpm
|
2011-10-23 19:50:55 +02:00
|
|
|
|
2011-12-12 00:54:57 +01:00
|
|
|
# copy all header files (for pd_mrpeach)
|
|
|
|
cp -p $TMP/$PRGNAM-$SRCVERSION/src/*.h $PKG/usr/include/
|
2011-10-23 19:50:55 +02:00
|
|
|
|
|
|
|
mv $PKG/usr/share/man $PKG/usr/man
|
2016-01-07 19:45:04 +01:00
|
|
|
find $PKG/usr/man -type f -exec gzip -9 {} \;
|
|
|
|
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
|
2011-10-23 19:50:55 +02:00
|
|
|
|
2011-12-12 00:54:57 +01:00
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2010-05-11 20:01:23 +02:00
|
|
|
cp -a INSTALL.txt README.txt LICENSE.txt src/CHANGELOG.txt \
|
2011-12-12 00:54:57 +01:00
|
|
|
$PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
2020-04-09 19:20:21 +02:00
|
|
|
# native documentation wants this
|
2011-12-12 00:54:57 +01:00
|
|
|
ln -s /usr/lib/pd/doc/ $PKG/usr/doc/$PRGNAM-$VERSION/docs
|
2010-05-11 20:01:23 +02:00
|
|
|
|
2020-04-09 19:20:21 +02:00
|
|
|
# pd-gui wants this:
|
|
|
|
# Error in startup script: couldn't execute "/usr/lib64/pd/tcl/../bin/pd":
|
|
|
|
# no such file or directory
|
|
|
|
cd $PKG/usr/lib$LIBDIRSUFFIX/$PRGNAM/bin/
|
|
|
|
# remove bad (temp) link
|
|
|
|
rm ./pd
|
|
|
|
ln -s ../../../bin/$PRGNAM ./$PRGNAM
|
|
|
|
|
2010-05-11 20:01:23 +02:00
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
2012-09-28 02:49:06 +02:00
|
|
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
2010-05-11 20:01:23 +02:00
|
|
|
|
|
|
|
cd $PKG
|
2011-12-12 00:54:57 +01:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|