summaryrefslogtreecommitdiff
path: root/community/stk/PKGBUILD
blob: 353f5cb1ee77234ad0e9103beacc2343ccd2b3cd (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
# Maintainer: Ray Rashif <schiv@archlinux.org>
# Maintainer: Mateusz Herych <heniekk@gmail.com>

pkgname=stk
pkgver=4.4.2
pkgrel=5
pkgdesc="The Synthesis ToolKit in C++"
arch=('i686' 'x86_64')
url="http://ccrma.stanford.edu/software/stk/"
license=('MIT')
depends=('gcc-libs' 'jack')
makedepends=('pkg-config')
optdepends=('oss: use OSSv4 output/API'
            'tk: run provided demos/samples')
source=(http://ccrma.stanford.edu/software/stk/release/$pkgname-$pkgver.tar.gz
        $pkgname.license
        cxxflags.patch
        runtime.patch)
md5sums=('0b7bd1f913ca01fb8b2201ebcf853358'
         'a0163d75a5f516b6c93f4fc948acff73'
         '1b09d29321d575ad670f6371651015c6'
         '36551c348340307c765fde85d4336e73')

build() {
  cd "$srcdir/$pkgname-$pkgver"

  # fails with --as-needed
  export LDFLAGS="${LDFLAGS//-Wl,--as-needed}"

  # optimise for our target architecture(s)
  patch -Np1 -i ../cxxflags.patch
  autoreconf

  # enable shared library
  sed -i \
    "s:cd src && \$(MAKE)$:& lib$pkgname.so.$pkgver:" \
      Makefile.in

  # fix demo rawwaves path
  sed -i 's:\.\./\.\.:/usr/lib/stk:' \
    projects/demo/demo.cpp

  # run actual build
  ./configure RAWWAVE_PATH=/usr/lib/stk/rawwaves/ \
              --prefix=/usr \
              --with-alsa \
              --with-jack \
              --with-oss
  make

  # fix executable scripts
  patch -Np1 -i ../runtime.patch
}

package() {
  cd "$srcdir/$pkgname-$pkgver"

  mkdir -p "$pkgdir"/usr/{bin,{lib,include}/stk}

  # install library
  cp -a src/libstk.* "$pkgdir/usr/lib/"

  # install headers
  install -m644 include/* "$pkgdir/usr/include/stk/"
  rm "$pkgdir"/usr/include/stk/*~

  # install runtime files
  cp -a rawwaves projects/demo/{demo,tcl} \
    projects/effects/{effects,tcl} \
    projects/ragamatic/{ragamat,tcl,rawwaves} \
      "$pkgdir/usr/lib/stk/"

  # install executables
  install -m755 projects/{demo/StkDemo,effects/StkEffects} \
    "$pkgdir/usr/bin/"

  install -m755 projects/ragamatic/Raga \
    "$pkgdir/usr/bin/StkRagamatic"

  # install license
  install -Dm644 ../$pkgname.license \
    "$pkgdir/usr/share/licenses/stk/LICENSE"
}

# vim:set ts=2 sw=2 et: