www-client/chawan: set compiler flags and linker flags properly for nimc

Another thanks to Agostino Sarubbo for finding this bug

code is mostly copy pasted from the nim_gen_config() function from
nim-utils.eclass, modified a bit to actually append to the original
nim.cfg, instead of replacing it

This should hopefully, fix the issue. With my testing, I tested by
setting the compiler to clang and then GCC, and thankfully when I
checked btop, nimc was actually using the appropriate compiler

Closes: https://bugs.gentoo.org/975973
Signed-off-by: ingenarel (NeoJesus) <ingenarel_neojesus@disroot.org>
This commit is contained in:
ingenarel (NeoJesus)
2026-05-30 18:43:15 +06:00
parent 907e99037c
commit 347405cba1
3 changed files with 81 additions and 0 deletions

View File

@@ -3,6 +3,8 @@
EAPI=8
inherit toolchain-funcs multiprocessing
DESCRIPTION="TUI web browser; supports CSS, images, JavaScript, and multiple web protocols"
HOMEPAGE="https://chawan.net"
@@ -43,3 +45,28 @@ src_prepare(){
die "Trying to sed the Makefile for lto failed!"
fi
}
src_configure(){
# code is mostly copy pasted from the nim_gen_config() function from nim-utils.eclass, modifed a bit to actually
# append to the original nim.cfg, instead of replacing it
cat >> "${S}"/nim.cfg <<- EOF || die "Failed to append to Nim config"
--parallelBuild:"$(makeopts_jobs)"
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}"
EOF
default
}