You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
148 lines
3.3 KiB
148 lines
3.3 KiB
1 year ago
|
# Copyright 1999-2023 Gentoo Authors
|
||
3 years ago
|
# Distributed under the terms of the GNU General Public License v2
|
||
|
|
||
1 year ago
|
EAPI=8
|
||
3 years ago
|
|
||
1 year ago
|
PYTHON_COMPAT=( python3_{9..11} )
|
||
3 years ago
|
|
||
1 year ago
|
inherit gnome2-utils python-single-r1 scons-utils toolchain-funcs
|
||
3 years ago
|
|
||
|
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}
|
||
1 year ago
|
gnome-base/librsvg:2[introspection]
|
||
|
sys-auth/polkit[introspection]
|
||
|
x11-libs/gdk-pixbuf[introspection]
|
||
|
x11-libs/gtk+:3[introspection]
|
||
|
x11-libs/gtksourceview:3.0[introspection]
|
||
|
x11-libs/pango[introspection]
|
||
3 years ago
|
$(python_gen_cond_dep '
|
||
2 years ago
|
dev-python/colorlog[${PYTHON_USEDEP}]
|
||
|
dev-python/pygobject:3[${PYTHON_USEDEP}]
|
||
3 years ago
|
')
|
||
|
)
|
||
|
"
|
||
|
BDEPEND="
|
||
|
virtual/pkgconfig
|
||
|
doc? (
|
||
|
${PYTHON_DEPS}
|
||
|
$(python_gen_cond_dep '
|
||
2 years ago
|
dev-python/sphinx[${PYTHON_USEDEP}]
|
||
|
dev-python/sphinx-bootstrap-theme[${PYTHON_USEDEP}]
|
||
3 years ago
|
')
|
||
|
)
|
||
|
nls? ( sys-devel/gettext )
|
||
|
test? (
|
||
|
${PYTHON_DEPS}
|
||
|
app-shells/dash
|
||
|
$(python_gen_cond_dep '
|
||
2 years ago
|
dev-python/nose[${PYTHON_USEDEP}]
|
||
|
dev-python/parameterized[${PYTHON_USEDEP}]
|
||
|
dev-python/psutil[${PYTHON_USEDEP}]
|
||
|
dev-python/pyxattr[${PYTHON_USEDEP}]
|
||
3 years ago
|
')
|
||
|
)
|
||
|
"
|
||
|
|
||
|
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"
|
||
|
# https://github.com/sahib/rmlint/pull/521
|
||
|
"${FILESDIR}/${PN}-2.10.1-fix-tests.patch"
|
||
|
# Skip problematic tests
|
||
|
"${FILESDIR}/${PN}-2.10.1-skip-tests.patch"
|
||
|
# https://github.com/sahib/rmlint/pull/523
|
||
|
"${FILESDIR}/${PN}-2.10.1-x86-fix-size.patch"
|
||
3 years ago
|
# https://github.com/sahib/rmlint/pull/526
|
||
|
"${FILESDIR}/${PN}-2.10.1-fix-cc.patch"
|
||
1 year ago
|
# https://github.com/sahib/rmlint/issues/608#issuecomment-1406811107
|
||
|
"${FILESDIR}/${PN}-2.10.1-fix-gui-install.patch"
|
||
3 years ago
|
)
|
||
|
|
||
|
src_prepare() {
|
||
|
default
|
||
1 year ago
|
# Force the GUI to run with the correct PYTHON_SINGLE_TARGET
|
||
|
sed -i "/const char \*commands/s/python3/${EPYTHON}/" \
|
||
|
lib/cmdline.c || die
|
||
3 years ago
|
if use test && use x86; then
|
||
|
# Skip part of a test until this is fixed:
|
||
|
# https://github.com/sahib/rmlint/issues/522
|
||
|
sed -i '/--size 0-18446744073709551615\.1/d' \
|
||
|
tests/test_options/test_size.py || die
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
src_configure() {
|
||
|
# Needed for USE=-native-symlinks
|
||
3 years ago
|
tc-export AR CC
|
||
3 years ago
|
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
|
||
|
}
|