summaryrefslogtreecommitdiff
path: root/dev-python/python-gflags
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/python-gflags')
-rw-r--r--dev-python/python-gflags/Manifest1
-rw-r--r--dev-python/python-gflags/files/python-gflags-3.1.1-script-install.patch33
-rw-r--r--dev-python/python-gflags/metadata.xml14
-rw-r--r--dev-python/python-gflags/python-gflags-3.1.2-r1.ebuild34
4 files changed, 82 insertions, 0 deletions
diff --git a/dev-python/python-gflags/Manifest b/dev-python/python-gflags/Manifest
new file mode 100644
index 000000000000..8e1dfc158b6b
--- /dev/null
+++ b/dev-python/python-gflags/Manifest
@@ -0,0 +1 @@
+DIST python-gflags-3.1.2.tar.gz 52093 BLAKE2B 4275b43ecf2c58f76fee0b1ff4645eb3176a9ae3b68fdd4a059c2f6f659ca1d9b6e4fad152a2fa48f1eb22c467dbc006835c241c21f89c0ca92367e484f34c6f SHA512 7a3c08b6b212cdb9cb7feaa48e3875d1204a4b3a57182508a078331565f70509d00c315400fa0316dbf61ed4d6a6a04ca8c1a2303567d37650d8dfbb329e2f6c
diff --git a/dev-python/python-gflags/files/python-gflags-3.1.1-script-install.patch b/dev-python/python-gflags/files/python-gflags-3.1.1-script-install.patch
new file mode 100644
index 000000000000..4fc791383092
--- /dev/null
+++ b/dev-python/python-gflags/files/python-gflags-3.1.1-script-install.patch
@@ -0,0 +1,33 @@
+From 3bc427f5ba0b612430066d5da0ba7a67252ebc75 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Tue, 9 May 2017 21:47:08 +0200
+Subject: [PATCH] setup.py: Install the script as 'scripts', rather than
+ 'data_files'
+
+Install the Python script using the 'scripts' key rather than
+the 'data_files' hack. This ensures that it is installed
+in the correct location (respecting install options) and its shebang
+is updated to match the correct Python interpreter.
+
+This is the same patch as I've sent back in 2012, rebased on top
+of the newest release.
+---
+ setup.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/setup.py b/setup.py
+index 647db36..1f9e8cb 100644
+--- a/setup.py
++++ b/setup.py
+@@ -39,7 +39,7 @@ setup(name='python-gflags',
+ author_email='google-gflags@googlegroups.com',
+ url='https://github.com/google/python-gflags',
+ packages=['gflags', 'gflags.third_party', 'gflags.third_party.pep257'],
+- data_files=[('bin', ['gflags2man.py'])],
++ scripts=['gflags2man.py'],
+ requires=['six'],
+ classifiers=[
+ 'Programming Language :: Python :: 2.7',
+--
+2.13.0.rc2
+
diff --git a/dev-python/python-gflags/metadata.xml b/dev-python/python-gflags/metadata.xml
new file mode 100644
index 000000000000..443537268619
--- /dev/null
+++ b/dev-python/python-gflags/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ <name>Python</name>
+ </maintainer>
+ <stabilize-allarches/>
+ <upstream>
+ <remote-id type="github">google/python-gflags</remote-id>
+ <remote-id type="pypi">python-gflags</remote-id>
+ </upstream>
+ <origin>gentoo-staging</origin>
+</pkgmetadata>
diff --git a/dev-python/python-gflags/python-gflags-3.1.2-r1.ebuild b/dev-python/python-gflags/python-gflags-3.1.2-r1.ebuild
new file mode 100644
index 000000000000..9a25317e4632
--- /dev/null
+++ b/dev-python/python-gflags/python-gflags-3.1.2-r1.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DISTUTILS_USE_SETUPTOOLS=no
+PYTHON_COMPAT=( python{2_7,3_{6,7,8}} )
+
+inherit distutils-r1
+
+DESCRIPTION="Google's Python argument parsing library"
+HOMEPAGE="https://github.com/google/python-gflags"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm ~arm64 hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc x86"
+
+RDEPEND="
+ dev-python/six[${PYTHON_USEDEP}]"
+
+DEPEND="
+ ${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.1.1-script-install.patch
+)
+
+python_test() {
+ # note: each test needs to be run separately, otherwise they fail
+ "${PYTHON}" -m gflags._helpers_test -v || die
+ "${PYTHON}" -m gflags.flags_formatting_test -v || die
+ "${PYTHON}" -m gflags.flags_unicode_literals_test -v || die
+}