From b91fa0f47765b05c11bad9b4327e9cd8389a87ef Mon Sep 17 00:00:00 2001 From: Linus Heckemann Date: Fri, 13 Jan 2017 09:51:04 +0000 Subject: syncthing: remove runtime dependency on go The hack used here is shamelessly stolen from buildGoPackage. If it is going to be applied to more expressions, it may make sense to factor it out so it can be shared. --- pkgs/applications/networking/syncthing/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'pkgs/applications/networking/syncthing') diff --git a/pkgs/applications/networking/syncthing/default.nix b/pkgs/applications/networking/syncthing/default.nix index 8e568798df81..48a348b699d5 100644 --- a/pkgs/applications/networking/syncthing/default.nix +++ b/pkgs/applications/networking/syncthing/default.nix @@ -1,4 +1,10 @@ { stdenv, lib, fetchFromGitHub, go, pkgs }: +let + removeExpr = ref: '' + sed -i "s,${ref},$(echo "${ref}" | sed "s,$NIX_STORE/[^-]*,$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,"),g" \ + ''; + +in stdenv.mkDerivation rec { version = "0.14.18"; @@ -42,6 +48,10 @@ stdenv.mkDerivation rec { --replace /usr/bin/syncthing $out/bin/syncthing ''; + preFixup = '' + find $out/bin -type f -exec ${removeExpr go} '{}' '+' + ''; + meta = with stdenv.lib; { homepage = https://www.syncthing.net/; description = "Open Source Continuous File Synchronization"; -- cgit 1.4.1