diff --git a/anda/langs/nim/nim/nim.spec b/anda/langs/nim/nim/nim.spec index cfba9b6540..d34565a4e9 100644 --- a/anda/langs/nim/nim/nim.spec +++ b/anda/langs/nim/nim/nim.spec @@ -7,12 +7,11 @@ Release: 1%?dist Summary: Imperative, multi-paradigm, compiled programming language License: MIT and BSD URL: https://nim-lang.org -Source0: https://nim-lang.org/download/nim-%{version}-linux_x64.tar.xz Source1: nim.1 Source2: nimgrep.1 Source3: nimble.1 Source4: nimsuggest.1 -BuildRequires: gcc mold git gcc-c++ nodejs openssl-devel pkgconfig(bash-completion) gc-devel pcre-devel +BuildRequires: gcc mold git-core gcc-c++ nodejs openssl-devel pkgconfig(bash-completion) gc-devel pcre-devel Requires: gcc @@ -46,7 +45,11 @@ and its standard library. %prep -%autosetup -n nim-%{version} +rm -rf ./* +# using git clone to include submodules +git clone --recurse-submodules -j8 https://github.com/nim-lang/Nim -b v%version --depth 1 . +# hack +cp /usr/bin/mold /usr/bin/ld %build @@ -57,15 +60,18 @@ export FCFLAGS="${FCFLAGS} -Ofast" export PATH="$(pwd):$(pwd)/bin:${PATH}" -mold -run nim c -d:danger koch.nim -mold -run koch boot -d:useLinenoise -t:-fPIE -l:-pie -d:release -d:nativeStacktrace -d:useGnuReadline +. ci/funs.sh +nimBuildCsourcesIfNeeded CFLAGS="${CFLAGS} -Ic_code -w -O3 -fno-strict-aliasing -fPIE" LDFLAGS="-ldl -lm -lrt -pie" + +nim c --noNimblePath --skipUserCfg --skipParentCfg --hints:off -d:danger koch.nim +koch boot -d:release -d:nimStrictMode --lib:lib %ifarch x86_64 -mold -run koch docs & +koch docs & %endif (cd lib && nim c --app:lib -d:createNimRtl -d:release nimrtl.nim) & -mold -run koch tools -t:-fPIE -l:-pie & -mold -run nim c -t:-fPIE -l:-pie -d:release nimsuggest/nimsuggest.nim & +koch tools -t:-fPIE -l:-pie & +nim c -d:danger -t:-fPIE -l:-pie nimsuggest/nimsuggest.nim & wait %ifarch x86_64 @@ -75,24 +81,24 @@ sed -i '/