mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 05:10:05 +02:00
The recipe is still disabled, but this change makes it more similar to what the current 2.12.10 already does.
204 lines
5.5 KiB
Bash
204 lines
5.5 KiB
Bash
SUMMARY="The XML C parser and toolkit of Gnome"
|
|
DESCRIPTION="Libxml2 is the XML C parser and toolkit developed for the Gnome \
|
|
project, but is usable outside of the Gnome platform as well.
|
|
XML itself is a metalanguage to design markup languages, i.e. text language \
|
|
where semantic and structure are added to the content using extra \"markup\" \
|
|
information enclosed between angle brackets. HTML is the most well-known \
|
|
markup language.
|
|
Though the library is written in C a variety of language bindings make it \
|
|
available in other environments."
|
|
HOMEPAGE="http://www.xmlsoft.org/"
|
|
COPYRIGHT="1998-2012 Daniel Veillard. All Rights Reserved."
|
|
LICENSE="MIT"
|
|
REVISION="1"
|
|
SOURCE_URI="https://download.gnome.org/sources/libxml2/${portVersion%.*}/libxml2-$portVersion.tar.xz"
|
|
CHECKSUM_SHA256="03d006f3537616833c16c53addcdc32a0eb20e55443cba4038307e3fa7d8d44b"
|
|
SOURCE_DIR="libxml2-$portVersion"
|
|
SOURCE_URI_2="https://www.w3.org/XML/Test/xmlts20130923.tar.gz"
|
|
CHECKSUM_SHA256_2="9b61db9f5dbffa545f4b8d78422167083a8568c59bd1129f94138f936cf6fc1f"
|
|
PATCHES="libxml2_2.14-$portVersion.patchset"
|
|
|
|
# disabled: not ABI compatible with 2.12 and can't be mixed with it
|
|
# wait for beta6 to activate, then rebuild all packages
|
|
ARCHITECTURES="!all"
|
|
SECONDARY_ARCHITECTURES="!x86"
|
|
|
|
libVersion="16.0.5"
|
|
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
|
|
|
|
pythonModuleEnabled=false
|
|
if [ "$targetArchitecture" = x86_gcc2 ]; then
|
|
if [ -n "$secondaryArchSuffix" ]; then
|
|
pythonModuleEnabled=true
|
|
fi
|
|
else
|
|
if [ -z "$secondaryArchSuffix" ]; then
|
|
pythonModuleEnabled=true
|
|
fi
|
|
fi
|
|
|
|
pythonVersion=3.10
|
|
pythonPackage=python${pythonVersion//.}
|
|
|
|
PROVIDES="
|
|
libxml2$secondaryArchSuffix = $portVersion compat >= 2
|
|
lib:libxml2$secondaryArchSuffix = $libVersionCompat
|
|
"
|
|
if [ -z "$secondaryArchSuffix" ]; then
|
|
PROVIDES="$PROVIDES
|
|
cmd:xmlcatalog = $portVersion compat >= 2
|
|
cmd:xmllint = $portVersion compat >= 2
|
|
"
|
|
fi
|
|
REQUIRES="
|
|
haiku$secondaryArchSuffix
|
|
lib:libz$secondaryArchSuffix
|
|
lib:libiconv$secondaryArchSuffix
|
|
"
|
|
|
|
PROVIDES_devel="
|
|
libxml2${secondaryArchSuffix}_devel = $portVersion
|
|
cmd:xml2_config$secondaryArchSuffix = $portVersion compat >= 2
|
|
devel:libxml2$secondaryArchSuffix = $libVersionCompat
|
|
"
|
|
REQUIRES_devel="
|
|
libxml2$secondaryArchSuffix == $portVersion base
|
|
devel:libiconv$secondaryArchSuffix
|
|
devel:libz$secondaryArchSuffix
|
|
"
|
|
|
|
if $pythonModuleEnabled; then
|
|
# Allows using dot in sub-package names (eg: "_python3.10" vs "_python310"):
|
|
eval "PACKAGE_NAME_$pythonPackage=\"${portName}_python$pythonVersion\""
|
|
|
|
eval "SUMMARY_$pythonPackage=\"The python module for libxml2\""
|
|
|
|
eval "PROVIDES_$pythonPackage=\"
|
|
${portName}_python$pythonVersion = $portVersion
|
|
\""
|
|
|
|
if [ -n "$secondaryArchSuffix" ]; then
|
|
eval "PROVIDES_${pythonPackage}+=\"
|
|
${portBaseName}_python$pythonVersion= $portVersion
|
|
\""
|
|
fi
|
|
|
|
eval "REQUIRES_$pythonPackage=\"
|
|
libxml2$secondaryArchSuffix == $portVersion base
|
|
haiku$secondaryArchSuffix
|
|
lib:libz$secondaryArchSuffix
|
|
cmd:python$pythonVersion
|
|
\""
|
|
|
|
eval "REPLACES_$pythonPackage=\"${portName}_python\""
|
|
fi
|
|
|
|
BUILD_REQUIRES="
|
|
haiku${secondaryArchSuffix}_devel
|
|
devel:libiconv$secondaryArchSuffix
|
|
devel:libz$secondaryArchSuffix
|
|
"
|
|
if $pythonModuleEnabled; then
|
|
BUILD_REQUIRES="$BUILD_REQUIRES
|
|
cmd:python$pythonVersion
|
|
"
|
|
fi
|
|
BUILD_PREREQUIRES="
|
|
lib:libicudata$secondaryArchSuffix
|
|
cmd:aclocal
|
|
cmd:autoconf
|
|
cmd:automake
|
|
cmd:gcc$secondaryArchSuffix
|
|
cmd:ld$secondaryArchSuffix
|
|
cmd:libtoolize$secondaryArchSuffix
|
|
cmd:make
|
|
cmd:sed
|
|
cmd:pkg_config$secondaryArchSuffix
|
|
"
|
|
|
|
PATCH()
|
|
{
|
|
# replace hard-coded references to the development documentation dir
|
|
sed -i "s,^devhelpdir = \(.*\),devhelpdir = ${developDocDir}," \
|
|
doc/devhelp/Makefile.am
|
|
}
|
|
|
|
BUILD()
|
|
{
|
|
withPython=
|
|
if $pythonModuleEnabled; then
|
|
# We symlink python's directories into our packaging directory and tell
|
|
# configure that it can find python there. This way the correct
|
|
# installation directory for the python module is determined.
|
|
pythonDir="$portPackageLinksDir/cmd~python$pythonVersion"
|
|
ln -s $pythonDir/bin $pythonDir/develop $pythonDir/lib $prefix
|
|
withPython="--with-python=$prefix"
|
|
else
|
|
withPython="--without-python"
|
|
fi
|
|
|
|
runConfigure ./configure LDFLAGS="-lnetwork" \
|
|
--disable-static \
|
|
--with-legacy \
|
|
$withPython
|
|
make $jobArgs
|
|
}
|
|
|
|
INSTALL()
|
|
{
|
|
if $pythonModuleEnabled; then
|
|
# Unfortunately we can't just remove the in symlinks we created in
|
|
# BUILD() and install normally, since then make detects that the
|
|
# Python.h is missing and tries to rebuild the module. So we leave
|
|
# things as is and use DESTDIR to install the everything in a subdir.
|
|
# Then we remove the symlinks and move everything where it belongs.
|
|
make DESTDIR=$prefix install
|
|
rm -f $prefix/bin $prefix/develop $prefix/lib
|
|
mv $prefix/$prefix/* $prefix
|
|
rm -r $prefix/packages
|
|
else
|
|
make install
|
|
fi
|
|
|
|
mkdir -p $dataDir/aclocal
|
|
cp aclocal.m4 $dataDir/aclocal
|
|
|
|
rm $libDir/libxml2.la
|
|
# prepare develop/lib
|
|
prepareInstalledDevelLibs libxml2
|
|
fixPkgconfig
|
|
fixDevelopLibDirReferences $binDir/xml2-config
|
|
|
|
# python package
|
|
if $pythonModuleEnabled; then
|
|
packageEntries $pythonPackage \
|
|
$prefix/lib/python*
|
|
fi
|
|
|
|
# devel package
|
|
packageEntries devel \
|
|
$binDir/xml2-config \
|
|
$dataDir \
|
|
$developDir \
|
|
$docDir \
|
|
$manDir/man1/xml2-config.1 \
|
|
$libDir/cmake
|
|
|
|
# Remove stuff we don't need in the secondary architecture base package.
|
|
if [ -n "$secondaryArchSuffix" ]; then
|
|
rm -rf $binDir
|
|
rm -rf $documentationDir
|
|
else
|
|
# left-over since all contents has been moved to other packages
|
|
rmdir $(dirname $docDir)
|
|
fi
|
|
}
|
|
|
|
TEST()
|
|
{
|
|
# link the conformance suite
|
|
ln -sf ../../sources-2/xmlconf
|
|
|
|
make check
|
|
}
|