summaryrefslogtreecommitdiff
path: root/user/uchardet/APKBUILD
blob: 05f10ff7b0cabca097ac1d742248c0a2fedbcbe2 (plain) (blame)
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
# Contributor: Kiyoshi Aman <adelie@aerdan.vulpine.house>
# Maintainer: Kiyoshi Aman <adelie@aerdan.vulpine.house>
pkgname=uchardet
pkgver=0.0.6
pkgrel=0
pkgdesc="Universal character encoding detection library"
url="https://www.freedesktop.org/wiki/Software/uchardet/"
arch="all"
license="MPL-1.1 OR GPL-2.0+ OR LGPL-2.1+"
makedepends="cmake"
subpackages="$pkgname-dev $pkgname-doc"
source="https://www.freedesktop.org/software/uchardet/releases/uchardet-$pkgver.tar.xz"
sha512sums="eceeadae060bf277e298d709856609dde32921271140dc1fb0a33c7b6e1381033fc2960d616ebbd82c92815936864d2c0743b1b5ea1b7d4a200df87df80d6de5  uchardet-0.0.6.tar.xz"
builddir="$srcdir/uchardet-$pkgver"

build() {
	cd "$builddir"
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=RelWithDebugInfo \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		${CMAKE_CROSSOPTS}
	make
}

check() {
	cd "$builddir"
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}