public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/proj/guru:dev commit in: app-benchmarks/poop/
@ 2023-06-14  9:26 Eric Joldasov
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Joldasov @ 2023-06-14  9:26 UTC (permalink / raw
  To: gentoo-commits

commit:     dfc2e100339eacc60c6fda3f436e3f8ea45729fe
Author:     Eric Joldasov <bratishkaerik <AT> getgoogleoff <DOT> me>
AuthorDate: Wed Jun 14 09:26:17 2023 +0000
Commit:     Eric Joldasov <bratishkaerik <AT> getgoogleoff <DOT> me>
CommitDate: Wed Jun 14 09:26:17 2023 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=dfc2e100

app-benchmarks/poop: new package, add 9999

Signed-off-by: Eric Joldasov <bratishkaerik <AT> getgoogleoff.me>

 app-benchmarks/poop/metadata.xml     |  12 ++++
 app-benchmarks/poop/poop-9999.ebuild | 120 +++++++++++++++++++++++++++++++++++
 2 files changed, 132 insertions(+)

diff --git a/app-benchmarks/poop/metadata.xml b/app-benchmarks/poop/metadata.xml
new file mode 100644
index 000000000..0ec639e43
--- /dev/null
+++ b/app-benchmarks/poop/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="person">
+		<email>bratishkaerik@getgoogleoff.me</email>
+		<name>Eric Joldasov</name>
+	</maintainer>
+	<upstream>
+		<remote-id type="github">andrewrk/poop</remote-id>
+		<bugs-to>https://github.com/andrewrk/poop/issues</bugs-to>
+	</upstream>
+</pkgmetadata>

diff --git a/app-benchmarks/poop/poop-9999.ebuild b/app-benchmarks/poop/poop-9999.ebuild
new file mode 100644
index 000000000..a56a627a2
--- /dev/null
+++ b/app-benchmarks/poop/poop-9999.ebuild
@@ -0,0 +1,120 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit edo git-r3
+
+EGIT_REPO_URI="https://github.com/andrewrk/poop"
+
+DESCRIPTION="Performance Optimizer Observation Platform"
+HOMEPAGE="https://github.com/andrewrk/poop"
+
+LICENSE="MIT"
+SLOT="0"
+
+EZIG_MIN="9999"
+EZIG_MAX_EXCLUSIVE="99991"
+
+DEPEND="dev-lang/zig:${EZIG_MIN}"
+RDEPEND="${DEPEND}"
+
+# see https://github.com/ziglang/zig/issues/3382
+# For now, Zig Build System doesn't support CFLAGS/LDFLAGS/etc.
+QA_FLAGS_IGNORED="usr/bin/poop"
+
+# : copied from sys-fs/ncdu :
+# Many thanks to Florian Schmaus (Flowdalic)!
+# Adapted from https://github.com/gentoo/gentoo/pull/28986
+# Set the EZIG environment variable.
+zig-set_EZIG() {
+	[[ -n ${EZIG} ]] && return
+
+	if [[ -n ${EZIG_OVERWRITE} ]]; then
+		export EZIG="${EZIG_OVERWRITE}"
+		return
+	fi
+
+	local candidates candidate selected selected_ver
+
+	candidates=$(compgen -c zig-)
+
+	for candidate in ${candidates}; do
+		if [[ ! ${candidate} =~ zig(-bin)?-([.0-9]+) ]]; then
+			continue
+		fi
+
+		local ver
+		if (( ${#BASH_REMATCH[@]} == 3 )); then
+			ver="${BASH_REMATCH[2]}"
+		else
+			ver="${BASH_REMATCH[1]}"
+		fi
+
+		if [[ -n ${EZIG_EXACT_VER} ]]; then
+			ver_test "${ver}" -ne "${EZIG_EXACT_VER}" && continue
+
+			selected="${candidate}"
+			selected_ver="${ver}"
+			break
+		fi
+
+		if [[ -n ${EZIG_MIN} ]] \
+			   && ver_test "${ver}" -lt "${EZIG_MIN}"; then
+			# Candidate does not satisfy EZIG_MIN condition.
+			continue
+		fi
+
+		if [[ -n ${EZIG_MAX_EXCLUSIVE} ]] \
+			   && ver_test "${ver}" -ge "${EZIG_MAX_EXCLUSIVE}"; then
+			# Candidate does not satisfy EZIG_MAX_EXCLUSIVE condition.
+			continue
+		fi
+
+		if [[ -n ${selected_ver} ]] \
+			   && ver_test "${selected_ver}" -gt "${ver}"; then
+			# Candidate is older than the currently selected candidate.
+			continue
+		fi
+
+		selected="${candidate}"
+		selected_ver="${ver}"
+	done
+
+	if [[ -z ${selected} ]]; then
+		die "Could not find (suitable) zig installation in PATH"
+	fi
+
+	export EZIG="${selected}"
+	export EZIG_VER="${ver}"
+}
+
+# Invoke zig with the optionally provided arguments.
+ezig() {
+	zig-set_EZIG
+
+	# Unfortunately, we cannot add more args here, since syntax is different
+	# for every subcommands. Yes, even target/cpu :( f.i. :
+	# -target/-mcpu for zig build-exe vs -Dtarget/-Dcpu for zig build-
+	# -OReleaseSafe for zig build-exe vs -DReleaseSafe for zig build
+	# (or even none, if hardcoded by upstream so choice is -Drelease=true/false)
+	# Ofc we can patch this, but still...
+
+	edo "${EZIG}" "${@}"
+}
+
+src_unpack() {
+	git-r3_src_unpack
+	cd "${S}" || die
+	# "zig build" doesn't have "fetch" subcommand yet
+	ezig build --help || die "Fetching Zig modules failed"
+}
+
+src_compile() {
+	ezig build -Doptimize=ReleaseSafe --verbose || die
+}
+
+src_install() {
+	DESTDIR="${ED}" ezig build install --prefix /usr -Doptimize=ReleaseSafe --verbose || die
+	dodoc README.md
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/proj/guru:dev commit in: app-benchmarks/poop/
@ 2024-08-01 19:52 Eric Joldasov
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Joldasov @ 2024-08-01 19:52 UTC (permalink / raw
  To: gentoo-commits

commit:     2665bb83705edb8cc292f25d6eda468ffe7bcfde
Author:     Eric Joldasov <bratishkaerik <AT> landless-city <DOT> net>
AuthorDate: Thu Aug  1 19:51:06 2024 +0000
Commit:     Eric Joldasov <bratishkaerik <AT> getgoogleoff <DOT> me>
CommitDate: Thu Aug  1 19:51:06 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=2665bb83

app-benchmarks/poop: Zig is not needed at runtime

Signed-off-by: Eric Joldasov <bratishkaerik <AT> landless-city.net>

 app-benchmarks/poop/poop-9999.ebuild | 1 -
 1 file changed, 1 deletion(-)

diff --git a/app-benchmarks/poop/poop-9999.ebuild b/app-benchmarks/poop/poop-9999.ebuild
index a56a627a2..e44812399 100644
--- a/app-benchmarks/poop/poop-9999.ebuild
+++ b/app-benchmarks/poop/poop-9999.ebuild
@@ -17,7 +17,6 @@ EZIG_MIN="9999"
 EZIG_MAX_EXCLUSIVE="99991"
 
 DEPEND="dev-lang/zig:${EZIG_MIN}"
-RDEPEND="${DEPEND}"
 
 # see https://github.com/ziglang/zig/issues/3382
 # For now, Zig Build System doesn't support CFLAGS/LDFLAGS/etc.


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-08-01 19:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-01 19:52 [gentoo-commits] repo/proj/guru:dev commit in: app-benchmarks/poop/ Eric Joldasov
  -- strict thread matches above, loose matches on Subject: below --
2023-06-14  9:26 Eric Joldasov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox