package/xml-security-c: new package
authorChris Simons <chris.simons@rockwellcollins.com>
Mon, 12 Apr 2021 16:23:47 +0000 (11:23 -0500)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Wed, 28 Jul 2021 21:50:47 +0000 (23:50 +0200)
Adds support for the Apache Santuario XML Security for C++ that
implementations the XML Digital Signature and Encryption
specifications.

Signed-off-by: Chris Simons <chris.simons@rockwellcollins.com>
Signed-off-by: Matt Weber <matthew.weber@rockwellcollins.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
DEVELOPERS
package/Config.in
package/xml-security-c/0001-autoconf-variable-cache-option-for-getcwd-test.patch [new file with mode: 0644]
package/xml-security-c/Config.in [new file with mode: 0644]
package/xml-security-c/xml-security-c.hash [new file with mode: 0644]
package/xml-security-c/xml-security-c.mk [new file with mode: 0644]

index 6533471736c9410fc9deb62b7b86987776ba8777..cc830d4a2aa9abe2d8820af10753a82fe5bb262e 100644 (file)
@@ -1834,6 +1834,7 @@ F:        package/valijson/
 F:     package/wpa_supplicant/
 F:     package/wireless_tools/
 F:     package/xen/
+F:     package/xml-security-c/
 F:     support/testing/tests/package/br2-external/openjdk/
 F:     support/testing/tests/package/test_openjdk.py
 F:     support/testing/tests/package/test_opkg/
index 79b58facc3b6e1ae073bc32499fe5911efcd473e..adda6f5be9230c0a804227c760abc585dc71ea46 100644 (file)
@@ -1672,6 +1672,7 @@ menu "JSON/XML"
        source "package/tinyxml2/Config.in"
        source "package/valijson/Config.in"
        source "package/xerces/Config.in"
+       source "package/xml-security-c/Config.in"
        source "package/yajl/Config.in"
        source "package/yaml-cpp/Config.in"
 endmenu
diff --git a/package/xml-security-c/0001-autoconf-variable-cache-option-for-getcwd-test.patch b/package/xml-security-c/0001-autoconf-variable-cache-option-for-getcwd-test.patch
new file mode 100644 (file)
index 0000000..26b53ba
--- /dev/null
@@ -0,0 +1,50 @@
+From 9d14fad412a497fe83cfc6ab594ddc612512f02a Mon Sep 17 00:00:00 2001
+From: Matt Weber <matthew.weber@rockwellcollins.com>
+Date: Thu, 4 Jun 2020 20:34:11 -0500
+Subject: [PATCH] autoconf variable cache option for getcwd test
+
+The cached variable allows cross compiled builds to successfully set the
+desired default for this value without invoking a test.
+
+Fixes:
+https://issues.apache.org/jira/browse/SANTUARIO-549
+
+Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
+---
+ configure.ac | 20 ++++++++++++--------
+ 1 file changed, 12 insertions(+), 8 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index b43d7a5..c3d4489 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -74,14 +74,18 @@ AC_CHECK_FUNCS([strcasecmp])
+ # Check whether getcwd can dynamically allocate memory.
+ AC_MSG_CHECKING([whether getcwd(NULL, 0) works])
+-AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <stdlib.h>
+-     #include <unistd.h>],
+-[char *cwd = getcwd(NULL, 0);
+-return (cwd != NULL) ? EXIT_SUCCESS : EXIT_FAILURE;])],
+-     [AC_MSG_RESULT(yes)
+-      AC_DEFINE([XSEC_HAVE_GETCWD_DYN], [1],
+-         [Define to 1 if getcwd(NULL, 0) works])],
+-     [AC_MSG_RESULT(no)])
++AC_CACHE_VAL([xml_cv_func_getcwd_null],
++[AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
++     #include <unistd.h>
++     char *cwd = getcwd(NULL, 0);
++     return (cwd != NULL) ? EXIT_SUCCESS : EXIT_FAILURE;]])],
++  [xml_cv_func_getcwd_null=yes],
++  [xml_cv_func_getcwd_null=no])])
++AC_MSG_RESULT([$xml_cv_func_getcwd_null])
++if test $xml_cv_func_getcwd_null = yes; then
++AC_DEFINE([XSEC_HAVE_GETCWD_DYN], [1],
++  [Define to 1 if getcwd(NULL, 0) works])
++fi
+ AC_LANG(C++)
+-- 
+2.17.1
+
diff --git a/package/xml-security-c/Config.in b/package/xml-security-c/Config.in
new file mode 100644 (file)
index 0000000..4c01855
--- /dev/null
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_XML_SECURITY_C
+       bool "xml-security-c"
+       depends on BR2_INSTALL_LIBSTDCPP # xerces
+       depends on BR2_USE_WCHAR # xerces
+       depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 # C++11
+       select BR2_PACKAGE_OPENSSL
+       select BR2_PACKAGE_XERCES
+       help
+         The xml-security-c library is a C++ implementation of
+         the XML Digital Signature and Encryption specifications.
+
+         https://santuario.apache.org/cindex.html
+
+comment "xml-security-c needs a toolchain w/ C++, wchar, gcc >= 4.7"
+       depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR ||
+               !BR2_TOOLCHAIN_GCC_AT_LEAST_4_7
diff --git a/package/xml-security-c/xml-security-c.hash b/package/xml-security-c/xml-security-c.hash
new file mode 100644 (file)
index 0000000..d91ed86
--- /dev/null
@@ -0,0 +1,3 @@
+# From http://www.apache.org/dist/santuario/c-library/xml-security-c-2.0.2.tar.gz.sha256
+sha256  c303a2b08cb9ca0f5594adcbb83829b1e793175d7114a82f7d78def8bb2e30df  xml-security-c-2.0.2.tar.gz
+sha256  c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4  LICENSE.txt
diff --git a/package/xml-security-c/xml-security-c.mk b/package/xml-security-c/xml-security-c.mk
new file mode 100644 (file)
index 0000000..fe76181
--- /dev/null
@@ -0,0 +1,21 @@
+################################################################################
+#
+# xml-security-c
+#
+################################################################################
+
+XML_SECURITY_C_VERSION = 2.0.2
+XML_SECURITY_C_SITE = http://archive.apache.org/dist/santuario/c-library
+XML_SECURITY_C_LICENSE = Apache-2.0
+XML_SECURITY_C_LICENSE_FILES = LICENSE.txt
+XML_SECURITY_C_DEPENDENCIES = openssl xerces
+XML_SECURITY_C_INSTALL_STAGING = YES
+
+XML_SECURITY_C_CONF_ENV = \
+       xml_cv_func_getcwd_null=yes \
+       CXXFLAGS="$(TARGET_CXXFLAGS) -std=c++11"
+
+# Patched configure.ac
+XML_SECURITY_C_AUTORECONF = YES
+
+$(eval $(autotools-package))