summaryrefslogtreecommitdiff
path: root/libre/hydrogen/PKGBUILD
blob: 1ca4bf7050f87f42fc1e3afba696420299b29026 (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
# Maintainer (Arch): David Runge <dave@sleepmap.de>
# Contributor (Arch): Rob Til Freedmen <rob.til.freedman@gmail.com>
# Maintainer (Arch): Ray Rashif <schiv@archlinux.org>
# Contributor (Arch): tobias <tobias@archlinux.org>
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
# Contributor: André Silva <emulatorman@hyperbola.info>

# parabola changes and rationale:
#  - removed drumkits recommendation

pkgname=hydrogen
pkgver=1.0.0beta1
_beta=beta1
pkgrel=1.par1
pkgdesc="An advanced drum machine, without nonfree drumkits recommendation"
arch=('x86_64' 'i686' 'armv7h')
license=('GPL2')
groups=('pro-audio')
url="http://www.hydrogen-music.org/"
depends=('desktop-file-utils' 'hicolor-icon-theme' 'libarchive' 'liblrdf'
'liblo' 'portaudio' 'portmidi' 'libpulse' 'qt5-xmlpatterns')
makedepends=('cmake' 'cppunit' 'ladspa' 'python2' 'qt5-tools')
optdepends=('rubberband: Time stretch samples')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/${pkgname}-music/${pkgname}/archive/${pkgver/${_beta}/-${_beta}}.tar.gz")
sha512sums=('73963a9f400a4d9f6faca41f5f9af2c4b00ebefb16f394a78fe81f7aacb23acee49633803a484e91705da01cb59b4699133f618fac34f6caa7734bcc67bf4518')

prepare() {
  # Change to list with free licensed drumkits only
  sed -i -e 's|www[.]hydrogen-music[.]org/feeds/drumkit_list[.]php|repo.parabola.nu/other/hydrogen-libre/feeds/drumkit_list.php|'\
  $(grep -rlI 'www[.]hydrogen-music[.]org/feeds/drumkit_list[.]php')

  mv -v "${pkgname}-${pkgver/${_beta}/-${_beta}}" "${pkgname}-${pkgver}"
  cd "${pkgname}-${pkgver}"
  # fix python2 shebang (only required for building)
  sed -e 's/python/python2/' -i data/i18n/stats.py
  # fix desktop file icon name
  # https://github.com/hydrogen-music/hydrogen/issues/558
  sed -e "s/h2-icon/${pkgname}/" -i "linux/${pkgname}.desktop"
  # fix man page location (seemingly fixed on HEAD)
  sed -e 's|/man/|/share/man/|' -i CMakeLists.txt
  # out-of-tree build
  mkdir -v build
}

build() {
  cd "${pkgname}-${pkgver}/build"
  cmake -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DWANT_DEBUG=OFF \
        -DWANT_CPPUNIT=ON \
        -DWANT_LRDF=ON \
        -DWANT_PORTAUDIO=ON \
        -DWANT_PORTMIDI=ON \
        -DWANT_PULSEAUDIO=ON \
        ..
  make
  # update translations
  (
    cd ../data/i18n
    ./updateTranslations.sh
  )
}

package() {
  cd "${pkgname}-${pkgver}/build"
  make DESTDIR="$pkgdir" install

  # install desktop file icon to correct location
  # https://github.com/hydrogen-music/hydrogen/issues/558
  install -vDm 644 "${pkgdir}/usr/share/${pkgname}/data/img/gray/h2-icon.svg" \
    "${pkgdir}/usr/share/icons/hicolor/scalable/apps/${pkgname}.svg"
  rm -rv "${pkgdir}/usr/share/pixmaps"
  rm -rv "${pkgdir}/usr/share/${pkgname}/data/doc"

  # docs
  install -vDm 644 ../{ChangeLog,DEVELOPERS,INSTALL.txt,README.txt} \
    -t "${pkgdir}/usr/share/doc/${pkgname}"

#  # clean up data dir
#  # https://github.com/hydrogen-music/hydrogen/issues/559
  rm -v "$pkgdir/usr/share/${pkgname}/data/i18n/"*.{ts,py,sh}
}

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