Files
haikuports/media-libs/zxing-cpp/zxing_cpp-2.2.1.recipe
2024-01-04 09:11:43 +01:00

99 lines
2.3 KiB
Bash

SUMMARY="C++ Multi-format 1D/2D barcode image processing library"
DESCRIPTION="ZXing-C++ (zebra crossing) is an open-source, multi-format linear/matrix barcode \
image processing library implemented in C++.
It was originally ported from the Java ZXing Library but has been developed further and now \
includes many improvements in terms of runtime and detection performance. It can both read and \
write barcodes in a number of formats."
HOMEPAGE="https://github.com/zxing-cpp/zxing-cpp"
COPYRIGHT="2016-2022 ZXing authors"
LICENSE="Apache v2"
REVISION="3"
SOURCE_URI="https://github.com/zxing-cpp/zxing-cpp/archive/refs/tags/v$portVersion.tar.gz"
CHECKSUM_SHA256="02078ae15f19f9d423a441f205b1d1bee32349ddda7467e2c84e8f08876f8635"
SOURCE_DIR="zxing-cpp-$portVersion"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
commandBinDir=$binDir
commandSuffix=$secondaryArchSuffix
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi
libVersion="$portVersion"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
PROVIDES="
zxing_cpp$secondaryArchSuffix = $portVersion
lib:libZXing$secondaryArchSuffix = $libVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
"
PROVIDES_tools="
zxing_cpp${secondaryArchSuffix}_tools = $portVersion
cmd:ZXingReader = $portVersion
cmd:ZXingWriter = $portVersion
"
REQUIRES_tools="
zxing_cpp$secondaryArchSuffix == $portVersion
haiku$secondaryArchSuffix
"
PROVIDES_devel="
zxing_cpp${secondaryArchSuffix}_devel = $portVersion
devel:libZXing$secondaryArchSuffix = $libVersionCompat
"
REQUIRES_devel="
zxing_cpp$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:git
cmd:make
cmd:pkg_config$secondaryArchSuffix
"
BUILD()
{
cmake -Bbuild -S. -DCMAKE_BUILD_TYPE=Release \
$cmakeDirArgs \
-DCMAKE_INSTALL_BINDIR=$commandBinDir \
-DBUILD_EXAMPLES=ON \
-DBUILD_UNIT_TESTS=ON
make -Cbuild $jobArgs
}
INSTALL()
{
make -Cbuild install
prepareInstalledDevelLib \
libZXing
fixPkgconfig
sed -i 's,\/include,/'${relativeIncludeDir}',g' \
$libDir/cmake/ZXing/ZXingTargets.cmake
packageEntries tools \
$commandBinDir
packageEntries devel \
$developDir \
$libDir/cmake
}
TEST()
{
make -Cbuild test
}