summary refs log tree commit diff
diff options
context:
space:
mode:
authorBernardo Meurer <bernardo@meurer.org>2021-12-08 15:19:03 +0000
committerBernardo Meurer <bernardo@meurer.org>2021-12-08 15:23:03 +0000
commita2a5e4ebd10cfc366496fca0fbc0119cb104d3d6 (patch)
treeb8b10dd7f085ccf14bb64f74ced26ee420064c65
parent9f329731b5ecbd5d0d1a76dd8a4ccfb9f9dbbda3 (diff)
downloadnixpkgs-a2a5e4ebd10cfc366496fca0fbc0119cb104d3d6.tar
nixpkgs-a2a5e4ebd10cfc366496fca0fbc0119cb104d3d6.tar.gz
nixpkgs-a2a5e4ebd10cfc366496fca0fbc0119cb104d3d6.tar.bz2
nixpkgs-a2a5e4ebd10cfc366496fca0fbc0119cb104d3d6.tar.lz
nixpkgs-a2a5e4ebd10cfc366496fca0fbc0119cb104d3d6.tar.xz
nixpkgs-a2a5e4ebd10cfc366496fca0fbc0119cb104d3d6.tar.zst
nixpkgs-a2a5e4ebd10cfc366496fca0fbc0119cb104d3d6.zip
localtime: 2017-11-07 -> 2021-11-23
-rw-r--r--pkgs/tools/system/localtime/default.nix40
1 files changed, 21 insertions, 19 deletions
diff --git a/pkgs/tools/system/localtime/default.nix b/pkgs/tools/system/localtime/default.nix
index 0ad17c6c659..943651fa249 100644
--- a/pkgs/tools/system/localtime/default.nix
+++ b/pkgs/tools/system/localtime/default.nix
@@ -1,38 +1,40 @@
-{ lib, fetchFromGitHub, buildGoPackage, m4 }:
-
-buildGoPackage rec {
+{ buildGoModule
+, fetchFromGitHub
+, geoclue2-with-demo-agent
+, lib
+, m4
+}:
+
+buildGoModule {
   pname = "localtime";
-  version = "unstable-2017-11-07";
+  version = "unstable-2021-11-23";
 
   src = fetchFromGitHub {
     owner = "Stebalien";
     repo = "localtime";
-    rev = "2e7b4317c723406bd75b2a1d640219ab9f8090ce";
-    sha256 = "04fyna8p7q7skzx9fzmncd6gx7x5pwa9jh8a84hpljlvj0kldfs8";
+    rev = "3e5d6cd64444b2164e87cea03448bfb8eefd6ccd";
+    sha256 = "sha256-6uxxPq6abtRqM/R2Fw46ynP9PEkHggTSUymLYlQXQRU=";
   };
 
-  goPackagePath = "github.com/Stebalien/localtime";
-
-  nativeBuildInputs = [ m4 ];
-
-  makeFlags = [
-    "PREFIX=${placeholder "out"}"
-    "BINDIR=${placeholder "out"}/bin"
-  ];
+  vendorSha256 = "sha256-sf3sL6aO5jSytT2NtBkA3lhg77RIzbYkSC4fkH+cwwk=";
 
-  buildPhase = ''
-    cd go/src/${goPackagePath}
-    make $makeFlags
+  postPatch = ''
+    demoPath="${geoclue2-with-demo-agent}/libexec/geoclue-2.0/demos/agent"
+    sed -i localtimed.go -e "s#/usr/lib/geoclue-2.0/demos/agent#$demoPath#"
   '';
 
+  nativeBuildInputs = [ m4 ];
+
   installPhase = ''
-    make install $makeFlags
+    runHook preInstall
+    make PREFIX="$out" install
+    runHook postInstall
   '';
 
   meta = with lib; {
     description = "A daemon for keeping the system timezone up-to-date based on the current location";
     homepage = "https://github.com/Stebalien/localtime";
-    maintainers = with maintainers; [ ];
+    maintainers = with maintainers; [ lovesegfault ];
     platforms = platforms.linux;
     license = licenses.gpl3;
   };