summaryrefslogtreecommitdiff
path: root/repo/rapidjson/rapidjson.xibuild
blob: 481891a631192a86a46fc070f1678a474905c042 (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
#!/bin/sh

NAME="rapidjson"
DESC="Fast JSON parser/generator for C++ with both SAX/DOM style API"

MAKEDEPS=" cmake"

PKG_VER=1.1.0
SOURCE="https://github.com/miloyip/rapidjson/archive/v$PKG_VER.tar.gz"

ADDITIONAL="
disable-march-cxx-flag.patch
do-not-include-gtest-src-dir.patch
"

prepare () {
    apply_patches
    find -name "CMakeLists.txt" | xargs sed -i "s/-Werror//g" 
}

build() {

	cmake -B build . \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_VERBOSE_MAKEFILE=ON \
		-DRAPIDJSON_BUILD_DOC=OFF \
		-DRAPIDJSON_BUILD_EXAMPLES=OFF \
		-DGTESTSRC_FOUND=ON \
		-DGTEST_SOURCE_DIR=.
	make -C build
}

package() {
	make -C build install DESTDIR="$PKG_DEST"

	# Remove examples and readme.
	rm -r "$PKG_DEST"/usr/share
}