~q3cpma/portage-overlay

851bfac4f15d1280ae9a88b2970b2363d39de91a — q3cpma 3 months ago 6e44a8e
Add nsxiv
Bump cyanrip, nicotine+, gtk+
Fork dunst to add xdg USE flag
Bump st and patches (add blinking cursor patch and USE flag too)
Remove mpv
13 files changed, 273 insertions(+), 896 deletions(-)

A media-gfx/nsxiv/metadata.xml
A media-gfx/nsxiv/nsxiv-29.ebuild
A media-gfx/nsxiv/nsxiv-9999.ebuild
R media-sound/cyanrip/{cyanrip-0.7.0.ebuild => cyanrip-0.8.1.ebuild}
D media-video/mpv/mpv-9999.ebuild
M net-p2p/nicotine+/metadata.xml
R net-p2p/nicotine+/{nicotine+-3.1.1.ebuild => nicotine+-3.2.2.ebuild}
D x11-libs/gtk+/gtk+-3.24.22.ebuild
D x11-libs/gtk+/gtk+-3.24.24-r1.ebuild
R x11-libs/gtk+/{gtk+-3.24.29.ebuild => gtk+-3.24.31.ebuild}
A x11-misc/dunst/dunst-1.8.1.ebuild
A x11-misc/dunst/metadata.xml
R x11-terms/st/{st-0.8.4.ebuild => st-0.8.5.ebuild}
A media-gfx/nsxiv/metadata.xml => media-gfx/nsxiv/metadata.xml +12 -0
@@ 0,0 1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
	<use>
	  <flag name="exif">Use media-libs/libexif for uto-orientation and exif thumbnails</flag>
	  <flag name="gif">Use media-libs/giflib for animated gif playback</flag>
	  <flag name="status-bar">Enable the status bar via x11-libs/libXft, media-libs/freetype and media-libs/fontconfig</flag>
	</use>
	<upstream>
		<remote-id type="github">muennich/sxiv</remote-id>
	</upstream>
</pkgmetadata>

A media-gfx/nsxiv/nsxiv-29.ebuild => media-gfx/nsxiv/nsxiv-29.ebuild +68 -0
@@ 0,0 1,68 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit xdg-utils savedconfig toolchain-funcs

if [[ ${PV} == "9999" ]] ; then
	EGIT_REPO_URI="https://github.com/nsxiv/nsxiv"
	inherit git-r3
else
	SRC_URI="https://github.com/nsxiv/nsxiv/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
	KEYWORDS="~amd64 arm64 ppc64 ~riscv x86"
fi

DESCRIPTION="Neo Simple (or small or suckless) X Image Viewer"
HOMEPAGE="https://github.com/nsxiv/nsxiv"

LICENSE="GPL-2"
SLOT="0"
IUSE="exif gif +jpeg +png +status-bar webp"

RDEPEND="
	exif? ( media-libs/libexif )
	gif? ( media-libs/giflib:0= )
	status-bar? (
		x11-libs/libXft
		media-libs/freetype:2[X]
		media-libs/fontconfig
	)
	media-libs/imlib2[X,gif?,jpeg?,png?,webp?]
	x11-libs/libX11
"
DEPEND="${RDEPEND}"

src_prepare() {
	restore_config config.h
	sed -i 's#^install: all$#install:#' Makefile
	default
}

src_compile() {
	emake V=1 CC="$(tc-getCC)" \
		HAVE_INOTIFY=1
		HAVE_LIBFONTS=$(usex status-bar 1 0) \
		HAVE_LIBEXIF=$(usex exif 1 0) \
		HAVE_GIFLIB=$(usex gif 1 0) \
		HAVE_LIBWEBP=0 # Needs =media-libs/imlib2>=1.7.5
}

src_install() {
	for target in install{,-icon,-desktop}; do
		emake DESTDIR="${ED}" PREFIX=/usr $target
	done
	dodoc README.md

	save_config config.h
}

pkg_postinst() {
	xdg_desktop_database_update
	xdg_icon_cache_update
}

pkg_postrm() {
	xdg_desktop_database_update
	xdg_icon_cache_update
}

A media-gfx/nsxiv/nsxiv-9999.ebuild => media-gfx/nsxiv/nsxiv-9999.ebuild +68 -0
@@ 0,0 1,68 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit xdg-utils savedconfig toolchain-funcs

if [[ ${PV} == "9999" ]] ; then
	EGIT_REPO_URI="https://github.com/nsxiv/nsxiv"
	inherit git-r3
else
	SRC_URI="https://github.com/nsxiv/nsxiv/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
	KEYWORDS="~amd64 arm64 ppc64 ~riscv x86"
fi

DESCRIPTION="Neo Simple (or small or suckless) X Image Viewer"
HOMEPAGE="https://github.com/nsxiv/nsxiv"

LICENSE="GPL-2"
SLOT="0"
IUSE="exif gif +jpeg +png +status-bar webp"

RDEPEND="
	exif? ( media-libs/libexif )
	gif? ( media-libs/giflib:0= )
	status-bar? (
		x11-libs/libXft
		media-libs/freetype:2[X]
		media-libs/fontconfig
	)
	media-libs/imlib2[X,gif?,jpeg?,png?,webp?]
	x11-libs/libX11
"
DEPEND="${RDEPEND}"

src_prepare() {
	restore_config config.h
	sed -i 's#^install: all$#install:#' Makefile
	default
}

src_compile() {
	emake V=1 CC="$(tc-getCC)" \
		HAVE_INOTIFY=1
		HAVE_LIBFONTS=$(usex status-bar 1 0) \
		HAVE_LIBEXIF=$(usex exif 1 0) \
		HAVE_GIFLIB=$(usex gif 1 0) \
		HAVE_LIBWEBP=0 # Needs =media-libs/imlib2>=1.7.5
}

src_install() {
	for target in install{,-icon,-desktop}; do
		emake DESTDIR="${ED}" PREFIX=/usr $target
	done
	dodoc README.md

	save_config config.h
}

pkg_postinst() {
	xdg_desktop_database_update
	xdg_icon_cache_update
}

pkg_postrm() {
	xdg_desktop_database_update
	xdg_icon_cache_update
}

R media-sound/cyanrip/cyanrip-0.7.0.ebuild => media-sound/cyanrip/cyanrip-0.8.1.ebuild +0 -0
D media-video/mpv/mpv-9999.ebuild => media-video/mpv/mpv-9999.ebuild +0 -360
@@ 1,360 0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

LUA_COMPAT=( lua5-{1..2} luajit )
PYTHON_COMPAT=( python3_{8..10} )
PYTHON_REQ_USE='threads(+)'

WAF_PV=2.0.9

inherit bash-completion-r1 flag-o-matic lua-single optfeature pax-utils python-r1 toolchain-funcs waf-utils xdg-utils

DESCRIPTION="Media player based on MPlayer and mplayer2"
HOMEPAGE="https://mpv.io/ https://github.com/mpv-player/mpv"

if [[ ${PV} != *9999* ]]; then
	SRC_URI="https://github.com/mpv-player/mpv/archive/v${PV}.tar.gz -> ${P}.tar.gz"
	KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ppc ppc64 ~riscv x86 ~amd64-linux"
	DOCS=( RELEASE_NOTES )
else
	EGIT_REPO_URI="https://github.com/mpv-player/mpv.git"
	inherit git-r3
	DOCS=(); SRC_URI=""
fi
SRC_URI+=" https://waf.io/waf-${WAF_PV}"
DOCS+=( README.md DOCS/{client-api,interface}-changes.rst )

# See Copyright in sources and Gentoo bug 506946. Waf is BSD, libmpv is ISC.
LICENSE="LGPL-2.1+ GPL-2+ BSD ISC"
SLOT="0"
IUSE="+alsa aqua archive bluray cdda +cli coreaudio cplugins cuda debug
	  doc drm dvb dvd +egl gamepad gbm +iconv jack javascript jpeg lcms
	  libcaca libmpv +lua openal +opengl pulseaudio raspberry-pi
	  rubberband sdl selinux test tools +uchardet vaapi vapoursynth
	  vdpau vulkan wayland +X +xv zlib zimg"

REQUIRED_USE="
	|| ( cli libmpv )
	aqua? ( opengl )
	cuda? ( opengl )
	egl? ( || ( gbm X wayland ) )
	gamepad? ( sdl )
	gbm? ( drm egl opengl )
	lcms? ( opengl )
	lua? ( ${LUA_REQUIRED_USE} )
	opengl? ( || ( aqua egl X raspberry-pi !cli ) )
	raspberry-pi? ( opengl )
	test? ( opengl )
	tools? ( cli )
	uchardet? ( iconv )
	vaapi? ( || ( gbm X wayland ) )
	vdpau? ( X )
	vulkan? ( || ( X wayland ) )
	wayland? ( egl )
	X? ( egl? ( opengl ) )
	xv? ( X )
	${PYTHON_REQUIRED_USE}
"

RESTRICT="!test? ( test )"

COMMON_DEPEND="
	>=media-video/ffmpeg-4.0:0=[encode,threads,vaapi?,vdpau?]
	alsa? ( >=media-libs/alsa-lib-1.0.18 )
	archive? ( >=app-arch/libarchive-3.4.0:= )
	bluray? ( >=media-libs/libbluray-0.3.0:= )
	cdda? ( dev-libs/libcdio-paranoia
			dev-libs/libcdio:= )
	drm? ( x11-libs/libdrm )
	dvd? (
		>=media-libs/libdvdnav-4.2.0:=
		>=media-libs/libdvdread-4.1.0:=
	)
	egl? ( media-libs/mesa[egl,gbm(-)?,wayland(-)?] )
	gamepad? ( media-libs/libsdl2 )
	iconv? (
		virtual/libiconv
		uchardet? ( app-i18n/uchardet )
	)
	jack? ( virtual/jack )
	javascript? ( >=dev-lang/mujs-1.0.0 )
	jpeg? ( virtual/jpeg:0 )
	lcms? ( >=media-libs/lcms-2.6:2 )
	>=media-libs/libass-0.12.1:=[fontconfig,harfbuzz(+)]
	virtual/ttf-fonts
	libcaca? ( >=media-libs/libcaca-0.99_beta18 )
	lua? ( ${LUA_DEPS} )
	openal? ( >=media-libs/openal-1.13 )
	pulseaudio? ( media-sound/pulseaudio )
	raspberry-pi? ( >=media-libs/raspberrypi-userland-0_pre20160305-r1 )
	rubberband? ( >=media-libs/rubberband-1.8.0 )
	sdl? ( media-libs/libsdl2[sound,threads,video] )
	vaapi? ( x11-libs/libva:=[drm?,X?,wayland?] )
	vapoursynth? ( media-libs/vapoursynth )
	vdpau? ( x11-libs/libvdpau )
	vulkan? (
		>=media-libs/libplacebo-3.104.0:=[vulkan]
		media-libs/shaderc
	)
	wayland? (
		>=dev-libs/wayland-1.6.0
		>=dev-libs/wayland-protocols-1.14
		>=x11-libs/libxkbcommon-0.3.0
	)
	X? (
		x11-libs/libX11
		x11-libs/libXScrnSaver
		x11-libs/libXext
		x11-libs/libXinerama
		x11-libs/libXrandr
		opengl? (
			x11-libs/libXdamage
			virtual/opengl
		)
		xv? ( x11-libs/libXv )
	)
	zlib? ( sys-libs/zlib )
	zimg? ( >=media-libs/zimg-2.9.2 )
"
DEPEND="${COMMON_DEPEND}
	${PYTHON_DEPS}
	cuda? ( >=media-libs/nv-codec-headers-8.2.15.7 )
	dvb? ( virtual/linuxtv-dvb-headers )
"
RDEPEND="${COMMON_DEPEND}
	cuda? ( x11-drivers/nvidia-drivers[X] )
	selinux? ( sec-policy/selinux-mplayer )
	tools? ( ${PYTHON_DEPS} )
"
BDEPEND="dev-python/docutils
	virtual/pkgconfig
	test? ( >=dev-util/cmocka-1.0.0 )
"

pkg_setup() {
	use lua && lua-single_pkg_setup
}

src_prepare() {
	cp "${DISTDIR}/waf-${WAF_PV}" "${S}"/waf || die
	chmod +x "${S}"/waf || die
	default
}

