newsboat: run parallel build for 'make' commands
`newsboat` contains quite a bit of C++ code built by custom Makefile.
`rust` code and tests already get build in parallel. The change enables
build parallelism for custom Makefile as well.
The effect on my machine is 78% build time reduction (4.5x speedup):
Before the change:
$ time nix build -f. newsboat --rebuild
real 6m20,904s
user 0m0,345s
sys 0m0,167s
After the change:
$ time nix build -f. newsboat
...
real 1m23,592s
user 0m0,277s
sys 0m0,097s
This commit is contained in:
@@ -31,7 +31,7 @@ rustPlatform.buildRustPackage rec {
|
||||
++ lib.optionals stdenv.isDarwin [ Security Foundation libiconv gettext ];
|
||||
|
||||
postBuild = ''
|
||||
make prefix="$out"
|
||||
make -j $NIX_BUILD_CORES prefix="$out"
|
||||
'';
|
||||
|
||||
# https://github.com/NixOS/nixpkgs/pull/98471#issuecomment-703100014 . We set
|
||||
@@ -44,11 +44,11 @@ rustPlatform.buildRustPackage rec {
|
||||
doCheck = true;
|
||||
|
||||
preCheck = ''
|
||||
make test
|
||||
make -j $NIX_BUILD_CORES test
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
make prefix="$out" install
|
||||
make -j $NIX_BUILD_CORES prefix="$out" install
|
||||
'' + lib.optionalString stdenv.isDarwin ''
|
||||
for prog in $out/bin/*; do
|
||||
wrapProgram "$prog" --prefix DYLD_LIBRARY_PATH : "${stfl}/lib"
|
||||
|
||||
Reference in New Issue
Block a user