localtime: install systemd serice and polkit rules

- Use the right variables and `make install` to ensure all products are
installed.
- Remove unneeded build inputs: we don't need systemd or polkit to
install the service or polkit rules.
This commit is contained in:
Michael Peyton Jones 2019-06-16 12:16:51 +01:00
parent ae71c13a92
commit 66da10e80f
No known key found for this signature in database
GPG Key ID: 86A43C24A728F66D

View File

@ -1,4 +1,4 @@
{ stdenv, systemd, polkit, fetchFromGitHub, buildGoPackage, m4}:
{ stdenv, fetchFromGitHub, buildGoPackage, m4 }:
buildGoPackage rec {
name = "localtime-2017-11-07";
@ -11,18 +11,17 @@ buildGoPackage rec {
};
goPackagePath = "github.com/Stebalien/localtime";
buildInputs = [ systemd polkit m4 ];
buildInputs = [ m4 ];
makeFlags = [ "PREFIX=$(out)" ];
makeFlags = [ "PREFIX=$(out)" "BINDIR=$(bin)/bin" ];
buildPhase = ''
cd go/src/${goPackagePath}
make localtimed
make $makeFlags
'';
installPhase = ''
mkdir -p $bin/bin
install -Dm555 localtimed $bin/bin
make install $makeFlags
'';
meta = with stdenv.lib; {