1
Fork 0
This commit is contained in:
Motiejus Jakštys 2024-01-17 12:59:37 +02:00
parent 33d6c66029
commit 91806efc72
1 changed files with 6 additions and 6 deletions

View File

@ -2,7 +2,6 @@
stdenv, stdenv,
runCommand, runCommand,
python3Packages, python3Packages,
coreutils,
zopfli, zopfli,
brotli, brotli,
findutils, findutils,
@ -18,22 +17,23 @@
dart-sass dart-sass
zopfli zopfli
brotli brotli
gawk
findutils
]; ];
patchPhase = ''patchShebangs --build manage.py''; patchPhase = ''patchShebangs --build manage.py'';
buildPhase = '' buildPhase = ''
mkdir -p static export E11SYNC_STATIC_ROOT=$PWD/static
export E11SYNC_STATIC_ROOT=static
export E11SYNC_DEBUG= export E11SYNC_DEBUG=
export E11SYNC_COMPRESS_OFFLINE=1 export E11SYNC_COMPRESS_OFFLINE=1
./manage.py collectstatic ./manage.py collectstatic
./manage.py compress ./manage.py compress
${findutils}/bin/find static/ \ find static/ \
-name '*.css' -or \ -name '*.css' -or \
-name '*.js' -or \ -name '*.js' -or \
-name '*.svg' | \ -name '*.svg' | \
${gawk}/bin/awk '{print "zopfli "$0;print "brotli "$0}' | \ awk '{print "zopfli \""$0"\"";print "brotli \""$0"\""}' | \
${findutils}/bin/xargs -P''$(${coreutils}/bin/nproc) -I{} $SHELL -c {} xargs -P''$(nproc) -I{} $SHELL -c {}
''; '';
installPhase = ''mv static $out''; installPhase = ''mv static $out'';