diff options
author | Bernd Waibel <waebbl@gmail.com> | 2019-05-24 09:04:08 +0200 |
---|---|---|
committer | Andreas Sturmlechner <asturm@gentoo.org> | 2020-04-11 16:17:26 +0200 |
commit | d63003e9ac333d54b8cb4b80d0550e2de0016468 (patch) | |
tree | 3e41b1f18849084407d7f85ad4bb3811596e2493 /media-libs | |
parent | dev-perl/autobox: Remove old 2.860.0 (diff) | |
download | gentoo-d63003e9ac333d54b8cb4b80d0550e2de0016468.tar.gz gentoo-d63003e9ac333d54b8cb4b80d0550e2de0016468.tar.bz2 gentoo-d63003e9ac333d54b8cb4b80d0550e2de0016468.zip |
media-libs/lib3mf: new package
Thanks to Scott Alfter who initially wrote the ebuild.
Reported-by: Scott Alfter <scott@alfter.us>
Closes: https://bugs.gentoo.org/686476
Package-Manager: Portage-2.3.96-r1, Repoman-2.3.22
Signed-off-by: Bernd Waibel <waebbl@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/15269
Closes: https://github.com/gentoo/gentoo/pull/12097
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'media-libs')
7 files changed, 235 insertions, 0 deletions
diff --git a/media-libs/lib3mf/Manifest b/media-libs/lib3mf/Manifest new file mode 100644 index 000000000000..8e5f81cdf625 --- /dev/null +++ b/media-libs/lib3mf/Manifest @@ -0,0 +1 @@ +DIST lib3mf-1.8.1.tar.gz 8415939 BLAKE2B 45652aab8c84eb5d500455db211eb911c6e74decf4fbbb652976847e1b3ea16db9c626bd37cd9669aefc8dea29c424e6518e0517e8f96fa6282771e34f840290 SHA512 f7fd75bcb6472de1595a018e5add516d0d78ab0aee92462b686b77f8d2bef05270e7b737cb7e1d31fc5850815056e753874c2f9ec456a455e8461c4010fe914a diff --git a/media-libs/lib3mf/files/lib3mf-1.8.1-0001-Gentoo-specific-avoid-pre-stripping-library.patch b/media-libs/lib3mf/files/lib3mf-1.8.1-0001-Gentoo-specific-avoid-pre-stripping-library.patch new file mode 100644 index 000000000000..c695283cffbb --- /dev/null +++ b/media-libs/lib3mf/files/lib3mf-1.8.1-0001-Gentoo-specific-avoid-pre-stripping-library.patch @@ -0,0 +1,27 @@ +From d97ad4604af7998541567ec486f90dd528e839b1 Mon Sep 17 00:00:00 2001 +From: Bernd Waibel <waebbl@gmail.com> +Date: Wed, 8 Apr 2020 19:09:42 +0200 +Subject: [PATCH 1/4] [Gentoo-specific] avoid pre-stripping library + +Signed-off-by: Bernd Waibel <waebbl@gmail.com> +--- + CMakeLists.txt | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5453440..c867224 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -104,7 +104,8 @@ if (UNIX OR MINGW) + # Uncomment the following to but the version info into the .so-file. + SET_TARGET_PROPERTIES(${PROJECT_NAME}_s PROPERTIES VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") + SET_TARGET_PROPERTIES(${PROJECT_NAME}_s PROPERTIES SOVERSION "${PROJECT_VERSION_MAJOR}") +- if (NOT APPLE) ++ # avoid pre-stripping on Gentoo, this is done by emerge ++ if (NOT APPLE OR (UNIX AND NOT CMAKE_BUILD_TYPE MATCHES "Gentoo")) + SET_TARGET_PROPERTIES(${PROJECT_NAME}_s PROPERTIES LINK_FLAGS -s) + endif() + if (NOT WIN32) +-- +2.26.0 + diff --git a/media-libs/lib3mf/files/lib3mf-1.8.1-0002-Add-library-link-dependencies.patch b/media-libs/lib3mf/files/lib3mf-1.8.1-0002-Add-library-link-dependencies.patch new file mode 100644 index 000000000000..de5331ae66ec --- /dev/null +++ b/media-libs/lib3mf/files/lib3mf-1.8.1-0002-Add-library-link-dependencies.patch @@ -0,0 +1,59 @@ +From 976f14e1ac26389dbfc04bcffd9f4e7e21197001 Mon Sep 17 00:00:00 2001 +From: Bernd Waibel <waebbl@gmail.com> +Date: Wed, 8 Apr 2020 20:05:16 +0200 +Subject: [PATCH] Add library link dependencies + +If USE_INCLUDED_LIBZIP and/or USE_INCLUDED_ZLIB are not set +add them to target_link_libaries command. + +Signed-off-by: Bernd Waibel <waebbl@gmail.com> +--- + CMakeLists.txt | 10 +++++++++- + UnitTests/CPP/CMakeLists.txt | 10 +++++++++- + 2 files changed, 18 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c867224..df87806 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -130,7 +130,15 @@ add_library(${PROJECT_NAME} SHARED ${SRCS_MAIN_PLATFORM} + ) + set(STARTUPPROJECT ${PROJECT_NAME}) + SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES PREFIX "" IMPORT_PREFIX "") +-target_link_libraries(${PROJECT_NAME} ${PROJECT_NAME}_s) ++if(USE_INCLUDED_LIBZIP AND USE_INCLUDED_ZLIB) ++ target_link_libraries(${PROJECT_NAME} ${PROJECT_NAME}_s) ++elseif(USE_INCLUDED_LIBZIP AND NOT USE_INCLUDED_ZLIB) ++ target_link_libraries(${PROJECT_NAME} ${PROJECT_NAME}_s z) ++elseif(USE_INCLUDED_ZLIB AND NOT USE_INCLUDED_LIBZIP) ++ target_link_libraries(${PROJECT_NAME} ${PROJECT_NAME}_s zip) ++else() ++ target_link_libraries(${PROJECT_NAME} ${PROJECT_NAME}_s zip z) ++endif() + if (UNIX OR MINGW) + # Uncomment the following to but the version info into the .so-file. + SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}.${BUILD_NUMBER}") +diff --git a/UnitTests/CPP/CMakeLists.txt b/UnitTests/CPP/CMakeLists.txt +index 2fdf85d..24d32bf 100644 +--- a/UnitTests/CPP/CMakeLists.txt ++++ b/UnitTests/CPP/CMakeLists.txt +@@ -22,7 +22,15 @@ if (WIN32) + endif() + + target_include_directories(${TESTNAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Include ${gtest_SOURCE_DIR}/include) +-target_link_libraries(${TESTNAME} ${PROJECT_NAME}_s gtest gtest_main) ++if(USE_INCLUDED_LIBZIP AND USE_INCLUDED_ZLIB) ++ target_link_libraries(${TESTNAME} ${PROJECT_NAME}_s gtest gtest_main) ++elseif(USE_INCLUDED_LIBZIP AND NOT USE_INCLUDED_ZLIB) ++ target_link_libraries(${TESTNAME} ${PROJECT_NAME}_s gtest gtest_main z) ++elseif(USE_INCLUDED_ZLIB AND NOT USE_INCLUDED_LIBZIP) ++ target_link_libraries(${TESTNAME} ${PROJECT_NAME}_s gtest gtest_main zip) ++else() ++ target_link_libraries(${TESTNAME} ${PROJECT_NAME}_s gtest gtest_main zip z) ++endif() + add_dependencies(${TESTNAME} ${PROJECT_NAME}_s) + set_target_properties(${TESTNAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/") + +-- +2.26.0 + diff --git a/media-libs/lib3mf/files/lib3mf-1.8.1-0003-Change-installation-include-dir.patch b/media-libs/lib3mf/files/lib3mf-1.8.1-0003-Change-installation-include-dir.patch new file mode 100644 index 000000000000..3d79c0d4a4f0 --- /dev/null +++ b/media-libs/lib3mf/files/lib3mf-1.8.1-0003-Change-installation-include-dir.patch @@ -0,0 +1,44 @@ +From f61a4c09977097b0d456ce9e480c2630b90cdc30 Mon Sep 17 00:00:00 2001 +From: Bernd Waibel <waebbl@gmail.com> +Date: Wed, 8 Apr 2020 19:16:07 +0200 +Subject: [PATCH 3/4] Change installation include dir to a more specific one. + +Signed-off-by: Bernd Waibel <waebbl@gmail.com> +--- + CMakeLists.txt | 6 +++--- + lib3MF.pc.in | 2 +- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index df87806..3101c65 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -148,9 +148,9 @@ install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") +-install(DIRECTORY Include/Model DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") +-install(DIRECTORY Include/Common DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") +-install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Include/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") ++install(DIRECTORY Include/Model DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/lib3mf") ++install(DIRECTORY Include/Common DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/lib3mf") ++install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Include/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/lib3mf") + + ######################################################### + configure_file(lib3MF.pc.in lib3MF.pc @ONLY) +diff --git a/lib3MF.pc.in b/lib3MF.pc.in +index 9afb6ee..cf8cafb 100644 +--- a/lib3MF.pc.in ++++ b/lib3MF.pc.in +@@ -1,7 +1,7 @@ + prefix=@CMAKE_INSTALL_PREFIX@ + exec_prefix=@CMAKE_INSTALL_PREFIX@ + libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@ +-includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ ++includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/lib3mf + + Name: @PROJECT_NAME@ + Description: @PROJECT_DESCRIPTION@ +-- +2.26.0 + diff --git a/media-libs/lib3mf/files/lib3mf-1.8.1-0004-Gentoo-specific-Remove-gtest-source-dir.patch b/media-libs/lib3mf/files/lib3mf-1.8.1-0004-Gentoo-specific-Remove-gtest-source-dir.patch new file mode 100644 index 000000000000..edc202e83038 --- /dev/null +++ b/media-libs/lib3mf/files/lib3mf-1.8.1-0004-Gentoo-specific-Remove-gtest-source-dir.patch @@ -0,0 +1,35 @@ +From f392342f819b59449228100b7de8c14eda3cc391 Mon Sep 17 00:00:00 2001 +From: Bernd Waibel <waebbl@gmail.com> +Date: Wed, 8 Apr 2020 19:55:40 +0200 +Subject: [PATCH] [Gentoo-specific] Remove gtest source dir + +We use system gtest on Gentoo + +Signed-off-by: Bernd Waibel <waebbl@gmail.com> +--- + UnitTests/CMakeLists.txt | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/UnitTests/CMakeLists.txt b/UnitTests/CMakeLists.txt +index 59ae773..1212228 100644 +--- a/UnitTests/CMakeLists.txt ++++ b/UnitTests/CMakeLists.txt +@@ -1,7 +1,5 @@ +-ADD_SUBDIRECTORY (googletest EXCLUDE_FROM_ALL) + enable_testing() +- +-SET(gtest_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/googletest/googletest") ++ + add_definitions( -DTESTFILESPATH="${CMAKE_CURRENT_SOURCE_DIR}/../TestFiles") + add_definitions( -DLTESTFILESPATH=L"${CMAKE_CURRENT_SOURCE_DIR}/../TestFiles") + add_definitions( -DLOUTFILESPATH=L"${CMAKE_BINARY_DIR}/") +@@ -12,4 +10,4 @@ add_subdirectory(C_Interface) + # Tests on internal classes of the library + add_subdirectory(CPP) + +-set(STARTUPPROJECT ${STARTUPPROJECT} PARENT_SCOPE) +\ No newline at end of file ++set(STARTUPPROJECT ${STARTUPPROJECT} PARENT_SCOPE) +-- +2.26.0 + diff --git a/media-libs/lib3mf/lib3mf-1.8.1.ebuild b/media-libs/lib3mf/lib3mf-1.8.1.ebuild new file mode 100644 index 000000000000..a53ea513ef48 --- /dev/null +++ b/media-libs/lib3mf/lib3mf-1.8.1.ebuild @@ -0,0 +1,48 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake + +DESCRIPTION="Implementation of the 3D Manufacturing Format file standard" +HOMEPAGE="https://3mf.io/" +SRC_URI="https://github.com/3MFConsortium/$PN/archive/v$PV.tar.gz -> $P.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="doc test" +RESTRICT="!test? ( test )" + +RDEPEND=" + dev-libs/libzip:= + sys-apps/util-linux + sys-libs/zlib +" +DEPEND=" + ${RDEPEND} + test? ( >=dev-cpp/gtest-1.8.0 ) +" + +PATCHES=( + "${FILESDIR}/${P}-0001-Gentoo-specific-avoid-pre-stripping-library.patch" + "${FILESDIR}/${P}-0002-Add-library-link-dependencies.patch" + "${FILESDIR}/${P}-0003-Change-installation-include-dir.patch" + "${FILESDIR}/${P}-0004-Gentoo-specific-Remove-gtest-source-dir.patch" +) + +src_configure() { + local mycmakeargs=( + -DLIB3MF_TESTS=$(usex test) + -DUSE_INCLUDED_LIBZIP=OFF + -DUSE_INCLUDED_ZLIB=OFF + ) + cmake_src_configure +} + +src_install() { + local DOCS=( CONTRIBUTING.md README.md ) + use doc && DOCS+=( Lib3MF-1.pdf ) + cmake_src_install +} diff --git a/media-libs/lib3mf/metadata.xml b/media-libs/lib3mf/metadata.xml new file mode 100644 index 000000000000..ca7507f06ed5 --- /dev/null +++ b/media-libs/lib3mf/metadata.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<maintainer type="person"> + <email>waebbl@gmail.com</email> + <name>Bernd Waibel</name> +</maintainer> +<maintainer type="project"> + <email>proxy-maint@gentoo.org</email> + <description>Gentoo Proxy Maintainer Team</description> +</maintainer> +<longdescription> + Implementation of the 3MF manufacturing file standard from the 3MF + consortium. + It provides reading and writing capabilities for 3MF files, as well + as conversion and validation tools for input and output data. +</longdescription> +<upstream> + <remote-id type="github">3MFConsortium/lib3mf</remote-id> +</upstream> +</pkgmetadata> |