src_configure() {
	python_setup
	tc-export CC PKG_CONFIG AR

	if use raspberry-pi; then
		append-cflags -I"${SYSROOT%/}${EPREFIX}/opt/vc/include"
		append-ldflags -L"${SYSROOT%/}${EPREFIX}/opt/vc/lib"
	fi

	local mywafargs=(
		--confdir="${EPREFIX}/etc/${PN}"

		$(usex cli '' '--disable-cplayer')
		$(use_enable libmpv libmpv-shared)

		--disable-libmpv-static
		--disable-static-build
		# See deep down below for build-date.
		--disable-optimize # Don't add '-O2' to CFLAGS.
		$(usex debug '' '--disable-debug-build')

		$(use_enable doc html-build)
		--disable-pdf-build
		--enable-manpage-build
		$(use_enable cplugins)
		$(use_enable test)

		$(use_enable iconv)
		$(use_enable lua)
		$(use_enable javascript)
		$(use_enable zlib)
		$(use_enable bluray libbluray)
		$(use_enable dvd dvdnav)
		$(use_enable cdda)
		$(use_enable uchardet)
		$(use_enable rubberband)
		$(use_enable lcms lcms2)
		$(use_enable vapoursynth)
		$(use_enable archive libarchive)

		--enable-libavdevice

		# Audio outputs:
		$(use_enable sdl sdl2) # Listed under audio, but also includes video.
		$(use_enable pulseaudio pulse)
		$(use_enable jack)
		$(use_enable openal)
		--disable-opensles
		$(use_enable alsa)
		$(use_enable coreaudio)

		# Video outputs:
		$(use_enable aqua cocoa)
		$(use_enable drm)
		$(use_enable gbm)
		$(use_enable wayland wayland-scanner)
		$(use_enable wayland wayland-protocols)
		$(use_enable wayland)
		$(use_enable X x11)
		$(use_enable xv)
		$(usex opengl "$(use_enable aqua gl-cocoa)" '--disable-gl-cocoa')
		$(usex opengl "$(use_enable X gl-x11)" '--disable-gl-x11')
		$(usex egl "$(use_enable X egl-x11)" '--disable-egl-x11')
		$(usex egl "$(use_enable gbm egl-drm)" '--disable-egl-drm')
		$(usex opengl "$(use_enable wayland gl-wayland)" '--disable-gl-wayland')
		$(use_enable vdpau)
		$(usex vdpau "$(use_enable opengl vdpau-gl-x11)" '--disable-vdpau-gl-x11')
		$(use_enable vaapi) # See below for vaapi-glx, vaapi-x-egl.
		$(usex vaapi "$(use_enable X vaapi-x11)" '--disable-vaapi-x11')
		$(usex vaapi "$(use_enable wayland vaapi-wayland)" '--disable-vaapi-wayland')
		$(usex vaapi "$(use_enable gbm vaapi-drm)" '--disable-vaapi-drm')
		$(use_enable libcaca caca)
		$(use_enable jpeg)
		$(use_enable vulkan shaderc)
		$(use_enable vulkan libplacebo)
		$(use_enable raspberry-pi rpi)
		$(usex libmpv "$(use_enable opengl plain-gl)" '--disable-plain-gl')
		$(usex opengl '' '--disable-gl')
		$(use_enable vulkan)
		$(use_enable gamepad sdl2-gamepad)

		# HWaccels:
		# Automagic Video Toolbox HW acceleration. See Gentoo bug 577332.
		$(use_enable cuda cuda-hwaccel)
		$(use_enable cuda cuda-interop)

		# TV features:
		$(use_enable dvb dvbin)

		# Miscellaneous features:
		$(use_enable zimg)
	)
	if use lua; then
		if use lua_single_target_luajit; then
			mywafargs+=( --lua="luajit" )
		else
			# Because it would be too simple to just let the user directly
			# specify the package name to check, wouldn't it.
			mywafargs+=( --lua="$(ver_rs 1 '' $(ver_cut 1-2 $(lua_get_version)))" )
		fi
	fi

	if use vaapi && use X; then
		mywafargs+=(
			$(use_enable egl vaapi-x-egl)
		)
	fi

	# Not for us
	mywafargs+=(
		--disable-android
		--disable-egl-android
		--disable-uwp
		--disable-audiounit
		--disable-macos-media-player
		--disable-wasapi
		--disable-ios-gl
		--disable-macos-touchbar
		--disable-macos-cocoa-cb
		--disable-tvos
		--disable-egl-angle-win32
	)

	mywafargs+=(
		--bashdir="$(get_bashcompdir)"
		--zshdir="${EPREFIX}"/usr/share/zsh/site-functions
)

	# Create reproducible non-live builds.
	[[ ${PV} != *9999* ]] && mywafargs+=(--disable-build-date)

	waf-utils_src_configure "${mywafargs[@]}"
}

src_install() {
	waf-utils_src_install

	if use lua; then
		insinto /usr/share/${PN}
		doins -r TOOLS/lua
	fi

	if use cli && use lua_single_target_luajit; then
		pax-mark -m "${ED}"/usr/bin/${PN}
	fi

	if use tools; then
		dobin TOOLS/{mpv_identify.sh,umpv}
		newbin TOOLS/idet.sh mpv_idet.sh
		python_replicate_script "${ED}"/usr/bin/umpv
	fi
}

pkg_postinst() {
	local rv softvol_0_18_1=0 osc_0_21_0=0 txtsubs_0_24_0=0 opengl_0_25_0=0

	for rv in ${REPLACING_VERSIONS}; do
		ver_test ${rv} -lt 0.18.1 && softvol_0_18_1=1
		ver_test ${rv} -lt 0.21.0 && osc_0_21_0=1
		ver_test ${rv} -lt 0.24.0 && txtsubs_0_24_0=1
		ver_test ${rv} -lt 0.25.0 && ! use opengl && opengl_0_25_0=1
	done

	if [[ ${softvol_0_18_1} -eq 1 ]]; then
		elog "Since version 0.18.1 the software volume control is always enabled."
		elog "This means that volume controls don't change the system volume,"
		elog "e.g. per-application volume with PulseAudio."
		elog "If you want to restore the previous behaviour, please refer to"
		elog
		elog "https://wiki.gentoo.org/wiki/Mpv#Volume_in_0.18.1"
		elog
	fi

	if [[ ${osc_0_21_0} -eq 1 ]]; then
		elog "In version 0.21.0 the default OSC layout was changed."
		elog "If you want to restore the previous layout, please refer to"
		elog
		elog "https://wiki.gentoo.org/wiki/Mpv#OSC_in_0.21.0"
		elog
	fi

	if [[ ${txtsubs_0_24_0} -eq 1 ]]; then
		elog "Since version 0.24.0 subtitles with .txt extension aren't autoloaded."
		elog "If you want to restore the previous behaviour, please refer to"
		elog
		elog "https://wiki.gentoo.org/wiki/Mpv#Subtitles_with_.txt_extension_in_0.24.0"
		elog
	fi

	if [[ ${opengl_0_25_0} -eq 1 ]]; then
		elog "Since version 0.25.0 the 'opengl' USE flag is mapped to"
		elog "the 'opengl' video output and no longer explicitly requires"
		elog "X11 or Mac OS Aqua. Consider enabling the 'opengl' USE flag."
	fi

	optfeature "URL support" net-misc/youtube-dl

	xdg_icon_cache_update
	xdg_desktop_database_update
}

