diff options
Diffstat (limited to 'pkgs/webapps/roundcubemail/default.nix')
-rw-r--r-- | pkgs/webapps/roundcubemail/default.nix | 55 |
1 files changed, 35 insertions, 20 deletions
diff --git a/pkgs/webapps/roundcubemail/default.nix b/pkgs/webapps/roundcubemail/default.nix index 4f288b8..2b22b29 100644 --- a/pkgs/webapps/roundcubemail/default.nix +++ b/pkgs/webapps/roundcubemail/default.nix | |||
@@ -1,6 +1,6 @@ | |||
1 | { varDir ? "/var/lib/roundcubemail" | 1 | { varDir ? "/var/lib/roundcubemail" |
2 | , roundcube_config ? "/etc/roundcube/config.php" | 2 | , roundcube_config ? "/etc/roundcube/config.php" |
3 | , stdenv, fetchurl, jre, unzip }: | 3 | , stdenv, fetchurl, jre, unzip, lib, callPackage }: |
4 | let | 4 | let |
5 | defaultInstall = '' | 5 | defaultInstall = '' |
6 | mkdir -p $out | 6 | mkdir -p $out |
@@ -19,20 +19,39 @@ let | |||
19 | src = fetchurl { inherit url sha256; }; | 19 | src = fetchurl { inherit url sha256; }; |
20 | passthru.pluginName = appName; | 20 | passthru.pluginName = appName; |
21 | }; | 21 | }; |
22 | withPlugins = plugins: skins: package.overrideAttrs(old: { | 22 | skinNames = []; |
23 | name = "${old.name}${if builtins.length skins > 0 then "-with-skins" else ""}${if builtins.length plugins > 0 then "-with-plugins" else ""}"; | 23 | allSkins = lib.attrsets.genAttrs skinNames |
24 | installPhase = old.installPhase + | 24 | (name: callPackage (./skins + "/${name}") {}); |
25 | builtins.concatStringsSep "\n" ( | 25 | pluginNames = [ |
26 | map (value: "ln -s ${value} $out/plugins/${value.pluginName}") plugins | 26 | "automatic_addressbook" "carddav" "contextmenu" |
27 | ) + | 27 | "contextmenu_folder" "html5_notifier" "ident_switch" |
28 | builtins.concatStringsSep "\n" ( | 28 | "message_highlight" "thunderbird_labels" |
29 | map (value: "ln -s ${value} $out/skins/${value.skinName}") skins | 29 | ]; |
30 | ); | 30 | allPlugins = lib.attrsets.genAttrs pluginNames |
31 | passthru = old.passthru // { | 31 | (name: callPackage (./plugins + "/${name}") { inherit buildPlugin; }); |
32 | inherit plugins skins; | 32 | toPassthru = pkg: plugins: skins: { |
33 | withPlugins = morePlugins: moreSkins: old.withPlugins (morePlugins ++ plugins) (morePlugins ++ skins); | 33 | inherit plugins skins allSkins allPlugins; |
34 | }; | 34 | withSkins = withSkins pkg; |
35 | }); | 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; | ||
36 | shrinker = fetchurl { | 55 | shrinker = fetchurl { |
37 | url = "http://dl.google.com/closure-compiler/compiler-latest.zip"; | 56 | url = "http://dl.google.com/closure-compiler/compiler-latest.zip"; |
38 | sha256 = "0naf3kflhlkm17ls1x7mgddd3b01f8yzbbbdjqwy5m12jmkzl2d5"; | 57 | sha256 = "0naf3kflhlkm17ls1x7mgddd3b01f8yzbbbdjqwy5m12jmkzl2d5"; |
@@ -61,10 +80,6 @@ let | |||
61 | cp -a . $out | 80 | cp -a . $out |
62 | ln -s ${roundcube_config} $out/config/config.inc.php | 81 | ln -s ${roundcube_config} $out/config/config.inc.php |
63 | ''; | 82 | ''; |
64 | passthru = { | 83 | passthru = toPassthru package [] []; |
65 | plugins = []; | ||
66 | skins = []; | ||
67 | inherit withPlugins buildPlugin; | ||
68 | }; | ||
69 | }; | 84 | }; |
70 | in package | 85 | in package |