static: get rid of django-compress
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
python3.withPackages
|
||||
(ps: [
|
||||
ps.django
|
||||
ps.django-compressor
|
||||
ps.geoip2
|
||||
]);
|
||||
in
|
||||
@@ -51,13 +50,12 @@ in
|
||||
--set E11SYNC_DATABASE_PATH "${databasePath}" \
|
||||
''} \
|
||||
--set E11SYNC_STATIC_ROOT "${e11sync-static.passthru.manifest}" \
|
||||
--set E11SYNC_COMPRESS_OFFLINE 1 \
|
||||
--set E11SYNC_DEBUG "" \
|
||||
--set GEOIP_PATH "${geoip-mmdb}" \
|
||||
'';
|
||||
passthru.tests.unit =
|
||||
runCommand "e11sync-test" {
|
||||
src = ../app;
|
||||
srcs = ../app;
|
||||
buildInputs = [
|
||||
pythonEnv
|
||||
dart-sass
|
||||
@@ -66,6 +64,7 @@ in
|
||||
unpackPhase
|
||||
patchShebangs --build app/manage.py
|
||||
export GEOIP_PATH="${geoip-mmdb}"
|
||||
export E11SYNC_STATIC_ROOT="${e11sync-static.passthru.manifest}"
|
||||
app/manage.py test app
|
||||
mkdir -p $out
|
||||
'';
|
||||
|
||||
@@ -9,33 +9,31 @@
|
||||
}: let
|
||||
self = stdenv.mkDerivation {
|
||||
name = "e11sync-static";
|
||||
src = ../app;
|
||||
srcs = [../app ../static];
|
||||
sourceRoot = ".";
|
||||
nativeBuildInputs = [
|
||||
python3Packages.django
|
||||
python3Packages.django-compressor
|
||||
dart-sass
|
||||
findutils
|
||||
];
|
||||
patchPhase = ''patchShebangs --build manage.py'';
|
||||
patchPhase = ''patchShebangs --build app/manage.py'';
|
||||
buildPhase = ''
|
||||
export E11SYNC_STATIC_ROOT=$PWD/static
|
||||
export E11SYNC_DEBUG=
|
||||
export E11SYNC_COMPRESS_OFFLINE=1
|
||||
./manage.py collectstatic
|
||||
./manage.py compress
|
||||
make -C static style.css
|
||||
app/manage.py collectstatic
|
||||
|
||||
find static/ \
|
||||
find app/_static \
|
||||
-name '*.css' -or \
|
||||
-name '*.js' -or \
|
||||
-name '*.svg' | \
|
||||
tee >(xargs -n1 -P''$(nproc) ${zopfli}/bin/zopfli) | \
|
||||
xargs -n1 -P''$(nproc) ${brotli}/bin/brotli
|
||||
'';
|
||||
installPhase = ''mv static $out'';
|
||||
installPhase = ''mv app/_static $out'';
|
||||
|
||||
passthru.manifest = runCommand "e11sync-static-manifest" {} ''
|
||||
mkdir -p $out/CACHE
|
||||
cp ${self}/CACHE/manifest.json $out/CACHE/
|
||||
mkdir -p $out
|
||||
cp ${self}/staticfiles.json $out/
|
||||
'';
|
||||
};
|
||||
in
|
||||
|
||||
Reference in New Issue
Block a user