pkg_postrm() {
	xdg_icon_cache_update
	xdg_desktop_database_update
}

src_test() {
	cd "${S}"/build/test || die
	local test
	for test in *; do
		if [[ -x ${test} ]]; then
			./"${test}" || die "Test suite failed"
		fi
	done
}

M net-p2p/nicotine+/metadata.xml => net-p2p/nicotine+/metadata.xml +1 -1
@@ 1,5 1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
	<maintainer type="person">
		<email>slashbeast@gentoo.org</email>

R net-p2p/nicotine+/nicotine+-3.1.1.ebuild => net-p2p/nicotine+/nicotine+-3.2.2.ebuild +1 -1
@@ 1,4 1,4 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

D x11-libs/gtk+/gtk+-3.24.22.ebuild => x11-libs/gtk+/gtk+-3.24.22.ebuild +0 -251
@@ 1,251 0,0 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=6
GNOME2_LA_PUNT="yes"
GNOME2_EAUTORECONF="yes"

inherit flag-o-matic gnome2 multilib virtualx multilib-minimal

DESCRIPTION="Gimp ToolKit +"
HOMEPAGE="https://www.gtk.org/"

LICENSE="LGPL-2+"
SLOT="3"
IUSE="aqua atk-bridge broadway cloudprint colord cups examples gtk-doc +introspection test vim-syntax wayland +X xinerama"
REQUIRED_USE="
	|| ( aqua wayland X )
	xinerama? ( X )
"

KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"

# Upstream wants us to do their job:
# https://bugzilla.gnome.org/show_bug.cgi?id=768662#c1
RESTRICT="test"

# FIXME: introspection data is built against system installation of gtk+:3,
# bug #????
COMMON_DEPEND="
	>=dev-libs/atk-2.15[introspection?,${MULTILIB_USEDEP}]
	>=dev-libs/fribidi-0.19.7[${MULTILIB_USEDEP}]
	>=dev-libs/glib-2.57.2:2[${MULTILIB_USEDEP}]
	media-libs/fontconfig[${MULTILIB_USEDEP}]
	>=media-libs/libepoxy-1.4[X(+)?,${MULTILIB_USEDEP}]
	>=x11-libs/cairo-1.14[aqua?,glib,svg,X?,${MULTILIB_USEDEP}]
	>=x11-libs/gdk-pixbuf-2.30:2[introspection?,${MULTILIB_USEDEP}]
	>=x11-libs/pango-1.41.0[introspection?,${MULTILIB_USEDEP}]
	>=media-libs/harfbuzz-0.9:=
	x11-misc/shared-mime-info

	cloudprint? (
		>=net-libs/rest-0.7[${MULTILIB_USEDEP}]
		>=dev-libs/json-glib-1.0[${MULTILIB_USEDEP}] )
	colord? ( >=x11-misc/colord-0.1.9:0=[${MULTILIB_USEDEP}] )
	cups? ( >=net-print/cups-2.0[${MULTILIB_USEDEP}] )
	introspection? ( >=dev-libs/gobject-introspection-1.39:= )
	wayland? (
		>=dev-libs/wayland-1.14.91[${MULTILIB_USEDEP}]
		>=dev-libs/wayland-protocols-1.14
		media-libs/mesa[wayland,${MULTILIB_USEDEP}]
		>=x11-libs/libxkbcommon-0.2[${MULTILIB_USEDEP}]
	)
	X? (
		atk-bridge? ( >=app-accessibility/at-spi2-atk-2.5.3[${MULTILIB_USEDEP}] )
		media-libs/mesa[X(+),${MULTILIB_USEDEP}]
		x11-libs/libX11[${MULTILIB_USEDEP}]
		>=x11-libs/libXi-1.3[${MULTILIB_USEDEP}]
		x11-libs/libXext[${MULTILIB_USEDEP}]
		>=x11-libs/libXrandr-1.5[${MULTILIB_USEDEP}]
		x11-libs/libXcursor[${MULTILIB_USEDEP}]
		x11-libs/libXfixes[${MULTILIB_USEDEP}]
		x11-libs/libXcomposite[${MULTILIB_USEDEP}]
		x11-libs/libXdamage[${MULTILIB_USEDEP}]
		xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
	)
"
DEPEND="${COMMON_DEPEND}
	app-text/docbook-xsl-stylesheets
	app-text/docbook-xml-dtd:4.1.2
	dev-libs/libxslt
	dev-libs/gobject-introspection-common
	>=dev-util/gdbus-codegen-2.48
	dev-util/glib-utils
	>=dev-util/gtk-doc-am-1.20
	gtk-doc? ( >=dev-util/gtk-doc-1.20
		app-text/docbook-xml-dtd:4.3 )
	>=sys-devel/gettext-0.19.7[${MULTILIB_USEDEP}]
	virtual/pkgconfig
	X? ( x11-base/xorg-proto )
	test? (
		media-fonts/font-misc-misc
		media-fonts/font-cursor-misc )
"
# gtk+-3.2.2 breaks Alt key handling in <=x11-libs/vte-0.30.1:2.90
# gtk+-3.3.18 breaks scrolling in <=x11-libs/vte-0.31.0:2.90
RDEPEND="${COMMON_DEPEND}
	>=dev-util/gtk-update-icon-cache-3
	!<gnome-base/gail-1000
	!<x11-libs/vte-0.31.0:2.90
"
# librsvg for svg icons (PDEPEND to avoid circular dep), bug #547710
PDEPEND="
	gnome-base/librsvg[${MULTILIB_USEDEP}]
	>=x11-themes/adwaita-icon-theme-3.14
	vim-syntax? ( app-vim/gtk-syntax )
"

