commit: 0d5a3af3ce962e8aab5e929061ba3910d9232597 Author: Kurt Kanzenbach <kurt <AT> kmk-computers <DOT> de> AuthorDate: Fri Jul 15 16:43:58 2022 +0000 Commit: Kurt Kanzenbach <kurt <AT> kmk-computers <DOT> de> CommitDate: Fri Jul 15 16:43:58 2022 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=0d5a3af3
dev-libs/open62541: add 1.3.2 Signed-off-by: Kurt Kanzenbach <kurt <AT> kmk-computers.de> dev-libs/open62541/Manifest | 1 + .../files/open62541-1.3.2-disable-xdp.patch | 21 +++ .../open62541/files/open62541-1.3.2-tests.patch | 144 +++++++++++++++++++++ dev-libs/open62541/open62541-1.3.2.ebuild | 96 ++++++++++++++ 4 files changed, 262 insertions(+) diff --git a/dev-libs/open62541/Manifest b/dev-libs/open62541/Manifest index 34410a6bd..d6a83c367 100644 --- a/dev-libs/open62541/Manifest +++ b/dev-libs/open62541/Manifest @@ -1 +1,2 @@ DIST open62541-1.3.1.tar.gz 3886706 BLAKE2B 3c53ea267e4ae1abb8047fc6f86a85fe327c4b528e30576d402b547bd8ab749596db6224fd12cc6baf506d60871bb30831fab32894a9d93be86f01a71db774df SHA512 49b2869c39205eebe5226c0238ee7cedc5eae42f140d205f6cf1df6f359e0a1cb04a50616ac846438569824b18a3af4d18d316288313f0368bcf9cd0f4282d5c +DIST open62541-1.3.2.tar.gz 3865664 BLAKE2B 850c0663e228acfde311168ef3e80a778085d46e6aceea0d646a3d27617810b57134ddf5334885bfd5678c21ec115c68065da5bc5dbba1a9246eb6e2ca7094df SHA512 7b1a62d20abc0b7ab14408eb8d98919223e53651de863ceab675d9bb9b88c8b76bc7dff0779cd8df878be4ef1ce2cf8ecf4b532a821eb3641460951e0a5a521e diff --git a/dev-libs/open62541/files/open62541-1.3.2-disable-xdp.patch b/dev-libs/open62541/files/open62541-1.3.2-disable-xdp.patch new file mode 100644 index 000000000..cb5cb6e8f --- /dev/null +++ b/dev-libs/open62541/files/open62541-1.3.2-disable-xdp.patch @@ -0,0 +1,21 @@ +From: Kurt Kanzenbach <k...@kmk-computers.de> +Subject: pubsub: Disable XDP code + +The XDP code assumes < dev-libs/libbpf-0.0.7. Disable it. + +Signed-off-by: Kurt Kanzenbach <k...@kmk-computers.de> +--- + plugins/ua_pubsub_ethernet.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/plugins/ua_pubsub_ethernet.c ++++ b/plugins/ua_pubsub_ethernet.c +@@ -43,7 +43,7 @@ static UA_THREAD_LOCAL UA_Byte ReceiveMs + #include <linux/if_link.h> + + #if defined __has_include +-# if __has_include(<bpf/bpf.h>) && __has_include(<bpf/libbpf.h>) && __has_include(<bpf/xsk.h>) ++# if 0 + # define LIBBPF_EBPF + /* Libbpf headers */ + # include <bpf/bpf.h> diff --git a/dev-libs/open62541/files/open62541-1.3.2-tests.patch b/dev-libs/open62541/files/open62541-1.3.2-tests.patch new file mode 100644 index 000000000..292cd73fc --- /dev/null +++ b/dev-libs/open62541/files/open62541-1.3.2-tests.patch @@ -0,0 +1,144 @@ +From: Kurt Kanzenbach <k...@kmk-computers.de> +Subject: test: Remove PubSub tests + +Remove PubSub tests. They don't run within portage. + +Signed-off-by: Kurt Kanzenbach <k...@kmk-computers.de> +--- + tests/CMakeLists.txt | 125 --------------------------------------------------- + 1 file changed, 125 deletions(-) + +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -381,131 +381,6 @@ if(UA_ENABLE_DISCOVERY) + add_test_valgrind(discovery ${TESTS_BINARY_DIR}/check_discovery) + endif() + +-if(UA_ENABLE_PUBSUB) +- add_executable(check_pubsub_encoding pubsub/check_pubsub_encoding.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>) +- target_link_libraries(check_pubsub_encoding ${LIBS}) +- add_test_valgrind(pubsub_encoding ${TESTS_BINARY_DIR}/check_pubsub_encoding) +- add_executable(check_pubsub_pds pubsub/check_pubsub_pds.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>) +- target_link_libraries(check_pubsub_pds ${LIBS}) +- add_test_valgrind(pubsub_pds ${TESTS_BINARY_DIR}/check_pubsub_pds) +- add_executable(check_pubsub_connection_udp pubsub/check_pubsub_connection_udp.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>) +- target_link_libraries(check_pubsub_connection_udp ${LIBS}) +- add_test_valgrind(pubsub_connection_udp ${TESTS_BINARY_DIR}/check_pubsub_connection_udp) +- add_executable(check_pubsub_publish pubsub/check_pubsub_publish.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>) +- target_link_libraries(check_pubsub_publish ${LIBS}) +- add_test_valgrind(pubsub_publish ${TESTS_BINARY_DIR}/check_pubsub_publish) +- add_executable(check_pubsub_publish_uadp pubsub/check_pubsub_publish_uadp.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>) +- target_link_libraries(check_pubsub_publish_uadp ${LIBS}) +- add_test_valgrind(pubsub_publish ${TESTS_BINARY_DIR}/check_pubsub_publish_uadp) +- add_executable(check_pubsub_get_state pubsub/check_pubsub_get_state.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>) +- target_link_libraries(check_pubsub_get_state ${LIBS}) +- add_test_valgrind(check_pubsub_get_state ${TESTS_BINARY_DIR}/check_pubsub_get_state) +- +- #Link libraries for executing subscriber unit test +- add_executable(check_pubsub_subscribe pubsub/check_pubsub_subscribe.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>) +- target_link_libraries(check_pubsub_subscribe ${LIBS}) +- add_executable(check_pubsub_publishspeed pubsub/check_pubsub_publishspeed.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>) +- target_link_libraries(check_pubsub_publishspeed ${LIBS}) +- add_test_valgrind(pubsub_publishspeed ${TESTS_BINARY_DIR}/check_pubsub_publish) +- add_executable(check_pubsub_config_freeze pubsub/check_pubsub_config_freeze.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>) +- target_link_libraries(check_pubsub_config_freeze ${LIBS}) +- add_test_valgrind(check_pubsub_config_freeze ${TESTS_BINARY_DIR}/check_pubsub_config_freeze) +- add_executable(check_pubsub_publish_rt_levels pubsub/check_pubsub_publish_rt_levels.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>) +- target_link_libraries(check_pubsub_publish_rt_levels ${LIBS}) +- add_test_valgrind(check_pubsub_publish_rt_levels ${TESTS_BINARY_DIR}/check_pubsub_publish_rt_levels) +- add_executable(check_pubsub_subscribe_config_freeze pubsub/check_pubsub_subscribe_config_freeze.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>) +- target_link_libraries(check_pubsub_subscribe_config_freeze ${LIBS}) +- add_test_valgrind(check_pubsub_subscribe_config_freeze ${TESTS_BINARY_DIR}/check_pubsub_subscribe_config_freeze) +- add_executable(check_pubsub_subscribe_rt_levels pubsub/check_pubsub_subscribe_rt_levels.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>) +- target_link_libraries(check_pubsub_subscribe_rt_levels ${LIBS}) +- add_test_valgrind(check_pubsub_subscribe_rt_levels ${TESTS_BINARY_DIR}/check_pubsub_subscribe_rt_levels) +- add_executable(check_pubsub_multiple_subscribe_rt_levels pubsub/check_pubsub_multiple_subscribe_rt_levels.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>) +- target_link_libraries(check_pubsub_multiple_subscribe_rt_levels ${LIBS}) +- add_test_valgrind(check_pubsub_multiple_subscribe_rt_levels ${TESTS_BINARY_DIR}/check_pubsub_multiple_subscribe_rt_levels) +- +- add_executable(check_pubsub_multiple_layer pubsub/check_pubsub_multiple_layer.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>) +- target_link_libraries(check_pubsub_multiple_layer ${LIBS}) +- add_test_valgrind(pubsub_multiple_layer ${TESTS_BINARY_DIR}/check_pubsub_multiple_layer) +- +- if(UA_ENABLE_PUBSUB_ENCRYPTION) +- add_executable(check_pubsub_encryption pubsub/check_pubsub_encryption.c +- $<TARGET_OBJECTS:open62541-object> +- $<TARGET_OBJECTS:open62541-testplugins>) +- target_link_libraries(check_pubsub_encryption ${LIBS}) +- add_test_valgrind(check_pubsub_encryption ${TESTS_BINARY_DIR}/check_pubsub_encryption) +- +- add_executable(check_pubsub_encryption_aes256 pubsub/check_pubsub_encryption_aes256.c +- $<TARGET_OBJECTS:open62541-object> +- $<TARGET_OBJECTS:open62541-testplugins>) +- target_link_libraries(check_pubsub_encryption_aes256 ${LIBS}) +- add_test_valgrind(check_pubsub_encryption_aes256 ${TESTS_BINARY_DIR}/check_pubsub_encryption_aes256) +- +- add_executable(check_pubsub_decryption pubsub/check_pubsub_decryption.c +- $<TARGET_OBJECTS:open62541-object> +- $<TARGET_OBJECTS:open62541-testplugins>) +- target_link_libraries(check_pubsub_decryption ${LIBS}) +- add_test_valgrind(check_pubsub_decryption ${TESTS_BINARY_DIR}/check_pubsub_decryption) +- +- add_executable(check_pubsub_subscribe_encrypted pubsub/check_pubsub_subscribe_encrypted.c +- $<TARGET_OBJECTS:open62541-object> +- $<TARGET_OBJECTS:open62541-testplugins>) +- target_link_libraries(check_pubsub_subscribe_encrypted ${LIBS}) +- add_test_valgrind(check_pubsub_subscribe_encrypted ${TESTS_BINARY_DIR}/check_pubsub_subscribe_encrypted) +- endif() +- +- if (UA_ENABLE_PUBSUB_MONITORING) +- add_executable(check_pubsub_subscribe_msgrcvtimeout pubsub/check_pubsub_subscribe_msgrcvtimeout.c +- $<TARGET_OBJECTS:open62541-object> +- $<TARGET_OBJECTS:open62541-testplugins>) +- target_link_libraries(check_pubsub_subscribe_msgrcvtimeout ${LIBS}) +- add_test_valgrind(check_pubsub_subscribe_msgrcvtimeout ${TESTS_BINARY_DIR}/check_pubsub_subscribe_msgrcvtimeout) +- endif() +- +- if(UA_ENABLE_PUBSUB_ETH_UADP) +- add_executable(check_pubsub_connection_ethernet pubsub/check_pubsub_connection_ethernet.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>) +- target_link_libraries(check_pubsub_connection_ethernet ${LIBS}) +- add_test_valgrind(pubsub_connection_ethernet ${TESTS_BINARY_DIR}/check_pubsub_connection_ethernet) +- add_executable(check_pubsub_publish_ethernet pubsub/check_pubsub_publish_ethernet.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>) +- target_link_libraries(check_pubsub_publish_ethernet ${LIBS}) +- add_test_valgrind(pubsub_publish_ethernet ${TESTS_BINARY_DIR}/check_pubsub_publish_ethernet) +- add_executable(check_pubsub_connection_ethernet_etf pubsub/check_pubsub_connection_ethernet_etf.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>) +- target_link_libraries(check_pubsub_connection_ethernet_etf ${LIBS}) +- add_test_valgrind(pubsub_connection_ethernet_etf ${TESTS_BINARY_DIR}/check_pubsub_connection_ethernet_etf) +- add_executable(check_pubsub_publish_ethernet_etf pubsub/check_pubsub_publish_ethernet_etf.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>) +- target_link_libraries(check_pubsub_publish_ethernet_etf ${LIBS}) +- add_test_valgrind(pubsub_publish_ethernet_etf ${TESTS_BINARY_DIR}/check_pubsub_publish_ethernet_etf) +- if(LIB_BPF) +- add_executable(check_pubsub_connection_xdp pubsub/check_pubsub_connection_xdp.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>) +- target_link_libraries(check_pubsub_connection_xdp ${LIBS}) +- add_test_valgrind(pubsub_connection_xdp ${TESTS_BINARY_DIR}/check_pubsub_connection_xdp) +- endif() +- endif() +- +- if(UA_ENABLE_PUBSUB_INFORMATIONMODEL) +- add_executable(check_pubsub_informationmodel pubsub/check_pubsub_informationmodel.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>) +- target_link_libraries(check_pubsub_informationmodel ${LIBS}) +- add_test_valgrind(check_pubsub_informationmodel ${TESTS_BINARY_DIR}/check_pubsub_informationmodel) +- if(UA_ENABLE_PUBSUB_INFORMATIONMODEL_METHODS) +- add_executable(check_pubsub_informationmodel_methods pubsub/check_pubsub_informationmodel_methods.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>) +- target_link_libraries(check_pubsub_informationmodel_methods ${LIBS}) +- add_test_valgrind(check_pubsub_informationmodel_methods ${TESTS_BINARY_DIR}/check_pubsub_informationmodel_methods) +- +- endif() +- endif() +- if(UA_ENABLE_PUBSUB_MQTT) +- if(NOT WIN32) +- add_executable(check_pubsub_connection_mqtt pubsub/check_pubsub_connection_mqtt.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>) +- target_link_libraries(check_pubsub_connection_mqtt ${LIBS}) +- add_test_valgrind(pubsub_connection_mqtt ${TESTS_BINARY_DIR}/check_pubsub_connection_mqtt) +- endif() +- endif() +- if(UA_ENABLE_PUBSUB_FILE_CONFIG) +- add_executable(check_pubsub_configuration pubsub/check_pubsub_configuration.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>) +- target_link_libraries(check_pubsub_configuration ${LIBS}) +- add_test_valgrind(pubsub_configuration ${TESTS_BINARY_DIR}/check_pubsub_configuration) +- endif() +-endif() +- + add_executable(check_server_readspeed server/check_server_readspeed.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>) + target_link_libraries(check_server_readspeed ${LIBS}) + add_test_no_valgrind(server_readspeed ${TESTS_BINARY_DIR}/check_server_readspeed) diff --git a/dev-libs/open62541/open62541-1.3.2.ebuild b/dev-libs/open62541/open62541-1.3.2.ebuild new file mode 100644 index 000000000..7e3c2224a --- /dev/null +++ b/dev-libs/open62541/open62541-1.3.2.ebuild @@ -0,0 +1,96 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8..10} ) + +inherit cmake python-single-r1 + +DESCRIPTION="Open source C implementation of OPC UA" +HOMEPAGE="https://www.open62541.org/" +SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MPL-2.0" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~x86" +IUSE="doc encryption examples mbedtls pubsub openssl test tools" +RESTRICT="!test? ( test )" + +REQUIRED_USE=" + ${PYTHON_REQUIRED_USE} + encryption? ( || ( mbedtls openssl ) ) +" + +BDEPEND=" + ${PYTHON_DEPS} + virtual/pkgconfig + doc? ( + media-gfx/graphviz + $(python_gen_cond_dep ' + dev-python/sphinx[${PYTHON_USEDEP}] + dev-python/sphinx_rtd_theme[${PYTHON_USEDEP}] + ') + ) + test? ( + dev-libs/check + dev-util/valgrind + $(python_gen_cond_dep ' + dev-python/subunit[${PYTHON_USEDEP}] + ') + ) +" +DEPEND=" + mbedtls? ( net-libs/mbedtls:= ) + openssl? ( dev-libs/openssl:0= ) +" +RDEPEND=" + ${PYTHON_DEPS} + ${DEPEND} +" + +PATCHES=( + "${FILESDIR}/${P}-disable-xdp.patch" + "${FILESDIR}/${P}-tests.patch" +) + +src_configure() { + local mycmakeargs=( + -DBUILD_SHARED_LIBS=ON + -DOPEN62541_VERSION=v${PV} + -DUA_BUILD_EXAMPLES=OFF + -DUA_BUILD_TOOLS=$(usex tools) + -DUA_BUILD_UNIT_TESTS=$(usex test) + -DUA_ENABLE_PUBSUB=$(usex pubsub) + -DUA_ENABLE_PUBSUB_ETH_UADP=$(usex pubsub) + -DUA_FORCE_WERROR=OFF + ) + + if use encryption; then + use mbedtls && mycmakeargs+=(-DUA_ENABLE_ENCRYPTION=MBEDTLS) + use openssl && mycmakeargs+=(-DUA_ENABLE_ENCRYPTION=OPENSSL) + fi + + cmake_src_configure +} + +src_compile() { + cmake_src_compile + use doc && cmake_build doc +} + +src_install() { + use doc && local HTML_DOCS=( "${WORKDIR}"/${P}_build/doc/. ) + cmake_src_install + + if use examples; then + docompress -x /usr/share/doc/${PF}/examples + dodoc -r examples/ + fi + + python_fix_shebang "${ED}" +} + +src_test() { + cmake_src_test -j1 +}