htmlcxx, new recipe (#9661)

This commit is contained in:
Schrijvers Luc
2023-10-22 07:20:46 +00:00
committed by GitHub
parent 2cad8aef5e
commit 57be915ca8
2 changed files with 139 additions and 0 deletions

View File

@@ -0,0 +1,113 @@
SUMMARY="A simple non-validating CSS 1 and HTML parser for C++"
DESCRIPTION="htmlcxx is the name of both the library and the utility application that comes with \
this package. Although the htmlcxx (the application) is mostly useless for programming, you can \
use it to easily see how htmlcxx (the library) would parse your html code.
Just install and try htmlcxx -h."
HOMEPAGE="https://sourceforge.net/projects/htmlcxx/"
COPYRIGHT="Davi de Castro Reis
Robson Braga Ara˙jo"
LICENSE="Apache v2
GNU LGPL v2"
REVISION="1"
SOURCE_URI="$HOMEPAGE/files/v0.87/htmlcxx-0.87.tar.gz"
CHECKSUM_SHA256="5d38f938cf4df9a298a5346af27195fffabfef9f460fc2a02233cbcfa8fc75c8"
PATCHES="htmlcxx-$portVersion-c++17.patch"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
# On x86_gcc2 we don't want to install the commands in bin/<arch>/, but in bin/.
commandBinDir=$binDir
commandSuffix=$secondaryArchSuffix
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi
libVersion="3.1.0"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
libCssVersion="0.0.0"
libCssVersionCompat="$libCssVersion compat >= ${libCssVersion%%.*}"
PROVIDES="
htmlcxx$secondaryArchSuffix = $portVersion
cmd:htmlcxx$commandSuffix
lib:libhtmlcxx$secondaryArchSuffix = $libVersionCompat
lib:libcss_parser$secondaryArchSuffix = $libCssVersionCompat
lib:libcss_parser_pp$secondaryArchSuffix = $libCssVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
"
PROVIDES_tools="
htmlcxx${secondaryArchSuffix}_tools = $portVersion
cmd:htmlcxx$commandSuffix
"
REQUIRES_tools="
htmlcxx$secondaryArchSuffix == $portVersion
haiku$secondaryArchSuffix
"
PROVIDES_devel="
htmlcxx${secondaryArchSuffix}_devel = $portVersion
devel:libhtmlcxx$secondaryArchSuffix = $libVersionCompat
devel:libcss_parser$secondaryArchSuffix = $libCssVersionCompat
devel:libcss_parser_pp$secondaryArchSuffix = $libCssVersionCompat
"
REQUIRES_devel="
htmlcxx$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libiconv$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:aclocal
cmd:autoreconf
cmd:flex
cmd:gcc$secondaryArchSuffix
cmd:libtoolize$secondaryArchSuffix
cmd:make
cmd:yacc
"
BUILD()
{
autoreconf -fi
runConfigure --omit-dirs binDir ./configure \
--bindir=$commandBinDir \
--disable-static
make $jobArgs
}
INSTALL()
{
make install
# remove libtool files
rm -rf $libDir/*.la
# move includedir
mkdir -p $includeDir
mv $prefix/include/* $includeDir
rm -rf $prefix/include
prepareInstalledDevelLibs \
libhtmlcxx \
libcss_parser \
libcss_parser_pp
fixPkgconfig
packageEntries devel \
$developDir
packageEntries tools \
$commandBinDir
}
TEST()
{
make check
}

View File

@@ -0,0 +1,26 @@
https://sourceforge.net/p/htmlcxx/patches/8/
diff --color -Naur a/html/CharsetConverter.cc b/html/CharsetConverter.cc
--- a/html/CharsetConverter.cc 2018-12-29 03:13:56.000000000 +0000
+++ b/html/CharsetConverter.cc 2021-05-31 23:03:10.705334580 +0100
@@ -7,7 +7,7 @@
using namespace std;
using namespace htmlcxx;
-CharsetConverter::CharsetConverter(const string &from, const string &to) throw (Exception)
+CharsetConverter::CharsetConverter(const string &from, const string &to)
{
mIconvDescriptor = iconv_open(to.c_str(), from.c_str());
if (mIconvDescriptor == (iconv_t)(-1))
diff --color -Naur a/html/CharsetConverter.h b/html/CharsetConverter.h
--- a/html/CharsetConverter.h 2018-12-29 03:13:56.000000000 +0000
+++ b/html/CharsetConverter.h 2021-05-31 23:03:19.042574598 +0100
@@ -17,7 +17,7 @@
: std::runtime_error(arg) {}
};
- CharsetConverter(const std::string &from, const std::string &to) throw (Exception);
+ CharsetConverter(const std::string &from, const std::string &to);
~CharsetConverter();
std::string convert(const std::string &input);