libxo: new recipe (#6321)

* libxo: new recipe
This commit is contained in:
extrowerk
2021-12-01 18:43:29 +01:00
committed by GitHub
parent 1df8a79891
commit 1062c38cf1
2 changed files with 134 additions and 0 deletions

View File

@@ -0,0 +1,86 @@
SUMMARY="A Library for generating Text, XML, JSON, and HTML Output"
DESCRIPTION="The libxo library allows an application to generate text, XML, \
JSON, and HTML output using a common set of function calls. The application \
decides at run time which output style should be produced."
HOMEPAGE="https://github.com/Juniper/libxo"
COPYRIGHT="2014 Juniper Networks, Inc."
LICENSE="BSD (2-clause)"
REVISION="1"
SOURCE_URI="https://github.com/Juniper/libxo/releases/download/$portVersion/libxo-$portVersion.tar.gz"
CHECKSUM_SHA256="9f2f276d7a5f25ff6fbfc0f38773d854c9356e7f985501627d0c0ee336c19006"
PATCHES="libxo-$portVersion.patchset"
ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"
libVersion="0.0.0"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
PROVIDES="
libxo$secondaryArchSuffix = $portVersion
cmd:libxo_config = $libVersionCompat
cmd:xo = $libVersionCompat
cmd:xohtml = $libVersionCompat
cmd:xolint = $libVersionCompat
cmd:xopo = $libVersionCompat
lib:libxo$secondaryArchSuffix = $libVersionCompat
"
REQUIRES="
haiku${secondaryArchSuffix}
lib:libcrypto$secondaryArchSuffix
lib:libintl$secondaryArchSuffix
"
PROVIDES_devel="
libxo${secondaryArchSuffix}_devel = $portVersion
devel:libxo$secondaryArchSuffix = $libVersionCompat
"
REQUIRES_devel="
libxo$secondaryArchSuffix == $portVersion base
devel:libcrypto$secondaryArchSuffix
devel:libintl$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libcrypto$secondaryArchSuffix
devel:libintl$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:msgfmt
cmd:gawk
cmd:gcc$secondaryArchSuffix
cmd:libtoolize$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
cmd:sed
"
defineDebugInfoPackage libxo$secondaryArchSuffix \
$libDir/libxo.so.$libVersion
BUILD()
{
LDFLAGS="-lbsd -lnetwork" CFLAGS="-D_DEFAULT_SOURCE" runConfigure ./configure
make $jobArgs
}
INSTALL()
{
make install
rm -rf $libDir/libxo.la
prepareInstalledDevelLibs \
libxo
fixPkgconfig
packageEntries devel \
$developDir \
$manDir
}
TEST()
{
make check
}

View File

@@ -0,0 +1,48 @@
From 34add293e316a2b8a7104666fe764be6adcc1b8a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Sun, 24 Oct 2021 10:54:21 +0200
Subject: Haiku patches
diff --git a/libxo/libxo.c b/libxo/libxo.c
index 916a111..b794d21 100644
--- a/libxo/libxo.c
+++ b/libxo/libxo.c
@@ -336,6 +336,8 @@ struct xo_handle_s {
#define XF_ENC_UTF8 2 /* UTF-8 */
#define XF_ENC_LOCALE 3 /* Current locale */
+typedef int64_t quad_t;
+
/*
* A place to parse printf-style format flags for each field
*/
diff --git a/libxo/xo_syslog.c b/libxo/xo_syslog.c
index 62da181..2d8212a 100644
--- a/libxo/xo_syslog.c
+++ b/libxo/xo_syslog.c
@@ -41,7 +41,11 @@
#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/socket.h>
+#ifdef _HAVE_SYS_SYSLOG
#include <sys/syslog.h>
+#else
+#include <syslog.h>
+#endif
#include <sys/uio.h>
#include <sys/un.h>
#include <netdb.h>
@@ -58,7 +62,9 @@
#include <stdarg.h>
#include <sys/time.h>
#include <sys/types.h>
+#ifdef _HAVE_SYS_SYSCTL
#include <sys/sysctl.h>
+#endif
#include "xo_config.h"
#include "xo.h"
--
2.30.2