commit: 95ee170d0def1727cc0ca5875ac32d5448378271
Author: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
AuthorDate: Thu Oct 30 17:26:10 2025 +0000
Commit: Anna Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
CommitDate: Thu Nov 6 12:25:31 2025 +0000
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=95ee170d
shards.eclass: add examples
Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq.in>
eclass/shards.eclass | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 57 insertions(+)
diff --git a/eclass/shards.eclass b/eclass/shards.eclass
index 0b81c185e1..ec29f3c702 100644
--- a/eclass/shards.eclass
+++ b/eclass/shards.eclass
@@ -14,6 +14,63 @@
# Shards as a build system.
#
# If the package has no shard.yml(5) file, use crystal-utils.eclass(5) instead.
+# @EXAMPLE:
+# Typical ebuild for a Crystal application:
+#
+# @CODE@
+# EAPI=8
+#
+# inherit shards
+#
+# ...
+#
+# DEPEND="dev-crystal/foo"
+#
+# CRYSTAL_DEFINES=( -Denable_cli )
+#
+# src_install() {
+# dobin hello-world
+# einstalldocs
+# }
+# @CODE@
+#
+#
+# Typical ebuild for a Crystal library:
+#
+# @CODE@
+# EAPI=8
+#
+# inherit shards
+#
+# ...
+#
+# RDEPEND="
+# dev-crystal/bar
+# dev-crystal/baz
+# "
+# @CODE@
+#
+#
+# Typical ebuild for a hybrid Crystal library/applicaton:
+#
+# @CODE@
+# EAPI=8
+#
+# inherit shards
+#
+# ...
+#
+# DEPEND="
+# dev-crystal/bar
+# dev-crystal/baz
+# "
+# RDEPEND="${DEPEND}"
+#
+# src_install() {
+# dobin helper-util
+# shards_src_install # install library sources
+# }
+# @CODE@
case ${EAPI} in
8) ;;