summaryrefslogtreecommitdiff
path: root/sys-fs
diff options
context:
space:
mode:
authorJustin Lecher <jlec@gentoo.org>2019-07-07 09:06:51 +0100
committerJustin Lecher <jlec@gentoo.org>2019-07-08 20:34:58 +0100
commit7b6255ed70d718ed032f9806fb206700477de39b (patch)
tree30c67f138a1c94d219af6f096a4bcf6970ec5eb8 /sys-fs
parentdev-python/gcs-oauth2-boto-plugin: Version bump to 2.5 (diff)
downloadgentoo-7b6255ed70d718ed032f9806fb206700477de39b.tar.gz
gentoo-7b6255ed70d718ed032f9806fb206700477de39b.tar.bz2
gentoo-7b6255ed70d718ed032f9806fb206700477de39b.zip
sys-fs/pysize: Restrict test and EAPI=7
Closes: https://bugs.gentoo.org/643440 Closes: https://bugs.gentoo.org/650112 Package-Manager: Portage-2.3.68, Repoman-2.3.12 Signed-off-by: Justin Lecher <jlec@gentoo.org>
Diffstat (limited to 'sys-fs')
-rw-r--r--sys-fs/pysize/files/psyco-0.2-automagic.patch4
-rw-r--r--sys-fs/pysize/pysize-0.2-r1.ebuild8
-rw-r--r--sys-fs/pysize/pysize-0.2-r2.ebuild68
3 files changed, 77 insertions, 3 deletions
diff --git a/sys-fs/pysize/files/psyco-0.2-automagic.patch b/sys-fs/pysize/files/psyco-0.2-automagic.patch
index 696f81fa4feb..72129804b88c 100644
--- a/sys-fs/pysize/files/psyco-0.2-automagic.patch
+++ b/sys-fs/pysize/files/psyco-0.2-automagic.patch
@@ -1,5 +1,5 @@
---- pysize/main.py 2007-03-11 16:09:53.000000000 +0100
-+++ pysize/main.py.new 2009-01-02 00:08:43.384827054 +0100
+--- a/pysize/main.py 2007-03-11 16:09:53.000000000 +0100
++++ b/pysize/main.py.new 2009-01-02 00:08:43.384827054 +0100
@@ -69,17 +69,8 @@
stats.print_stats(40)
os.remove(prof_file)
diff --git a/sys-fs/pysize/pysize-0.2-r1.ebuild b/sys-fs/pysize/pysize-0.2-r1.ebuild
index 00d9596d3c9c..867db7463b78 100644
--- a/sys-fs/pysize/pysize-0.2-r1.ebuild
+++ b/sys-fs/pysize/pysize-0.2-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=5
@@ -18,6 +18,8 @@ IUSE="gtk ncurses"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+RESTRICT="test"
+
RDEPEND="
gtk? ( dev-python/pygtk:2 )
ncurses? ( sys-libs/ncurses:0= )"
@@ -49,6 +51,10 @@ python_prepare_all() {
fi
sed \
+ -e "s:/tmp:${T}:g" \
+ -i tests/tests/*.py tests/*py || die
+
+ sed \
-e '/for ui_run in/s:ui_ascii.run:ui_ascii.run, ui_ascii.run:g' \
-i pysize/main.py || die
diff --git a/sys-fs/pysize/pysize-0.2-r2.ebuild b/sys-fs/pysize/pysize-0.2-r2.ebuild
new file mode 100644
index 000000000000..df91d9b7fc8a
--- /dev/null
+++ b/sys-fs/pysize/pysize-0.2-r2.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python2_7 pypy )
+
+inherit distutils-r1
+
+DESCRIPTION="A graphical and console tool for exploring the size of directories"
+HOMEPAGE="http://guichaz.free.fr/pysize/"
+SRC_URI="http://guichaz.free.fr/${PN}/files/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="gtk ncurses"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RESTRICT="test"
+
+RDEPEND="
+ gtk? ( dev-python/pygtk:2 )
+ ncurses? ( sys-libs/ncurses:0= )"
+DEPEND="${RDEPEND}
+ dev-python/setuptools[${PYTHON_USEDEP}]"
+
+PATCHES=(
+ "${FILESDIR}"/psyco-${PV}-automagic.patch
+ "${FILESDIR}"/${PV}-setuptools-automagic.patch
+ )
+
+python_prepare_all() {
+ if ! use gtk; then
+ sed \
+ -e '/^from pysize.ui.gtk/d' \
+ -e "s~'gtk': ui_gtk.run,~~g" \
+ -e 's:ui_gtk.run,::g' \
+ -i pysize/main.py || die "Failed to remove gtk support"
+ rm -rf pysize/ui/gtk || die "Failed to remove gtk support"
+ fi
+
+ if ! use ncurses; then
+ sed \
+ -e '/^from pysize.ui.curses/d' \
+ -e "s~'curses': ui_curses.run,~~g" \
+ -e 's:ui_curses.run,::g' \
+ -i pysize/main.py || die "Failed to remove ncurses support"
+ rm -rf pysize/ui/curses || die "Failed to remove ncurses support"
+ fi
+
+ sed \
+ -e "s:/tmp:${T}:g" \
+ -i tests/tests/*.py tests/*py || die
+
+ sed \
+ -e '/for ui_run in/s:ui_ascii.run:ui_ascii.run, ui_ascii.run:g' \
+ -i pysize/main.py || die
+
+ distutils-r1_python_prepare_all
+}
+
+python_test() {
+ pushd "${S}"/tests > /dev/null
+ PYTHONPATH=.:../ "${PYTHON}" pysize_tests.py || die "tests failed under ${EPYTHON}"
+ popd > /dev/null
+}