1
Fork 0

e11sync-static: patch sources correctly

This commit is contained in:
Motiejus Jakštys 2024-01-14 22:49:44 +02:00
parent 75fb04d227
commit 87cdffd212
2 changed files with 9 additions and 9 deletions

View File

@ -17,17 +17,18 @@ stdenv.mkDerivation {
python3Packages.django-compressor
dart-sass
];
patchPhase = ''patchShebangs --build app/manage.py'';
buildPhase = ''
mkdir -p static
export E11SYNC_STATIC_ROOT=static
export E11SYNC_DEBUG=
export E11SYNC_COMPRESS_OFFLINE=1
${python3}/bin/python3 ${self}/app/manage.py collectstatic
${python3}/bin/python3 ${self}/app/manage.py compress
app/manage.py collectstatic
app/manage.py compress
${findutils}/bin/find static/CACHE -name '*.css' | \
${findutils}/bin/xargs -P''$(${coreutils}/bin/nproc) -I{} sh -c \
"${zopfli}/bin/zopfli {} && ${brotli}/bin/brotli {}"
${findutils}/bin/xargs -P''$(${coreutils}/bin/nproc) -I{} sh -c \
"${zopfli}/bin/zopfli {} && ${brotli}/bin/brotli {}"
'';
installPhase = ''mv static $out'';
}

View File

@ -20,10 +20,10 @@ stdenv.mkDerivation {
];
nativeBuildInputs = [makeWrapper];
src = self;
dontUnpack = true;
buildPhase = ''
mkdir -p $out;
cp -r ${self}/app $out
patchPhase = ''patchShebangs --build app/manage.py'';
buildPhase = ''mkdir -p $out'';
installPhase = ''
cp -r app $out
makeWrapper ${python3Packages.gunicorn}/bin/gunicorn $out/bin/e11sync-gunicorn \
--chdir $out/app \
--set-default E11SYNC_HTTP_PORT ${toString gunicornPort} \
@ -39,7 +39,6 @@ stdenv.mkDerivation {
passthru.tests = {
unit =
runCommand "e11sync-test" {
src = self;
buildInputs = [
python3Packages.django_5
python3Packages.django-compressor