nim-utils.eclass: allow generating nim.cfg in custom dir

Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>
This commit is contained in:
Anna (cybertailor) Vyalkova
2022-07-16 12:08:16 +05:00
parent c27eb43e0a
commit b70ece6ec5

View File

@@ -87,15 +87,18 @@ etestament() {
}
# @FUNCTION: nim_gen_config
# @USAGE:
# @USAGE: [<dir>]
# @DESCRIPTION:
# Generate the ${WORKDIR}/nim.cfg to respect user's toolchain and preferences.
# Generate a nim.cfg file in <dir> (default: $WORKDIR) to respect user's
# toolchain and preferences.
nim_gen_config() {
debug-print-function ${FUNCNAME} "${@}"
xdg_environment_reset
cat > "${WORKDIR}/nim.cfg" <<- EOF || die "Failed to create Nim config"
local dir=${1:-${WORKDIR}}
cat > "${dir}"/nim.cfg <<- EOF || die "Failed to create Nim config"
cc:"gcc"
gcc.exe:"$(tc-getCC)"
gcc.linkerexe:"$(tc-getCC)"