blob: 101c7e6302da9662a58534471db2f4ad217389ad (
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
|
# Maintainer: Alexandre Bouvier <contact@amb.tf>
_pkgname=libchdr
pkgname=$_pkgname-git
pkgver=0.3.0.r0.g93d8c23
pkgrel=1
pkgdesc="Standalone library for reading MAME's CHDv1-v5 formats"
arch=('aarch64' 'armv7h' 'i486' 'i686' 'pentium4' 'x86_64')
url="https://github.com/rtissera/libchdr"
license=('BSD-3-Clause')
depends=('glibc')
makedepends=('cmake' 'git' 'zlib' 'zstd')
provides=("$_pkgname=$pkgver" 'libchdr.so')
conflicts=("$_pkgname")
source=("$_pkgname::git+$url.git")
b2sums=('SKIP')
pkgver() {
cd $_pkgname
git describe --long --abbrev=7 | sed 's/^v//;s/[^-]*-g/r&/;s/-/./g'
}
prepare() {
cd $_pkgname
# only build shared library
sed -i '/(chdr-static/d;/tests/d' CMakeLists.txt
}
build() {
local options=(
-B build
-D CMAKE_BUILD_TYPE=Release
-D CMAKE_C_FLAGS_RELEASE="-DNDEBUG"
-D CMAKE_INSTALL_PREFIX=/usr
-D WITH_SYSTEM_ZLIB=ON
-D WITH_SYSTEM_ZSTD=ON
-W no-dev
)
cmake "${options[@]}" $_pkgname
cmake --build build
}
package() {
depends+=('libz.so' 'libzstd.so')
# shellcheck disable=SC2154
DESTDIR="$pkgdir" cmake --install build
install -Dm644 -t "$pkgdir"/usr/share/licenses/$pkgname $_pkgname/LICENSE.txt
}
|