Merge pull request #52627 from vdemeester/52469-localtime-to-buildgopackage

localtime: migrate to using buildGoPackage
This commit is contained in:
Jörg Thalheim 2018-12-21 15:32:49 +01:00 committed by GitHub
commit 594fd0ff6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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