summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 18efa2501bcad46fceff7aef15ec53e3cc497ef6 (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
# Maintainer: Milk (milk / milkii on Freenode)
# Maintainer: Jean Pierre Cimalando <jp-dev@inbox.ru>
# Contributor: osch <oliver@luced.de>
pkgname=surge-synthesizer-git
_pkgname=surge
pkgver=r1010.856e43b
pkgrel=1
pkgdesc="Surge Synthesizer plugin (LV2/VST3, git head)"
arch=('x86_64')
url="https://surge-synthesizer.github.io"
license=('GPL3')
groups=('lv2-plugins')
depends=('cairo'  'fontconfig'          'freetype2'
         'libx11' 'xcb-util-cursor'     'xcb-util'
         'libxcb' 'xcb-util-renderutil' 'xcb-util-image'
         'xcb-util-keysyms' 'libxkbcommon-x11' 'cmake')
makedepends=('premake-git' 'git' 'python')
provides=('surge-synthesizer' 'surge-synthesizer-bin')
conflicts=('surge-synthesizer' 'surge-synthesizer-bin' 'surge')
source=("git+https://github.com/surge-synthesizer/surge.git")
options=()
md5sums=('SKIP')

pkgver() {
  cd "$srcdir/$_pkgname"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
	cd "$srcdir/$_pkgname"
	git submodule update --init --recursive

	# version number extraction from the source code
	cat << EOF > extract_version.cpp
#include "src/common/version.h"
#include <stdio.h>
int main() { puts(VERSION_STR); }
EOF
	g++ -Ivst3sdk -o extract_version extract_version.cpp
	printf "%s+git%s" "$(./extract_version)" "$(git rev-parse --short HEAD)" > VERSION
}

build() {
	cd "$srcdir/$_pkgname"

	# work around parallel make issues
	export MAKEFLAGS=

	premake5 --cc=gcc --os=linux gmake2
	make -f surge-lv2.make config=release_x64
	make -f surge-vst3.make  config=release_x64
}

package() {
	cd "$srcdir/$_pkgname"

	install -d "$pkgdir/usr/lib/lv2"
	cp -rfd target/lv2/Release/Surge.lv2 "$pkgdir/usr/lib/lv2/"

	install -d "$pkgdir/usr/lib/vst3"
	cp -rfd products/Surge.vst3 "$pkgdir/usr/lib/vst3/"

	install -d "$pkgdir/usr/share/Surge"
	cp -rfd resources/data/* "$pkgdir/usr/share/Surge/"

	install -D -m644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
	install -D -m644 README.md AUTHORS -t "$pkgdir/usr/share/doc/Surge/"
}