mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-19 12:03:02 -04:00
crystal-utils.eclass: introduce mycrystalargs
Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>
This commit is contained in:
@@ -61,7 +61,19 @@ _crystal_get_debug_opt() {
|
|||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
# Set Crystal environment variables to match user settings.
|
# 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.
|
# Must be run or ecrystal/eshards will fail.
|
||||||
|
#
|
||||||
|
# @CODE
|
||||||
|
# src_configure() {
|
||||||
|
# local mycrystalargs=(
|
||||||
|
# -Dfoo
|
||||||
|
# )
|
||||||
|
# crystal_configure
|
||||||
|
# }
|
||||||
|
# @CODE
|
||||||
crystal_configure() {
|
crystal_configure() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "${@}"
|
||||||
|
|
||||||
@@ -69,6 +81,12 @@ crystal_configure() {
|
|||||||
export CRYSTAL_CACHE_DIR="${T}/crystal"
|
export CRYSTAL_CACHE_DIR="${T}/crystal"
|
||||||
export SHARDS_CACHE_PATH="${T}/shards"
|
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=(
|
local args=(
|
||||||
--link-flags="\"${LDFLAGS}\""
|
--link-flags="\"${LDFLAGS}\""
|
||||||
--release
|
--release
|
||||||
@@ -78,6 +96,7 @@ crystal_configure() {
|
|||||||
$(is-flagq -mcpu && echo "--mcpu=$(get-flag mcpu)")
|
$(is-flagq -mcpu && echo "--mcpu=$(get-flag mcpu)")
|
||||||
$(is-flagq -mcmodel && echo "--mcmodel=$(get-flag mcmodel)")
|
$(is-flagq -mcmodel && echo "--mcmodel=$(get-flag mcmodel)")
|
||||||
# TODO: --mattr
|
# TODO: --mattr
|
||||||
|
"${mycrystalargs[@]}"
|
||||||
)
|
)
|
||||||
|
|
||||||
export CRYSTAL_OPTS="${args[@]}"
|
export CRYSTAL_OPTS="${args[@]}"
|
||||||
|
|||||||
@@ -64,7 +64,6 @@ shards_src_configure() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# @FUNCTION: shards_src_compile
|
# @FUNCTION: shards_src_compile
|
||||||
# @USAGE: [<args>...]
|
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
# General function for building packages using Shards.
|
# General function for building packages using Shards.
|
||||||
shards_src_compile() {
|
shards_src_compile() {
|
||||||
@@ -73,7 +72,6 @@ shards_src_compile() {
|
|||||||
local build_args=(
|
local build_args=(
|
||||||
--threads=$(makeopts_jobs)
|
--threads=$(makeopts_jobs)
|
||||||
--verbose
|
--verbose
|
||||||
"${@}"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if gshards-has-targets; then
|
if gshards-has-targets; then
|
||||||
|
|||||||
Reference in New Issue
Block a user