diff options
author | Anna Vyalkova <cyber+gentoo@sysrq.in> | 2022-07-14 01:02:11 +0500 |
---|---|---|
committer | Maciej Barć <xgqt@gentoo.org> | 2022-07-13 22:40:30 +0200 |
commit | 04f9f72582c8aa0e532fec8378e4ee0933ffc99c (patch) | |
tree | 894e05327a8903484ca7d07cd53628f5da2b7b58 /dev-lang/nim | |
parent | dev-lang/nim: add experimental patches (diff) | |
download | gentoo-04f9f72582c8aa0e532fec8378e4ee0933ffc99c.tar.gz gentoo-04f9f72582c8aa0e532fec8378e4ee0933ffc99c.tar.bz2 gentoo-04f9f72582c8aa0e532fec8378e4ee0933ffc99c.zip |
dev-lang/nim: respect flags
Signed-off-by: Anna Vyalkova <cyber+gentoo@sysrq.in>
Closes: https://github.com/gentoo/gentoo/pull/26387
Signed-off-by: Maciej Barć <xgqt@gentoo.org>
Diffstat (limited to 'dev-lang/nim')
-rw-r--r-- | dev-lang/nim/nim-1.6.6-r1.ebuild | 64 |
1 files changed, 33 insertions, 31 deletions
diff --git a/dev-lang/nim/nim-1.6.6-r1.ebuild b/dev-lang/nim/nim-1.6.6-r1.ebuild index 0ab7dd480dca..9d4da4f7a23b 100644 --- a/dev-lang/nim/nim-1.6.6-r1.ebuild +++ b/dev-lang/nim/nim-1.6.6-r1.ebuild @@ -3,7 +3,7 @@ EAPI=8 -inherit bash-completion-r1 multiprocessing toolchain-funcs +inherit bash-completion-r1 multiprocessing toolchain-funcs xdg-utils DESCRIPTION="compiled, garbage-collected systems programming language" HOMEPAGE="https://nim-lang.org/" @@ -24,20 +24,8 @@ DEPEND="${RDEPEND}" PATCHES=( "${FILESDIR}"/${PN}-0.20.0-paths.patch ) -# Generated by nim -QA_FLAGS_IGNORED=" -usr/bin/atlas -usr/bin/nim -usr/bin/nim_dbg -usr/bin/nimble -usr/bin/nimgrep -usr/bin/nimpretty -usr/bin/nimsuggest -usr/bin/testament -" - _run() { - echo "Running: ${@}" + einfo "Running: ${@}" PATH="${S}/bin:${PATH}" "${@}" || die "Failed: \"${*}\"" } @@ -46,6 +34,31 @@ nim_use_enable() { use "${1}" && echo "-d:${2}" } +# Borrowed from nim-utils.eclass (guru overlay). +nim_gen_config() { + cat > nim.cfg <<- EOF || die "Failed to create Nim config" + cc:"gcc" + gcc.exe:"$(tc-getCC)" + gcc.linkerexe:"$(tc-getCC)" + gcc.cpp.exe:"$(tc-getCXX)" + gcc.cpp.linkerexe:"$(tc-getCXX)" + gcc.options.speed:"${CFLAGS}" + gcc.options.size:"${CFLAGS}" + gcc.options.debug:"${CFLAGS}" + gcc.options.always:"${CPPFLAGS}" + gcc.options.linker:"${LDFLAGS}" + gcc.cpp.options.speed:"${CXXFLAGS}" + gcc.cpp.options.size:"${CXXFLAGS}" + gcc.cpp.options.debug:"${CXXFLAGS}" + gcc.cpp.options.always:"${CPPFLAGS}" + gcc.cpp.options.linker:"${LDFLAGS}" + + $([[ "${NOCOLOR}" == true || "${NOCOLOR}" == yes ]] && echo '--colors:"off"') + -d:"$(usex debug debug release)" + --parallelBuild:"$(makeopts_jobs)" + EOF +} + src_prepare() { default @@ -55,31 +68,20 @@ src_prepare() { } src_configure() { - export XDG_CACHE_HOME="${T}/cache" # 667182 + xdg_environment_reset # bug 667182 + unset NIMBLE_DIR tc-export CC CXX LD - local build_type - if use debug ; then - build_type="debug" - else - build_type="release" - fi - export NIM_OPTS=( --parallelBuild:$(makeopts_jobs) -d:${build_type} ) - - # Override defaults - echo "gcc.exe = \"$(tc-getCC)\"" >> config/nim.cfg || die - echo "gcc.linkerexe = \"$(tc-getCC)\"" >> config/nim.cfg || die - echo "gcc.cpp.exe = \"$(tc-getCXX)\"" >> config/nim.cfg || die - echo "gcc.cpp.linkerexe = \"$(tc-getCXX)\"" >> config/nim.cfg || die + nim_gen_config } src_compile() { _run bash ./build.sh - _run ./bin/nim ${NIM_OPTS[@]} compile koch - _run ./koch boot ${NIM_OPTS[@]} $(nim_use_enable readline useGnuReadline) - _run ./koch tools ${NIM_OPTS[@]} + _run ./bin/nim compile koch + _run ./koch boot $(nim_use_enable readline useGnuReadline) + _run ./koch tools } src_test() { |