summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ed953bee44cf7b150f325131ac8681e3cf6f6076 (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=r4.1490253
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=('gcc-libs')
makedepends=('clang')
provides=("$_pkgname")
conflicts=("$_pkgname")
source=("${_pkgname}::git+https://github.com/blend2d/blend2d"
        "asmjit::git+https://github.com/asmjit/asmjit#branch=next-wip")
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_BUILD_EMBED=FALSE \
    -DBLEND2D_BUILD_STATIC=FALSE \
    -DBLEND2D_BUILD_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
}