cmark-0.29.0.recipe revision 66ecfeb4
1SUMMARY="CommonMark parsing and rendering library and program in C"
2DESCRIPTION="cmark is the C reference implementation of CommonMark, \
3a rationalized version of Markdown syntax with a spec. \
4(For the JavaScript reference implementation, see commonmark.js.) \
5It provides a shared library (libcmark) with functions for parsing \
6CommonMark documents to an abstract syntax tree (AST), manipulating the AST, \
7and rendering the document to HTML, groff man, LaTeX, CommonMark, or an XML \
8representation of the AST. It also provides a command-line program (cmark) \
9for parsing and rendering CommonMark documents."
10HOMEPAGE="https://github.com/commonmark/cmark"
11COPYRIGHT="2014-2017 John MacFarlane"
12LICENSE="BSD (2-clause)"
13REVISION="1"
14SOURCE_URI="https://github.com/commonmark/cmark/archive/$portVersion.tar.gz"
15CHECKSUM_SHA256="2558ace3cbeff85610de3bda32858f722b359acdadf0c4691851865bb84924a6"
16SOURCE_FILENAME="cmark-$portVersion.tar.gz"
17
18ARCHITECTURES="!x86_gcc2 ?x86 x86_64"
19SECONDARY_ARCHITECTURES="x86"
20
21commandSuffix=$secondaryArchSuffix
22commandBinDir=$binDir
23relativeCommandBinDir=$relativeBinDir
24if [ "$targetArchitecture" = x86_gcc2 ]; then
25	commandSuffix=
26	commandBinDir=$prefix/bin
27	relativeCommandBinDir=bin
28fi
29
30PROVIDES="
31	cmark$secondaryArchSuffix = $portVersion compat >= 0
32	lib:libcmark$secondaryArchSuffix = $portVersion compat >= 0
33	cmd:cmark$commandSuffix = $portVersion compat >= 0
34	"
35REQUIRES="
36	haiku$secondaryArchSuffix
37	"
38REPLACES="
39	libcmark$secondaryArchSuffix
40	"
41
42PROVIDES_devel="
43	cmark${secondaryArchSuffix}_devel = $portVersion compat >= 0
44	devel:libcmark$secondaryArchSuffix = $portVersion compat >= 0
45	"
46REQUIRES_devel="
47	cmark$secondaryArchSuffix == $portVersion base
48	"
49
50BUILD_REQUIRES="
51	haiku${secondaryArchSuffix}_devel
52	"
53BUILD_PREREQUIRES="
54	cmd:aclocal
55	cmd:autoconf
56	cmd:automake
57	cmd:gcc$secondaryArchSuffix
58	cmd:ld$secondaryArchSuffix
59	cmd:libtoolize$secondaryArchSuffix
60	cmd:make
61	cmd:cmake
62	cmd:python3
63	"
64
65PATCH()
66{
67	if [ "$relativeCommandBinDir" != bin ]; then
68		sed -i \
69			-e "s|\(RUNTIME DESTINATION\) bin|\1 $relativeCommandBinDir|;" \
70			src/CMakeLists.txt
71	fi
72	sed -i \
73		-e "s|\(DESTINATION\) include|\1 $relativeIncludeDir|;" \
74		src/CMakeLists.txt
75}
76
77BUILD()
78{
79	mkdir -p build
80	cd build
81	cmake .. $cmakeDirArgs \
82		${secondaryArchSubDir:+-DLIB_SUFFIX=$secondaryArchSubDir} \
83
84	make $jobArgs
85}
86
87INSTALL()
88{
89	make install
90
91	prepareInstalledDevelLib libcmark
92	fixPkgconfig
93
94	# devel package
95	packageEntries devel \
96		"$developDir" \
97		"$libDir"/cmake \
98		"$manDir"/man3 \
99
100}
101
102TEST()
103{
104	LIBRARY_PATH="$sourceDir/build/src${LIBRARY_PATH:+:$LIBRARY_PATH}" \
105	make test
106}
107