yaml_cpp-0.6.3.recipe revision 1b29910a
1SUMMARY="A YAML parser and emitter in C++"
2DESCRIPTION="yaml-cpp is a YAML parser and emitter in C++ matching the YAML \
31.2 spec."
4HOMEPAGE="https://github.com/jbeder/yaml-cpp"
5COPYRIGHT="2018 Jesse Beder"
6LICENSE="MIT"
7REVISION="1"
8SOURCE_URI="https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-$portVersion.tar.gz"
9CHECKSUM_SHA256="77ea1b90b3718aa0c324207cb29418f5bced2354c2e483a9523d98c3460af1ed"
10SOURCE_DIR="yaml-cpp-yaml-cpp-$portVersion"
11
12ARCHITECTURES="!x86_gcc2 x86 x86_64"
13SECONDARY_ARCHITECTURES="x86"
14
15libVersion="0.6.0"
16libVersionCompat="$libVersion compat >= ${libVersion%.*}"
17
18PROVIDES="
19	yaml_cpp$secondaryArchSuffix = $portVersion
20	lib:libyaml_cpp$secondaryArchSuffix = $libVersionCompat
21	"
22REQUIRES="
23	haiku$secondaryArchSuffix
24	"
25
26PROVIDES_devel="
27	yaml_cpp${secondaryArchSuffix}_devel = $portVersion
28	devel:libyaml_cpp$secondaryArchSuffix = $libVersionCompat
29	"
30REQUIRES_devel="
31	yaml_cpp$secondaryArchSuffix == $portVersion base
32	"
33
34BUILD_REQUIRES="
35	haiku${secondaryArchSuffix}_devel
36	devel:libgtest$secondaryArchSuffix
37	"
38BUILD_PREREQUIRES="
39	cmd:cmake
40	cmd:gcc$secondaryArchSuffix
41	cmd:ld$secondaryArchSuffix
42	cmd:make
43	cmd:pkg_config$secondaryArchSuffix
44	"
45
46BUILD()
47{
48	mkdir -p build && cd "$_"
49	cmake .. \
50		-DBUILD_SHARED_LIBS=ON \
51		-DYAML_CPP_BUILD_TOOLS=OFF \
52		-DYAML_CPP_BUILD_TESTS=OFF \
53		-DCMAKE_INSTALL_PREFIX:PATH=$prefix
54	make $jobArgs
55}
56
57INSTALL()
58{
59	cd build
60	make install
61
62	mkdir -p `dirname $includeDir` $libDir
63	mv $prefix/include $includeDir
64
65	if [ -n "$secondaryArchSuffix" ]; then
66		mv $prefix/lib/libyaml-cpp* $prefix/lib/pkgconfig $libDir/
67	fi
68
69	prepareInstalledDevelLib libyaml-cpp
70	fixPkgconfig
71
72	packageEntries devel \
73		$developDir
74}
75
76TEST()
77{
78	# tests make the build considerably longer
79	# TODO: fail with: The current thread is not holding the mutex @0xf96b94
80	# probably because gtest is not ported (also it uses bundled one)
81
82	cd build
83
84	cmake .. \
85		-DBUILD_SHARED_LIBS=ON \
86		-DYAML_CPP_BUILD_TOOLS=ON \
87		-DYAML_CPP_BUILD_TESTS=ON \
88		-DCMAKE_INSTALL_PREFIX:PATH=$prefix
89
90	make $jobArgs
91	cd test
92	./run-tests
93}
94