public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/ncdu/, sys-fs/ncdu/files/
Date: Sat, 11 Mar 2023 17:15:39 +0000 (UTC)	[thread overview]
Message-ID: <1678554910.e4707343c9b2c5c1bfc27d09a6025b191fc7093a.sam@gentoo> (raw)

commit:     e4707343c9b2c5c1bfc27d09a6025b191fc7093a
Author:     Eric Joldasov <bratishkaerik <AT> getgoogleoff <DOT> me>
AuthorDate: Thu Mar  9 17:01:20 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Mar 11 17:15:10 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e4707343

sys-fs/ncdu: create and use zig variable in makefile

Big thanks to Florian Schmaus <flow <AT> gentoo.org> for creating and
upstreaming this patch! I guess I contributed too much entropy and
problems to testing branch today :%

Closes: https://bugs.gentoo.org/900547
Signed-off-by: Eric Joldasov <bratishkaerik <AT> getgoogleoff.me>
Closes: https://github.com/gentoo/gentoo/pull/30023
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../ncdu-2.2.2-makefile-add-zig-variable.patch     | 48 ++++++++++++++++++++++
 sys-fs/ncdu/ncdu-2.2.2-r1.ebuild                   | 10 +++--
 2 files changed, 55 insertions(+), 3 deletions(-)

diff --git a/sys-fs/ncdu/files/ncdu-2.2.2-makefile-add-zig-variable.patch b/sys-fs/ncdu/files/ncdu-2.2.2-makefile-add-zig-variable.patch
new file mode 100644
index 000000000000..9a118508641b
--- /dev/null
+++ b/sys-fs/ncdu/files/ncdu-2.2.2-makefile-add-zig-variable.patch
@@ -0,0 +1,48 @@
+From 74be2772499b4eb065a11477c6632146ed647dc8 Mon Sep 17 00:00:00 2001
+From: Florian Schmaus <flo@geekplace.eu>
+Date: Thu, 9 Mar 2023 16:01:40 +0100
+Subject: [PATCH] Makefile: Add ZIG variable and build target
+
+The ZIG variable helps to test ncdu with different zig installations,
+and it allows Gentoo to inject the zig version that should be used to
+build zig into the Makefile.
+
+Also add a phony 'build' target as first target to the Makefile so
+that it becomes the default target. This allows the Gentoo package to
+use the default src_compile() function.
+
+See also https://bugs.gentoo.org/900547
+---
+ Makefile | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 7cdbca3..eb854c6 100644
+--- a/Makefile
++++ b/Makefile
+@@ -4,6 +4,8 @@
+ # Optional semi-standard Makefile with some handy tools.
+ # Ncdu itself can be built with just the zig build system.
+ 
++ZIG ?= zig
++
+ PREFIX ?= /usr/local
+ BINDIR ?= ${PREFIX}/bin
+ MANDIR ?= ${PREFIX}/share/man/man1
+@@ -11,11 +13,14 @@ ZIG_FLAGS ?= -Drelease-fast
+ 
+ NCDU_VERSION=$(shell grep 'program_version = "' src/main.zig | sed -e 's/^.*"\(.\+\)".*$$/\1/')
+ 
++.PHONY: build
++build: release doc
++
+ release:
+-	zig build ${ZIG_FLAGS}
++	$(ZIG) build ${ZIG_FLAGS}
+ 
+ debug:
+-	zig build
++	$(ZIG) build
+ 
+ clean:
+ 	rm -rf zig-cache zig-out

diff --git a/sys-fs/ncdu/ncdu-2.2.2-r1.ebuild b/sys-fs/ncdu/ncdu-2.2.2-r1.ebuild
index b8f45c71bf2c..74c745fa8f11 100644
--- a/sys-fs/ncdu/ncdu-2.2.2-r1.ebuild
+++ b/sys-fs/ncdu/ncdu-2.2.2-r1.ebuild
@@ -30,6 +30,10 @@ BDEPEND="
 
 VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/yoranheling.asc
 
+PATCHES=(
+	"${FILESDIR}/${P}-makefile-add-zig-variable.patch"
+)
+
 # see https://github.com/ziglang/zig/issues/3382
 # For now, Zig doesn't support CFLAGS/LDFLAGS/etc.
 QA_FLAGS_IGNORED="usr/bin/ncdu"
@@ -120,9 +124,9 @@ src_unpack() {
 	default
 }
 
-src_compile() {
-	ezig build -Drelease-fast
-	edo pod2man --center "ncdu manual" --release "ncdu-${PV}" ncdu.pod >ncdu.1
+src_configure() {
+	zig-set_EZIG
+	export ZIG=${EZIG}
 }
 
 src_test() {


             reply	other threads:[~2023-03-11 17:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-11 17:15 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-12-23 18:45 [gentoo-commits] repo/gentoo:master commit in: sys-fs/ncdu/, sys-fs/ncdu/files/ Jakov Smolić
2017-03-09 13:43 Michael Weber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1678554910.e4707343c9b2c5c1bfc27d09a6025b191fc7093a.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox