diff options
author | Bernd Waibel <waebbl-gentoo@posteo.net> | 2021-04-06 20:36:18 +0200 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2021-04-10 04:24:19 +0000 |
commit | b74aaca2db7cd5f9d9bd15745d4ea52ab36e5886 (patch) | |
tree | 607d8abdd33df41320df5280d5dfd21331345aec /media-libs/lib3mf | |
parent | games-emulation/pcsx2: update to match upstream changes (diff) | |
download | gentoo-b74aaca2db7cd5f9d9bd15745d4ea52ab36e5886.tar.gz gentoo-b74aaca2db7cd5f9d9bd15745d4ea52ab36e5886.tar.bz2 gentoo-b74aaca2db7cd5f9d9bd15745d4ea52ab36e5886.zip |
media-libs/lib3mf: re-add x86 keyword
Add USE flag to depend on system-provided dev-go/act
package.
Package-Manager: Portage-3.0.18, Repoman-3.0.3
Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'media-libs/lib3mf')
-rw-r--r-- | media-libs/lib3mf/files/lib3mf-2.1.1-0001-patch-to-use-system-provided-act-binary.patch | 141 | ||||
-rw-r--r-- | media-libs/lib3mf/lib3mf-2.1.1-r1.ebuild | 69 | ||||
-rw-r--r-- | media-libs/lib3mf/metadata.xml | 7 |
3 files changed, 217 insertions, 0 deletions
diff --git a/media-libs/lib3mf/files/lib3mf-2.1.1-0001-patch-to-use-system-provided-act-binary.patch b/media-libs/lib3mf/files/lib3mf-2.1.1-0001-patch-to-use-system-provided-act-binary.patch new file mode 100644 index 000000000000..00089c58468f --- /dev/null +++ b/media-libs/lib3mf/files/lib3mf-2.1.1-0001-patch-to-use-system-provided-act-binary.patch @@ -0,0 +1,141 @@ +From c4e004aa8580f799dbbb7ec6951e0826dc387811 Mon Sep 17 00:00:00 2001 +From: Bernd Waibel <waebbl-gentoo@posteo.net> +Date: Tue, 6 Apr 2021 08:45:45 +0200 +Subject: [PATCH] patch to use system-provided act binary + +Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net> +--- + CMakeLists.txt | 109 +++++++++++++++++++++++++++++++++---------------- + 1 file changed, 73 insertions(+), 36 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 64a11d9..55abdde 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -54,14 +54,19 @@ if (${MSVC}) + endif() + + ### The API generation target +-if(CMAKE_HOST_UNIX) +- if(APPLE) +- set(ACT_COMMANDENDING darwin) +- else() +- set(ACT_COMMANDENDING linux) ++option(USE_SYSTEM_ACT "Use system-provided act binary" OFF) ++if(NOT USE_SYSTEM_ACT) ++ if(CMAKE_HOST_UNIX) ++ if(APPLE) ++ set(ACT_COMMANDENDING darwin) ++ else() ++ set(ACT_COMMANDENDING linux) ++ endif() ++ elseif(CMAKE_HOST_WIN32) ++ set(ACT_COMMANDENDING exe) + endif() +-elseif(CMAKE_HOST_WIN32) +- set(ACT_COMMANDENDING exe) ++else() ++ find_program(ACT act) + endif() + + set(CMAKE_CURRENT_BINARY_DIR_AUTOGENERATED ${CMAKE_CURRENT_BINARY_DIR}/Autogenerated) +@@ -71,35 +76,67 @@ set(ACT_GENERATED_SOURCE + ${CMAKE_CURRENT_BINARY_DIR_AUTOGENERATED}/Source/Implementation/lib3mf_interfacewrapper.cpp + ${CMAKE_CURRENT_BINARY_DIR_AUTOGENERATED}/Source/Implementation/lib3mf_interfacejournal.cpp + ) +-add_custom_command( +- BYPRODUCTS +- ${ACT_GENERATED_SOURCE} +- OUTPUT +- ${CMAKE_CURRENT_BINARY_DIR_AUTOGENERATED}/LIB3MFACTGENERATIONSTAMP +- WORKING_DIRECTORY +- ${CMAKE_CURRENT_SOURCE_DIR}/AutomaticComponentToolkit +- COMMAND +- cmake -E make_directory "${CMAKE_CURRENT_BINARY_DIR_AUTOGENERATED}" +- COMMAND +- cmake -E touch "${CMAKE_CURRENT_BINARY_DIR_AUTOGENERATED}/LIB3MFACTGENERATIONSTAMP" +- COMMAND +- ${CMAKE_CURRENT_SOURCE_DIR}/AutomaticComponentToolkit/bin/act.${ACT_COMMANDENDING} ${CMAKE_CURRENT_SOURCE_DIR}/AutomaticComponentToolkit/lib3mf.xml +- COMMAND +- cmake -E remove_directory "${CMAKE_CURRENT_BINARY_DIR_AUTOGENERATED}/Source" +- COMMAND +- cmake -E remove_directory "${CMAKE_CURRENT_BINARY_DIR_AUTOGENERATED}/Bindings" +- COMMAND +- cmake -E copy_directory "${CMAKE_TEMP_HEADER_FOLDER}/Bindings" ${CMAKE_CURRENT_BINARY_DIR_AUTOGENERATED}/Bindings +- COMMAND +- cmake -E copy_directory "${CMAKE_TEMP_HEADER_FOLDER}/Implementations/Cpp/Interfaces" "${CMAKE_CURRENT_BINARY_DIR_AUTOGENERATED}/Source/Implementation" +- COMMAND +- cmake -E remove_directory "${CMAKE_TEMP_HEADER_FOLDER}" +- COMMENT +- "Generating hourglass API bindings and implementation stub" +- DEPENDS +- ${CMAKE_CURRENT_SOURCE_DIR}/AutomaticComponentToolkit/lib3mf.xml +- VERBATIM +-) ++if(NOT USE_SYSTEM_ACT) ++ add_custom_command( ++ BYPRODUCTS ++ ${ACT_GENERATED_SOURCE} ++ OUTPUT ++ ${CMAKE_CURRENT_BINARY_DIR_AUTOGENERATED}/LIB3MFACTGENERATIONSTAMP ++ WORKING_DIRECTORY ++ ${CMAKE_CURRENT_SOURCE_DIR}/AutomaticComponentToolkit ++ COMMAND ++ cmake -E make_directory "${CMAKE_CURRENT_BINARY_DIR_AUTOGENERATED}" ++ COMMAND ++ cmake -E touch "${CMAKE_CURRENT_BINARY_DIR_AUTOGENERATED}/LIB3MFACTGENERATIONSTAMP" ++ COMMAND ++ ${CMAKE_CURRENT_SOURCE_DIR}/AutomaticComponentToolkit/bin/act.${ACT_COMMANDENDING} ${CMAKE_CURRENT_SOURCE_DIR}/AutomaticComponentToolkit/lib3mf.xml ++ COMMAND ++ cmake -E remove_directory "${CMAKE_CURRENT_BINARY_DIR_AUTOGENERATED}/Source" ++ COMMAND ++ cmake -E remove_directory "${CMAKE_CURRENT_BINARY_DIR_AUTOGENERATED}/Bindings" ++ COMMAND ++ cmake -E copy_directory "${CMAKE_TEMP_HEADER_FOLDER}/Bindings" ${CMAKE_CURRENT_BINARY_DIR_AUTOGENERATED}/Bindings ++ COMMAND ++ cmake -E copy_directory "${CMAKE_TEMP_HEADER_FOLDER}/Implementations/Cpp/Interfaces" "${CMAKE_CURRENT_BINARY_DIR_AUTOGENERATED}/Source/Implementation" ++ COMMAND ++ cmake -E remove_directory "${CMAKE_TEMP_HEADER_FOLDER}" ++ COMMENT ++ "Generating hourglass API bindings and implementation stub" ++ DEPENDS ++ ${CMAKE_CURRENT_SOURCE_DIR}/AutomaticComponentToolkit/lib3mf.xml ++ VERBATIM ++ ) ++else() ++ add_custom_command( ++ BYPRODUCTS ++ ${ACT_GENERATED_SOURCE} ++ OUTPUT ++ ${CMAKE_CURRENT_BINARY_DIR_AUTOGENERATED}/LIB3MFACTGENERATIONSTAMP ++ WORKING_DIRECTORY ++ ${CMAKE_CURRENT_SOURCE_DIR}/AutomaticComponentToolkit ++ COMMAND ++ cmake -E make_directory "${CMAKE_CURRENT_BINARY_DIR_AUTOGENERATED}" ++ COMMAND ++ cmake -E touch "${CMAKE_CURRENT_BINARY_DIR_AUTOGENERATED}/LIB3MFACTGENERATIONSTAMP" ++ COMMAND ++ ${ACT} ${CMAKE_CURRENT_SOURCE_DIR}/AutomaticComponentToolkit/lib3mf.xml ++ COMMAND ++ cmake -E remove_directory "${CMAKE_CURRENT_BINARY_DIR_AUTOGENERATED}/Source" ++ COMMAND ++ cmake -E remove_directory "${CMAKE_CURRENT_BINARY_DIR_AUTOGENERATED}/Bindings" ++ COMMAND ++ cmake -E copy_directory "${CMAKE_TEMP_HEADER_FOLDER}/Bindings" ${CMAKE_CURRENT_BINARY_DIR_AUTOGENERATED}/Bindings ++ COMMAND ++ cmake -E copy_directory "${CMAKE_TEMP_HEADER_FOLDER}/Implementations/Cpp/Interfaces" "${CMAKE_CURRENT_BINARY_DIR_AUTOGENERATED}/Source/Implementation" ++ COMMAND ++ cmake -E remove_directory "${CMAKE_TEMP_HEADER_FOLDER}" ++ COMMENT ++ "Generating hourglass API bindings and implementation stub" ++ DEPENDS ++ ${CMAKE_CURRENT_SOURCE_DIR}/AutomaticComponentToolkit/lib3mf.xml ++ VERBATIM ++ ) ++endif() + + add_custom_target(lib3mfACT + DEPENDS +-- +2.31.1 + diff --git a/media-libs/lib3mf/lib3mf-2.1.1-r1.ebuild b/media-libs/lib3mf/lib3mf-2.1.1-r1.ebuild new file mode 100644 index 000000000000..fb5acbc060c8 --- /dev/null +++ b/media-libs/lib3mf/lib3mf-2.1.1-r1.ebuild @@ -0,0 +1,69 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake eapi8-dosym + +DESCRIPTION="Implementation of the 3D Manufacturing Format file standard" +HOMEPAGE="https://3mf.io/ https://github.com/3MFConsortium/lib3mf" +SRC_URI="https://github.com/3MFConsortium/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="BSD" +SLOT="0/2" +# the included ACT binary is a statically x86_64 built one +# see https://github.com/3MFConsortium/lib3mf/issues/199 +# Keyword arm64 can be re-added after we have dev-go/act +# package keyworded +KEYWORDS="~amd64 ~x86" +IUSE="+system-act test" +RESTRICT="!test? ( test )" + +RDEPEND=" + dev-libs/libzip:= + sys-apps/util-linux + sys-libs/zlib +" +DEPEND="${RDEPEND}" +BDEPEND=" + virtual/pkgconfig + system-act? ( dev-go/act ) + test? ( + dev-cpp/gtest + dev-libs/openssl + dev-util/valgrind + ) +" + +PATCHES=( + "${FILESDIR}"/${PN}-2.1.0-0001-Gentoo-specific-avoid-pre-stripping-library.patch + "${FILESDIR}"/${P}-0001-patch-to-use-system-provided-act-binary.patch +) + +src_configure() { + local mycmakeargs=( + -DCMAKE_INSTALL_INCLUDEDIR="include/${PN}" + -DLIB3MF_TESTS=$(usex test) + -DUSE_INCLUDED_LIBZIP=OFF + -DUSE_INCLUDED_ZLIB=OFF + -DUSE_SYSTEM_ACT=$(usex system-act) + ) + + if use test; then + mycmakeargs+=( + -DUSE_INCLUDED_GTEST=OFF + # code says it uses libressl, but works with openssl too + -DUSE_INCLUDED_SSL=OFF + ) + fi + + cmake_src_configure +} + +src_install() { + cmake_src_install + + for suf in abi types implicit; do + dosym8 -r /usr/include/${PN}/Bindings/Cpp/${PN}_${suf}.hpp /usr/include/${PN}/${PN}_${suf}.hpp + done +} diff --git a/media-libs/lib3mf/metadata.xml b/media-libs/lib3mf/metadata.xml index 7907c9b23f8c..2b80f7d806e5 100644 --- a/media-libs/lib3mf/metadata.xml +++ b/media-libs/lib3mf/metadata.xml @@ -15,6 +15,13 @@ It provides reading and writing capabilities for 3MF files, as well as conversion and validation tools for input and output data. </longdescription> +<use> + <flag name="system-act"> + Use system-provided <pkg>dev-go/act</pkg> as code generator + instead of package provided binaries. This flag will be removed + after some time used for testing! + </flag> +</use> <upstream> <remote-id type="github">3MFConsortium/lib3mf</remote-id> </upstream> |