107 lines
2.6 KiB
Bash
107 lines
2.6 KiB
Bash
SUMMARY="CommonMark parsing and rendering library and program in C"
|
|
DESCRIPTION="cmark is the C reference implementation of CommonMark, \
|
|
a rationalized version of Markdown syntax with a spec. \
|
|
(For the JavaScript reference implementation, see commonmark.js.) \
|
|
It provides a shared library (libcmark) with functions for parsing \
|
|
CommonMark documents to an abstract syntax tree (AST), manipulating the AST, \
|
|
and rendering the document to HTML, groff man, LaTeX, CommonMark, or an XML \
|
|
representation of the AST. It also provides a command-line program (cmark) \
|
|
for parsing and rendering CommonMark documents."
|
|
HOMEPAGE="https://github.com/commonmark/cmark"
|
|
COPYRIGHT="2014-2017 John MacFarlane"
|
|
LICENSE="BSD (2-clause)"
|
|
REVISION="1"
|
|
SOURCE_URI="https://github.com/commonmark/cmark/archive/$portVersion.tar.gz"
|
|
CHECKSUM_SHA256="2558ace3cbeff85610de3bda32858f722b359acdadf0c4691851865bb84924a6"
|
|
SOURCE_FILENAME="cmark-$portVersion.tar.gz"
|
|
|
|
ARCHITECTURES="all !x86_gcc2 ?x86"
|
|
SECONDARY_ARCHITECTURES="x86"
|
|
|
|
commandSuffix=$secondaryArchSuffix
|
|
commandBinDir=$binDir
|
|
relativeCommandBinDir=$relativeBinDir
|
|
if [ "$targetArchitecture" = x86_gcc2 ]; then
|
|
commandSuffix=
|
|
commandBinDir=$prefix/bin
|
|
relativeCommandBinDir=bin
|
|
fi
|
|
|
|
PROVIDES="
|
|
cmark$secondaryArchSuffix = $portVersion compat >= 0
|
|
lib:libcmark$secondaryArchSuffix = $portVersion compat >= 0
|
|
cmd:cmark$commandSuffix = $portVersion compat >= 0
|
|
"
|
|
REQUIRES="
|
|
haiku$secondaryArchSuffix
|
|
"
|
|
REPLACES="
|
|
libcmark$secondaryArchSuffix
|
|
"
|
|
|
|
PROVIDES_devel="
|
|
cmark${secondaryArchSuffix}_devel = $portVersion compat >= 0
|
|
devel:libcmark$secondaryArchSuffix = $portVersion compat >= 0
|
|
"
|
|
REQUIRES_devel="
|
|
cmark$secondaryArchSuffix == $portVersion base
|
|
"
|
|
|
|
BUILD_REQUIRES="
|
|
haiku${secondaryArchSuffix}_devel
|
|
"
|
|
BUILD_PREREQUIRES="
|
|
cmd:aclocal
|
|
cmd:autoconf
|
|
cmd:automake
|
|
cmd:gcc$secondaryArchSuffix
|
|
cmd:ld$secondaryArchSuffix
|
|
cmd:libtoolize$secondaryArchSuffix
|
|
cmd:make
|
|
cmd:cmake
|
|
cmd:python3
|
|
"
|
|
|
|
PATCH()
|
|
{
|
|
if [ "$relativeCommandBinDir" != bin ]; then
|
|
sed -i \
|
|
-e "s|\(RUNTIME DESTINATION\) bin|\1 $relativeCommandBinDir|;" \
|
|
src/CMakeLists.txt
|
|
fi
|
|
sed -i \
|
|
-e "s|\(DESTINATION\) include|\1 $relativeIncludeDir|;" \
|
|
src/CMakeLists.txt
|
|
}
|
|
|
|
BUILD()
|
|
{
|
|
mkdir -p build
|
|
cd build
|
|
cmake .. $cmakeDirArgs \
|
|
${secondaryArchSubDir:+-DLIB_SUFFIX=$secondaryArchSubDir} \
|
|
|
|
make $jobArgs
|
|
}
|
|
|
|
INSTALL()
|
|
{
|
|
make install
|
|
|
|
prepareInstalledDevelLib libcmark
|
|
fixPkgconfig
|
|
|
|
# devel package
|
|
packageEntries devel \
|
|
"$developDir" \
|
|
"$libDir"/cmake \
|
|
"$manDir"/man3 \
|
|
|
|
}
|
|
|
|
TEST()
|
|
{
|
|
LIBRARY_PATH="$sourceDir/build/src${LIBRARY_PATH:+:$LIBRARY_PATH}" \
|
|
make test
|
|
}
|