aboutsummaryrefslogtreecommitdiff
path: root/audio/pd/pd.SlackBuild
blob: f8598f974fb5f134899b3d677db71cfaaed0313f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/sh

# Slackware build script for Pure Data

# Modified by by Ilya Dmitrichenko <errordeveloper-AT-gmail-DOT-com>
# Modified by Robby Workman <rworkman@slackbuilds.org> with minor stuff:
# -fix makefile patch to use DESTDIR correctly
# -miscellanous script tweaks
# No additional license terms
# Modified by Michales Michaloudes <korgie@gmail.com> (2011)
# - version bump
# - desktop icon
# - enable jack and portmidi

PRGNAM=pd
VERSION=${VERSION:-0.43-0}
CANONICALIZEDVERSION=$(echo $VERSION | tr - .)
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i486 ;;
    arm*) ARCH=arm ;;
       *) ARCH=$( uname -m ) ;;
  esac
fi

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.src.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
chmod -R u+w,go+r-w,a-s .

cd src
  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 \
    --enable-portmidi
make
make install DESTDIR=$PKG
cd -

find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

# create and cp KDE desktop icon
mkdir -p $PKG/usr/share/applications
mkdir -p $PKG/usr/share/$PRGNAM
cp -a $CWD/$PRGNAM.desktop $PKG/usr/share/applications
convert $TMP/$PRGNAM-$VERSION/src/pd.ico $TMP/$PRGNAM\_48.xpm
cp $TMP/$PRGNAM\_48-3.xpm $PKG/usr/share/$PRGNAM

# For 0.43-0 version
mkdir -p $PKG/usr/lib/pd/tcl/
cp -a $TMP/$PRGNAM-$VERSION/tcl/*.tcl $PKG/usr/lib/pd/tcl/

mv $PKG/usr/share/man $PKG/usr/man

mkdir -p $PKG/usr/doc/$PRGNAM-$CANONICALIZEDVERSION
cp -a INSTALL.txt README.txt LICENSE.txt src/CHANGELOG.txt \
  $PKG/usr/doc/$PRGNAM-$CANONICALIZEDVERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$CANONICALIZEDVERSION/$PRGNAM.SlackBuild
ln -s /usr/lib/pd/doc/ $PKG/usr/doc/$PRGNAM-$CANONICALIZEDVERSION/docs

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$CANONICALIZEDVERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}