net-news/sfeed: more flexible theme handling

Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>
This commit is contained in:
Anna (cybertailor) Vyalkova
2022-02-19 22:30:03 +05:00
parent 45751df4e7
commit 5c2ef748c6

View File

@@ -12,21 +12,16 @@ if [[ ${PV} == 9999 ]]; then
inherit git-r3
EGIT_REPO_URI="git://git.codemadness.org/sfeed"
else
SRC_URI="https://www.codemadness.org/releases/sfeed/sfeed-${PV}.tar.gz"
SRC_URI="https://www.codemadness.org/releases/${PN}/${P}.tar.gz"
KEYWORDS="~amd64"
fi
LICENSE="ISC"
SLOT="0"
IUSE="
+ncurses
+theme-mono
theme-mono-highlight
theme-newsboat
theme-templeos
"
REQUIRED_USE="ncurses? ( ^^ ( theme-mono theme-mono-highlight theme-newsboat theme-templeos ) )"
THEMES=( mono{,-highlight} newsboat templeos )
IUSE="+ncurses +$(printf "theme-%s " ${THEMES[@]})"
REQUIRED_USE="ncurses? ( ^^ ( $(printf "theme-%s " ${THEMES[@]}) ) )"
DEPEND="ncurses? ( sys-libs/ncurses )"
RDEPEND="${DEPEND}
@@ -35,23 +30,15 @@ RDEPEND="${DEPEND}
BDEPEND="virtual/pkgconfig"
src_configure() {
if use theme-mono ; then
SFEED_THEME="mono"
elif use theme-mono-highlight ; then
SFEED_THEME="mono_highlight"
elif use theme-newsboat ; then
SFEED_THEME="newsboat"
elif use theme-templeos ; then
SFEED_THEME="templeos"
fi
for name in "${THEMES[@]}"; do
if use theme-${name}; then
SFEED_THEME="${name//-/_}"
fi
done
if use ncurses ; then
SFEED_CURSES="sfeed_curses"
else
SFEED_CURSES=""
fi
use ncurses && SFEED_CURSES="sfeed_curses"
restore_config themes/mono.h themes/mono_highlight.h themes/newsboat.h themes/templeos.h
restore_config $(printf "themes/%s.h " ${THEMES[@]//-/_})
}
src_compile() {
@@ -72,5 +59,5 @@ src_install() {
einstalldocs
save_config themes/mono.h themes/mono_highlight.h themes/newsboat.h themes/templeos.h
save_config $(printf "themes/%s.h " ${THEMES[@]//-/_})
}