Files
haikuports/dev-libs/libpcre2/libpcre2-10.43.recipe
2024-03-01 21:42:09 +10:00

134 lines
3.7 KiB
Bash

SUMMARY="Perl5 Compatible Regular Expressions"
DESCRIPTION="The PCRE2 library is a set of functions that implement regular \
expression pattern matching using the same syntax and semantics as Perl 5. \
PCRE2 has its own native API, as well as a set of wrapper functions that \
correspond to the POSIX regular expression API. The PCRE2 library is free, \
even for building proprietary software.
PCRE2 is a re-working of the original PCRE library to provide an entirely new \
API."
HOMEPAGE="https://www.pcre.org/"
COPYRIGHT="1997-2024 University of Cambridge"
LICENSE="PCRE"
REVISION="2"
SOURCE_URI="https://github.com/PhilipHazel/pcre2/releases/download/pcre2-$portVersion/pcre2-$portVersion.tar.bz2"
CHECKSUM_SHA256="e2a53984ff0b07dfdb5ae4486bbb9b21cca8e7df2434096cc9bf1b728c350bcb"
SOURCE_DIR="pcre2-$portVersion"
PATCHES="libpcre2-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
libpcre2Version="0.12.0"
libpcre2posixVersion="3.0.5"
libpcre2VersionCompat="$libpcre2Version compat >= ${libpcre2Version%%.*}"
libpcre2posixVersionCompat="$libpcre2posixVersion compat >= ${libpcre2posixVersion%%.*}"
portVersionCompat="$portVersion compat >= 10"
PROVIDES="
libpcre2$secondaryArchSuffix = $portVersionCompat
cmd:pcre2grep$secondaryArchSuffix
cmd:pcre2test$secondaryArchSuffix
lib:libpcre2_16$secondaryArchSuffix = $libpcre2VersionCompat
lib:libpcre2_32$secondaryArchSuffix = $libpcre2VersionCompat
lib:libpcre2_8$secondaryArchSuffix = $libpcre2VersionCompat
lib:libpcre2_posix$secondaryArchSuffix = $libpcre2posixVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libbz2$secondaryArchSuffix
lib:libedit$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
PROVIDES_devel="
libpcre2${secondaryArchSuffix}_devel = $portVersionCompat
cmd:pcre2_config$secondaryArchSuffix = $portVersionCompat
devel:libpcre2_16$secondaryArchSuffix = $libpcre2VersionCompat
devel:libpcre2_32$secondaryArchSuffix = $libpcre2VersionCompat
devel:libpcre2_8$secondaryArchSuffix = $libpcre2VersionCompat
devel:libpcre2_posix$secondaryArchSuffix = $libpcre2posixVersionCompat
"
REQUIRES_devel="
libpcre2$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libbz2$secondaryArchSuffix
devel:libedit$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:aclocal
cmd:autoconf
cmd:automake
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:libtoolize$secondaryArchSuffix
cmd:make
"
BUILD()
{
libtoolize --force --copy --install
aclocal
autoconf
automake --add-missing
jitOption=--enable-jit
if [ "$effectiveTargetArchitecture" = x86_gcc2 ] || [ "$effectiveTargetArchitecture" = riscv64 ]; then
jitOption=--disable-jit
fi
runConfigure ./configure \
--with-pic \
--enable-pcre2-16 \
--enable-pcre2-32 \
$jitOption \
--enable-pcre2grep-libz \
--enable-pcre2grep-libbz2 \
--enable-pcre2test-libedit \
--disable-static
#--enable-pcre2test-libreadline \
#--enable-debug
make $jobArgs
}
INSTALL()
{
make install
# remove libtool files
rm -f "$libDir"/libpcre2-*.la
# prepare develop/lib
prepareInstalledDevelLibs \
libpcre2-8 \
libpcre2-16 \
libpcre2-32 \
libpcre2-posix
fixPkgconfig
# fix pcre-config
fixDevelopLibDirReferences $binDir/pcre2-config
if [ -z "$secondaryArchSuffix" ]; then
maybe_manDir_man1_pcre2_config="$manDir"/man1/pcre2-config.1
maybe_manDir_man3="$manDir"/man3
else
maybe_manDir_man1_pcre2_config=
maybe_manDir_man3=
rm -rf "$documentationDir"
fi
# devel package
packageEntries devel \
"$binDir"/pcre2-config \
"$developDir" \
${maybe_manDir_man1_pcre2_config:+"$maybe_manDir_man1_pcre2_config"} \
${maybe_manDir_man3:+"$maybe_manDir_man3"}
}
TEST()
{
make check
}