MULTILIB_CHOST_TOOLS=(
	/usr/bin/gtk-query-immodules-3.0$(get_exeext)
)

strip_builddir() {
	local rule=$1
	shift
	local directory=$1
	shift
	sed -e "s/^\(${rule} =.*\)${directory}\(.*\)$/\1\2/" -i $@ \
		|| die "Could not strip director ${directory} from build."
}

src_prepare() {
	if ! use test ; then
		# don't waste time building tests
		strip_builddir SRC_SUBDIRS testsuite Makefile.{am,in}

		# the tests dir needs to be build now because since commit
		# 7ff3c6df80185e165e3bf6aa31bd014d1f8bf224 tests/gtkgears.o needs to be there
		# strip_builddir SRC_SUBDIRS tests Makefile.{am,in}
	fi

	if ! use examples; then
		# don't waste time building demos
		strip_builddir SRC_SUBDIRS demos Makefile.{am,in}
		strip_builddir SRC_SUBDIRS examples Makefile.{am,in}
	fi

	# gtk-update-icon-cache is installed by dev-util/gtk-update-icon-cache
	eapply "${FILESDIR}"/${PN}-3.24.8-update-icon-cache.patch

	# Fix broken autotools logic
	eapply "${FILESDIR}"/${PN}-3.22.20-libcloudproviders-automagic.patch

	# get rid of gtk3-atk-bridge crap
	if ! use atk-bridge; then
		eapply "${FILESDIR}"/${PN}-3.22.30.atk-bridge.patch
	fi

	gnome2_src_prepare
}

multilib_src_configure() {
	local myconf=(
		$(use_enable aqua quartz-backend)
		$(use_with atk-bridge)
		$(use_enable broadway broadway-backend)
		$(use_enable cloudprint)
		$(use_enable colord)
		$(use_enable cups cups auto)
		$(multilib_native_use_enable gtk-doc)
		$(multilib_native_use_enable introspection)
		$(use_enable wayland wayland-backend)
		$(use_enable X x11-backend)
		$(use_enable X xcomposite)
		$(use_enable X xdamage)
		$(use_enable X xfixes)
		$(use_enable X xkb)
		$(use_enable X xrandr)
		$(use_enable xinerama)
		# cloudprovider is not packaged in Gentoo yet
		--disable-cloudproviders
		--disable-papi
		# sysprof integration needs >=sysprof-3.33.2
		--disable-profiler
		--enable-man
		--with-xml-catalog="${EPREFIX}"/etc/xml/catalog
		# need libdir here to avoid a double slash in a path that libtool doesn't
		# grok so well during install (// between $EPREFIX and usr ...)
		# TODO: Is this still the case?
		--libdir="${EPREFIX}"/usr/$(get_libdir)
		CUPS_CONFIG="${EPREFIX}/usr/bin/${CHOST}-cups-config"
	)

	if use wayland; then
		myconf+=(
			# Include wayland immodule into gtk itself, to avoid problems like
			# https://gitlab.gnome.org/GNOME/gnome-shell/issues/109 from a
			# user overridden GTK_IM_MODULE envvar
			--with-included-immodules=wayland
		)
	fi;

	ECONF_SOURCE=${S} gnome2_src_configure "${myconf[@]}"

	# work-around gtk-doc out-of-source brokedness
	if multilib_is_native_abi; then
		local d
		for d in gdk gtk libgail-util; do
			ln -s "${S}"/docs/reference/${d}/html docs/reference/${d}/html || die
		done
	fi
}

multilib_src_test() {
	"${EROOT}${GLIB_COMPILE_SCHEMAS}" --allow-any-name "${S}/gtk" || die
	GSETTINGS_SCHEMA_DIR="${S}/gtk" virtx emake check
}

multilib_src_install() {
	gnome2_src_install
}

multilib_src_install_all() {
	insinto /etc/gtk-3.0
	doins "${FILESDIR}"/settings.ini
	# Skip README.{in,commits,win32} that would get installed by default
	DOCS=( AUTHORS ChangeLog NEWS README )
	einstalldocs
}

pkg_preinst() {
	gnome2_pkg_preinst

	multilib_pkg_preinst() {
		# Make immodules.cache belongs to gtk+ alone
		local cache="usr/$(get_libdir)/gtk-3.0/3.0.0/immodules.cache"

		if [[ -e ${EROOT}${cache} ]]; then
			cp "${EROOT}"${cache} "${ED}"/${cache} || die
		else
			touch "${ED}"/${cache} || die
		fi
	}
	multilib_parallel_foreach_abi multilib_pkg_preinst
}

pkg_postinst() {
	gnome2_pkg_postinst

	multilib_pkg_postinst() {
		gnome2_query_immodules_gtk3 \
			|| die "Update immodules cache failed (for ${ABI})"
	}
	multilib_parallel_foreach_abi multilib_pkg_postinst

	if ! has_version "app-text/evince"; then
		elog "Please install app-text/evince for print preview functionality."
		elog "Alternatively, check \"gtk-print-preview-command\" documentation and"
		elog "add it to your settings.ini file."
	fi
}

pkg_postrm() {
	gnome2_pkg_postrm

	if [[ -z ${REPLACED_BY_VERSION} ]]; then
		multilib_pkg_postrm() {
			rm -f "${EROOT}"usr/$(get_libdir)/gtk-3.0/3.0.0/immodules.cache
		}
		multilib_foreach_abi multilib_pkg_postrm
	fi
}

D x11-libs/gtk+/gtk+-3.24.24-r1.ebuild => x11-libs/gtk+/gtk+-3.24.24-r1.ebuild +0 -256
@@ 1,256 0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7
GNOME2_EAUTORECONF="yes"

inherit gnome2 multilib multilib-minimal virtualx

DESCRIPTION="Gimp ToolKit +"
HOMEPAGE="https://www.gtk.org/"

LICENSE="LGPL-2+"
SLOT="3"
IUSE="aqua atk-bridge broadway cloudprint colord cups examples gtk-doc +introspection sysprof test vim-syntax wayland +X xinerama"
REQUIRED_USE="
	|| ( aqua wayland X )
	xinerama? ( X )
"

KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"

# Upstream wants us to do their job:
# https://bugzilla.gnome.org/show_bug.cgi?id=768662#c1
RESTRICT="test"

