commit:     582cf2584bc6d154d48a3316252068f674c68f41
Author:     Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
AuthorDate: Tue Nov  8 16:13:19 2022 +0000
Commit:     Anna Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
CommitDate: Tue Nov  8 17:11:30 2022 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=582cf258

dev-util/gshards: new package, add 0.1

Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq.in>

 dev-util/gshards/files/0.1/gshards-get-pkgname.cr | 10 ++++++
 dev-util/gshards/files/0.1/gshards-has-targets.cr | 14 ++++++++
 dev-util/gshards/gshards-0.1.ebuild               | 39 +++++++++++++++++++++++
 dev-util/gshards/metadata.xml                     |  8 +++++
 4 files changed, 71 insertions(+)

diff --git a/dev-util/gshards/files/0.1/gshards-get-pkgname.cr 
b/dev-util/gshards/files/0.1/gshards-get-pkgname.cr
new file mode 100644
index 000000000..4a1947221
--- /dev/null
+++ b/dev-util/gshards/files/0.1/gshards-get-pkgname.cr
@@ -0,0 +1,10 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+require "yaml"
+
+yaml = File.open("shard.yml") do |file|
+  YAML.parse(file)
+end
+
+puts yaml["name"].as_s

diff --git a/dev-util/gshards/files/0.1/gshards-has-targets.cr 
b/dev-util/gshards/files/0.1/gshards-has-targets.cr
new file mode 100644
index 000000000..1b2eb308e
--- /dev/null
+++ b/dev-util/gshards/files/0.1/gshards-has-targets.cr
@@ -0,0 +1,14 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+require "yaml"
+
+yaml = File.open("shard.yml") do |file|
+  YAML.parse(file)
+end
+
+if yaml["targets"]?
+  exit(0)
+end
+
+exit(1)

diff --git a/dev-util/gshards/gshards-0.1.ebuild 
b/dev-util/gshards/gshards-0.1.ebuild
new file mode 100644
index 000000000..e5541387e
--- /dev/null
+++ b/dev-util/gshards/gshards-0.1.ebuild
@@ -0,0 +1,39 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit crystal-utils multiprocessing toolchain-funcs
+
+DESCRIPTION="Small helper tools to aid installing Crystal packages in Gentoo"
+HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage";
+S="${WORKDIR}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64"
+
+RDEPEND="
+       dev-libs/boehm-gc
+       dev-libs/libevent:=
+       dev-libs/libyaml
+"
+DEPEND="${RDEPEND}"
+BDEPEND="${CRYSTAL_DEPS}"
+
+QA_FLAGS_IGNORED='.*'
+
+src_configure() {
+       crystal_configure
+       tc-export CC
+}
+
+src_compile() {
+       for prog in "${FILESDIR}"/${PV}/gshards-*.cr; do
+               ecrystal build "${prog}" --verbose --threads=$(makeopts_jobs)
+       done
+}
+
+src_install() {
+       dobin gshards-*
+}

diff --git a/dev-util/gshards/metadata.xml b/dev-util/gshards/metadata.xml
new file mode 100644
index 000000000..7ebbd0334
--- /dev/null
+++ b/dev-util/gshards/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>cyber+gen...@sysrq.in</email>
+               <name>Anna</name>
+       </maintainer>
+</pkgmetadata>

Reply via email to