summary refs log tree commit diff
path: root/gnu/packages/task-management.scm
diff options
context:
space:
mode:
authorZac Berkowitz <zac.berkowitz@gmail.com>2023-01-28 10:47:43 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2023-01-28 11:01:00 +0100
commit2083bd052e9db8cfb32a6c3cf634c7817f49e009 (patch)
tree098a78b01bb98484f4cce5c30745d0efbb71547e /gnu/packages/task-management.scm
parent09ffaaa43649b110722357ded8bc619b9a5448a8 (diff)
downloadguix-2083bd052e9db8cfb32a6c3cf634c7817f49e009.tar.gz
gnu: Add timewarrior.
* gnu/packages/task-management.scm (timewarrior): New variable.
* gnu/packages/patches/timewarrior-time-sensitive-tests.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register new file.

Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Diffstat (limited to 'gnu/packages/task-management.scm')
-rw-r--r--gnu/packages/task-management.scm53
1 files changed, 53 insertions, 0 deletions
diff --git a/gnu/packages/task-management.scm b/gnu/packages/task-management.scm
index c4f7f99049..29515c6eb9 100644
--- a/gnu/packages/task-management.scm
+++ b/gnu/packages/task-management.scm
@@ -29,6 +29,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix gexp)
   #:use-module (guix packages)
+  #:use-module (gnu packages)
   #:use-module (gnu packages check)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
@@ -46,6 +47,7 @@
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages readline)
+  #:use-module (gnu packages ruby)
   #:use-module (gnu packages time)
   #:use-module (gnu packages tls)
   #:use-module (guix download)
@@ -181,6 +183,57 @@ environment for list management. It has a review feature, shell command
 execution, and libreadline support.")
     (license license:expat)))
 
+(define-public timewarrior
+  (package
+    (name "timewarrior")
+    (version "1.4.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://github.com/GothenburgBitFactory/timewarrior/releases/download/v" version
+             "/timew-" version ".tar.gz"))
+       (patches (search-patches "timewarrior-time-sensitive-tests.patch"))
+       (sha256 (base32
+                "0lyaqzcg8np2fpsmih0hlkjxd3qbadc7khr24m1pq9lsdhq7xpy4"))))
+    (build-system cmake-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'patch-source-shebangs 'patch-cmake-shell
+            (lambda _
+              (substitute* "src/commands/CMakeLists.txt"
+                (("/bin/sh") "sh"))))
+          ;; Fix out of source building of manual pages
+          (add-after 'patch-source-shebangs 'patch-man-cmake
+            (lambda _
+              (substitute* "doc/man1/CMakeLists.txt"
+                (("\\$\\{CMAKE_CURRENT_BINARY_DIR\\}")
+                 "${CMAKE_CURRENT_SOURCE_DIR}"))
+              (substitute* "doc/man7/CMakeLists.txt"
+                (("\\$\\{CMAKE_CURRENT_BINARY_DIR\\}")
+                 "${CMAKE_CURRENT_SOURCE_DIR}"))))
+          (add-after 'install 'install-completions
+            (lambda _
+              (let ((bash-completion-install-dir
+                     (string-append #$output "/etc/bash_completion.d")))
+                (mkdir-p bash-completion-install-dir)
+                (copy-file
+                 "../timew-1.4.3/completion/timew-completion.bash"
+                 (string-append bash-completion-install-dir "/timew"))))))))
+    (native-inputs
+     (list ruby-asciidoctor))
+    (inputs
+     (list gnutls python `(,util-linux "lib")))
+    (home-page "https://timewarrior.net")
+    (synopsis "Command line utility to track and report time")
+    (description
+     "Timewarrior is a command line time tracking application, which allows
+you to record time spent on activities.  You may be tracking your time for
+curiosity, or because your work requires it.")
+    (license license:expat)))
+
 (define-public worklog
   (let ((commit "0f545ad6697ef4de7f68d92cd7cc5c6a4c60517b")
         (revision "1"))