aboutsummaryrefslogtreecommitdiff
blob: 8993de01435d133f5b6c0ac71e4c313d9dd03991 (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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6

PYTHON_COMPAT=( python2_7 python3_{4,5,6} )

inherit cmake-utils llvm python-r1 git-r3

DESCRIPTION="Tool for creating Python bindings for C++ libraries"
HOMEPAGE="https://wiki.qt.io/PySide2"
EGIT_REPO_URI="https://code.qt.io/pyside/pyside-setup.git"
#FIXME: Switch to the clang-enabled "dev" branch once stable.
EGIT_BRANCH="5.6"

LICENSE="|| ( GPL-2+ LGPL-3 ) GPL-3"
SLOT="2"
KEYWORDS=""
IUSE="test"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"

# Minimum version of Qt required.
QT_PV="5.6*:5"

#FIXME: Add "sys-devel/clang:*" after switching to the "dev" branch.
DEPEND="
	${PYTHON_DEPS}
	dev-libs/libxml2
	dev-libs/libxslt
	=dev-qt/qtcore-${QT_PV}
	=dev-qt/qtxml-${QT_PV}
	=dev-qt/qtxmlpatterns-${QT_PV}
"
RDEPEND="${DEPEND}"

S=${WORKDIR}/${P}/sources/shiboken2

DOCS=( AUTHORS )

src_prepare() {
	#FIXME: Uncomment after switching to the "dev" branch.
	# sed -i -e "/^find_library(CLANG_LIBRARY/ s~/lib)$~/$(get_libdir))~" CMakeLists.txt || die

	if use prefix; then
		cp "${FILESDIR}"/rpath.cmake . || die
		sed -i -e '1iinclude(rpath.cmake)' CMakeLists.txt || die
	fi

	cmake-utils_src_prepare
}

src_configure() {
	configuration() {
		local mycmakeargs=(
			-DBUILD_TESTS=$(usex test)
			-DPYTHON_EXECUTABLE="${PYTHON}"
		)

		#FIXME: Uncomment after switching to the "dev" branch.
		#FIXME: "CMakeLists.txt" currently requires that callers manually set
		#this environment variable to the absolute path of the directory
		#containing clang libraries rather than magically finding this path
		#(e.g., via "find_package(CLang)"). If this changes, remove this option.
		# CLANG_INSTALL_DIR="$(get_llvm_prefix)" cmake-utils_src_configure

		cmake-utils_src_configure
	}
	python_foreach_impl configuration
}

src_compile() {
	python_foreach_impl cmake-utils_src_compile
}

src_test() {
	python_foreach_impl cmake-utils_src_test
}

src_install() {
	installation() {
		cmake-utils_src_install
		mv "${ED}"usr/$(get_libdir)/pkgconfig/${PN}2{,-${EPYTHON}}.pc || die
	}
	python_foreach_impl installation
}