summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 717386d0d1bd2f1200dfb9691e5ec37c27c0fb92 (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: Cebtenzzre <cebtenzzre (at) gmail (dot) com>

_pkgname=blend2d
pkgname=${_pkgname}-git
pkgver=r87.592d1ba
pkgrel=1
pkgdesc='A high-performance 2D vector graphics engine written in C++'
url='https://blend2d.com'
arch=('i686' 'x86_64')
license=('custom:zlib')
depends=('glibc')
makedepends=('clang' 'cmake' 'git')
provides=("$_pkgname")
conflicts=("$_pkgname")
source=("${_pkgname}::git+https://github.com/blend2d/blend2d"
        "asmjit::git+https://github.com/asmjit/asmjit")
sha1sums=('SKIP' 'SKIP')

pkgver() {
  cd "$_pkgname"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
  cd "$_pkgname"

  [[ -d build ]] && rm -rf build
  mkdir build && cd build

  # "It's strongly advised to use Clang to compile Blend2D on all platforms to achieve maximum performance."
  export CC='clang'
  export CXX='clang++'

  # Build a shared library with tests
  cmake .. \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=Release \
    -DASMJIT_DIR="$srcdir"/asmjit \
    -DBLEND2D_EMBED=FALSE \
    -DBLEND2D_STATIC=FALSE \
    -DBLEND2D_TEST=TRUE

  make
}

check() {
  cd "$_pkgname"/build
  ./bl_test_unit
}

package() {
  cd "$_pkgname"/build
  make DESTDIR="$pkgdir" install

  # Do not include the unit test program
  rm -rf "$pkgdir"/usr/bin

  install -Dm644 -t "$pkgdir"/usr/share/licenses/"$pkgname" ../LICENSE.md
}