mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 00:43:20 +00:00
peertube: parallelize gzip and brotli step (#319092)
This commit is contained in:
parent
b15dd7203f
commit
accc33c07d
@ -8,6 +8,7 @@
|
|||||||
, brotli
|
, brotli
|
||||||
, fixup-yarn-lock
|
, fixup-yarn-lock
|
||||||
, jq
|
, jq
|
||||||
|
, fd
|
||||||
, nodejs
|
, nodejs
|
||||||
, which
|
, which
|
||||||
, yarn
|
, yarn
|
||||||
@ -76,7 +77,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
outputs = [ "out" "cli" "runner" ];
|
outputs = [ "out" "cli" "runner" ];
|
||||||
|
|
||||||
nativeBuildInputs = [ brotli fixup-yarn-lock jq which yarn ];
|
nativeBuildInputs = [ brotli fixup-yarn-lock jq which yarn fd ];
|
||||||
|
|
||||||
buildInputs = [ nodejs ];
|
buildInputs = [ nodejs ];
|
||||||
|
|
||||||
@ -161,10 +162,10 @@ stdenv.mkDerivation rec {
|
|||||||
ln -s $runner/dist/peertube-runner.js $runner/bin/peertube-runner
|
ln -s $runner/dist/peertube-runner.js $runner/bin/peertube-runner
|
||||||
|
|
||||||
# Create static gzip and brotli files
|
# Create static gzip and brotli files
|
||||||
find $out/client/dist -type f -regextype posix-extended -iregex '.*\.(css|eot|html|js|json|svg|webmanifest|xlf)' | while read file; do
|
fd -e css -e eot -e html -e js -e json -e svg -e webmanifest -e xlf \
|
||||||
gzip -9 -n -c $file > $file.gz
|
--type file --search-path $out/client/dist \
|
||||||
brotli --best -f $file -o $file.br
|
--exec gzip -9 -n -c {} > {}.gz \;\
|
||||||
done
|
--exec brotli --best -f {} -o {}.br
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru.tests.peertube = nixosTests.peertube;
|
passthru.tests.peertube = nixosTests.peertube;
|
||||||
|
Loading…
Reference in New Issue
Block a user