commit:     09843a875f741d97a28a528d04dee47d0aa0347b
Author:     Anna Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
AuthorDate: Thu Jul 14 09:29:58 2022 +0000
Commit:     Maciej Barć <xgqt <AT> gentoo <DOT> org>
CommitDate: Thu Jul 14 14:19:14 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=09843a87

dev-lang/nim: several imrovements (with a revbump)

* mention sys-process/parallel integration

* build with linenoise unconditionally

* fix "calls cc directly" in stage1

* remove -O3 from default flags

* use edo instead of custom _run

Signed-off-by: Anna Vyalkova <cyber+gentoo <AT> sysrq.in>
Closes: https://github.com/gentoo/gentoo/pull/26399
Signed-off-by: Maciej Barć <xgqt <AT> gentoo.org>

 dev-lang/nim/files/nim-1.6.6-csources-flags.patch  | 11 ++++++
 .../{nim-1.6.6-r1.ebuild => nim-1.6.6-r2.ebuild}   | 43 +++++++++++-----------
 2 files changed, 33 insertions(+), 21 deletions(-)

diff --git a/dev-lang/nim/files/nim-1.6.6-csources-flags.patch 
b/dev-lang/nim/files/nim-1.6.6-csources-flags.patch
new file mode 100644
index 000000000000..9a39a900e82a
--- /dev/null
+++ b/dev-lang/nim/files/nim-1.6.6-csources-flags.patch
@@ -0,0 +1,11 @@
+--- a/build.sh
++++ b/build.sh
+@@ -60,7 +60,7 @@
+   fi
+   CC="sem -j $parallel --id $$ ${CC}"
+ fi
+-COMP_FLAGS="${CPPFLAGS:-} ${CFLAGS:-} -w -fmax-errors=3 -O3 
-fno-strict-aliasing -fno-ident $extraBuildArgs"
++COMP_FLAGS="${CPPFLAGS:-} ${CFLAGS:-} -w -fmax-errors=3 -fno-strict-aliasing 
-fno-ident $extraBuildArgs"
+ LINK_FLAGS="${LDFLAGS:-} "
+ PS4=""
+ # platform detection

diff --git a/dev-lang/nim/nim-1.6.6-r1.ebuild b/dev-lang/nim/nim-1.6.6-r2.ebuild
similarity index 73%
rename from dev-lang/nim/nim-1.6.6-r1.ebuild
rename to dev-lang/nim/nim-1.6.6-r2.ebuild
index 9d4da4f7a23b..79f9edc5c376 100644
--- a/dev-lang/nim/nim-1.6.6-r1.ebuild
+++ b/dev-lang/nim/nim-1.6.6-r2.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-inherit bash-completion-r1 multiprocessing toolchain-funcs xdg-utils
+inherit bash-completion-r1 edo multiprocessing toolchain-funcs xdg-utils
 
 DESCRIPTION="compiled, garbage-collected systems programming language"
 HOMEPAGE="https://nim-lang.org/";
@@ -15,24 +15,16 @@ SRC_URI="
 LICENSE="MIT"
 SLOT="0"
 KEYWORDS="~amd64 ~arm ~x86"
-IUSE="debug experimental +readline"
+IUSE="debug experimental"
 RESTRICT="test"  # need to sort out depends and numerous failures
 
-RDEPEND="readline? ( sys-libs/readline:0= )"
-DEPEND="${RDEPEND}"
+# BDEPEND="sys-process/parallel"
 # BDEPEND="test? ( net-libs/nodejs )"
 
-PATCHES=( "${FILESDIR}"/${PN}-0.20.0-paths.patch )
-
-_run() {
-       einfo "Running: ${@}"
-       PATH="${S}/bin:${PATH}" "${@}" || die "Failed: \"${*}\""
-}
-
-nim_use_enable() {
-       [[ -z "${2}" ]] && die "usage: nim_use_enable <USE flag> <compiler 
flag>"
-       use "${1}" && echo "-d:${2}"
-}
+PATCHES=(
+       "${FILESDIR}"/${PN}-0.20.0-paths.patch
+       "${FILESDIR}"/${PN}-1.6.6-csources-flags.patch
+)
 
 # Borrowed from nim-utils.eclass (guru overlay).
 nim_gen_config() {
@@ -77,19 +69,28 @@ src_configure() {
 }
 
 src_compile() {
-       _run bash ./build.sh
+       local -x PATH="${S}/bin:${PATH}"
 
-       _run ./bin/nim compile koch
-       _run ./koch boot $(nim_use_enable readline useGnuReadline)
-       _run ./koch tools
+       # Build from C sources
+       # Compiling with sys-process/parallel fails for some reason but 
hopefully
+       # we'll be able to enable it later...
+       edo bash build.sh  # --parallel "$(makeopts_jobs)"
+
+       edo ./bin/nim compile koch
+       edo ./koch boot -d:nimUseLinenoise --skipParentCfg:off
+       edo ./koch tools
 }
 
 src_test() {
-       _run ./koch test
+       local -x PATH="${S}/bin:${PATH}"
+
+       edo ./koch test
 }
 
 src_install() {
-       _run ./koch install "${ED}"
+       local -x PATH="${S}/bin:${PATH}"
+
+       edo ./koch install "${ED}"
 
        # "./koch install" installs only "nim" binary
        # but not the rest

Reply via email to