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

View File

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