summaryrefslogtreecommitdiff
path: root/media-libs/lib3mf/lib3mf-2.2.0.ebuild
blob: d5d470010791d938eea2f9bf3e2c2317626ad86e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit cmake

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"
KEYWORDS="amd64 ~arm64 ~ppc64 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-debug/valgrind
	)
"

PATCHES=(
	"${FILESDIR}"/${PN}-2.1.0-0001-Gentoo-specific-avoid-pre-stripping-library.patch
	"${FILESDIR}"/${P}-0001-use-system-provided-act-binary.patch
	"${FILESDIR}"/${P}-0002-Gentoo-specific-remove-add_dependencies.patch
	"${FILESDIR}"/${P}-0001-remove-std-and-opt-flags.patch
	"${FILESDIR}"/${P}-include-cstdint.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
		dosym -r /usr/include/${PN}/Bindings/Cpp/${PN}_${suf}.hpp /usr/include/${PN}/${PN}_${suf}.hpp
	done
}