summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e7690160e3269ed7ae48c7aee33ec83eb56033b2 (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
# Maintainer: Lubosz Sarnecki <lubosz at gmail com>

_realname='sphvr'
pkgname="$_realname-git"
pkgver=0.0.1.103.830dc5a
pkgrel=1
pkgdesc='A spherical media player using Vulkan and GStreamer.'
arch=('i686' 'x86_64')
url='https://gitlab.com/lubosz/sphvr'
depends=('gulkan-git' 'gst-plugins-bad-libs')
provides=("$_realname="$pkgver)
conflicts=("$_realname")
makedepends=('meson' 'git' 'glslang' 'vulkan-headers' 'glm')
license=('MIT')

source=('git+https://gitlab.com/lubosz/sphvr.git')
md5sums=('SKIP')

ver() {
  PREFIX="        version: '"
  echo $(grep "$PREFIX" meson.build | sed -e "s/${PREFIX}//" | sed "s/',//")
}

pkgver() {
  cd $_realname
  hash=$(git log --pretty=format:'%h' -n 1)
  revision=$(git rev-list --count HEAD)
  echo $(ver).$revision.$hash
}

build() {
  rm -rf build
  arch-meson $_realname build --libdir=lib --buildtype release
  ninja -C build
}

package() {
  DESTDIR="$pkgdir" ninja -C build install

  install -Dm644 "${srcdir}"/sphvr/LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}