# FIXME: introspection data is built against system installation of gtk+:3,
# bug #????
COMMON_DEPEND="
	>=dev-libs/atk-2.32.0[introspection?,${MULTILIB_USEDEP}]
	>=dev-libs/fribidi-0.19.7[${MULTILIB_USEDEP}]
	>=dev-libs/glib-2.57.2:2[${MULTILIB_USEDEP}]
	media-libs/fontconfig[${MULTILIB_USEDEP}]
	>=media-libs/harfbuzz-0.9:=
	>=media-libs/libepoxy-1.4[X(+)?,${MULTILIB_USEDEP}]
	virtual/libintl[${MULTILIB_USEDEP}]
	>=x11-libs/cairo-1.14[aqua?,glib,svg,X?,${MULTILIB_USEDEP}]
	>=x11-libs/gdk-pixbuf-2.30:2[introspection?,${MULTILIB_USEDEP}]
	>=x11-libs/pango-1.41.0[introspection?,${MULTILIB_USEDEP}]
	x11-misc/shared-mime-info

	cloudprint? (
		>=dev-libs/json-glib-1.0[${MULTILIB_USEDEP}]
		>=net-libs/rest-0.7[${MULTILIB_USEDEP}]
	)
	colord? ( >=x11-misc/colord-0.1.9:0=[${MULTILIB_USEDEP}] )
	cups? ( >=net-print/cups-2.0[${MULTILIB_USEDEP}] )
	introspection? ( >=dev-libs/gobject-introspection-1.39:= )
	sysprof? ( >=dev-util/sysprof-capture-3.33.2:3[${MULTILIB_USEDEP}] )
	wayland? (
		>=dev-libs/wayland-1.14.91[${MULTILIB_USEDEP}]
		>=dev-libs/wayland-protocols-1.17
		media-libs/mesa[wayland,${MULTILIB_USEDEP}]
		>=x11-libs/libxkbcommon-0.2[${MULTILIB_USEDEP}]
	)
	X? (
		atk-bridge? ( >=app-accessibility/at-spi2-atk-2.15.1[${MULTILIB_USEDEP}] )
		media-libs/mesa[X(+),${MULTILIB_USEDEP}]
		x11-libs/libX11[${MULTILIB_USEDEP}]
		x11-libs/libXcomposite[${MULTILIB_USEDEP}]
		x11-libs/libXcursor[${MULTILIB_USEDEP}]
		x11-libs/libXdamage[${MULTILIB_USEDEP}]
		x11-libs/libXext[${MULTILIB_USEDEP}]
		x11-libs/libXfixes[${MULTILIB_USEDEP}]
		>=x11-libs/libXi-1.3[${MULTILIB_USEDEP}]
		>=x11-libs/libXrandr-1.5[${MULTILIB_USEDEP}]
		xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
	)
"
DEPEND="${COMMON_DEPEND}
	test? (
		media-fonts/font-cursor-misc
		media-fonts/font-misc-misc
	)
	X? ( x11-base/xorg-proto )
"
# gtk+-3.2.2 breaks Alt key handling in <=x11-libs/vte-0.30.1:2.90
# gtk+-3.3.18 breaks scrolling in <=x11-libs/vte-0.31.0:2.90
RDEPEND="${COMMON_DEPEND}
	>=dev-util/gtk-update-icon-cache-3
	!<gnome-base/gail-1000
	!<x11-libs/vte-0.31.0:2.90
"
# librsvg for svg icons (PDEPEND to avoid circular dep), bug #547710
PDEPEND="
	gnome-base/librsvg[${MULTILIB_USEDEP}]
	>=x11-themes/adwaita-icon-theme-3.14
	vim-syntax? ( app-vim/gtk-syntax )
"
BDEPEND="
	app-text/docbook-xml-dtd:4.1.2
	app-text/docbook-xsl-stylesheets
	dev-libs/gobject-introspection-common
	dev-libs/libxslt
	>=dev-util/gdbus-codegen-2.48
	dev-util/glib-utils
	>=dev-util/gtk-doc-am-1.20
	>=sys-devel/gettext-0.19.7
	virtual/pkgconfig
	gtk-doc? (
		app-text/docbook-xml-dtd:4.3
		>=dev-util/gtk-doc-1.20
	)
"

MULTILIB_CHOST_TOOLS=(
	/usr/bin/gtk-query-immodules-3.0$(get_exeext)
)

PATCHES=(
	# gtk-update-icon-cache is installed by dev-util/gtk-update-icon-cache
	"${FILESDIR}"/${PN}-3.24.8-update-icon-cache.patch

	# Fix broken autotools logic
	"${FILESDIR}"/${PN}-3.22.20-libcloudproviders-automagic.patch

	"${FILESDIR}"/${PN}-3.22.30.atk-bridge.patch
)

strip_builddir() {
	local rule=$1
	shift
	local directory=$1
	shift
	sed -e "s/^\(${rule} =.*\)${directory}\(.*\)$/\1\2/" -i $@ \
		|| die "Could not strip director ${directory} from build."
}

src_prepare() {
	if ! use test ; then
		# don't waste time building tests
		strip_builddir SRC_SUBDIRS testsuite Makefile.{am,in}

		# the tests dir needs to be build now because since commit
		# 7ff3c6df80185e165e3bf6aa31bd014d1f8bf224 tests/gtkgears.o needs to be there
		# strip_builddir SRC_SUBDIRS tests Makefile.{am,in}
	fi

	if ! use examples; then
		# don't waste time building demos
		strip_builddir SRC_SUBDIRS demos Makefile.{am,in}
		strip_builddir SRC_SUBDIRS examples Makefile.{am,in}
	fi

	gnome2_src_prepare
}

