diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-05-08 10:56:21 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-05-08 10:56:21 +0200 |
commit | a8bfce17c5eda890d3486357952572f4c1c6b18a (patch) | |
tree | e7acfe9fa0aa99cb4b54f941bc6742ee897393c6 /pkgs/impure/etherpad-lite | |
parent | fd2d83bd2bf20fafc63daf5041db0151a4b4d17d (diff) | |
download | Nix-a8bfce17c5eda890d3486357952572f4c1c6b18a.tar.gz Nix-a8bfce17c5eda890d3486357952572f4c1c6b18a.tar.zst Nix-a8bfce17c5eda890d3486357952572f4c1c6b18a.zip |
Move etherpad-lite to pkgs
Diffstat (limited to 'pkgs/impure/etherpad-lite')
-rw-r--r-- | pkgs/impure/etherpad-lite/default.nix | 69 | ||||
-rw-r--r-- | pkgs/impure/etherpad-lite/etherpad-lite.json | 15 | ||||
-rw-r--r-- | pkgs/impure/etherpad-lite/libreoffice_patch.diff | 11 |
3 files changed, 95 insertions, 0 deletions
diff --git a/pkgs/impure/etherpad-lite/default.nix b/pkgs/impure/etherpad-lite/default.nix new file mode 100644 index 0000000..c85bd7e --- /dev/null +++ b/pkgs/impure/etherpad-lite/default.nix | |||
@@ -0,0 +1,69 @@ | |||
1 | { session_key ? "/etc/etherpad-lite/SESSIONKEY.txt" | ||
2 | , api_key ? "/etc/etherpad-lite/APIKEY.txt" | ||
3 | , stdenv, mylibs, cacert, nodejs, python, fetchurl }: | ||
4 | let | ||
5 | jquery = fetchurl { | ||
6 | url = https://code.jquery.com/jquery-1.9.1.js; | ||
7 | sha256 = "0h4dk67yc9d0kadqxb6b33585f3x3559p6qmp70l00qwq030vn3v"; | ||
8 | }; | ||
9 | withModules = modules: package.overrideAttrs(old: { | ||
10 | buildPhase = old.buildPhase + | ||
11 | builtins.concatStringsSep "\n" | ||
12 | (map (n: "npm install ${n}; touch node_modules/${n}/.ep_initialized") modules); | ||
13 | # FIXME: ln -s don’t seem to work, etherpad seems | ||
14 | # unable to "touch" them after initialization | ||
15 | passthru = old.passthru // { | ||
16 | inherit modules; | ||
17 | withModules = moreModules: old.withModules (moreModules ++ modules); | ||
18 | }; | ||
19 | }); | ||
20 | package = stdenv.mkDerivation (mylibs.fetchedGithub ./etherpad-lite.json // rec { | ||
21 | __noChroot = true; | ||
22 | patches = [ ./libreoffice_patch.diff ]; | ||
23 | buildPhase = '' | ||
24 | export GIT_SSL_CAINFO=${cacert}/etc/ssl/certs/ca-bundle.crt | ||
25 | export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt | ||
26 | export HOME=$PWD | ||
27 | |||
28 | touch src/.ep_initialized | ||
29 | cp -v src/static/custom/js.template src/static/custom/index.js | ||
30 | cp -v src/static/custom/js.template src/static/custom/pad.js | ||
31 | cp -v src/static/custom/js.template src/static/custom/timeslider.js | ||
32 | cp -v src/static/custom/css.template src/static/custom/index.css | ||
33 | cp -v src/static/custom/css.template src/static/custom/pad.css | ||
34 | cp -v src/static/custom/css.template src/static/custom/timeslider.css | ||
35 | |||
36 | sed -i 's/var\/dirty.db/\/var\/lib\/etherpad-lite\/dirty.db/g' \ | ||
37 | settings.json.template | ||
38 | |||
39 | mkdir -v node_modules | ||
40 | ln -s ../src node_modules/ep_etherpad-lite | ||
41 | |||
42 | node bin/doc/generate doc/index.md --format=html \ | ||
43 | --template=doc/template.html > documentation.html | ||
44 | |||
45 | cd src | ||
46 | npm install | ||
47 | cd .. | ||
48 | ''; | ||
49 | installPhase = '' | ||
50 | mkdir -p $out | ||
51 | install -t $out/src/ -vDm 644 src/.ep_initialized | ||
52 | cp -a node_modules $out/ | ||
53 | cp -a src/* $out/src/ | ||
54 | ln -sf ${session_key} $out/SESSIONKEY.txt | ||
55 | ln -sf ${api_key} $out/APIKEY.txt | ||
56 | cp ${jquery} $out/src/static/js/jquery.js | ||
57 | |||
58 | mkdir $out/doc | ||
59 | install -t "$out/doc/" \ | ||
60 | -vDm 644 {CHANGELOG,CONTRIBUTING,README}.md \ | ||
61 | -vDm 644 documentation.html | ||
62 | ''; | ||
63 | buildInputs = [ nodejs python ]; | ||
64 | passthru = { | ||
65 | modules = []; | ||
66 | inherit withModules; | ||
67 | }; | ||
68 | }); | ||
69 | in package | ||
diff --git a/pkgs/impure/etherpad-lite/etherpad-lite.json b/pkgs/impure/etherpad-lite/etherpad-lite.json new file mode 100644 index 0000000..81369c4 --- /dev/null +++ b/pkgs/impure/etherpad-lite/etherpad-lite.json | |||
@@ -0,0 +1,15 @@ | |||
1 | { | ||
2 | "tag": "1.7.0", | ||
3 | "meta": { | ||
4 | "name": "etherpad-lite", | ||
5 | "url": "https://github.com/ether/etherpad-lite", | ||
6 | "branch": "refs/tags/1.7.0" | ||
7 | }, | ||
8 | "github": { | ||
9 | "owner": "ether", | ||
10 | "repo": "etherpad-lite", | ||
11 | "rev": "96ac381afb9ea731dad48968f15d77dc6488bd0d", | ||
12 | "sha256": "03k6bwlm9ch9kssy9jipfg8ij7rpbzd89xq4mvg4grg1q6ivnzk9", | ||
13 | "fetchSubmodules": true | ||
14 | } | ||
15 | } | ||
diff --git a/pkgs/impure/etherpad-lite/libreoffice_patch.diff b/pkgs/impure/etherpad-lite/libreoffice_patch.diff new file mode 100644 index 0000000..d9e3dfc --- /dev/null +++ b/pkgs/impure/etherpad-lite/libreoffice_patch.diff | |||
@@ -0,0 +1,11 @@ | |||
1 | --- a/src/node/utils/LibreOffice.js 2018-06-18 09:54:15.087161212 +0200 | ||
2 | +++ b/src/node/utils/LibreOffice.js 2018-06-18 10:33:27.534055021 +0200 | ||
3 | @@ -63,6 +63,7 @@ | ||
4 | '--invisible', | ||
5 | '--nologo', | ||
6 | '--nolockcheck', | ||
7 | + '-env:UserInstallation=file:///tmp/', | ||
8 | '--convert-to', task.type, | ||
9 | task.srcFile, | ||
10 | '--outdir', tmpDir | ||
11 | |||