summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fcb217c03e07fad3bd947e889f0f3225a7ffca18 (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
# -*- shell-script -*-
# Maintainer: Albert Graef <aggraef at gmail dot com>

# This is a generic PKGBUILD which lets you build variants of the package for
# all the different Pd flavors out there. Just `makepkg` will build the pd
# (vanilla) package, `makepkg puredata=purr-data` will build a package for
# purr-data, etc. Note that in any case, pd-faustgen2 uses its own copy of the
# Pd source to build the external, but the resulting binary will work with all
# current Pd flavors. The PKGBUILD just makes sure that the external will be
# installed into the right directory for the target Pd version.

# Name of the Pd flavor we're building this package for (pd, pd-l2ork,
# purr-data, etc.). The package name prefix is derived from this (pd for
# vanilla, pdl2ork for pd-l2ork, purrdata for purr-data, etc.).
puredata=${puredata:-pd}
pkgpref=$(echo "$puredata" | sed -e 's/-//g')

# Source and destination package names.
src_pkgname=pd-faustgen
dest_pkgname=$pkgpref-faustgen2

pkgname=$dest_pkgname-git
pkgver=2.0.0rc4.r1.g61e30e1
pkgrel=1
pkgdesc="The FAUST compiler embedded in a Pd external - git version"
arch=("i686" "x86_64")
license=('MIT')
url="https://github.com/agraef/$src_pkgname"
depends=("$puredata" 'llvm-libs')
makedepends=('cmake' 'faust' 'llvm')
provides=("$dest_pkgname")
conflicts=("$dest_pkgname")
source=("git+https://github.com/agraef/$src_pkgname.git")
md5sums=('SKIP')

pkgver() {
    cd "$src_pkgname"
    git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-rc/rc/g;s/-/./g'
}

prepare() {
     cd "$src_pkgname"
     # We don't have to initialize the faust submodules, as we're building
     # against an installed libfaust. This makes checking out the submodules
     # much quicker.
     git submodule update --init pd.build pure-data
}

# Installation goes into /usr/lib/$puredata. Figure out the real name of that
# directory in case it is a link (as is the case with purr-data).
pdlibdir=$(cd /usr/lib/$puredata && pwd -P)

build() {
     cd "$src_pkgname"
     rm -rf build
     mkdir build && cd build
     cmake .. -DCMAKE_INSTALL_PREFIX="$pdlibdir" -DINSTALL_DIR="extra/faustgen2~" -DINSTALLED_FAUST=ON
     make
}

package() {
     cd "$src_pkgname/build"
     make install DESTDIR="$pkgdir"
}