commit:     266d32d8ed1ec248aceb65639ce8b9467b76340d
Author:     Lucio Sauer <watermanpaint <AT> posteo <DOT> net>
AuthorDate: Mon Oct 20 08:23:38 2025 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Mon Oct 20 11:06:09 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=266d32d8

media-gfx/maim: fix CMake < 3.10 warning

Closes: https://bugs.gentoo.org/964644
Signed-off-by: Lucio Sauer <watermanpaint <AT> posteo.net>
Part-of: https://github.com/gentoo/gentoo/pull/44258
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../maim/files/maim-5.8.1-cmake-min-ver-3.10.patch | 41 +++++++++++++++++
 media-gfx/maim/maim-5.8.1-r1.ebuild                | 53 ++++++++++++++++++++++
 2 files changed, 94 insertions(+)

diff --git a/media-gfx/maim/files/maim-5.8.1-cmake-min-ver-3.10.patch 
b/media-gfx/maim/files/maim-5.8.1-cmake-min-ver-3.10.patch
new file mode 100644
index 000000000000..19afce824cce
--- /dev/null
+++ b/media-gfx/maim/files/maim-5.8.1-cmake-min-ver-3.10.patch
@@ -0,0 +1,41 @@
+Backport upstream patch to fix deprecation warning for CMake < 3.10
+introduced with CMake version 3.31.
+
+See-also: 
https://github.com/naelstrof/maim/commit/ef0b35a9be1525b85f6c814f2d0156d91942c831
+From: Lucio Sauer <[email protected]>
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,4 +1,4 @@
+-cmake_minimum_required( VERSION 3.5.0 )
++cmake_minimum_required( VERSION 3.10 )
+ 
+ project(maim VERSION 5.8.1 LANGUAGES CXX)
+ 
+@@ -67,17 +67,13 @@ target_link_libraries( ${BIN_TARGET}
+                        ${SLOP_LIBRARY}
+                        ${WEBP_LIBRARY} )
+ 
+-if( ${CMAKE_VERSION} VERSION_LESS 3.7 )
+-  message( WARNING "CMake version is below 3.7, CMake version >= 3.7 is 
required for unicode support." )
+-else()
+-  find_package(ICU COMPONENTS uc)
+-  set( MAIM_UNICODE TRUE CACHE BOOL "To enable or disable unicode support." )
+-  if ( MAIM_UNICODE AND ICU_FOUND )
+-      # ICU is required for old nvidia drivers to work for whatever reason.
+-      add_definitions(-DCXXOPTS_USE_UNICODE)
+-      include_directories( ${ICU_INCLUDE_DIR} )
+-      target_link_libraries( ${BIN_TARGET} ${ICU_UC_LIBRARIES} )
+-  endif()
++find_package(ICU COMPONENTS uc)
++set( MAIM_UNICODE TRUE CACHE BOOL "To enable or disable unicode support." )
++if ( MAIM_UNICODE AND ICU_FOUND )
++# ICU is required for old nvidia drivers to work for whatever reason.
++  add_definitions(-DCXXOPTS_USE_UNICODE)
++  include_directories( ${ICU_INCLUDE_DIR} )
++  target_link_libraries( ${BIN_TARGET} ${ICU_UC_LIBRARIES} )
+ endif()
+ 
+ install( TARGETS ${BIN_TARGET} DESTINATION "${CMAKE_INSTALL_BINDIR}" )
+-- 
+2.51.0
+

diff --git a/media-gfx/maim/maim-5.8.1-r1.ebuild 
b/media-gfx/maim/maim-5.8.1-r1.ebuild
new file mode 100644
index 000000000000..e7ef6d6a7d05
--- /dev/null
+++ b/media-gfx/maim/maim-5.8.1-r1.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake optfeature
+
+DESCRIPTION="Commandline tool to take screenshots of the desktop"
+HOMEPAGE="https://github.com/naelstrof/maim";
+
+if [[ ${PV} == *9999 ]]; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/naelstrof/maim.git";
+else
+       SRC_URI="https://github.com/naelstrof/maim/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+       KEYWORDS="~amd64 ~x86"
+fi
+
+LICENSE="GPL-3+ MIT"
+SLOT="0"
+IUSE="icu"
+
+RDEPEND="
+       media-libs/libjpeg-turbo:=
+       media-libs/libpng:0=
+       media-libs/libwebp:=
+       x11-libs/libX11
+       x11-libs/libXcomposite
+       x11-libs/libXext
+       x11-libs/libXfixes
+       x11-libs/libXrandr
+       x11-libs/libXrender
+       >=x11-misc/slop-7.5:=
+       icu? ( dev-libs/icu:= )
+"
+DEPEND="
+       ${RDEPEND}
+       media-libs/glm
+       x11-base/xorg-proto
+"
+
+PATCHES=( "${FILESDIR}"/${P}-cmake-min-ver-3.10.patch ) # bug 964644
+
+src_configure() {
+       local mycmakeargs=(
+               -DMAIM_UNICODE=$(usex icu)
+       )
+       cmake_src_configure
+}
+
+pkg_postinst() {
+       optfeature "using OpenGL-based CLI flags" x11-misc/slop[opengl]
+}

Reply via email to