cmake: fix build on 2nd arch, fix PROVIDES*, simplify INSTALL.

* Add REPLACES to get rid of the previous revision which had
  "libcmark" (instead of "cmark") in its PROVIDES.
* Move man3/cmark.3 and $libDir/cmake/ to the devel package.
* * Define commandBinDir and friends.
* Add PATCH() to have correct directories in src/CMakeLists.txt.
* Enable on x86 secondary arch.
* Update HOMEPAGE & COPYRIGHT.
This commit is contained in:
fbrosson
2018-06-12 06:07:25 +00:00
parent 47e252d54a
commit 1495c0fe5e

View File

@@ -7,31 +7,44 @@ 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/jgm/cmark"
COPYRIGHT="2014 John MacFarlane"
HOMEPAGE="https://github.com/commonmark/cmark"
COPYRIGHT="2014-2017 John MacFarlane"
LICENSE="BSD (2-clause)"
REVISION="1"
SOURCE_URI="https://github.com/jgm/cmark/archive/$portVersion.tar.gz"
REVISION="2"
SOURCE_URI="https://github.com/commonmark/cmark/archive/$portVersion.tar.gz"
CHECKSUM_SHA256="acc98685d3c1b515ff787ac7c994188dadaf28a2d700c10c1221da4199bae1fc"
SOURCE_FILENAME="cmark-$portVersion.tar.gz"
ARCHITECTURES="!x86_gcc2 ?x86 x86_64"
SECONDARY_ARCHITECTURES="?x86"
SECONDARY_ARCHITECTURES="x86"
commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
relativeCommandBinDir=$relativeBinDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
relativeCommandBinDir=bin
fi
PROVIDES="
libcmark$secondaryArchSuffix = $portVersion compat >= 0
cmark$secondaryArchSuffix = $portVersion compat >= 0
lib:libcmark$secondaryArchSuffix = $portVersion compat >= 0
cmd:cmark$secondaryArchSuffix = $portVersion compat >= 0
cmd:cmark$commandSuffix = $portVersion compat >= 0
"
REQUIRES="
haiku$secondaryArchSuffix
"
REPLACES="
libcmark$secondaryArchSuffix
"
PROVIDES_devel="
libcmark${secondaryArchSuffix}_devel = $portVersion compat >= 0
cmark${secondaryArchSuffix}_devel = $portVersion compat >= 0
devel:libcmark$secondaryArchSuffix = $portVersion compat >= 0
"
REQUIRES_devel="
libcmark$secondaryArchSuffix == $portVersion base
cmark$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
@@ -49,11 +62,25 @@ BUILD_PREREQUIRES="
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 build
mkdir -p build
cd build
cmake .. $cmakeDirArgs
cmake .. $cmakeDirArgs \
${secondaryArchSubDir:+-DLIB_SUFFIX=$secondaryArchSubDir} \
make $jobArgs
}
@@ -61,19 +88,19 @@ INSTALL()
{
make install
mkdir -p $(dirname $includeDir)
mv $prefix/include $includeDir
prepareInstalledDevelLib libcmark
fixPkgconfig
# devel package
packageEntries devel \
$developDir \
$libDir/cmake
"$developDir" \
"$libDir"/cmake \
"$manDir"/man3 \
}
TEST()
{
LIBRARY_PATH="$sourceDir/build/src${LIBRARY_PATH:+:$LIBRARY_PATH}" \
make test
}