From 87cdffd2129b41950078f3006ad61c47614749db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Sun, 14 Jan 2024 22:49:44 +0200 Subject: [PATCH] e11sync-static: patch sources correctly --- pkgs/e11sync-static.nix | 9 +++++---- pkgs/e11sync.nix | 9 ++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pkgs/e11sync-static.nix b/pkgs/e11sync-static.nix index db1a67c..d3d8409 100644 --- a/pkgs/e11sync-static.nix +++ b/pkgs/e11sync-static.nix @@ -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''; } diff --git a/pkgs/e11sync.nix b/pkgs/e11sync.nix index 93cf944..1fa9e89 100644 --- a/pkgs/e11sync.nix +++ b/pkgs/e11sync.nix @@ -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