From ed473e661533d04d3ed212be837346430c73cc88 Mon Sep 17 00:00:00 2001 From: Vincent Demeester Date: Fri, 21 Dec 2018 15:24:02 +0100 Subject: [PATCH] localtime: migrate to using buildGoPackage Signed-off-by: Vincent Demeester --- pkgs/tools/system/localtime/default.nix | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/pkgs/tools/system/localtime/default.nix b/pkgs/tools/system/localtime/default.nix index 442b9a42f2b8..45cf378a14ed 100644 --- a/pkgs/tools/system/localtime/default.nix +++ b/pkgs/tools/system/localtime/default.nix @@ -1,6 +1,6 @@ -{ stdenv, go, systemd, polkit, fetchFromGitHub, m4, removeReferencesTo }: +{ stdenv, systemd, polkit, fetchFromGitHub, buildGoPackage, m4}: -stdenv.mkDerivation { +buildGoPackage rec { name = "localtime-2017-11-07"; src = fetchFromGitHub { @@ -9,14 +9,20 @@ stdenv.mkDerivation { rev = "2e7b4317c723406bd75b2a1d640219ab9f8090ce"; sha256 = "04fyna8p7q7skzx9fzmncd6gx7x5pwa9jh8a84hpljlvj0kldfs8"; }; + goPackagePath = "github.com/Stebalien/localtime"; - buildInputs = [ go systemd polkit m4 removeReferencesTo ]; - disallowedRequisites = [ go ]; + buildInputs = [ systemd polkit m4 ]; makeFlags = [ "PREFIX=$(out)" ]; - preFixup = '' - find $out/bin -type f -exec remove-references-to -t ${go} '{}' + + buildPhase = '' + cd go/src/${goPackagePath} + make localtimed + ''; + + installPhase = '' + mkdir -p $bin/bin + install -Dm555 localtimed $bin/bin ''; meta = with stdenv.lib; {