From 1247e537b0c8e5ed780ab890cbce4612714a0fa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Thu, 9 May 2019 10:03:16 +0200 Subject: Make etherpad derivation pure It also moves .ep_initialized to /var/lib to allow proper initialization. --- pkgs/impure/etherpad-lite/default.nix | 69 ----------------------------------- 1 file changed, 69 deletions(-) delete mode 100644 pkgs/impure/etherpad-lite/default.nix (limited to 'pkgs/impure/etherpad-lite/default.nix') diff --git a/pkgs/impure/etherpad-lite/default.nix b/pkgs/impure/etherpad-lite/default.nix deleted file mode 100644 index c85bd7e..0000000 --- a/pkgs/impure/etherpad-lite/default.nix +++ /dev/null @@ -1,69 +0,0 @@ -{ session_key ? "/etc/etherpad-lite/SESSIONKEY.txt" -, api_key ? "/etc/etherpad-lite/APIKEY.txt" -, stdenv, mylibs, cacert, nodejs, python, fetchurl }: -let - jquery = fetchurl { - url = https://code.jquery.com/jquery-1.9.1.js; - sha256 = "0h4dk67yc9d0kadqxb6b33585f3x3559p6qmp70l00qwq030vn3v"; - }; - withModules = modules: package.overrideAttrs(old: { - buildPhase = old.buildPhase + - builtins.concatStringsSep "\n" - (map (n: "npm install ${n}; touch node_modules/${n}/.ep_initialized") modules); - # FIXME: ln -s don’t seem to work, etherpad seems - # unable to "touch" them after initialization - passthru = old.passthru // { - inherit modules; - withModules = moreModules: old.withModules (moreModules ++ modules); - }; - }); - package = stdenv.mkDerivation (mylibs.fetchedGithub ./etherpad-lite.json // rec { - __noChroot = true; - patches = [ ./libreoffice_patch.diff ]; - buildPhase = '' - export GIT_SSL_CAINFO=${cacert}/etc/ssl/certs/ca-bundle.crt - export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt - export HOME=$PWD - - touch src/.ep_initialized - cp -v src/static/custom/js.template src/static/custom/index.js - cp -v src/static/custom/js.template src/static/custom/pad.js - cp -v src/static/custom/js.template src/static/custom/timeslider.js - cp -v src/static/custom/css.template src/static/custom/index.css - cp -v src/static/custom/css.template src/static/custom/pad.css - cp -v src/static/custom/css.template src/static/custom/timeslider.css - - sed -i 's/var\/dirty.db/\/var\/lib\/etherpad-lite\/dirty.db/g' \ - settings.json.template - - mkdir -v node_modules - ln -s ../src node_modules/ep_etherpad-lite - - node bin/doc/generate doc/index.md --format=html \ - --template=doc/template.html > documentation.html - - cd src - npm install - cd .. - ''; - installPhase = '' - mkdir -p $out - install -t $out/src/ -vDm 644 src/.ep_initialized - cp -a node_modules $out/ - cp -a src/* $out/src/ - ln -sf ${session_key} $out/SESSIONKEY.txt - ln -sf ${api_key} $out/APIKEY.txt - cp ${jquery} $out/src/static/js/jquery.js - - mkdir $out/doc - install -t "$out/doc/" \ - -vDm 644 {CHANGELOG,CONTRIBUTING,README}.md \ - -vDm 644 documentation.html - ''; - buildInputs = [ nodejs python ]; - passthru = { - modules = []; - inherit withModules; - }; - }); -in package -- cgit v1.2.3