diff options
author | Miroslav Šulc <fordfrog@gentoo.org> | 2020-12-26 10:18:40 +0100 |
---|---|---|
committer | Miroslav Šulc <fordfrog@gentoo.org> | 2020-12-26 10:19:51 +0100 |
commit | 4ad700c6777d38c4312473076db545fed88f48cf (patch) | |
tree | 9b146c9eb3232eeb8a4a123104cfe443c09091d2 /dev-python/pyside2-tools | |
parent | sys-boot/silo: stable 1.4.14_p20200602 for sparc, bug #759655 (diff) | |
download | gentoo-4ad700c6777d38c4312473076db545fed88f48cf.tar.gz gentoo-4ad700c6777d38c4312473076db545fed88f48cf.tar.bz2 gentoo-4ad700c6777d38c4312473076db545fed88f48cf.zip |
dev-python/pyside2-tools: added new ebuild
it will be needed for media-gfx/freecad once it gets back the the tree
used ebuild by Cecil Curry (leycec/raiagent overlay)
minor changes:
1) bump to 5.15.1
2) dropped py3_9 because it's missing on deps
3) moved from cmake-utils to cmake
4) skipping tests if tools USE flag is not set as the tests need the tools
Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
Diffstat (limited to 'dev-python/pyside2-tools')
-rw-r--r-- | dev-python/pyside2-tools/Manifest | 1 | ||||
-rw-r--r-- | dev-python/pyside2-tools/metadata.xml | 11 | ||||
-rw-r--r-- | dev-python/pyside2-tools/pyside2-tools-5.15.1.ebuild | 125 |
3 files changed, 137 insertions, 0 deletions
diff --git a/dev-python/pyside2-tools/Manifest b/dev-python/pyside2-tools/Manifest new file mode 100644 index 000000000000..0d5e684462d4 --- /dev/null +++ b/dev-python/pyside2-tools/Manifest @@ -0,0 +1 @@ +DIST pyside-setup-opensource-src-5.15.1.tar.xz 3454052 BLAKE2B c7190dff493434064976a4604fb5858d2e20c1b98098ccd6e5c4c69d0b67ae9f4bf970e2ab42b634208ea96aab31b21f3dfb5f18fddd0bdaab655bba729e4449 SHA512 f14c7037367799005fff73d9fc8e7998db1895700911adf34dfabdeb4db486c7b28ba2afb3eaee37c58f4099b00e4a86917b8f7d85f274026bddfc090658b306 diff --git a/dev-python/pyside2-tools/metadata.xml b/dev-python/pyside2-tools/metadata.xml new file mode 100644 index 000000000000..e31c29a6f7d7 --- /dev/null +++ b/dev-python/pyside2-tools/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>fordfrog@gentoo.org</email> + <name>Miroslav Šulc</name> + </maintainer> + <use> + <flag name="tools">Install supplementary tools (rcc, uic, designer)</flag> + </use> +</pkgmetadata> diff --git a/dev-python/pyside2-tools/pyside2-tools-5.15.1.ebuild b/dev-python/pyside2-tools/pyside2-tools-5.15.1.ebuild new file mode 100644 index 000000000000..165134f5b6a3 --- /dev/null +++ b/dev-python/pyside2-tools/pyside2-tools-5.15.1.ebuild @@ -0,0 +1,125 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +# TODO: Add PyPy once officially supported. See also: +# https://bugreports.qt.io/browse/PYSIDE-535 +PYTHON_COMPAT=( python3_{6..8} ) +CMAKE_IN_SOURCE_BUILD=1 + +inherit cmake python-r1 virtualx + +MY_P=pyside-setup-opensource-src-${PV} + +DESCRIPTION="PySide development tools (lupdate, rcc, uic)" +HOMEPAGE="https://wiki.qt.io/PySide2" +SRC_URI="https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-${PV}-src/${MY_P}.tar.xz" + +# Though "LICENSE-uic" suggests the "pyside2uic" directory to be dual-licensed +# under the BSD 3-clause and GPL v2 licenses, this appears to be an oversight; +# all files in this (and every) directory are licensed only under the GPL v2. +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="test tools" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +# Note that: +# * "pyside2uic" imports the "PySide2.QtGui" and "PySide2.QtWidgets" C +# extensions and hence requires "widgets", which includes "gui" as well. +# * "dev-qt/qtchooser" installs binaries conflicting with the "tools" USE flag. +COMMON_DEPEND="${PYTHON_DEPS} + >=dev-python/pyside2-${PV}[widgets,${PYTHON_USEDEP}] +" +RDEPEND="${COMMON_DEPEND} + tools? ( !dev-qt/qtchooser ) +" +DEPEND="${COMMON_DEPEND} + test? ( virtual/pkgconfig ) +" + +S=${WORKDIR}/${MY_P}/sources/${PN} +DOCS=( README.md ) + +src_prepare() { + cmake_src_prepare + + python_copy_sources + + pyside-tools_prepare() { + pushd "${BUILD_DIR}" >/dev/null || die + + if python_is_python3; then + # Remove Python 2-specific paths. + rm -rf pyside2uic/port_v2 || die + + # Generate proper Python 3 test interfaces with the "-py3" option. + sed -i -e \ + 's~${PYSIDERCC_EXECUTABLE}~"${PYSIDERCC_EXECUTABLE} -py3"~' \ + tests/rcc/CMakeLists.txt || die + else + # Remove Python 3-specific paths. + rm -rf pyside2uic/port_v3 || die + fi + + # Force testing against the current Python version. + sed -i -e "/pkg-config/ s:shiboken2:&-${EPYTHON}:" \ + tests/rcc/run_test.sh || die + + popd >/dev/null || die + } + + python_foreach_impl pyside-tools_prepare +} + +src_configure() { + local mycmakeargs=( + -DBUILD_TESTS=$(usex test) + ) + + pyside-tools_configure() { + local mycmakeargs=( + "${mycmakeargs[@]}" + -DPYTHON_CONFIG_SUFFIX="-${EPYTHON}" + ) + CMAKE_USE_DIR="${BUILD_DIR}" cmake_src_configure + } + + python_foreach_impl pyside-tools_configure +} + +src_compile() { + pyside-tools_compile() { + CMAKE_USE_DIR="${BUILD_DIR}" cmake_src_compile + } + + python_foreach_impl pyside-tools_compile +} + +src_test() { + # tests work only if tools USE flag enabled + if [ use tools ]; then + pyside-tools_test() { + local -x PYTHONDONTWRITEBYTECODE + CMAKE_USE_DIR="${BUILD_DIR}" virtx cmake_src_test + } + + python_foreach_impl pyside-tools_test + fi +} + +src_install() { + pyside-tools_install() { + CMAKE_USE_DIR="${BUILD_DIR}" cmake_src_install + } + + python_foreach_impl pyside-tools_install + + use tools || rm "${ED}"/usr/bin/{rcc,uic,designer} || die + + # Remove the broken "pyside_tool.py" script. By inspection, this script + # reduces to a noop. Moreover, this script raises the following exception: + # FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/../pyside_tool.py': '/usr/bin/../pyside_tool.py' + rm "${ED}"/usr/bin/pyside_tool.py +} |