mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-01-19 14:07:01 +01:00
gnu: nim: Enable parallel building.
* gnu/packages/nim.scm (nim)[arguments]: Adjust custom 'build phase to add parallel flag. [native-inputs]: Add parallel.
This commit is contained in:
parent
6bc9c73f72
commit
4d41dad4ba
1 changed files with 10 additions and 3 deletions
|
@ -28,6 +28,7 @@ (define-module (gnu packages nim)
|
||||||
#:use-module (guix packages)
|
#:use-module (guix packages)
|
||||||
#:use-module (gnu packages bdw-gc)
|
#:use-module (gnu packages bdw-gc)
|
||||||
#:use-module (gnu packages certs)
|
#:use-module (gnu packages certs)
|
||||||
|
#:use-module (gnu packages parallel)
|
||||||
#:use-module (gnu packages pcre)
|
#:use-module (gnu packages pcre)
|
||||||
#:use-module (gnu packages sqlite)
|
#:use-module (gnu packages sqlite)
|
||||||
#:use-module (gnu packages tls))
|
#:use-module (gnu packages tls))
|
||||||
|
@ -104,10 +105,16 @@ (define-public nim
|
||||||
(substitute* (find-files "c_code" "stdlib_osproc\\.nim\\.c")
|
(substitute* (find-files "c_code" "stdlib_osproc\\.nim\\.c")
|
||||||
(("\"/bin/sh\", 7") (format #f "~s, ~s" sh (string-length sh)))))))
|
(("\"/bin/sh\", 7") (format #f "~s, ~s" sh (string-length sh)))))))
|
||||||
(replace 'build
|
(replace 'build
|
||||||
(lambda _
|
(lambda* (#:key (parallel-build? #t) #:allow-other-keys)
|
||||||
(setenv "XDG_CACHE_HOME" "./cache-home")
|
(setenv "XDG_CACHE_HOME" "./cache-home")
|
||||||
|
(setenv "HOME" "./cache-home")
|
||||||
(mkdir-p "./cache-home")
|
(mkdir-p "./cache-home")
|
||||||
(invoke "sh" "build.sh")
|
(invoke "sh" "build.sh"
|
||||||
|
"--parallel"
|
||||||
|
(if parallel-build?
|
||||||
|
(number->string (parallel-job-count))
|
||||||
|
"1"))
|
||||||
|
(sleep 5) ; Wait for the parallel builds to finish.
|
||||||
(invoke "./bin/nim" "c" "-d:release" "koch")
|
(invoke "./bin/nim" "c" "-d:release" "koch")
|
||||||
(invoke "./koch" "boot" "-d:release")
|
(invoke "./koch" "boot" "-d:release")
|
||||||
(invoke "./koch" "tools")))
|
(invoke "./koch" "tools")))
|
||||||
|
@ -139,7 +146,7 @@ (define-public nim
|
||||||
(copy-file "dist/nimble/nimble.bash-completion"
|
(copy-file "dist/nimble/nimble.bash-completion"
|
||||||
(string-append zsh "/_nimble"))))))))
|
(string-append zsh "/_nimble"))))))))
|
||||||
(inputs (list libgc openssl pcre sqlite))
|
(inputs (list libgc openssl pcre sqlite))
|
||||||
(native-inputs (list nss-certs))
|
(native-inputs (list nss-certs parallel))
|
||||||
(home-page "https://nim-lang.org")
|
(home-page "https://nim-lang.org")
|
||||||
(synopsis "Statically-typed, imperative programming language")
|
(synopsis "Statically-typed, imperative programming language")
|
||||||
(description "Nim (formerly known as Nimrod) is a statically-typed,
|
(description "Nim (formerly known as Nimrod) is a statically-typed,
|
||||||
|
|
Loading…
Reference in a new issue