summary refs log tree commit diff
path: root/pkgs/applications/networking/syncthing
diff options
context:
space:
mode:
authorLinus Heckemann <git@sphalerite.org>2017-01-13 09:51:04 +0000
committerLinus Heckemann <git@sphalerite.org>2017-01-13 09:54:48 +0000
commitb91fa0f47765b05c11bad9b4327e9cd8389a87ef (patch)
treee34459b34d1de0658352140a695f1c29fdab8734 /pkgs/applications/networking/syncthing
parentb8b783221978bf8cbe1471bc9dae9fdf7ea4dce1 (diff)
downloadnixpkgs-b91fa0f47765b05c11bad9b4327e9cd8389a87ef.tar
nixpkgs-b91fa0f47765b05c11bad9b4327e9cd8389a87ef.tar.gz
nixpkgs-b91fa0f47765b05c11bad9b4327e9cd8389a87ef.tar.bz2
nixpkgs-b91fa0f47765b05c11bad9b4327e9cd8389a87ef.tar.lz
nixpkgs-b91fa0f47765b05c11bad9b4327e9cd8389a87ef.tar.xz
nixpkgs-b91fa0f47765b05c11bad9b4327e9cd8389a87ef.tar.zst
nixpkgs-b91fa0f47765b05c11bad9b4327e9cd8389a87ef.zip
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.
Diffstat (limited to 'pkgs/applications/networking/syncthing')
-rw-r--r--pkgs/applications/networking/syncthing/default.nix10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkgs/applications/networking/syncthing/default.nix b/pkgs/applications/networking/syncthing/default.nix
index 8e568798df8..48a348b699d 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";