summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c6690bd2c65438fed49b0f2da99a1d0e785c2fd6 (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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# Maintainer: rtfreedman  (rob<d0t>til<d0t>freedman<aT>googlemail<d0t>com
# Contributor: Loren Copeland <thisisquitealongname at gm--l> 
# based on jack2 PKGBUILD by Ray Rashif <schiv@archlinux.org>

pkgbase=jack2-git
pkgname=('jack2-git')
#pkgname= # single build (overrides split)
pkgver=3382
pkgrel=1
arch=('i686' 'x86_64')
url="http://jackaudio.org/"
backup=(etc/security/limits.d/99-audio.conf)
license=('GPL')
makedepends=('python2' 'celt' 'opus' 'libsamplerate' 'git' 'libffado')
source=("git+https://github.com/jackaudio/jack2"
        '99-audio.conf'
        '40-hpet-permissions.rules')
md5sums=('SKIP'
         'ae65b7c9ebe0fff6c918ba9d97ae342d'
         '471aad533ff56c5d3cbbf65ce32cadef')

_gitname='jack2'

_pyfix() {
  sed -i 's:bin/env python:bin/env python2:' \
    "$pkgdir/usr/bin/jack_control"
}

_wafconf() {
  # default=64,  kxstudio=256  --clients= 
  # default=768, kxstudio=2048 --ports-per-application= 

  python2 waf configure --prefix=/usr \
    --clients=128 --ports-per-application=1536 \
    --alsa  --firewire $@

  # not building with doxygen
  # see https://github.com/jackaudio/jack2/issues/22
}

_isbuild() {
  printf "%s\n" ${pkgname[@]} | grep -qx $1
}

pkgver() {
  cd jack2
  # get a plain number
  echo $(git rev-list --count master) 
}

prepare() {
  # we may do 2 different builds
  #cp -r $_gitname $_gitname-dbus
	echo 'bouh'
}

build() {
  cd "$srcdir"

  # Some optimisation bug exists for current GCC
  # see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53663 ##fixed
  #export CFLAGS="${CFLAGS/-O[0-9]/-O0}"
  #export CFLAGS
  #export CXXFLAGS="$CFLAGS"

  # fix doxygen building
  # TODO: report upstream, but redundant until gihub issue 22 resolves
  #sed -i 's:build/default/html:html:' $_tarname-$pkgver/wscript

  # mixed dbus/classic build
  if _isbuild jack2-git; then
    cd $_gitname
    msg2 "Running Mixed D-Bus/Classic build"
    _wafconf --classic --dbus # --autostart=dbus|none|default|classic
    python2 waf build $MAKEFLAGS
    cd ..
  fi

  # dbus-ONLY build
  if _isbuild jack2-dbus-git; then
    cd $_gitname-dbus
    msg2 "Running D-Bus-only build"
    _wafconf --dbus --autostart=dbus
    python2 waf build $MAKEFLAGS
    cd ..
  fi
}

package_jack2-git() {
  ! _isbuild jack2-git && return 0

  pkgdesc="The next-generation JACK with SMP support"
  depends=('libsamplerate' 'opus' 'celt' 'libffado')
  optdepends=('python2: jack_control')
  conflicts=('jack')
  provides=('jack' 'jackmp' 'jackdmp' 'jackdbus')

  cd "$srcdir/$_gitname"

  python2 waf install --destdir="$pkgdir"

  # fix for major python transition
  _pyfix

  # configure realtime access/scheduling
  # see https://bugs.archlinux.org/task/26343
  install -Dm644 "$srcdir/99-audio.conf" \
    "$pkgdir/etc/security/limits.d/99-audio.conf"

  install -Dm644 "$srcdir/40-hpet-permissions.rules" \
    "$pkgdir/usr/lib/udev/rules.d/40-hpet-permissions.rules"
}

package_jack2-dbus-git() {
  ! _isbuild jack2-dbus-git && return 0

  pkgdesc="The next-generation JACK with SMP support (for D-BUS interaction only)"
  depends=('libsamplerate' 'celt' 'opus' 'libffado')
  optdepends=('python2: jack_control')
  conflicts=('jack' 'jack2')
  provides=('jack' 'jack2' 'jackmp' 'jackdmp' 'jackdbus')

  cd "$srcdir/$_gitname-dbus"

  python2 waf install --destdir="$pkgdir"

  _pyfix

  install -Dm644 "$srcdir/99-audio.conf" \
    "$pkgdir/etc/security/limits.d/99-audio.conf"

  install -Dm644 "$srcdir/40-hpet-permissions.rules" \
    "$pkgdir/usr/lib/udev/rules.d/40-hpet-permissions.rules"
}

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