Gentoo Archives: gentoo-commits

From: "Miroslav Šulc" <fordfrog@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pyside2-tools/
Date: Sat, 26 Dec 2020 09:20:07
Message-Id: 1608974391.4ad700c6777d38c4312473076db545fed88f48cf.fordfrog@gentoo
1 commit: 4ad700c6777d38c4312473076db545fed88f48cf
2 Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
3 AuthorDate: Sat Dec 26 09:18:40 2020 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Sat Dec 26 09:19:51 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4ad700c6
7
8 dev-python/pyside2-tools: added new ebuild
9
10 it will be needed for media-gfx/freecad once it gets back the the tree
11
12 used ebuild by Cecil Curry (leycec/raiagent overlay)
13
14 minor changes:
15 1) bump to 5.15.1
16 2) dropped py3_9 because it's missing on deps
17 3) moved from cmake-utils to cmake
18 4) skipping tests if tools USE flag is not set as the tests need the tools
19
20 Package-Manager: Portage-3.0.12, Repoman-3.0.2
21 Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>
22
23 dev-python/pyside2-tools/Manifest | 1 +
24 dev-python/pyside2-tools/metadata.xml | 11 ++
25 .../pyside2-tools/pyside2-tools-5.15.1.ebuild | 125 +++++++++++++++++++++
26 3 files changed, 137 insertions(+)
27
28 diff --git a/dev-python/pyside2-tools/Manifest b/dev-python/pyside2-tools/Manifest
29 new file mode 100644
30 index 00000000000..0d5e684462d
31 --- /dev/null
32 +++ b/dev-python/pyside2-tools/Manifest
33 @@ -0,0 +1 @@
34 +DIST pyside-setup-opensource-src-5.15.1.tar.xz 3454052 BLAKE2B c7190dff493434064976a4604fb5858d2e20c1b98098ccd6e5c4c69d0b67ae9f4bf970e2ab42b634208ea96aab31b21f3dfb5f18fddd0bdaab655bba729e4449 SHA512 f14c7037367799005fff73d9fc8e7998db1895700911adf34dfabdeb4db486c7b28ba2afb3eaee37c58f4099b00e4a86917b8f7d85f274026bddfc090658b306
35
36 diff --git a/dev-python/pyside2-tools/metadata.xml b/dev-python/pyside2-tools/metadata.xml
37 new file mode 100644
38 index 00000000000..e31c29a6f7d
39 --- /dev/null
40 +++ b/dev-python/pyside2-tools/metadata.xml
41 @@ -0,0 +1,11 @@
42 +<?xml version="1.0" encoding="UTF-8"?>
43 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
44 +<pkgmetadata>
45 + <maintainer type="person">
46 + <email>fordfrog@g.o</email>
47 + <name>Miroslav Šulc</name>
48 + </maintainer>
49 + <use>
50 + <flag name="tools">Install supplementary tools (rcc, uic, designer)</flag>
51 + </use>
52 +</pkgmetadata>
53
54 diff --git a/dev-python/pyside2-tools/pyside2-tools-5.15.1.ebuild b/dev-python/pyside2-tools/pyside2-tools-5.15.1.ebuild
55 new file mode 100644
56 index 00000000000..165134f5b6a
57 --- /dev/null
58 +++ b/dev-python/pyside2-tools/pyside2-tools-5.15.1.ebuild
59 @@ -0,0 +1,125 @@
60 +# Copyright 1999-2020 Gentoo Authors
61 +# Distributed under the terms of the GNU General Public License v2
62 +
63 +EAPI=7
64 +
65 +# TODO: Add PyPy once officially supported. See also:
66 +# https://bugreports.qt.io/browse/PYSIDE-535
67 +PYTHON_COMPAT=( python3_{6..8} )
68 +CMAKE_IN_SOURCE_BUILD=1
69 +
70 +inherit cmake python-r1 virtualx
71 +
72 +MY_P=pyside-setup-opensource-src-${PV}
73 +
74 +DESCRIPTION="PySide development tools (lupdate, rcc, uic)"
75 +HOMEPAGE="https://wiki.qt.io/PySide2"
76 +SRC_URI="https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-${PV}-src/${MY_P}.tar.xz"
77 +
78 +# Though "LICENSE-uic" suggests the "pyside2uic" directory to be dual-licensed
79 +# under the BSD 3-clause and GPL v2 licenses, this appears to be an oversight;
80 +# all files in this (and every) directory are licensed only under the GPL v2.
81 +LICENSE="GPL-2"
82 +SLOT="0"
83 +KEYWORDS="~amd64 ~x86"
84 +IUSE="test tools"
85 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
86 +
87 +# Note that:
88 +# * "pyside2uic" imports the "PySide2.QtGui" and "PySide2.QtWidgets" C
89 +# extensions and hence requires "widgets", which includes "gui" as well.
90 +# * "dev-qt/qtchooser" installs binaries conflicting with the "tools" USE flag.
91 +COMMON_DEPEND="${PYTHON_DEPS}
92 + >=dev-python/pyside2-${PV}[widgets,${PYTHON_USEDEP}]
93 +"
94 +RDEPEND="${COMMON_DEPEND}
95 + tools? ( !dev-qt/qtchooser )
96 +"
97 +DEPEND="${COMMON_DEPEND}
98 + test? ( virtual/pkgconfig )
99 +"
100 +
101 +S=${WORKDIR}/${MY_P}/sources/${PN}
102 +DOCS=( README.md )
103 +
104 +src_prepare() {
105 + cmake_src_prepare
106 +
107 + python_copy_sources
108 +
109 + pyside-tools_prepare() {
110 + pushd "${BUILD_DIR}" >/dev/null || die
111 +
112 + if python_is_python3; then
113 + # Remove Python 2-specific paths.
114 + rm -rf pyside2uic/port_v2 || die
115 +
116 + # Generate proper Python 3 test interfaces with the "-py3" option.
117 + sed -i -e \
118 + 's~${PYSIDERCC_EXECUTABLE}~"${PYSIDERCC_EXECUTABLE} -py3"~' \
119 + tests/rcc/CMakeLists.txt || die
120 + else
121 + # Remove Python 3-specific paths.
122 + rm -rf pyside2uic/port_v3 || die
123 + fi
124 +
125 + # Force testing against the current Python version.
126 + sed -i -e "/pkg-config/ s:shiboken2:&-${EPYTHON}:" \
127 + tests/rcc/run_test.sh || die
128 +
129 + popd >/dev/null || die
130 + }
131 +
132 + python_foreach_impl pyside-tools_prepare
133 +}
134 +
135 +src_configure() {
136 + local mycmakeargs=(
137 + -DBUILD_TESTS=$(usex test)
138 + )
139 +
140 + pyside-tools_configure() {
141 + local mycmakeargs=(
142 + "${mycmakeargs[@]}"
143 + -DPYTHON_CONFIG_SUFFIX="-${EPYTHON}"
144 + )
145 + CMAKE_USE_DIR="${BUILD_DIR}" cmake_src_configure
146 + }
147 +
148 + python_foreach_impl pyside-tools_configure
149 +}
150 +
151 +src_compile() {
152 + pyside-tools_compile() {
153 + CMAKE_USE_DIR="${BUILD_DIR}" cmake_src_compile
154 + }
155 +
156 + python_foreach_impl pyside-tools_compile
157 +}
158 +
159 +src_test() {
160 + # tests work only if tools USE flag enabled
161 + if [ use tools ]; then
162 + pyside-tools_test() {
163 + local -x PYTHONDONTWRITEBYTECODE
164 + CMAKE_USE_DIR="${BUILD_DIR}" virtx cmake_src_test
165 + }
166 +
167 + python_foreach_impl pyside-tools_test
168 + fi
169 +}
170 +
171 +src_install() {
172 + pyside-tools_install() {
173 + CMAKE_USE_DIR="${BUILD_DIR}" cmake_src_install
174 + }
175 +
176 + python_foreach_impl pyside-tools_install
177 +
178 + use tools || rm "${ED}"/usr/bin/{rcc,uic,designer} || die
179 +
180 + # Remove the broken "pyside_tool.py" script. By inspection, this script
181 + # reduces to a noop. Moreover, this script raises the following exception:
182 + # FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/../pyside_tool.py': '/usr/bin/../pyside_tool.py'
183 + rm "${ED}"/usr/bin/pyside_tool.py
184 +}