multilib_src_configure() {
	local myconf=(
		$(use_enable aqua quartz-backend)
		$(use_with atk-bridge)
		$(use_enable broadway broadway-backend)
		$(use_enable cloudprint)
		$(use_enable colord)
		$(use_enable cups cups auto)
		$(multilib_native_use_enable gtk-doc)
		$(multilib_native_use_enable introspection)
		$(use_enable sysprof profiler)
		$(use_enable wayland wayland-backend)
		$(use_enable X x11-backend)
		$(use_enable X xcomposite)
		$(use_enable X xdamage)
		$(use_enable X xfixes)
		$(use_enable X xkb)
		$(use_enable X xrandr)
		$(use_enable xinerama)
		# cloudprovider is not packaged in Gentoo yet
		--disable-cloudproviders
		--disable-papi
		--enable-man
		--with-xml-catalog="${EPREFIX}"/etc/xml/catalog
		# need libdir here to avoid a double slash in a path that libtool doesn't
		# grok so well during install (// between $EPREFIX and usr ...)
		# TODO: Is this still the case?
		--libdir="${EPREFIX}"/usr/$(get_libdir)
		CUPS_CONFIG="${EPREFIX}/usr/bin/${CHOST}-cups-config"
	)

	if use wayland; then
		myconf+=(
			# Include wayland immodule into gtk itself, to avoid problems like
			# https://gitlab.gnome.org/GNOME/gnome-shell/issues/109 from a
			# user overridden GTK_IM_MODULE envvar
			--with-included-immodules=wayland
		)
	fi;

	ECONF_SOURCE=${S} gnome2_src_configure "${myconf[@]}"

	# work-around gtk-doc out-of-source brokedness
	if multilib_is_native_abi; then
		local d
		for d in gdk gtk libgail-util; do
			ln -s "${S}"/docs/reference/${d}/html docs/reference/${d}/html || die
		done
	fi
}

multilib_src_test() {
	"${EROOT}${GLIB_COMPILE_SCHEMAS}" --allow-any-name "${S}/gtk" || die
	GSETTINGS_SCHEMA_DIR="${S}/gtk" virtx emake check
}

multilib_src_install() {
	gnome2_src_install
}

multilib_src_install_all() {
	insinto /etc/gtk-3.0
	doins "${FILESDIR}"/settings.ini
	# Skip README.{in,commits,win32} that would get installed by default
	DOCS=( AUTHORS ChangeLog NEWS README )
	einstalldocs
}

pkg_preinst() {
	gnome2_pkg_preinst

	multilib_pkg_preinst() {
		# Make immodules.cache belongs to gtk+ alone
		local cache="/usr/$(get_libdir)/gtk-3.0/3.0.0/immodules.cache"

		if [[ -e ${EROOT}${cache} ]]; then
			cp "${EROOT}${cache}" "${ED}${cache}" || die
		else
			touch "${ED}${cache}" || die
		fi
	}
	multilib_parallel_foreach_abi multilib_pkg_preinst
}

pkg_postinst() {
	gnome2_pkg_postinst

	multilib_pkg_postinst() {
		gnome2_query_immodules_gtk3 \
			|| die "Update immodules cache failed (for ${ABI})"
	}
	multilib_parallel_foreach_abi multilib_pkg_postinst

	if ! has_version "app-text/evince"; then
		elog "Please install app-text/evince for print preview functionality."
		elog "Alternatively, check \"gtk-print-preview-command\" documentation and"
		elog "add it to your settings.ini file."
	fi
}

pkg_postrm() {
	gnome2_pkg_postrm

	if [[ -z ${REPLACED_BY_VERSION} ]]; then
		multilib_pkg_postrm() {
			rm -f "${EROOT}/usr/$(get_libdir)/gtk-3.0/3.0.0/immodules.cache"
		}
		multilib_foreach_abi multilib_pkg_postrm
	fi
}

R x11-libs/gtk+/gtk+-3.24.29.ebuild => x11-libs/gtk+/gtk+-3.24.31.ebuild +5 -10
@@ 1,4 1,4 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7


@@ 11,7 11,7 @@ HOMEPAGE="https://www.gtk.org/"

LICENSE="LGPL-2+"
SLOT="3"
IUSE="aqua atk-bridge broadway cloudprint colord cups examples gtk-doc +introspection sysprof test vim-syntax wayland +X xinerama"
IUSE="aqua atk-bridge broadway colord cups examples gtk-doc +introspection sysprof test vim-syntax wayland +X xinerama"
REQUIRED_USE="
	|| ( aqua wayland X )
	xinerama? ( X )


@@ 30,18 30,14 @@ COMMON_DEPEND="
	>=dev-libs/fribidi-0.19.7[${MULTILIB_USEDEP}]
	>=dev-libs/glib-2.57.2:2[${MULTILIB_USEDEP}]
	media-libs/fontconfig[${MULTILIB_USEDEP}]
	>=media-libs/harfbuzz-0.9:=
	>=media-libs/harfbuzz-2.2.0:=
	>=media-libs/libepoxy-1.4[X(+)?,${MULTILIB_USEDEP}]
	virtual/libintl[${MULTILIB_USEDEP}]
	>=x11-libs/cairo-1.14[aqua?,glib,svg,X?,${MULTILIB_USEDEP}]
	>=x11-libs/gdk-pixbuf-2.30:2[introspection?,${MULTILIB_USEDEP}]
	>=x11-libs/pango-1.41.0[introspection?,${MULTILIB_USEDEP}]
	>=x11-libs/pango-1.44.0[introspection?,${MULTILIB_USEDEP}]
	x11-misc/shared-mime-info

	cloudprint? (
		>=dev-libs/json-glib-1.0[${MULTILIB_USEDEP}]
		>=net-libs/rest-0.7[${MULTILIB_USEDEP}]
	)
	colord? ( >=x11-misc/colord-0.1.9:0=[${MULTILIB_USEDEP}] )
	cups? ( >=net-print/cups-2.0[${MULTILIB_USEDEP}] )
	introspection? ( >=dev-libs/gobject-introspection-1.39:= )


@@ 61,7 57,7 @@ COMMON_DEPEND="
		x11-libs/libXdamage[${MULTILIB_USEDEP}]
		x11-libs/libXext[${MULTILIB_USEDEP}]
		x11-libs/libXfixes[${MULTILIB_USEDEP}]
		>=x11-libs/libXi-1.3[${MULTILIB_USEDEP}]
		>=x11-libs/libXi-1.8[${MULTILIB_USEDEP}]
		>=x11-libs/libXrandr-1.5[${MULTILIB_USEDEP}]
		xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
	)


