summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Szuba <marecki@gentoo.org>2020-04-22 22:44:15 +0100
committerMarek Szuba <marecki@gentoo.org>2020-04-23 00:47:27 +0100
commitdfc3dd1bac0fb409e346a2813ce0fca107deb2c9 (patch)
treec67708d51e3d97c78c95d429e89ea3529f032543
parentnet-vpn/openvpn: 2.4.9 bump (diff)
downloadgentoo-dfc3dd1bac0fb409e346a2813ce0fca107deb2c9.tar.gz
gentoo-dfc3dd1bac0fb409e346a2813ce0fca107deb2c9.tar.bz2
gentoo-dfc3dd1bac0fb409e346a2813ce0fca107deb2c9.zip
app-emulation/protontricks: re-enable tests
Instead of having to jump through hoops to satisfy setuptools-scm, remove references to that package and seed the version file manually, using the value of ${PV}. Presto, can use GitHub release archives - and by extension run tests - again! Signed-off-by: Marek Szuba <marecki@gentoo.org>
-rw-r--r--app-emulation/protontricks/Manifest1
-rw-r--r--app-emulation/protontricks/files/protontricks-1.4.1_no-setuptools-scm.patch36
-rw-r--r--app-emulation/protontricks/protontricks-1.4.1-r1.ebuild58
3 files changed, 95 insertions, 0 deletions
diff --git a/app-emulation/protontricks/Manifest b/app-emulation/protontricks/Manifest
index fe8223dd60da..07a1ca660a76 100644
--- a/app-emulation/protontricks/Manifest
+++ b/app-emulation/protontricks/Manifest
@@ -1 +1,2 @@
+DIST protontricks-1.4.1.gh.tar.gz 40029 BLAKE2B 3937f69ad1113c0a368117db38cf8bf1b66feea5cc7c509eaee2f7adabdeea724368baa15f51134a5a9749171a34f439878bfda3fc6b813caba11faf7be76373 SHA512 96d4b3aa5b1ca8f7f9bad0859f5984eb29a0bed01f420d108e537deef0436af314e73fcfaccfd58b5b1dc912698404bd4b0157e69ab6a055d65eb3701a60d00b
DIST protontricks-1.4.1.tar.gz 31838 BLAKE2B b8c94a1b96fa7df14eaf1cc6d11cb96e43ae4e8c7bd232687a50cae9c79cf2d0e7864b1af0e1dc4cc20086952e1fcefeb16cb71a9c3a977f6feafad1b17d6857 SHA512 7635c9830afa3c64617514cd86edc7d7f9f33e6e81a1da995ec8bee70adc1cf8b5d9de92036c372134e408d735615b267b46a9afc9246f14ff161cb2ee1fc8f9
diff --git a/app-emulation/protontricks/files/protontricks-1.4.1_no-setuptools-scm.patch b/app-emulation/protontricks/files/protontricks-1.4.1_no-setuptools-scm.patch
new file mode 100644
index 000000000000..fac3ed813d4e
--- /dev/null
+++ b/app-emulation/protontricks/files/protontricks-1.4.1_no-setuptools-scm.patch
@@ -0,0 +1,36 @@
+Since version 1.4.1 upstream has used setuptools-scm to determine the
+current version number. Unfortunately the package in question does not
+support GitHub release archives, using GitHub VCS snapshots would require
+retrieving and updating commit hashes corresponding to release tags, and
+PyPI tarballs do not contain tests. setuptools_scm_git_archive does not
+help because it requires extra files to be included in the repository,
+which upstream has not done.
+
+Seeing as we already know the version number, bypass setuptools_scm
+altogether and create the version file ourselves. For obvious reasons the
+latter cannot be done with a patch alone - have to call sed in src_prepare.
+
+--- a/setup.py
++++ b/setup.py
+@@ -16,9 +16,6 @@
+
+ setup(
+ name="protontricks",
+- use_scm_version={
+- "write_to": "src/protontricks/_version.py"
+- },
+ description=DESCRIPTION,
+ long_description=LONG_DESCRIPTION,
+ author=AUTHOR,
+@@ -28,7 +25,6 @@
+ packages=["protontricks"],
+ package_data={"": ["LICENSE"]},
+ package_dir={"protontricks": "src/protontricks"},
+- setup_requires=["setuptools_scm"],
+ install_requires=["vdf>=2.4"],
+ entry_points={
+ "console_scripts": [
+--- /dev/null
++++ b/src/protontricks/_version.py
+@@ -0,0 +1 @@
++version = '@VERSION@'
diff --git a/app-emulation/protontricks/protontricks-1.4.1-r1.ebuild b/app-emulation/protontricks/protontricks-1.4.1-r1.ebuild
new file mode 100644
index 000000000000..d17ef1b45996
--- /dev/null
+++ b/app-emulation/protontricks/protontricks-1.4.1-r1.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6,7,8} )
+DISTUTILS_SINGLE_IMPL=1
+DISTUTILS_USE_SETUPTOOLS=rdepend
+
+inherit distutils-r1
+
+DESCRIPTION="app-emulation/winetricks wrapper for Proton (Steam Play) games"
+HOMEPAGE="https://github.com/Matoking/protontricks"
+# Will remove the .gh bit come next version bump
+SRC_URI="https://github.com/Matoking/${PN}/archive/${PV}.tar.gz -> ${P}.gh.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="+gui"
+
+RDEPEND="app-emulation/winetricks
+ $(python_gen_cond_dep '
+ dev-python/vdf[${PYTHON_USEDEP}]
+ ')
+ gui? ( gnome-extra/zenity
+ || (
+ app-emulation/winetricks[gtk]
+ app-emulation/winetricks[kde]
+ )
+ )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.4.1_no-setuptools-scm.patch
+)
+
+DOCS=( CHANGELOG.md README.md )
+
+distutils_enable_tests pytest
+
+python_prepare_all() {
+ distutils-r1_python_prepare_all
+ sed -i -e "s/@VERSION@/${PV}/" "${S}"/src/${PN}/_version.py || die
+}
+
+pkg_postinst() {
+ elog
+
+ if ! use gui; then
+ ewarn "Please note that disabling USE=gui does *not* presently remove the --gui command-line option,"
+ ewarn "it just means using this option will fail unless gnome-extra/zenity happens to be installed."
+ ewarn
+ fi
+
+ elog "Protontricks can only find games for which a Proton prefix already exists."
+ elog "Make sure to run a Proton game at least once before trying to use protontricks on it."
+ elog
+}