diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2023-10-04 01:35:06 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2023-10-04 02:11:48 +0200 |
commit | 1a64deeb894dc95e2645a75771732c6cc53a79ad (patch) | |
tree | 1b9df4838f894577a09b9b260151756272efeb53 /pkgs/webapps/roundcubemail/default.nix | |
parent | fa25ffd4583cc362075cd5e1b4130f33306103f0 (diff) | |
download | Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.gz Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.zst Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.zip |
Squash changes containing private information
There were a lot of changes since the previous commit, but a lot of them
contained personnal information about users. All thos changes got
stashed into a single commit (history is kept in a different place) and
private information was moved in a separate private repository
Diffstat (limited to 'pkgs/webapps/roundcubemail/default.nix')
-rw-r--r-- | pkgs/webapps/roundcubemail/default.nix | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/pkgs/webapps/roundcubemail/default.nix b/pkgs/webapps/roundcubemail/default.nix deleted file mode 100644 index bdddf2f..0000000 --- a/pkgs/webapps/roundcubemail/default.nix +++ /dev/null | |||
@@ -1,85 +0,0 @@ | |||
1 | { varDir ? "/var/lib/roundcubemail" | ||
2 | , roundcube_config ? "/etc/roundcube/config.php" | ||
3 | , stdenv, fetchurl, jre, unzip, lib, callPackage }: | ||
4 | let | ||
5 | defaultInstall = '' | ||
6 | mkdir -p $out | ||
7 | cp -R . $out/ | ||
8 | cd $out | ||
9 | if [ -d skins -a -d skins/larry -a ! -d skins/elastic ]; then | ||
10 | ln -s larry skins/elastic | ||
11 | fi | ||
12 | ''; | ||
13 | buildPlugin = { appName, version, url, sha256, installPhase ? defaultInstall }: | ||
14 | stdenv.mkDerivation rec { | ||
15 | name = "roundcube-${appName}-${version}"; | ||
16 | inherit version; | ||
17 | phases = "unpackPhase installPhase"; | ||
18 | inherit installPhase; | ||
19 | src = fetchurl { inherit url sha256; }; | ||
20 | passthru.pluginName = appName; | ||
21 | }; | ||
22 | skinNames = []; | ||
23 | allSkins = lib.attrsets.genAttrs skinNames | ||
24 | (name: callPackage (./skins + "/${name}") {}); | ||
25 | pluginNames = [ | ||
26 | "automatic_addressbook" "carddav" "contextmenu" | ||
27 | "contextmenu_folder" "html5_notifier" "ident_switch" | ||
28 | "message_highlight" "thunderbird_labels" | ||
29 | ]; | ||
30 | allPlugins = lib.attrsets.genAttrs pluginNames | ||
31 | (name: callPackage (./plugins + "/${name}") { inherit buildPlugin; }); | ||
32 | toPassthru = pkg: plugins: skins: { | ||
33 | inherit plugins skins allSkins allPlugins; | ||
34 | withSkins = withSkins pkg; | ||
35 | withPlugins = withPlugins pkg; | ||
36 | }; | ||
37 | withPlugins = pkg: toPlugins: | ||
38 | let | ||
39 | plugins = toPlugins allPlugins; | ||
40 | toInstallPlugin = n: "ln -s ${n} $out/plugins/${n.pluginName}"; | ||
41 | newRoundcube = pkg.overrideAttrs(old: { | ||
42 | installPhase = old.installPhase + "\n" + builtins.concatStringsSep "\n" (map toInstallPlugin plugins); | ||
43 | passthru = toPassthru newRoundcube (pkg.plugins ++ plugins) pkg.skins; | ||
44 | }); | ||
45 | in newRoundcube; | ||
46 | withSkins = pkg: toSkins: | ||
47 | let | ||
48 | skins = toSkins allSkins; | ||
49 | toInstallSkin = n: "ln -s ${n} $out/skins/${n.skinName}"; | ||
50 | newRoundcube = pkg.overrideAttrs(old: { | ||
51 | installPhase = old.installPhase + "\n" + builtins.concatStringsSep "\n" (map toInstallSkin skins); | ||
52 | passthru = toPassthru newRoundcube pkg.plugins (pkg.skins ++ skins); | ||
53 | }); | ||
54 | in newRoundcube; | ||
55 | shrinker = fetchurl { | ||
56 | url = "https://dl.google.com/closure-compiler/compiler-20200719.zip"; | ||
57 | sha256 = "0j46y9ack2yq67naca6nfysbmyilwjlkl29dbswidf1lq09yhhj3"; | ||
58 | }; | ||
59 | package = stdenv.mkDerivation rec { | ||
60 | version = "1.4.4"; | ||
61 | name = "roundcubemail-${version}"; | ||
62 | src= fetchurl { | ||
63 | url = "https://github.com/roundcube/roundcubemail/releases/download/${version}/${name}-complete.tar.gz"; | ||
64 | sha256 = "1my726p0wmsn21nbdsjx02h6hnbh8nidzipzdy0gk0qgda1j729b"; | ||
65 | }; | ||
66 | patches = [ ./add_all.patch ]; # This patch includes js modification which requires to re-run the jsshrink below | ||
67 | buildInputs = [ unzip jre ]; | ||
68 | buildPhase = '' | ||
69 | mkdir -p /tmp | ||
70 | unzip -p "${shrinker}" "*.jar" > "/tmp/compiler.jar" | ||
71 | ./bin/jsshrink.sh | ||
72 | sed -i \ | ||
73 | -e "s|RCUBE_INSTALL_PATH . 'temp.*|'${varDir}/cache';|" \ | ||
74 | config/defaults.inc.php | ||
75 | sed -i \ | ||
76 | -e "s|RCUBE_INSTALL_PATH . 'logs.*|'${varDir}/logs';|" \ | ||
77 | config/defaults.inc.php | ||
78 | ''; | ||
79 | installPhase = '' | ||
80 | cp -a . $out | ||
81 | ln -s ${roundcube_config} $out/config/config.inc.php | ||
82 | ''; | ||
83 | passthru = toPassthru package [] []; | ||
84 | }; | ||
85 | in package | ||