summaryrefslogtreecommitdiff
path: root/main/inih/APKBUILD
blob: 3a270f6fa0b3603ed727beccbfc18d1f5de84f02 (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
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer:
pkgname=inih
pkgver=56
pkgrel=1
pkgdesc="Simple .INI file parser for embedded systems"
options="!check" # No testsuite in Meson, unittests always return 0
url="https://github.com/benhoyt/inih"
arch="all"
license="BSD-3-Clause"
makedepends="meson"
checkdepends="bash"
subpackages="
	$pkgname-dev:_dev
	$pkgname-inireader
	$pkgname-inireader-dev
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/benhoyt/inih/archive/r$pkgver.tar.gz"
builddir="$srcdir/inih-r$pkgver"

prepare() {
	default_prepare

	sed -i "s|@PKGVER@|$pkgver|" meson.build
}

build() {
	abuild-meson \
		-Ddefault_library=both \
		-Ddistro_install=true \
		-Dwith_INIReader=true \
		-Dmulti-line_entries=true \
		-Dutf-8_bom=true \
		-Dinline_comments=true \
		-Duse_heap=false \
		. output
	meson compile -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

inireader() {
	pkgdesc="C++ library and API for inih"
	amove usr/lib/libINIReader.so.*
}

_dev() {
	default_dev

	# Move inireader stuff out, it will be caught later
	mkdir -p "$pkgdir"/usr/lib/pkgconfig "$pkgdir"/usr/include

	# Headers
	mv "$subpkgdir"/usr/include/INIReader.h "$pkgdir"/usr/include

	# Static and Shared libraries
	mv "$subpkgdir"/usr/lib/libINIReader.so "$pkgdir"/usr/lib
	mv "$subpkgdir"/usr/lib/libINIReader.a "$pkgdir"/usr/lib

	# Pkgconfig
	mv "$subpkgdir"/usr/lib/pkgconfig/INIReader.pc "$pkgdir"/usr/lib/pkgconfig
}

sha512sums="
ff3e0910990f73e5b21fddc84737ab346279f201c86c7ad864c6cad9de5bde57c3e0a433b9b8f3585b7d86feaae2ea074185f92891dcadc98c274c1c0745d2d2  inih-56.tar.gz
"