summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e048e7f7b14a85e486efbcb9411e820277ceecbc (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
# Maintainer: JP Cimalando <jp-dev@inbox.ru>
pkgname=fmidi-git
pkgver=v0.1.r31.666cd72
pkgrel=1
pkgdesc="Library and programs to read and play back MIDI files"
arch=('i686' 'x86_64')
url="https://github.com/jpcima/fmidi"
license=('custom')
groups=()
depends=('libev' 'rtmidi')
makedepends=('git' 'cmake' 'boost')
provides=('fmidi')
conflicts=('fmidi')
replaces=()
backup=()
options=('staticlibs')
install=
source=('fmidi::git+https://github.com/jpcima/fmidi.git'
        'fmt::git+https://github.com/fmtlib/fmt.git')
md5sums=('SKIP'
         'SKIP')
noextract=()

pkgver() {
  cd "$srcdir/fmidi"
  printf "%s" "$(git describe --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')"
}

prepare() {
  cd "$srcdir/fmidi"
  git submodule init
  git config submodule.thirdparty/fmt.url "$srcdir"/fmt
  git submodule update
}

build() {
  install -d "$srcdir/fmidi-static"
  cd "$srcdir/fmidi-static"
  cmake -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DFMIDI_STATIC=ON \
        ../fmidi
  make

  install -d "$srcdir/fmidi-shared"
  cd "$srcdir/fmidi-shared"
  cmake -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DFMIDI_STATIC=OFF \
        ../fmidi
  make
}

package() {
  make DESTDIR="$pkgdir/" -C "$srcdir/fmidi-static" install
  make DESTDIR="$pkgdir/" -C "$srcdir/fmidi-shared" install
  install -D -m644 "$srcdir/fmidi/LICENSE.md" \
          "$pkgdir/usr/share/licenses/$pkgname/LICENSE.md"
}