summaryrefslogtreecommitdiff
path: root/pkgs/servers/roundcube/default.nix
blob: 6ed84bd702e40fff350f0155503660e279876544 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{
  fetchurl,
  lib,
  stdenv,
  buildEnv,
  roundcube,
  roundcubePlugins,
  nixosTests,
  runCommand,
}:

stdenv.mkDerivation rec {
  pname = "roundcube";
  version = "1.7.0";

  src = fetchurl {
    url = "https://github.com/roundcube/roundcubemail/releases/download/${version}/roundcubemail-${version}-complete.tar.gz";
    sha256 = "sha256-o0w2baK3okrUpjgrS7mmd8tYHuCL/GME0KmnIQmOepg=";
  };

  patches = [ ./0001-Don-t-resolve-symlinks-when-trying-to-find-INSTALL_P.patch ];

  dontBuild = true;

  # FIXME: this should be removed after upstream releases the update forcing the use of public_html.
  dontCheckForBrokenSymlinks = true;

  installPhase = ''
    mkdir $out
    cp -r * $out/
    ln -sf /etc/roundcube/config.inc.php $out/config/config.inc.php
    rm -rf $out/installer
  '';

  passthru.withPlugins =
    f:
    buildEnv {
      name = "${roundcube.name}-with-plugins";
      paths = (f roundcubePlugins) ++ [
        roundcube
        (runCommand "dummy" { } ''
          mkdir -p $out/public_html/
        '')
      ];
    };

  passthru.tests = { inherit (nixosTests) roundcube; };

  meta = {
    description = "Open Source Webmail Software";
    maintainers = with lib.maintainers; [
      vskilet
      ma27
    ];
    license = lib.licenses.gpl3;
    platforms = lib.platforms.all;
  };
}