summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1a48500626cd952b7dbede719a3814ee0d67b97f (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
# Maintainer: carstene1ns <arch carsten-teibes de> - http://git.io/ctPKG

pkgname=fluidsynth-git
pkgver=1.1.8.r868.e485129
pkgrel=1
pkgdesc="A real-time software synthesizer based on the SoundFont 2 specifications (development version)"
arch=('i686' 'x86_64')
url="http://www.fluidsynth.org/"
license=('LGPL')
depends=('glib2' 'jack' 'libpulse' 'alsa-lib' 'ladspa')
makedepends=('git' 'cmake')
optdepends=('pulseaudio: PulseAudio sound support')
conflicts=('fluidsynth')
provides=("fluidsynth=${pkgver%.r*}")
source=(${pkgname%-*}::"git+https://github.com/FluidSynth/fluidsynth.git")
md5sums=('SKIP')

pkgver() {
  cd ${pkgname%-*}

  _major=$(grep -o "FLUIDSYNTH_VERSION_MAJOR.*" CMakeLists.txt | grep -o "[0-9]*")
  _minor=$(grep -o "FLUIDSYNTH_VERSION_MINOR.*" CMakeLists.txt | grep -o "[0-9]*")
  _micro=$(grep -o "FLUIDSYNTH_VERSION_MICRO.*" CMakeLists.txt | grep -o "[0-9]*")
  _rev=$(git rev-list --count HEAD)
  _hash=$(git rev-parse --short HEAD)
  printf "$_major.$_minor.$_micro.r%s.%s" "$_rev" "$_hash"
}

prepare() {
  rm -rf build
  mkdir build
}

build() {
  cd build

  cmake ../${pkgname%-*} -DCMAKE_INSTALL_PREFIX=/usr \
                         -DCMAKE_BUILD_TYPE=Release \
                         -Denable-ladspa=ON \
                         -DLIB_SUFFIX=""
  make
}

package() {
  make -C build DESTDIR="$pkgdir/" install
}