From b70ece6ec5263b28ef71f9881759dfc2fa7ad4e0 Mon Sep 17 00:00:00 2001 From: "Anna (cybertailor) Vyalkova" Date: Sat, 16 Jul 2022 12:08:16 +0500 Subject: [PATCH] nim-utils.eclass: allow generating nim.cfg in custom dir Signed-off-by: Anna (cybertailor) Vyalkova --- eclass/nim-utils.eclass | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/eclass/nim-utils.eclass b/eclass/nim-utils.eclass index 951234d1ba..0106d9dfae 100644 --- a/eclass/nim-utils.eclass +++ b/eclass/nim-utils.eclass @@ -87,15 +87,18 @@ etestament() { } # @FUNCTION: nim_gen_config -# @USAGE: +# @USAGE: [] # @DESCRIPTION: -# Generate the ${WORKDIR}/nim.cfg to respect user's toolchain and preferences. +# Generate a nim.cfg file in (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)"