summaryrefslogtreecommitdiff
path: root/audio/audacity/audacity.SlackBuild
blob: 498019a9b4d4245da4ecb648f226191c1e3397f5 (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 Audacity

# Written by Chess Griffin <chess at chessgriffin dot com>
# Thanks to Eric Hameleers for adding the audacity.desktop
# file and other tweaks and bug fixes.  Thanks to Heinz
# Wiesinger for bug fixes and and the soundtouch and twolame
# improvements.

# Modified by the SlackBuilds.org project

PRGNAM=audacity
VERSION=1.3.6
ARCH=${ARCH:-i486}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}

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

SOUNDTOUCH=${SOUNDTOUCH:-no}
TWOLAME=${TWOLAME:-no}

if [ "$SOUNDTOUCH" = "no" ]; then
    do_soundtouch="without"
else
    do_soundtouch="with"
fi

if [ "$TWOLAME" = "no" ]; then
    do_twolame="without"
else
    do_twolame="with"
fi

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

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

# The following is needed until Slackware officially ships
# autotools-1.10.
sed -i "s|am__api_version='1.10'|am__api_version='1.9'|" lib-src/portsmf/configure

CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
  --prefix=/usr \
  --enable-unicode \
  --enable-nyquist \
  --enable-vamp \
  --with-expat \
  --with-libvorbis \
  --with-libmad \
  --with-libflac \
  --with-libsndfile \
  --with-libid3tag \
  --with-libresample \
  --$do_soundtouch-soundtouch \
  --$do_twolame-libtwolame \
  || exit 1

make || exit 1
make install DESTDIR=$PKG || exit 1

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

# We're going to overwrite the include audacity.desktop file with ours,
# and the icon isn't added at all by upstream, so we'll do that here
install -D -m 0644 $CWD/audacity.desktop $PKG/usr/share/applications/audacity.desktop
install -D -m 0644 images/AudacityLogo48x48.xpm $PKG/usr/share/pixmaps/audacity.xpm

# Move manpage directory to proper loacation; pages are gzipped already
mv $PKG/usr/share/man $PKG/usr

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
mv $PKG/usr/share/doc/audacity/* $PKG/usr/doc/$PRGNAM-$VERSION
cp LICENSE.txt README.txt $PKG/usr/doc/$PRGNAM-$VERSION
rm -r $PKG/usr/share/doc
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

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

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz