From 324e6dba04ae636e10ac3cf72689fee9e578e530 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Tue, 2 Apr 2019 16:25:31 +0200 Subject: [PATCH] roundcube: don't resolve symlinks in update.sh A side-effect of this is that the derivation required a rewrite in order to apply the patch properly. --- ...mlinks-when-trying-to-find-INSTALL_P.patch | 27 +++++++++++++++++++ pkgs/servers/roundcube/default.nix | 23 ++++++++++------ 2 files changed, 42 insertions(+), 8 deletions(-) create mode 100644 pkgs/servers/roundcube/0001-Don-t-resolve-symlinks-when-trying-to-find-INSTALL_P.patch diff --git a/pkgs/servers/roundcube/0001-Don-t-resolve-symlinks-when-trying-to-find-INSTALL_P.patch b/pkgs/servers/roundcube/0001-Don-t-resolve-symlinks-when-trying-to-find-INSTALL_P.patch new file mode 100644 index 00000000000..96710d6162d --- /dev/null +++ b/pkgs/servers/roundcube/0001-Don-t-resolve-symlinks-when-trying-to-find-INSTALL_P.patch @@ -0,0 +1,27 @@ +From c1832eabb99cec47f1714f696275285e1e28da34 Mon Sep 17 00:00:00 2001 +From: Maximilian Bosch +Date: Tue, 2 Apr 2019 16:20:50 +0200 +Subject: [PATCH] Don't resolve symlinks when trying to find INSTALL_PATH + +Nix specific patch. This behavior breaks roundcube setups where plugins +are in a store path with symlinks to the actual source. +--- + bin/update.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/bin/update.sh b/bin/update.sh +index 08e3bb5..b2ad498 100755 +--- a/bin/update.sh ++++ b/bin/update.sh +@@ -19,7 +19,7 @@ + +-----------------------------------------------------------------------+ + */ + +-define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' ); ++define('INSTALL_PATH', __DIR__ . '/../' ); + + require_once INSTALL_PATH . 'program/include/clisetup.php'; + +-- +2.19.2 + diff --git a/pkgs/servers/roundcube/default.nix b/pkgs/servers/roundcube/default.nix index cda5ae1d6c5..685e856644e 100644 --- a/pkgs/servers/roundcube/default.nix +++ b/pkgs/servers/roundcube/default.nix @@ -1,14 +1,21 @@ -{ lib, stdenv, fetchzip, buildEnv, roundcube, roundcubePlugins }: -let +{ lib, fetchurl, stdenv, buildEnv, roundcube, roundcubePlugins }: + +stdenv.mkDerivation rec { + pname = "roundcube"; version = "1.3.8"; -in -fetchzip rec { - name= "roundcube-${version}"; - url = "https://github.com/roundcube/roundcubemail/releases/download/${version}/roundcubemail-${version}-complete.tar.gz"; - sha256 = "1lhwr13bglm8rqgamnb480b07wpqhw9bskjj2xxb0x8kdjly29ks"; + src = fetchurl { + url = "https://github.com/roundcube/roundcubemail/releases/download/${version}/roundcubemail-${version}-complete.tar.gz"; + sha256 = "018djad7ygfl9c9f2l2j42qkg31ml3hs2f01f0dk361zckwk77n4"; + }; - extraPostFetch = '' + patches = [ ./0001-Don-t-resolve-symlinks-when-trying-to-find-INSTALL_P.patch ]; + + dontBuild = true; + + installPhase = '' + mkdir $out + cp -r * $out/ ln -sf /etc/roundcube/config.inc.php $out/config/config.inc.php rm -rf $out/installer '';