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

pkgbase=libopenmpt
pkgname=(libopenmpt openmpt123 openmpt123-minimal libopenmpt-modplug)
_pkgver=0.4.5+release
pkgver=${_pkgver%+*}
pkgrel=1
pkgdesc='A cross-platform C++ and C library to decode tracked music files (modules) into a raw PCM audio stream.'
arch=('i686' 'x86_64')
url='http://lib.openmpt.org/'
license=('BSD')
depends=('zlib' 'gcc-libs' 'libvorbis' 'mpg123')
makedepends=('sdl2' 'portaudio' 'libsndfile' 'flac' 'help2man' 'libpulse')
source=("https://lib.openmpt.org/files/$pkgname/src/$pkgname-${_pkgver}.makefile.tar.gz")
sha256sums=('46ceb540ac5e3ed48682c67f3397488c84ced85d14e481d20dbe6a3427a70b12')

build() {
  cd $pkgbase-${_pkgver%-*}

  make PREFIX=/usr CONFIG=gcc STATIC_LIB=0 NO_SDL=1 TEST=0 #VERBOSE=2

  # additional, minimal openmpt123 version
  cp bin/openmpt123.norpath bin/openmpt123_full
  rm openmpt123/openmpt123.o bin/openmpt123{,.norpath}
  make PREFIX=/usr CONFIG=gcc STATIC_LIB=0 NO_SDL=1 \
    NO_PORTAUDIO=1 NO_FLAC=1 NO_SNDFILE=1 NO_PULSEAUDIO=1 TEST=0 #VERBOSE=2
  cp bin/openmpt123.norpath bin/openmpt123_minimal
}

check() {
  cd $pkgbase-${_pkgver%-*}

  make test
}

package_libopenmpt() {
  cd $pkgbase-${_pkgver%-*}

  make PREFIX=/usr DESTDIR="$pkgdir" OPENMPT123=0 TEST=0 install

  # license
  install -Dm0644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

package_libopenmpt-modplug() {
  pkgdesc='libmodplug compat layer/bridge to libopenmpt'
  depends=("libopenmpt=$pkgver")
  conflicts=('libmodplug')
  provides=('libmodplug')
  install='libopenmpt-modplug.install'

  # library
  cd $pkgbase-${_pkgver%-*}
  make PREFIX=/usr DESTDIR="$pkgdir" TEST=0 install-modplug

  # headers
  install -d "$pkgdir"/usr/include/libmodplug
  install -m0644 include/modplug/include/libmodplug/{stdafx,sndfile,modplug}.h "$pkgdir"/usr/include/libmodplug

  # pkg-config
  install -Dm0644 include/modplug/include/libmodplug/libmodplug.pc.in "$pkgdir"/usr/lib/pkgconfig/libmodplug.pc
  sed -e 's|@.*prefix@|/usr|g;s|@libdir@|/usr/lib|' -i "$pkgdir"/usr/lib/pkgconfig/libmodplug.pc

  # link license
  install -d "$pkgdir"/usr/share/licenses
  ln -s $pkgbase "$pkgdir"/usr/share/licenses/$pkgname
}

package_openmpt123() {
  pkgdesc='A cross-platform command-line or terminal based module file player.'
  depends=("libopenmpt=$pkgver" 'sdl2' 'portaudio' 'libsndfile' 'flac' 'libpulse')

  cd $pkgbase-${_pkgver%-*}/bin
  install -Dm755 openmpt123_full "$pkgdir"/usr/bin/openmpt123
  install -Dm644 openmpt123.1 "$pkgdir"/usr/share/man/man1/openmpt123.1
  
  # link license
  install -d "$pkgdir"/usr/share/licenses
  ln -s $pkgbase "$pkgdir"/usr/share/licenses/$pkgname
}

package_openmpt123-minimal() {
  pkgdesc='A cross-platform command-line or terminal based module file player (with minimal dependencies).'
  depends=("libopenmpt=$pkgver" 'sdl2')
  conflicts=('openmpt123')

  cd $pkgbase-${_pkgver%-*}/bin
  install -Dm0755 openmpt123_minimal "$pkgdir"/usr/bin/openmpt123
  install -Dm0644 openmpt123.1 "$pkgdir"/usr/share/man/man1/openmpt123.1

  # link license
  install -d "$pkgdir"/usr/share/licenses
  ln -s $pkgbase "$pkgdir"/usr/share/licenses/$pkgname
}