1
Fork 0

e11sync-static: more paralellism when building

This commit is contained in:
Motiejus Jakštys 2024-01-17 08:59:02 +02:00
parent 2acf5a5bf6
commit c61408beab
1 changed files with 5 additions and 2 deletions

View File

@ -6,6 +6,7 @@
brotli, brotli,
findutils, findutils,
dart-sass, dart-sass,
gawk,
}: }:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "e11sync-static"; name = "e11sync-static";
@ -14,6 +15,8 @@ stdenv.mkDerivation {
python3Packages.django python3Packages.django
python3Packages.django-compressor python3Packages.django-compressor
dart-sass dart-sass
zopfli
brotli
]; ];
patchPhase = ''patchShebangs --build manage.py''; patchPhase = ''patchShebangs --build manage.py'';
buildPhase = '' buildPhase = ''
@ -28,8 +31,8 @@ stdenv.mkDerivation {
-name '*.css' -or \ -name '*.css' -or \
-name '*.js' -or \ -name '*.js' -or \
-name '*.svg' | \ -name '*.svg' | \
${findutils}/bin/xargs -P''$(${coreutils}/bin/nproc) -I{} sh -c \ ${gawk}/bin/awk '{print "zopfli "$0;print "brotli "$0}' | \
"${zopfli}/bin/zopfli {} && ${brotli}/bin/brotli {}" ${findutils}/bin/xargs -P''$(${coreutils}/bin/nproc) -I{} $SHELL -c {}
''; '';
installPhase = ''mv static $out''; installPhase = ''mv static $out'';
} }