x11-apps/variety: add 0.9.1

Signed-off-by: tooknox <yt+gentoo@sysv.in>
This commit is contained in:
tooknox committed 2026-09-01 14:07:40 +05:30
1 parent 6c7f6da2e0
commit a0fbf4ff91
2 files changed
+142

No files matched your search

+1
View File
@@ -1 +1,2 @@
DIST variety-0.9.0.tar.gz 738943 BLAKE2B 4992e1709bc631a8dd969ecc279dd38e0ee936f853e31ef1a05ca9ecff7bab052e6ad7a9a388e1264b432eb7851238d1ecd460d0eb8643d037cb481c09016f9e SHA512 ccb76b7d5c378b1e38373e5072a669b065a08f573070b464ac6bf5e47fae048a31a58d0b4fd8647d0dcd9321935b91931605a2ee2c3b6629118450a0bf37d4ed
DIST variety-0.9.1.tar.gz 752523 BLAKE2B d52ffd6ae9f1b57534c3aa36ae09b1f394ca5b330a43c24cea4eb0d2f6136147fd413eb5191bf2c846b662a1e7c9c18c843e83c8e0fd8e701ac0abe488c2c76b SHA512 ea07bb82d2398f3602459439dcdb0f27b26c18d5771f21c3d2e24547aa2f0a4abbde7098d1b204bd013084a47877eaad2e6a668acfb48c34a6703b3efe467b26
+141
View File
@@ -0,0 +1,141 @@
# Copyright 2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{11..14} )
DISTUTILS_USE_PEP517=setuptools
DISTUTILS_SINGLE_IMPL=1
inherit desktop distutils-r1 optfeature xdg
MY_PV="0.9.1"
MY_P="${PN}-${MY_PV}"
DESCRIPTION="Wallpaper downloader and manager for Linux systems"
HOMEPAGE="https://github.com/varietywalls/variety"
SRC_URI="https://github.com/varietywalls/variety/archive/refs/tags/${MY_PV}.tar.gz -> ${MY_P}.tar.gz"
S="${WORKDIR}/${MY_P}"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="test"
#RESTRICT="!test? ( test )"
RESTRICT="test"
PROPERTIES="test_network"
RDEPEND="
$(python_gen_cond_dep '
dev-python/beautifulsoup4[${PYTHON_USEDEP}]
dev-python/configobj[${PYTHON_USEDEP}]
dev-python/dbus-python[${PYTHON_USEDEP}]
dev-python/httplib2[${PYTHON_USEDEP}]
dev-python/lxml[${PYTHON_USEDEP}]
dev-python/packaging[${PYTHON_USEDEP}]
dev-python/pillow[${PYTHON_USEDEP}]
dev-python/pycurl[${PYTHON_USEDEP}]
dev-python/pygobject:3[${PYTHON_USEDEP},cairo]
dev-python/requests[${PYTHON_USEDEP}]
')
media-gfx/imagemagick
media-libs/gexiv2[introspection]
x11-libs/gtk+:3[introspection]
x11-libs/libnotify[introspection]
"
# Trim RDEPEND from legacy versions
# net-libs/webkit-gtk[introspection]
# x11-libs/gdk-pixbuf:2[introspection]
# x11-libs/pango[introspection]
BDEPEND="
sys-devel/gettext
test? (
$(python_gen_cond_dep '
dev-python/pylint[${PYTHON_USEDEP}]
')
)
"
distutils_enable_tests unittest
python_test() {
eunittest -s tests -p '[tT]est*.py'
}
pkg_setup() {
python-single-r1_pkg_setup
}
src_prepare() {
# cleanup upstream GitHub artifacts to avoid incorrect installation paths
rm -f "${S}"/README.md "${S}"/CONTRIBUTING.md "${S}"/AUTHORS || die
# changes.txt is required for preference -> changelog
#rm -f "${S}"/data/ui/changes.txt || die
# variety requires this file; distutils-r1 does not generate it
cat > variety_lib/variety_build_settings.py <<-EOF || die
__variety_data_directory__ = '/usr/share/variety'
EOF
# patch setup.py robustly so setuptools does not try to package
# variety/data and trigger namespace/package QA warnings.
sed -i -e '/package_data={/,/}/ { /package_data={/!d; s/$/},/ }' \
-e 's/include_package_data=True,/include_package_data=False,/g' "${S}"/setup.py || die
# silence deprecated PEP621 license table warning
sed -i -e 's/license = { text = "GPL-3.0-only" }/license = "GPL-3.0-only"/' "${S}"/pyproject.toml || die
# patch varietyconfig.py to make runtime data lookup use /usr/share/variety instead of package resources
sed -i -e 's@import importlib\.resources@import os@' -e '/pkg_files_root = importlib/,/return str(/ {
/pkg_files_root = importlib/d
s@return str(.*@return os.path.join("/usr/share/variety", *path_segments)@
}' "${S}"/variety_lib/varietyconfig.py || die
# make real desktop entry from upstream template
sed -i -e 's/^_Name=/Name=/' -e 's/^_Comment=/Comment=/' "${S}"/variety.desktop || die
distutils-r1_src_prepare
}
src_install() {
distutils-r1_src_install
# install Variety shared data directory
insinto /usr/share/variety
doins -r "${S}"/data/config "${S}"/data/ui "${S}"/data/media "${S}"/data/scripts
# install desktop templates
doins "${S}"/data/variety-autostart.desktop.template
doins "${S}"/data/variety-profile.desktop.template
# compile and install translations from po/*.po
local po lang
for po in po/*.po; do
[[ -f ${po} ]] || continue
lang=${po##*/}
lang=${lang%.po}
dodir /usr/share/locale/${lang}/LC_MESSAGES || die
msgfmt "${po}" -o "${ED}/usr/share/locale/${lang}/LC_MESSAGES/variety.mo" || die "msgfmt failed for ${po}"
done
# install application icon
doicon -s scalable "${S}"/data/icons/scalable/apps/variety.svg
# install desktop entry
domenu "${S}"/variety.desktop
}
pkg_postinst() {
xdg_pkg_postinst
optfeature "displaying systray icon, without it, a classic tray icon will be used" dev-libs/libayatana-appindicator
}
pkg_postrm() {
xdg_pkg_postrm
}