Files
haikuports/dev-libs/msgpack_c_cpp/msgpack_c_cpp-3.2.0.recipe
2026-01-08 12:29:07 +01:00

109 lines
2.7 KiB
Bash

SUMMARY="A serialization library"
DESCRIPTION="An efficient binary serialization format, which lets you exchange \
data among multiple languages like JSON, except that it's faster and smaller. \
Small integers are encoded into a single byte while typical short strings \
require only one extra byte in addition to the strings themselves."
HOMEPAGE="https://msgpack.org/"
COPYRIGHT="2008-2015 Furuhashi Sadayuki"
LICENSE="Boost v1.0"
REVISION="4"
SOURCE_URI="https://github.com/msgpack/msgpack-c/archive/cpp-$portVersion.tar.gz"
CHECKSUM_SHA256="ff865a36bad5c72b8e7ebc4b7cf5f27a820fce4faff9c571c1791e3728355a39"
SOURCE_DIR="msgpack-c-cpp-$portVersion"
PATCHES="msgpack_c_cpp-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
libVersion="2.0.0"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
boostMinimumVersion="1.88.0"
PROVIDES="
msgpack_c_cpp$secondaryArchSuffix = $portVersion
lib:libmsgpackc$secondaryArchSuffix = $libVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
PROVIDES_devel="
msgpack_c_cpp${secondaryArchSuffix}_devel = $portVersion
devel:libmsgpackc$secondaryArchSuffix = $libVersionCompat
"
REQUIRES_devel="
msgpack_c_cpp$secondaryArchSuffix == $portVersion base
devel:libz$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libboost_chrono$secondaryArchSuffix >= $boostMinimumVersion
devel:libboost_context$secondaryArchSuffix >= $boostMinimumVersion
devel:libboost_system$secondaryArchSuffix >= $boostMinimumVersion
devel:libboost_timer$secondaryArchSuffix >= $boostMinimumVersion
devel:libgtest$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:dot
cmd:doxygen
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:libtoolize$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
cmd:sed
"
defineDebugInfoPackage msgpack_c_cpp$secondaryArchSuffix \
"$libDir"/libmsgpackc.so.$libVersion
PATCH()
{
sed -i 's/-pthread/-lroot/g' example/cpp03/CMakeLists.txt
sed -i "s|-std=c++98|-std=gnu++14|g" CMakeLists.txt
}
BUILD()
{
cmake -Bbuild -S. \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX="$prefix" \
-DCMAKE_INSTALL_LIBDIR="$libDir" \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_SKIP_RPATH=YES \
-DMSGPACK_BUILD_EXAMPLES=OFF \
-DMSGPACK_CXX11=OFF \
-DMSGPACK_BUILD_TESTS=OFF \
-Wno-dev
make -C build $jobArgs
}
INSTALL()
{
make -C build install
mkdir -p "$includeDir"
mv "$prefix"/include/* "$includeDir"
rm -rf "$prefix"/include
rm -f "$libDir"/*.la
prepareInstalledDevelLib libmsgpackc
fixPkgconfig
packageEntries devel \
"$developDir" \
"$libDir"/cmake
}
TEST()
{
make check
}