about summary refs log tree commit diff
path: root/pkgs/tools/system/tuptime/default.nix
diff options
context:
space:
mode:
authorEvils <evils.devils@protonmail.com>2020-05-31 04:11:23 +0200
committerEvils <evils.devils@protonmail.com>2020-06-20 05:34:37 +0200
commit1dca47c19a9cc3aa2d481a35cacf49eb2daa1843 (patch)
treea0552af93ea6a0420fc413cc5e6c65ace966aefb /pkgs/tools/system/tuptime/default.nix
parentbe707e4cc5c8911ddd8dda582d3fb88ec8559866 (diff)
downloadnixlib-1dca47c19a9cc3aa2d481a35cacf49eb2daa1843.tar
nixlib-1dca47c19a9cc3aa2d481a35cacf49eb2daa1843.tar.gz
nixlib-1dca47c19a9cc3aa2d481a35cacf49eb2daa1843.tar.bz2
nixlib-1dca47c19a9cc3aa2d481a35cacf49eb2daa1843.tar.lz
nixlib-1dca47c19a9cc3aa2d481a35cacf49eb2daa1843.tar.xz
nixlib-1dca47c19a9cc3aa2d481a35cacf49eb2daa1843.tar.zst
nixlib-1dca47c19a9cc3aa2d481a35cacf49eb2daa1843.zip
tuptime: 4.1.0 -> 5.0.0
uptimed import script removed from source ("unreliable")
new database format, including migration script instead
Diffstat (limited to 'pkgs/tools/system/tuptime/default.nix')
-rw-r--r--pkgs/tools/system/tuptime/default.nix27
1 files changed, 18 insertions, 9 deletions
diff --git a/pkgs/tools/system/tuptime/default.nix b/pkgs/tools/system/tuptime/default.nix
index acc96998952d..abfc8ae5ac87 100644
--- a/pkgs/tools/system/tuptime/default.nix
+++ b/pkgs/tools/system/tuptime/default.nix
@@ -1,28 +1,37 @@
-{ stdenv, fetchFromGitHub, python3 }:
+{ stdenv, fetchFromGitHub
+, makeWrapper, installShellFiles
+, python3, sqlite }:
 
 stdenv.mkDerivation rec {
   pname = "tuptime";
-  version = "4.1.0";
+  version = "5.0.0";
 
   src = fetchFromGitHub {
     owner = "rfrail3";
     repo = "tuptime";
     rev = version;
-    sha256 = "0p5v1jp6bl0hjv04q3gh11q6dx9z0x61h6svcbvwp5ni0h1bkz1a";
+    sha256 = "0izps85p8pxidfrzp7l4hp221fx3dcgapapsix1zavq6jrsl2qyh";
   };
 
+  nativeBuildInputs = [ makeWrapper installShellFiles ];
+
   buildInputs = [ python3 ];
 
+  outputs = [ "out" "man" ];
+
   installPhase = ''
     mkdir -p $out/bin
-    install -m 755 src/tuptime $out/bin/
+    install -m 755 $src/src/tuptime $out/bin/
 
-    mkdir -p $out/share/man/man1
-    cp src/man/tuptime.1 $out/share/man/man1/
+    installManPage $src/src/man/tuptime.1
+
+    install -Dm 0755 $src/misc/scripts/db-tuptime-migrate-4.0-to-5.0.sh \
+      $out/share/tuptime/db-tuptime-migrate-4.0-to-5.0.sh
+  '';
 
-    # upstream only ships this, there are more scripts there...
-    mkdir -p $out/usr/share/doc/tuptime/contrib
-    cp misc/scripts/uptimed-to-tuptime.py $out/usr/share/doc/tuptime/contrib/
+  preFixup = ''
+    wrapProgram $out/share/tuptime/db-tuptime-migrate-4.0-to-5.0.sh \
+      --prefix PATH : "${stdenv.lib.makeBinPath [ sqlite ]}"
   '';
 
   meta = with stdenv.lib; {