From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1559222-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 5639C158089
	for <garchives@archives.gentoo.org>; Mon,  2 Oct 2023 12:22:03 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 9F2EE2BC02E;
	Mon,  2 Oct 2023 12:22:02 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 8A60E2BC02E
	for <gentoo-commits@lists.gentoo.org>; Mon,  2 Oct 2023 12:22:02 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 6EF8C335C7E
	for <gentoo-commits@lists.gentoo.org>; Mon,  2 Oct 2023 12:22:01 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id EDD5C8EB
	for <gentoo-commits@lists.gentoo.org>; Mon,  2 Oct 2023 12:21:59 +0000 (UTC)
From: "Nickolas Raymond Kaczynski" <nrk@disroot.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Nickolas Raymond Kaczynski" <nrk@disroot.org>
Message-ID: <1696249299.0d65b247b839fc2574f59722d650ab04b3a5f803.nrk@gentoo>
Subject: [gentoo-commits] repo/proj/guru:dev commit in: media-gfx/nsxiv/
X-VCS-Repository: repo/proj/guru
X-VCS-Files: media-gfx/nsxiv/nsxiv-32.ebuild media-gfx/nsxiv/nsxiv-9999.ebuild
X-VCS-Directories: media-gfx/nsxiv/
X-VCS-Committer: nrk
X-VCS-Committer-Name: Nickolas Raymond Kaczynski
X-VCS-Revision: 0d65b247b839fc2574f59722d650ab04b3a5f803
X-VCS-Branch: dev
Date: Mon,  2 Oct 2023 12:21:59 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 2a7dcd10-be35-4d99-9140-8793df02b8ff
X-Archives-Hash: 07e247638f5d92d2f03ae0b0a1c0c73e

commit:     0d65b247b839fc2574f59722d650ab04b3a5f803
Author:     NRK <nrk <AT> disroot <DOT> org>
AuthorDate: Mon Oct  2 12:18:32 2023 +0000
Commit:     Nickolas Raymond Kaczynski <nrk <AT> disroot <DOT> org>
CommitDate: Mon Oct  2 12:21:39 2023 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=0d65b247

media-gfx/nsxiv: add debug useflag

v32 changed from having assertions enabled by default to having them
disabled. explicitly passing `-DDEBUG` is now required to enable
assertions.

Signed-off-by: NRK <nrk <AT> disroot.org>

 media-gfx/nsxiv/nsxiv-32.ebuild   | 9 ++++++---
 media-gfx/nsxiv/nsxiv-9999.ebuild | 9 ++++++---
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/media-gfx/nsxiv/nsxiv-32.ebuild b/media-gfx/nsxiv/nsxiv-32.ebuild
index 21454ad79b..289eb79656 100644
--- a/media-gfx/nsxiv/nsxiv-32.ebuild
+++ b/media-gfx/nsxiv/nsxiv-32.ebuild
@@ -18,7 +18,7 @@ HOMEPAGE="https://codeberg.org/nsxiv/nsxiv"
 
 LICENSE="GPL-2+ public-domain"
 SLOT="0"
-IUSE="+statusbar +inotify exif"
+IUSE="+statusbar +inotify exif debug"
 
 RDEPEND="
 	x11-libs/libX11
@@ -43,12 +43,15 @@ src_prepare() {
 }
 
 src_configure() {
+	# avoid rebuild on `make install`
 	sed -i -e '/^install: / s|: all|:|' Makefile || die
-	sed -i -e 's|^CFLAGS =|CFLAGS +=|;s|-O2 ||;' config.mk || die
 }
 
 src_compile() {
-	emake CC="$(tc-getCC)" OPT_DEP_DEFAULT=0 \
+	local dbg=""
+	use debug && dbg="-UNDEBUG -DDEBUG"
+	emake CC="$(tc-getCC)" CFLAGS="${CFLAGS} ${dbg}" \
+		OPT_DEP_DEFAULT=0 \
 		HAVE_INOTIFY="$(usex inotify 1 0)" \
 		HAVE_LIBFONTS="$(usex statusbar 1 0)" \
 		HAVE_LIBEXIF="$(usex exif 1 0)"

diff --git a/media-gfx/nsxiv/nsxiv-9999.ebuild b/media-gfx/nsxiv/nsxiv-9999.ebuild
index 21454ad79b..289eb79656 100644
--- a/media-gfx/nsxiv/nsxiv-9999.ebuild
+++ b/media-gfx/nsxiv/nsxiv-9999.ebuild
@@ -18,7 +18,7 @@ HOMEPAGE="https://codeberg.org/nsxiv/nsxiv"
 
 LICENSE="GPL-2+ public-domain"
 SLOT="0"
-IUSE="+statusbar +inotify exif"
+IUSE="+statusbar +inotify exif debug"
 
 RDEPEND="
 	x11-libs/libX11
@@ -43,12 +43,15 @@ src_prepare() {
 }
 
 src_configure() {
+	# avoid rebuild on `make install`
 	sed -i -e '/^install: / s|: all|:|' Makefile || die
-	sed -i -e 's|^CFLAGS =|CFLAGS +=|;s|-O2 ||;' config.mk || die
 }
 
 src_compile() {
-	emake CC="$(tc-getCC)" OPT_DEP_DEFAULT=0 \
+	local dbg=""
+	use debug && dbg="-UNDEBUG -DDEBUG"
+	emake CC="$(tc-getCC)" CFLAGS="${CFLAGS} ${dbg}" \
+		OPT_DEP_DEFAULT=0 \
 		HAVE_INOTIFY="$(usex inotify 1 0)" \
 		HAVE_LIBFONTS="$(usex statusbar 1 0)" \
 		HAVE_LIBEXIF="$(usex exif 1 0)"