From 347405cba127deb37fcf78d8ac142ebbb0e2413b Mon Sep 17 00:00:00 2001 From: "ingenarel (NeoJesus)" Date: Sat, 30 May 2026 18:43:15 +0600 Subject: [PATCH] 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) --- www-client/chawan/chawan-0.3.3.ebuild | 27 +++++++++++++++++++++++++++ www-client/chawan/chawan-0.4.0.ebuild | 27 +++++++++++++++++++++++++++ www-client/chawan/chawan-9999.ebuild | 27 +++++++++++++++++++++++++++ 3 files changed, 81 insertions(+) diff --git a/www-client/chawan/chawan-0.3.3.ebuild b/www-client/chawan/chawan-0.3.3.ebuild index 416fc3890b..0bed1cef89 100644 --- a/www-client/chawan/chawan-0.3.3.ebuild +++ b/www-client/chawan/chawan-0.3.3.ebuild @@ -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 +} diff --git a/www-client/chawan/chawan-0.4.0.ebuild b/www-client/chawan/chawan-0.4.0.ebuild index ab069a1a28..81cd3402ea 100644 --- a/www-client/chawan/chawan-0.4.0.ebuild +++ b/www-client/chawan/chawan-0.4.0.ebuild @@ -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 +} diff --git a/www-client/chawan/chawan-9999.ebuild b/www-client/chawan/chawan-9999.ebuild index ab069a1a28..81cd3402ea 100644 --- a/www-client/chawan/chawan-9999.ebuild +++ b/www-client/chawan/chawan-9999.ebuild @@ -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 +}