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.
This commit is contained in:
Linus Heckemann 2017-01-13 09:51:04 +00:00
parent b8b7832219
commit b91fa0f477

View File

@ -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";