localtime: migrate to using buildGoPackage

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
Vincent Demeester 2018-12-21 15:24:02 +01:00
parent 25eb8419d9
commit ed473e6615
No known key found for this signature in database
GPG Key ID: 083CC6FD6EB699A3

View File

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