public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: app-misc/rmlint/, app-misc/rmlint/files/
@ 2021-09-09 21:00 Louis Sautier
  0 siblings, 0 replies; 2+ messages in thread
From: Louis Sautier @ 2021-09-09 21:00 UTC (permalink / raw
  To: gentoo-commits

commit:     cb7eb2d9bba3a28ef8c241ab0e6c6a9caf959991
Author:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
AuthorDate: Thu Sep  9 11:23:38 2021 +0000
Commit:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
CommitDate: Thu Sep  9 21:00:28 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cb7eb2d9

app-misc/rmlint: fix build and tests without native symlinks

Closes: https://bugs.gentoo.org/812197
Signed-off-by: Louis Sautier <sbraz <AT> gentoo.org>

 app-misc/rmlint/files/rmlint-2.10.1-fix-cc.patch | 40 ++++++++++++++++++++++++
 app-misc/rmlint/rmlint-2.10.1.ebuild             |  4 ++-
 2 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/app-misc/rmlint/files/rmlint-2.10.1-fix-cc.patch b/app-misc/rmlint/files/rmlint-2.10.1-fix-cc.patch
new file mode 100644
index 00000000000..78aac09ce2a
--- /dev/null
+++ b/app-misc/rmlint/files/rmlint-2.10.1-fix-cc.patch
@@ -0,0 +1,40 @@
+commit 41056d132ae772b3c050020d68b7daa585e4143c
+Author: Louis Sautier <sautier.louis@gmail.com>
+Date:   Thu Sep 9 13:29:37 2021 +0200
+
+    Never hardcode compiler, select it based on CC environment variable
+
+diff --git a/SConstruct b/SConstruct
+index 7e12d413..20b080da 100755
+--- a/SConstruct
++++ b/SConstruct
+@@ -37,8 +37,9 @@ Export('VERSION_MAJOR VERSION_MINOR VERSION_PATCH VERSION_NAME')
+ def check_gcc_version(context):
+     context.Message('Checking for GCC version... ')
+ 
++    gcc = os.environ.get("CC", "gcc")
+     try:
+-        v = subprocess.check_output("printf '%s\n' __GNUC__ | gcc -E -P -", shell=True)
++        v = subprocess.check_output("printf '%s\n' __GNUC__ | {} -E -P -".format(gcc), shell=True)
+         try:
+             v = int(v)
+             context.Result(str(v))
+diff --git a/tests/test_types/test_nonstripped.py b/tests/test_types/test_nonstripped.py
+index a18648c9..d3190d1b 100644
+--- a/tests/test_types/test_nonstripped.py
++++ b/tests/test_types/test_nonstripped.py
+@@ -21,8 +21,12 @@ def create_binary(path, stripped=False):
+     path = path + '.stripped' if stripped else path + '.nonstripped'
+     full_path = os.path.join(TESTDIR_NAME, path)
+ 
+-    command = 'echo \'{src}\' | cc -o {path} {option} -std=c99 -xc -'.format(
+-        src=SOURCE, path=full_path, option=('-s' if stripped else '-ggdb3')
++    cc = os.environ.get("CC", "cc")
++    command = 'echo \'{src}\' | {cc} -o {path} {option} -std=c99 -xc -'.format(
++        cc=cc,
++        src=SOURCE,
++        path=full_path,
++        option=('-s' if stripped else '-ggdb3')
+     )
+     subprocess.call(command, shell=True)
+ 

diff --git a/app-misc/rmlint/rmlint-2.10.1.ebuild b/app-misc/rmlint/rmlint-2.10.1.ebuild
index 11a0d0b2e17..aaa9a53dd04 100644
--- a/app-misc/rmlint/rmlint-2.10.1.ebuild
+++ b/app-misc/rmlint/rmlint-2.10.1.ebuild
@@ -68,6 +68,8 @@ PATCHES=(
 	"${FILESDIR}/${PN}-2.10.1-skip-tests.patch"
 	# https://github.com/sahib/rmlint/pull/523
 	"${FILESDIR}/${PN}-2.10.1-x86-fix-size.patch"
+	# https://github.com/sahib/rmlint/pull/526
+	"${FILESDIR}/${PN}-2.10.1-fix-cc.patch"
 )
 
 src_prepare() {
@@ -82,7 +84,7 @@ src_prepare() {
 
 src_configure() {
 	# Needed for USE=-native-symlinks
-	tc-export CC
+	tc-export AR CC
 	scons_opts=(
 		VERBOSE=1
 		$(use_with doc docs)


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-misc/rmlint/, app-misc/rmlint/files/
@ 2023-08-10  0:59 Louis Sautier
  0 siblings, 0 replies; 2+ messages in thread
From: Louis Sautier @ 2023-08-10  0:59 UTC (permalink / raw
  To: gentoo-commits

commit:     9274f3c655d55c0e1c35e2d70202b0144c8ad4ca
Author:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 10 00:43:22 2023 +0000
Commit:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
CommitDate: Thu Aug 10 00:56:37 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9274f3c6

app-misc/rmlint: add 2.10.2

This new version fixes several bugs including broken tests.
It also removes the dependency of the GUI on Polkit (#828111), which,
according to https://github.com/sahib/rmlint/commit/a807253e, isn't used
for anything at the moment.

Bug: https://bugs.gentoo.org/828111
Signed-off-by: Louis Sautier <sbraz <AT> gentoo.org>

 app-misc/rmlint/Manifest                           |   1 +
 .../files/rmlint-2.10.2-fix-sorting-tests.patch    |  51 ++++++++
 app-misc/rmlint/rmlint-2.10.2.ebuild               | 136 +++++++++++++++++++++
 3 files changed, 188 insertions(+)

diff --git a/app-misc/rmlint/Manifest b/app-misc/rmlint/Manifest
index 09581c7bdc75..ce83f677e26d 100644
--- a/app-misc/rmlint/Manifest
+++ b/app-misc/rmlint/Manifest
@@ -1 +1,2 @@
 DIST rmlint-2.10.1.tar.gz 2494474 BLAKE2B 40219ff64d54f0e2fc66a958c6ca51520152f77f9038e9756ab601da5180502528be7b2d750c85b5991c31db96c3eb7415841084b6c90db103dc212947864034 SHA512 a1281359798816dadaf3a1e706e671dc63edf8f7d176c114a924a1e03fc9ad6fa54d10de701b09b5e364a9a815e0d11bdbef3d16fb7fec74eb85af20a106db1a
+DIST rmlint-2.10.2.tar.gz 2499695 BLAKE2B 07c887f660685b5ec86c8a448d482c96cc40b129fc906d0c31c01e07617bf0167055145050c21b565cb1551ccc1ce6329593d92473c371125b2c91d31d9d601c SHA512 8f8d58892785e9012cb15f3e89480d9d04772fa3f923064520bf17afcc8948b1a24d6f8399176a1a26bd5036553c605958f3720e40cf6cba135a4f3381131180

diff --git a/app-misc/rmlint/files/rmlint-2.10.2-fix-sorting-tests.patch b/app-misc/rmlint/files/rmlint-2.10.2-fix-sorting-tests.patch
new file mode 100644
index 000000000000..77f47b18c853
--- /dev/null
+++ b/app-misc/rmlint/files/rmlint-2.10.2-fix-sorting-tests.patch
@@ -0,0 +1,51 @@
+From 69d9dcb60c9e88084aba37545c77fd02fdc7df33 Mon Sep 17 00:00:00 2001
+From: Cebtenzzre <cebtenzzre@gmail.com>
+Date: Wed, 9 Aug 2023 18:42:00 -0400
+Subject: [PATCH] tests: fix failures caused by certain directory names
+
+Fixes #630
+--- a/tests/test_options/test_sorting.py
++++ b/tests/test_options/test_sorting.py
+@@ -158,15 +158,15 @@ def test_sort_by_regex():
+     create_file('xxx', 'aaab')
+     create_file('xxx', 'b')
+     create_file('xxx', 'c')
+-    create_file('xxx', '1/c')
+-    create_file('xxx', 'd')
++    create_file('xxx', 'd/e')
++    create_file('xxx', 'f')
+ 
+-    head, *data, footer = run_rmlint("-S 'r<1/c>x<d$>a'")
++    head, *data, footer = run_rmlint("-S 'r<d/e>x<f$>a'")
+ 
+     paths = [p['path'] for p in data]
+ 
+-    assert paths[0].endswith('1/c')
+-    assert paths[1].endswith('d')
++    assert paths[0].endswith('d/e')
++    assert paths[1].endswith('f')
+     assert paths[2].endswith('aaaa')
+     assert paths[3].endswith('aaab')
+     assert paths[4].endswith('b')
+@@ -206,16 +206,16 @@ def test_sort_by_regex_bad_input():
+ # regression test for GitHub issue #484
+ @with_setup(usual_setup_func, usual_teardown_func)
+ def test_regex_multiple_matches():
+-    paths = [
+-        '1/a', '1/a2', '1/b',
+-        '2/a', '2/a2', '2/b',
+-    ]
++    paths = [os.path.join(dname, bname)
++             for dname in ['unique_1', 'unique_2']
++             for bname in ['a', 'a2', 'b']]
++
+     for path in reversed(paths):
+         create_file('xxx', path)
+ 
+     # when multiple paths matched a regex, rmlint would not try the next criterion
+     # check multiple times because sort order was inconsistent before the fix
+     for _ in range(3):
+-        head, *data, foot = run_rmlint("-S 'r<1>x<a>l'")
++        head, *data, foot = run_rmlint("-S 'r<unique_1>x<a>l'")
+         assert len(data) == len(paths)
+         assert [e['path'] for e in data] == [os.path.join(TESTDIR_NAME, p) for p in paths]

diff --git a/app-misc/rmlint/rmlint-2.10.2.ebuild b/app-misc/rmlint/rmlint-2.10.2.ebuild
new file mode 100644
index 000000000000..93b2c479581f
--- /dev/null
+++ b/app-misc/rmlint/rmlint-2.10.2.ebuild
@@ -0,0 +1,136 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..11} )
+
+inherit gnome2-utils python-single-r1 scons-utils toolchain-funcs
+
+DESCRIPTION="Extremely fast tool to remove duplicates and other lint from your filesystem"
+HOMEPAGE="https://rmlint.readthedocs.io/"
+SRC_URI="https://github.com/sahib/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc gui nls test"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+	dev-libs/glib:2
+	dev-libs/json-glib
+	virtual/libelf:0=
+"
+RDEPEND="
+	${DEPEND}
+	gui? (
+		${PYTHON_DEPS}
+		gnome-base/librsvg:2[introspection]
+		x11-libs/gdk-pixbuf[introspection]
+		x11-libs/gtk+:3[introspection]
+		x11-libs/gtksourceview:3.0[introspection]
+		x11-libs/pango[introspection]
+		$(python_gen_cond_dep '
+			dev-python/colorlog[${PYTHON_USEDEP}]
+			dev-python/pygobject:3[${PYTHON_USEDEP}]
+		')
+	)
+"
+BDEPEND="
+	virtual/pkgconfig
+	doc? (
+		${PYTHON_DEPS}
+		$(python_gen_cond_dep '
+			dev-python/sphinx[${PYTHON_USEDEP}]
+			dev-python/sphinx-bootstrap-theme[${PYTHON_USEDEP}]
+		')
+	)
+	nls? ( sys-devel/gettext )
+	test? (
+		${PYTHON_DEPS}
+		app-shells/dash
+		$(python_gen_cond_dep '
+			dev-python/nose[${PYTHON_USEDEP}]
+			dev-python/parameterized[${PYTHON_USEDEP}]
+			dev-python/psutil[${PYTHON_USEDEP}]
+			dev-python/pyxattr[${PYTHON_USEDEP}]
+		')
+	)
+"
+
+DOCS=(CHANGELOG.md README.rst)
+PATCHES=(
+	# The build system tries to override several CFLAGS
+	"${FILESDIR}/${PN}-2.10.1-cflags.patch"
+	# https://github.com/sahib/rmlint/pull/520
+	"${FILESDIR}/${PN}-2.10.1-scons.patch"
+	# Skip problematic tests
+	"${FILESDIR}/${PN}-2.10.1-skip-tests.patch"
+	# https://github.com/sahib/rmlint/pull/526
+	"${FILESDIR}/${PN}-2.10.1-fix-cc.patch"
+	# https://github.com/sahib/rmlint/commit/69d9dcb60c9e88084aba37545c77fd02fdc7df33
+	"${FILESDIR}/${P}-fix-sorting-tests.patch"
+)
+
+src_prepare() {
+	default
+	# Force the GUI to run with the correct PYTHON_SINGLE_TARGET
+	sed -i "/const char \*commands/s/python3/${EPYTHON}/" \
+		lib/cmdline.c || die
+}
+
+src_configure() {
+	# Needed for USE=-native-symlinks
+	tc-export AR CC
+	scons_opts=(
+		VERBOSE=1
+		$(use_with doc docs)
+		$(use_with gui)
+		$(use_with nls gettext)
+	)
+	escons "${scons_opts[@]}" config
+}
+
+src_compile() {
+	escons "${scons_opts[@]}"
+}
+
+src_test() {
+	RM_TS_DIR="${T}/tests" nosetests -s -v -a '!slow' || \
+		die "Tests failed"
+}
+
+src_install() {
+	escons "${scons_opts[@]}" --prefix="${ED}/usr" --actual-prefix="${EPREFIX}/usr" install
+
+	# https://github.com/sahib/rmlint/pull/525
+	if use doc; then
+		gzip -d "${ED}/usr/share/man/man1/rmlint.1.gz" || die
+	fi
+	if use gui; then
+		python_optimize
+	fi
+	einstalldocs
+}
+
+pkg_preinst() {
+	if use gui; then
+		gnome2_schemas_savelist
+	fi
+}
+
+pkg_postinst() {
+	if use gui; then
+		gnome2_schemas_update
+		xdg_icon_cache_update
+	fi
+}
+
+pkg_postrm() {
+	if use gui; then
+		gnome2_schemas_update
+		xdg_icon_cache_update
+	fi
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-10  0:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-10  0:59 [gentoo-commits] repo/gentoo:master commit in: app-misc/rmlint/, app-misc/rmlint/files/ Louis Sautier
  -- strict thread matches above, loose matches on Subject: below --
2021-09-09 21:00 Louis Sautier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox