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:
parent
005199faf7
commit
ef91c7bcd8
@ -31,7 +31,7 @@ rustPlatform.buildRustPackage rec {
|
|||||||
++ lib.optionals stdenv.isDarwin [ Security Foundation libiconv gettext ];
|
++ lib.optionals stdenv.isDarwin [ Security Foundation libiconv gettext ];
|
||||||
|
|
||||||
postBuild = ''
|
postBuild = ''
|
||||||
make prefix="$out"
|
make -j $NIX_BUILD_CORES prefix="$out"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# https://github.com/NixOS/nixpkgs/pull/98471#issuecomment-703100014 . We set
|
# https://github.com/NixOS/nixpkgs/pull/98471#issuecomment-703100014 . We set
|
||||||
@ -44,11 +44,11 @@ rustPlatform.buildRustPackage rec {
|
|||||||
doCheck = true;
|
doCheck = true;
|
||||||
|
|
||||||
preCheck = ''
|
preCheck = ''
|
||||||
make test
|
make -j $NIX_BUILD_CORES test
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
make prefix="$out" install
|
make -j $NIX_BUILD_CORES prefix="$out" install
|
||||||
'' + lib.optionalString stdenv.isDarwin ''
|
'' + lib.optionalString stdenv.isDarwin ''
|
||||||
for prog in $out/bin/*; do
|
for prog in $out/bin/*; do
|
||||||
wrapProgram "$prog" --prefix DYLD_LIBRARY_PATH : "${stfl}/lib"
|
wrapProgram "$prog" --prefix DYLD_LIBRARY_PATH : "${stfl}/lib"
|
||||||
|
Loading…
Reference in New Issue
Block a user