@@ 149,7 145,6 @@ multilib_src_configure() {
		$(use_enable aqua quartz-backend)
		$(use_with atk-bridge)
		$(use_enable broadway broadway-backend)
		$(use_enable cloudprint)
		$(use_enable colord)
		$(use_enable cups cups auto)
		$(multilib_native_use_enable gtk-doc)

A x11-misc/dunst/dunst-1.8.1.ebuild => x11-misc/dunst/dunst-1.8.1.ebuild +83 -0
@@ 0,0 1,83 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit systemd toolchain-funcs

DESCRIPTION="Lightweight replacement for common notification daemons"
HOMEPAGE="https://dunst-project.org/ https://github.com/dunst-project/dunst"
SRC_URI="https://github.com/dunst-project/dunst/archive/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~x86"
IUSE="wayland xdg"

DEPEND="
	dev-libs/glib:2
	sys-apps/dbus
	x11-libs/cairo[X,glib]
	x11-libs/gdk-pixbuf:2
	x11-libs/libX11
	x11-libs/libXext
	x11-libs/libXScrnSaver
	x11-libs/libXinerama
	x11-libs/libXrandr
	x11-libs/libnotify
	x11-libs/pango[X]
	xdg? ( x11-misc/xdg-utils )
	wayland? ( dev-libs/wayland )
"

RDEPEND="${DEPEND}"

BDEPEND="
	dev-lang/perl
	virtual/pkgconfig
	wayland? ( dev-libs/wayland-protocols )
"

src_prepare() {
	default

	# Respect users CFLAGS
	sed -e 's/-Os//' -i config.mk || die

	# Use correct path for dbus and system unit
	sed -e "s|##PREFIX##|${EPREFIX}/usr|" -i dunst.systemd.service.in || die
	sed -e "s|##PREFIX##|${EPREFIX}/usr|" -i org.knopwob.dunst.service.in || die
}

src_configure() {
	tc-export CC PKG_CONFIG

	default
}

src_compile() {
	local myemakeargs=(
		SYSCONFDIR="${EPREFIX}/etc/xdg"
		SYSTEMD="0"
		WAYLAND="$(usex wayland 1 0)"
	)

	emake "${myemakeargs[@]}"
}

src_install() {
	local myemakeargs=(
		PREFIX="${ED}/usr"
		SYSCONFDIR="${ED}/etc/xdg"
		SYSTEMD="0"
		WAYLAND="$(usex wayland 1 0)"
	)

	emake "${myemakeargs[@]}" install

	if ! use xdg; then
		ewarn "xdg USE flag was not set, x11-misc/xdg-utils may not be installed"
		ewarn "and the default dunstrc uses xdg-open as URL handler"
	fi
	systemd_newuserunit dunst.systemd.service.in dunst.service
}

A x11-misc/dunst/metadata.xml => x11-misc/dunst/metadata.xml +14 -0
@@ 0,0 1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
	<maintainer type="person">
		<email>conikost@gentoo.org</email>
		<name>Conrad Kostecki</name>
	</maintainer>
	<use>
	  <flag name="xdg">Pulls the optional x11-misc/xdg-utils package needed by the default config</flag>
	</use>
	<upstream>
		<remote-id type="github">dunst-project/dunst</remote-id>
	</upstream>
</pkgmetadata>

R x11-terms/st/st-0.8.4.ebuild => x11-terms/st/st-0.8.5.ebuild +21 -17
@@ 1,33 1,34 @@
# Copyright 1999-2020 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7
inherit desktop git-r3 multilib savedconfig toolchain-funcs
inherit desktop savedconfig toolchain-funcs

DESCRIPTION="simple terminal implementation for X"
HOMEPAGE="https://st.suckless.org/"
EGIT_REPO_URI="https://git.suckless.org/${PN}"
SRC_URI="plumb? ( https://st.suckless.org/patches/right_click_to_plumb/simple_plumb.diff )
		 scrollback? ( https://st.suckless.org/patches/scrollback/st-scrollback-0.8.4.diff
					   https://st.suckless.org/patches/scrollback/st-scrollback-mouse-20191024-a2c479c.diff
					   https://st.suckless.org/patches/scrollback/st-scrollback-mouse-altscreen-20200416-5703aa0.diff )"

SRC_URI="https://dl.suckless.org/${PN}/${P}.tar.gz
		 plumb? ( https://st.suckless.org/patches/right_click_to_plumb/simple_plumb-0.8.5.diff )
		 scrollback? ( https://st.suckless.org/patches/scrollback/st-scrollback-ringbuffer-0.8.5.diff
					   https://st.suckless.org/patches/scrollback/st-scrollback-mouse-20220127-2c5edf2.diff
					   https://st.suckless.org/patches/scrollback/st-scrollback-mouse-altscreen-20220127-2c5edf2.diff )
		 blinking-cursor? ( https://st.suckless.org/patches/blinking_cursor/st-blinking_cursor-20211116-2f6e597.diff )"
KEYWORDS="amd64 ~arm ~arm64 ~hppa ~m68k ~ppc64 ~riscv ~x86"
LICENSE="MIT-with-advertising"
SLOT="0"
KEYWORDS="~amd64"
IUSE="plumb savedconfig scrollback"
IUSE="blinking-cursor plumb scrollback"

RDEPEND="
	>=sys-libs/ncurses-6.0:0=
	media-libs/fontconfig
	x11-libs/libX11
	x11-libs/libXft
	~x11-terms/st-terminfo-${PV}
"
DEPEND="
	${RDEPEND}
	virtual/pkgconfig
	x11-base/xorg-proto
"
BDEPEND="virtual/pkgconfig"

src_prepare() {
	default


@@ 43,14 44,17 @@ src_prepare() {

	use scrollback &&
		eapply \
			"$DISTDIR"/st-scrollback-0.8.4.diff \
			"$DISTDIR"/st-scrollback-mouse-20191024-a2c479c.diff \
			"$DISTDIR"/st-scrollback-mouse-altscreen-20200416-5703aa0.diff
			"$DISTDIR"/st-scrollback-ringbuffer-0.8.5.diff \
			"$DISTDIR"/st-scrollback-mouse-20220127-2c5edf2.diff \
			"$DISTDIR"/st-scrollback-mouse-altscreen-20220127-2c5edf2.diff
	use plumb &&
		eapply "$DISTDIR"/simple_plumb.diff
		eapply "$DISTDIR"/simple_plumb-0.8.5.diff
	use blinking-cursor &&
		eapply "$DISTDIR"/st-blinking_cursor-20211116-2f6e597.diff

	eapply_user

	use savedconfig && restore_config config.h
	restore_config config.h
}

src_configure() {


@@ 65,5 69,5 @@ src_install() {
	emake DESTDIR="${D}" PREFIX="${EPREFIX}"/usr install
	dodoc TODO
	make_desktop_entry ${PN} simpleterm utilities-terminal 'System;TerminalEmulator;' ''
	use savedconfig && save_config config.h
	save_config config.h
}