aboutsummaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorAnna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>2022-11-09 12:32:49 +0500
committerAnna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>2022-11-09 12:32:49 +0500
commit2946a0ea45c40df19cf06c128ebdba892df4404e (patch)
treed33e1cc362c4b2f448135ea45753e74c5dae4872 /eclass
parentdev-crystal/athena-negotiation: rename package (diff)
downloadguru-2946a0ea45c40df19cf06c128ebdba892df4404e.tar.gz
guru-2946a0ea45c40df19cf06c128ebdba892df4404e.tar.bz2
guru-2946a0ea45c40df19cf06c128ebdba892df4404e.zip
crystal-utils.eclass: introduce mycrystalargs
Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/crystal-utils.eclass19
-rw-r--r--eclass/shards.eclass2
2 files changed, 19 insertions, 2 deletions
diff --git a/eclass/crystal-utils.eclass b/eclass/crystal-utils.eclass
index cb67682a6..8f8df3cc3 100644
--- a/eclass/crystal-utils.eclass
+++ b/eclass/crystal-utils.eclass
@@ -61,7 +61,19 @@ _crystal_get_debug_opt() {
# @DESCRIPTION:
# Set Crystal environment variables to match user settings.
#
+# Passes arguments to Crystal by reading from an optionally pre-defined local
+# mycrystalargs bash array.
+#
# Must be run or ecrystal/eshards will fail.
+#
+# @CODE
+# src_configure() {
+# local mycrystalargs=(
+# -Dfoo
+# )
+# crystal_configure
+# }
+# @CODE
crystal_configure() {
debug-print-function ${FUNCNAME} "${@}"
@@ -69,6 +81,12 @@ crystal_configure() {
export CRYSTAL_CACHE_DIR="${T}/crystal"
export SHARDS_CACHE_PATH="${T}/shards"
+ [[ -z ${mycrystalargs} ]] && local -a mycrystalargs=()
+ local mycrystalargstype=$(declare -p mycrystalargs 2>&-)
+ if [[ "${mycrystalargstype}" != "declare -a mycrystalargs="* ]]; then
+ die "mycrystalargs must be declared as array"
+ fi
+
local args=(
--link-flags="\"${LDFLAGS}\""
--release
@@ -78,6 +96,7 @@ crystal_configure() {
$(is-flagq -mcpu && echo "--mcpu=$(get-flag mcpu)")
$(is-flagq -mcmodel && echo "--mcmodel=$(get-flag mcmodel)")
# TODO: --mattr
+ "${mycrystalargs[@]}"
)
export CRYSTAL_OPTS="${args[@]}"
diff --git a/eclass/shards.eclass b/eclass/shards.eclass
index 95fe26226..756fdf335 100644
--- a/eclass/shards.eclass
+++ b/eclass/shards.eclass
@@ -64,7 +64,6 @@ shards_src_configure() {
}
# @FUNCTION: shards_src_compile
-# @USAGE: [<args>...]
# @DESCRIPTION:
# General function for building packages using Shards.
shards_src_compile() {
@@ -73,7 +72,6 @@ shards_src_compile() {
local build_args=(
--threads=$(makeopts_jobs)
--verbose
- "${@}"
)
if gshards-has-targets; then