summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 563af5bb2b139bb392b95721ea6704ce518894fc (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
# Maintainer: Paul Hentschel (hpmachining)

pkgname=cbang
pkgver=1.8.0
pkgrel=4
pkgdesc="a library of cross-platform C++ utilities"
arch=('x86_64')
url="https://github.com/CauldronDevelopmentLLC/cbang"
license=('LGPL2.1')
depends=(
  'v8-r'
  'libevent'
  'sqlite'
  're2'
  'libyaml'
  'zlib'
  'bzip2'
  'expat'
)
makedepends=(
  'scons'
)
checkdepends=(
  'python'
  'python-six'
)
optdepends=(
  'mariadb-libs: MariaDB database support'
)
source=(
  "$pkgname-$pkgver.tar.gz::https://github.com/CauldronDevelopmentLLC/cbang/archive/refs/tags/$pkgver.tar.gz"
  "0001_v8_sandbox_enable.patch"
  "0002_include_cstdint.patch"
  "0003_ScriptOrigin.patch"
)
sha256sums=('4be28b0aa0d024e5c9fd274264bed7f82551219414c12c45e35afd8946f6e7d7'
            '75eff0bcd04293990f8dfb0771562356ccac2a7f40a06df0c0ba515fcdf4126a'
            'a2e16d999e58856fe9885243235d711afc0b2260c0c0b346b59aa4b948209d5c'
            '8b1beb7ef9e4aba856d5fc14f0de0bf7eeb321dcfc7ce1a8c64a3ae3b4363c9b')

prepare() {
	cd "$pkgname-$pkgver"
	patch -p1 -i "../0001_v8_sandbox_enable.patch"
	patch -p1 -i "../0002_include_cstdint.patch"
	patch -p1 -i "../0003_ScriptOrigin.patch"
}

build() {
  cd "$pkgname-$pkgver"
  scons cxxstd="c++17" disable_local="libevent sqlite3 re2 libyaml zlib bzip2 expat"
}

check() {
  cd "$pkgname-$pkgver/tests"
  scons cxxstd="c++17" disable_local="libevent sqlite3 re2 libyaml zlib bzip2 expat"
  python ./testHarness
}

package() {
  cd "$pkgname-$pkgver"
  scons install prefix="$pkgdir/opt/$pkgname" \
	cxxstd="c++17" disable_local="libevent sqlite3 re2 libyaml zlib bzip2 expat"
  install -m644 lib/libcbang.a -t "$pkgdir/opt/$pkgname/lib"
  install -m644 lib/libcbang-boost.a -t "$pkgdir/opt/$pkgname/lib"
  cp -a config/ "$pkgdir/opt/$pkgname/config/"
  cp -a src/boost/boost/ "$pkgdir/opt/$pkgname/include/"
  cp -a include/cbang/ "$pkgdir/opt/$pkgname/include/"
}