commit:     d6350364b40b96f59181622d90b0dad9355d99df
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 13 01:53:33 2025 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Thu Nov 13 02:57:31 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d6350364

media-gfx/imv: add 5.0.0

Was starting to consider dropping this to maintainer-needed and
expecting eventual last-rites, but seems it got a new maintainer
upstream.

freeimage support was dropped which IMO is good given freeimage is in a
garbage state and hoping we can remove it from Gentoo eventually. This
does lose support for some obscure formats, but it keeps bmp+webp by
newly using libnsbmp+libwebp (personally I would recommend libvips to
upstream if want wider image support, but there is many alternatives).
As a bonus, removing freeimage obsoletes the old (removed) nsgif patch
to ensure it's used over freeimage so gif can be animated.

Also adds support for qoi and farbfeld, but only enabling the latter
for now given qoi is unpackaged and I do not intend to maintain it
(it is just a tiny header-only package though). Not exposing farbfeld
as a USE given support is builtin and VERY small (easy implementation
is a design goal of the format), not that many users will need this.

Also re-add USE=gif given this can use libnsgif-1.0.0 now, albeit the
upstream fix used a old patch that I had formerly rejected downstream
because the meson.build checks for == 1.0.0 rather than >= 1.0.0 and
will break when libnsgif-1.0.1 or so releases even if it does not break
compatibility. Quickfix for now but still needs to be reported.

Given freeimage was default, at least enable jpeg+png by default to not
be near-useless on non-desktop profiles. Given people using bmp is rare
nowadays, will let users enable that one manually if needed though.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 media-gfx/imv/Manifest                            |  1 +
 media-gfx/imv/files/imv-5.0.0-nsgif-version.patch |  5 ++
 media-gfx/imv/imv-5.0.0.ebuild                    | 87 +++++++++++++++++++++++
 media-gfx/imv/metadata.xml                        |  1 +
 4 files changed, 94 insertions(+)

diff --git a/media-gfx/imv/Manifest b/media-gfx/imv/Manifest
index 97bb550ff9d7..189b19a26df1 100644
--- a/media-gfx/imv/Manifest
+++ b/media-gfx/imv/Manifest
@@ -1 +1,2 @@
 DIST imv-4.5.0.tar.gz 82559 BLAKE2B 
100174071049ee711a868832ea297cc7fd43450145db9e71a631afb97d7d77574f37501b749734f47b3f2699d159ed05e5159fd9060c6f0a5de18b92708d9e9c
 SHA512 
5a192e1721b4752ba98de23e4a709904f43cce6954d1bc4a8feb5fb4921b46d497915fb7b2885cf87a65983fe2727c856d6c0c8b0cca2906e4b069e4a4f9c417
+DIST imv-5.0.0.tar.gz 71306 BLAKE2B 
bc65c1c0006a22dc09d01d914aa1eb32bdf6e54344053a94c9f1c56955d8f5056b57bacc180375aaa426db097335548692264b7f9fd47e9854196ec9e2e0deec
 SHA512 
4c551ab5aba31d4bf41be13bb8d26df311fba2969c6ad36f706e76e45c854c8d47d16c6011fa54ebd369722c7ebb4ea797e4c86ef537ed2d2c87db4bbace6886

diff --git a/media-gfx/imv/files/imv-5.0.0-nsgif-version.patch 
b/media-gfx/imv/files/imv-5.0.0-nsgif-version.patch
new file mode 100644
index 000000000000..4ec2eab72edf
--- /dev/null
+++ b/media-gfx/imv/files/imv-5.0.0-nsgif-version.patch
@@ -0,0 +1,5 @@
+--- a/meson.build
++++ b/meson.build
+@@ -140 +140 @@
+-  ['libnsgif', 'dependency', 'libnsgif', '1.0.0', ['image/gif']],
++  ['libnsgif', 'dependency', 'libnsgif', '>= 1.0.0', ['image/gif']],

diff --git a/media-gfx/imv/imv-5.0.0.ebuild b/media-gfx/imv/imv-5.0.0.ebuild
new file mode 100644
index 000000000000..436f331e7e4f
--- /dev/null
+++ b/media-gfx/imv/imv-5.0.0.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit meson xdg
+
+DESCRIPTION="Minimal image viewer designed for tiling window manager users"
+HOMEPAGE="https://sr.ht/~exec64/imv/";
+SRC_URI="https://git.sr.ht/~exec64/imv/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+S=${WORKDIR}/${PN}-v${PV}
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~riscv ~x86"
+IUSE="+X bmp gif heif icu +jpeg jpegxl +png svg test tiff wayland webp"
+REQUIRED_USE="|| ( X wayland )"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+       dev-libs/glib:2
+       dev-libs/inih
+       media-libs/libglvnd[X?]
+       x11-libs/cairo
+       x11-libs/libxkbcommon[X?]
+       x11-libs/pango
+       X? (
+               x11-libs/libX11
+               x11-libs/libxcb:=
+       )
+       bmp? ( media-libs/libnsbmp:= )
+       gif? ( >=media-libs/libnsgif-1:= )
+       heif? ( media-libs/libheif:= )
+       icu? ( dev-libs/icu:= )
+       !icu? ( >=dev-libs/libgrapheme-2:= )
+       jpeg? ( media-libs/libjpeg-turbo:= )
+       jpegxl? ( media-libs/libjxl:= )
+       png? ( media-libs/libpng:= )
+       svg? ( >=gnome-base/librsvg-2.44:2 )
+       tiff? ( media-libs/tiff:= )
+       wayland? ( dev-libs/wayland )
+       webp? ( media-libs/libwebp:= )
+       !sys-apps/renameutils
+"
+DEPEND="
+       ${RDEPEND}
+       X? ( x11-base/xorg-proto )
+       test? ( dev-util/cmocka )
+       wayland? ( dev-libs/wayland-protocols )
+"
+BDEPEND="
+       app-text/asciidoc
+       wayland? ( dev-util/wayland-scanner )
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-5.0.0-nsgif-version.patch
+)
+
+src_prepare() {
+       default
+
+       # if wayland-only, don't automagic on libGL and force libOpenGL
+       if use !X; then
+               sed -i "/dependency('gl'/{s/'gl'/'opengl'/;s/false/true/}" 
meson.build || die
+       fi
+}
+
+src_configure() {
+       local emesonargs=(
+               $(meson_feature bmp libnsbmp)
+               $(meson_feature gif libnsgif)
+               $(meson_feature heif libheif)
+               $(meson_feature jpeg libjpeg)
+               $(meson_feature jpegxl libjxl)
+               $(meson_feature png libpng)
+               -Dqoi=disabled # not packaged
+               $(meson_feature svg librsvg)
+               $(meson_feature test)
+               $(meson_feature tiff libtiff)
+               -Dunicode=$(usex icu{,} grapheme)
+               $(meson_feature webp libwebp)
+               -Dwindows=$(usex X $(usex wayland all x11) wayland)
+       )
+
+       meson_src_configure
+}

diff --git a/media-gfx/imv/metadata.xml b/media-gfx/imv/metadata.xml
index 8b185754e66c..227378987f6a 100644
--- a/media-gfx/imv/metadata.xml
+++ b/media-gfx/imv/metadata.xml
@@ -6,6 +6,7 @@
                <name>Ionen Wolkens</name>
        </maintainer>
        <use>
+               <flag name="bmp">Add bitmap (.bmp) image support using 
<pkg>media-libs/libnsbmp</pkg></flag>
                <flag name="freeimage">Use <pkg>media-libs/freeimage</pkg> for 
additional image support</flag>
        </use>
        <upstream>

Reply via email to