[PATCH] Add timewarrior 1.4.3

OpenSubmitted by Zac Berkowitz.
Details
2 participants
  • Maxime Devos
  • Zac Berkowitz
Owner
unassigned
Severity
normal
Z
Z
Zac Berkowitz wrote on 9 Jun 17:11 +0200
(address . guix-patches@gnu.org)
CANNGBfmtyGVoYSC+QkqvShkOZijyr0XRwp6ZML+ks-ndUEAPdQ@mail.gmail.com
From dc3cd50a62ddce3fcc2ea9c374036192411b833a Mon Sep 17 00:00:00 2001
From: Zac Berkowitz <zac.berkowitz@gmail.com>
Date: Fri, 13 May 2022 11:56:51 -0400
Subject: [PATCH] gnu: Add timewarrior.

* gnu/packages/task-management.scm (timewarrior): New variable
---
gnu/packages/task-management.scm | 38 ++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)

Toggle diff (58 lines)
diff --git a/gnu/packages/task-management.scm b/gnu/packages/task-management.scm
index aeedbfbe6a..3a21c1a44d 100644
--- a/gnu/packages/task-management.scm
+++ b/gnu/packages/task-management.scm
@@ -38,6 +38,7 @@ (define-module (gnu packages task-management)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-xyz)
+  #:use-module (gnu packages ruby)
   #:use-module (gnu packages time)
   #:use-module (gnu packages tls)
   #:use-module (guix download)
@@ -145,6 +146,43 @@ (define-public taskwarrior
 and querying data, exposing task data in multiple formats to other tools.")
     (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"))
+       (sha256 (base32
+                "0lyaqzcg8np2fpsmih0hlkjxd3qbadc7khr24m1pq9lsdhq7xpy4"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("ruby-asciidoctor" ,ruby-asciidoctor)
+       ("python" ,python)))
+    (inputs
+     `(("gnutls" ,gnutls)
+       ("util-linux:lib" ,util-linux "lib")))
+     ;; (list gnutls
+     ;;       `(,util-linux "lib")))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (delete 'install-license-files) ; Already installed by package
+         (add-after 'patch-source-shebangs 'patch-cmake-shell
+           (lambda _
+             (substitute* "src/commands/CMakeLists.txt"
+               (("/bin/sh") (which "sh"))))))))
+     (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"))
-- 
2.36.1
M
M
Maxime Devos wrote on 9 Jun 21:50 +0200
fbec639f90f6e6dd91f78b40952c319ed8c69971.camel@telenet.be
Zac Berkowitz schreef op do 09-06-2022 om 11:11 [-0400]:
Toggle quote (10 lines)
> +       (method url-fetch)
> +       (uri (string-append
> +            
> "https://github.com/GothenburgBitFactory/timewarrior/releases/download/v
> " version
> +             "/timew-" version ".tar.gz"))
> +       (sha256 (base32
> +               
> "0lyaqzcg8np2fpsmih0hlkjxd3qbadc7khr24m1pq9lsdhq7xpy4"))))

I can confirm the hash matches, and hashing the file with sha256sum
agrees with the hash mentioned on https://timewarrior.net/releases/.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYqJPHRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7p7gAQDWOjgqQiu1MscBaxtOxB8I4A8i
987j81Vfw4kjw+HGZwEAqmfisqo6m47JgzIzl5ZkkledAUvNBWaDSXUY7blkCgo=
=SKqG
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 9 Jun 21:53 +0200
e10249aa44483f4f057403ec9e960390fe1bfade.camel@telenet.be
Zac Berkowitz schreef op do 09-06-2022 om 11:11 [-0400]:
Toggle quote (7 lines)
> +    (native-inputs
> +     `(("ruby-asciidoctor" ,ruby-asciidoctor)
> +       ("python" ,python)))
> +    (inputs
> +     `(("gnutls" ,gnutls)
> +       ("util-linux:lib" ,util-linux "lib")))

Nowadays, these can be simplified to.

(native-inputs (list ruby-asciidoctor python))

Where did you learn about the old form?

Likewise (if I remember the syntax right):

(list gnutls `(,util-linux "lib"))

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYqJPxRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7gspAP4wZASyqH8fyMT+o7XKLSsGMlP4
6ITfM+XPDiPnUxAwXQEA2e15ViBWTg1C+HTYPqt1BU5n9hh7OzNh5kzFRKqcAAw=
=VnNW
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 9 Jun 21:55 +0200
c4e2154a3b8ade436b19fe1514161d4ea7bef2c7.camel@telenet.be
Zac Berkowitz schreef op do 09-06-2022 om 11:11 [-0400]:
+         (delete 'install-license-files) ; Already installed by
package

Not a problem I think -- at worst, the license file will appear twice,
but identical files are automatically deduplicated, and even if not, they
are relatively small files anyway.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYqJQFRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7iLHAP0T6p5CeAMifQtofWOWB7RXJhGr
rz1QMfoSVGEdN9wb6gEA6AO84U5qFbfTuhL4pqC5YQnqE4wgr2RE8/H3llStbA0=
=H/UA
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 9 Jun 21:56 +0200
81396756098f5459b17cb29d640a937830f53f95.camel@telenet.be
Zac Berkowitz schreef op do 09-06-2022 om 11:11 [-0400]:
Toggle quote (3 lines)
> +             (substitute* "src/commands/CMakeLists.txt"
> +               (("/bin/sh") (which "sh"))))))))

In this context, (which "sh") can maybe be simplified to just "sh", not
that it really matters.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYqJQcRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7j0pAP0c/Lqwho5EY8ieXNrvQS5kMg18
et3pOYyzWW08mmQsDgD+NMmpZM0Q6FG7aRsCfZjZ40OpEOMHuVLvs9Z9e6R26w4=
=5/JI
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 9 Jun 22:01 +0200
0503b01df689d2e4af62ff112672ed343ac67050.camel@telenet.be
Zac Berkowitz schreef op do 09-06-2022 om 11:11 [-0400]:
Toggle quote (2 lines)
> * gnu/packages/task-management.scm (timewarrior): New variable

This contains a binary src/libshared/src/wcwidth.h, which should be
built from source with the generator

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYqJRixccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7qvJAQDCbp7m2AkbsL6MyjHJHil7MPz8
4dRrlwb1vjIXi+9eSAD/U5Nbfm7wBAING4KpQy+2GCHX/rVgS4yadwHhrwWpuAQ=
=171S
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 9 Jun 22:06 +0200
7ae686d14e77e1cae8e458fdafb35788e8bd9d2c.camel@telenet.be
Zac Berkowitz schreef op do 09-06-2022 om 11:11 [-0400]:
Toggle quote (3 lines)
> * gnu/packages/task-management.scm (timewarrior): New variable


-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYqJSvhccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7nuzAP4qmcFEG/CUcmppwFXVPryNvDC2
38oA5rZjXF9JQxkjmQEA/U/BtM4pv0q11lXD69/kt3zZMFfx/CbHIZQ2t+T/ywY=
=qDqq
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 9 Jun 22:08 +0200
395752216d24481be235782d3cb782cec4e20f45.camel@telenet.be
Zac Berkowitz schreef op do 09-06-2022 om 11:11 [-0400]:
Toggle quote (4 lines)
> +    (native-inputs
> +     `(("ruby-asciidoctor" ,ruby-asciidoctor)
> +       ("python" ,python)))

According to Debian, additional (native-)inputs are required:


Are the tests actually run and can the man page be read?

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYqJTIRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7mHjAPwLdjlXu5Z7T8+kFY6jP++uHzTa
qxQH6dvtT8J2qNz8HQEAra4Mlz09IJRRuCGVP60vuie0FlZX21l2cvCeHqUugw0=
=z7LB
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 9 Jun 22:09 +0200
5bdbcd625540ce4c89e3f6ae512608639b1e07a6.camel@telenet.be
Zac Berkowitz schreef op do 09-06-2022 om 11:11 [-0400]:
Toggle quote (8 lines)
> +       (method url-fetch)
> +       (uri (string-append
> +            
> "https://github.com/GothenburgBitFactory/timewarrior/releases/download/v
> " version
> +             "/timew-" version ".tar.gz"))
> +       (sha256 (base32

The tests are missing:


so maybe use the source code on git instead?
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYqJTahccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7rOrAQCGNtnDHoWN7854/fl5b6WbeK8Q
4OiCPJd2g69Q43BmhgD6A5rAXq9v/NPKsuc1lKX7U5FKlxnvB7OtMwRz3RPXagU=
=JzaW
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 9 Jun 22:10 +0200
f8a6d83fd343aa20a7dd81e8da7c639e5816034f.camel@telenet.be
Zac Berkowitz schreef op do 09-06-2022 om 11:11 [-0400]:
Toggle quote (9 lines)
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append
> +            
> "https://github.com/GothenburgBitFactory/timewarrior/releases/download/v
> " version
> +             "/timew-" version ".tar.gz"))
> +       (sha256 (base32

Is the bash completion installed in the right location?
According to Debian, it isn't:

-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYqJTqxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7gvJAP0fFnC6eiJTCewyduG2Onnxg+nH
GX8b5/mkl4feg9CGogD+KoyglwIl+qQr1DFuaIWM1PrOu7yaS6Nck2kYRRbXfwM=
=13+n
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 9 Jun 22:12 +0200
5abef1f5d4f29660832066999dac4d4f2287ca0b.camel@telenet.be
Zac Berkowitz schreef op do 09-06-2022 om 11:11 [-0400]:
Toggle quote (4 lines)
> +    (native-inputs
> +     `(("ruby-asciidoctor" ,ruby-asciidoctor)
> +       ("python" ,python)))

Are the scripts in ext/*.py installed somewhere? If so, 'python' needs
to be in 'inputs' instead for cross-compilation.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYqJUJBccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7pHMAQCa4zVpS9CvTatqqscigFt1sez+
fuz+7MBV7DzFU8ouugD+PwaZiqwnpU8jsMVALZqXw17PdxcsQAYrdyoeotjRkQw=
=Ocmy
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 9 Jun 22:17 +0200
56ba51f3df6a70e78518630ad45c3dfc07fdd2a9.camel@telenet.be
According to archlinux, there are some bogus man pages:


are they absent here? (Also, archlinux has the same hash!)
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYqJVSRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7oMnAP9k2l/TRTqBzYr2OfS4+jwz+aba
7ZuQ6ALZW5nj0tTkfAEAqGZZXXtZv2Mhd9ouGl3RbSAX7QR0wlxbzdUKKvXQ/Ao=
=770W
-----END PGP SIGNATURE-----


Z
Z
Zac Berkowitz wrote on 10 Jun 03:36 +0200
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 55874@debbugs.gnu.org)
CANNGBfkQGne5VV2CjT8OqtKb4-2BBm1g+19w3qnrEEYDYC5qCw@mail.gmail.com
Maxime,

Thanks for all of the great feedback -- seems like "works for me"
wasn't nearly good enough in this case! I'll chip away at these
issues next week when I've got some time. Is submitting a new patch
on this bug # the best way forward? Or should I close this and open a
new patch issue when it's ready?

Cheers,

Zac

On Thu, Jun 9, 2022 at 4:17 PM Maxime Devos <maximedevos@telenet.be> wrote:
Toggle quote (6 lines)
>
> According to archlinux, there are some bogus man pages:
>
> https://archlinuxarm.org/packages/aarch64/timew/files/PKGBUILD
>
> are they absent here? (Also, archlinux has the same hash!)
M
M
Maxime Devos wrote on 10 Jun 09:49 +0200
(name . Zac Berkowitz)(address . zac.berkowitz@gmail.com)(address . 55874@debbugs.gnu.org)
c78c6132514b8ec6bd68760e3990f915e32748c0.camel@telenet.be
Zac Berkowitz schreef op do 09-06-2022 om 21:36 [-0400]:
Toggle quote (8 lines)
> Maxime,
>
> Thanks for all of the great feedback -- seems like "works for me"
> wasn't nearly good enough in this case!  I'll chip away at these
> issues next week when I've got some time.  Is submitting a new patch
> on this bug # the best way forward?  Or should I close this and open a
> new patch issue when it's ready?

Send it as a v2 to 55874@, then all the relevant information is kept

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYqL3lBccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7uXAAQChlFMtBZZEZboBDTKgGEt2gOcD
kKmX0mFSPTsC6vjgTAEAjYpYvbWV0IgKJ7jZ0ZUdVQyBy7+yUhICRs2RNH/7mwI=
=Evsm
-----END PGP SIGNATURE-----


Z
Z
Zac Berkowitz wrote on 10 Jun 16:04 +0200
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 55874@debbugs.gnu.org)
CANNGBfkndu19UdqkeMBwjWhDWcUzwS2mb08O4EFtnt0BJ4yweA@mail.gmail.com
Maxime,

Ended up having a bit of time today to look through what you brought
up. Thanks again for it!

Toggle quote (10 lines)
>> + (native-inputs
>> + `(("ruby-asciidoctor" ,ruby-asciidoctor)
>> + ("python" ,python)))
>
> According to Debian, additional (native-)inputs are required:
>
> https://salsa.debian.org/tasktools-team/timew/-/blob/master/debian/tests/control
>
> Are the tests actually run and can the man page be read?

According to the source
asciidoctor is required to build the docs, but python is not a
requirement at runtime.
I'm able to run the timew executable in a pure shell without moving
python to the input list, so this seems to be a debian issue?

The python scripts in ext/ are completely optional according to the
README in that same directory. Like taskwarrior, timewarrior can
execute python scripts as hooks in response to various commands, but
they're not necessary for base use.
Maybe this is why debian adds the python requirement? So hooks just
work out of the box? How does guix deal with optional dependencies
like this?

Tests are run and pass, but that doesn't rule out determinism issues,
I'll see what debian did to address that.

man pages are not available, I'll correct that.

Toggle quote (13 lines)
>> + (native-inputs
>> + `(("ruby-asciidoctor" ,ruby-asciidoctor)
>> + ("python" ,python)))
>> + (inputs
>> + `(("gnutls" ,gnutls)
>> + ("util-linux:lib" ,util-linux "lib")))
>
> Nowadays, these can be simplified to.
>
> (native-inputs (list ruby-asciidoctor python))
>
> Where did you learn about the old form?

Wouldn't say "learn" - I'm very new to lisps! The code here is mostly
adapted from taskwarrior (same developer) and other snippets from
gnu/packages. I'm sure I grep'd for another package that required
asciidoctor and adapted their portion of the code.

Toggle quote (7 lines)
>>+ (delete 'install-license-files) ; Already installed by
>> package
>
> Not a problem I think -- at worst, the license file will appear twice,
> but identical files are automatically deduplicated, and even if not, they
> are relatively small files anyway.

This is from taskwarrior from the same developer and has a similar
build setup. Seems like both packages should be consistent, but I'm
happy to remove this directive if needed.

Toggle quote (6 lines)
>> + (substitute* "src/commands/CMakeLists.txt"
>> + (("/bin/sh") (which "sh"))))))))
>
> In this context, (which "sh") can maybe be simplified to just "sh", not
> that it really matters.

Ok.




On Fri, Jun 10, 2022 at 3:49 AM Maxime Devos <maximedevos@telenet.be> wrote:
Toggle quote (15 lines)
>
> Zac Berkowitz schreef op do 09-06-2022 om 21:36 [-0400]:
> > Maxime,
> >
> > Thanks for all of the great feedback -- seems like "works for me"
> > wasn't nearly good enough in this case! I'll chip away at these
> > issues next week when I've got some time. Is submitting a new patch
> > on this bug # the best way forward? Or should I close this and open a
> > new patch issue when it's ready?
>
> Send it as a v2 to 55874@, then all the relevant information is kept
> together at <https://issues.guix.gnu.org/55874>.
>
> Greetings,
> Maxime.
M
M
Maxime Devos wrote on 10 Jun 16:54 +0200
(name . Zac Berkowitz)(address . zac.berkowitz@gmail.com)(address . 55874@debbugs.gnu.org)
6590de620d1c20115e12eafcacddb7637d903a9e.camel@telenet.be
Zac Berkowitz schreef op vr 10-06-2022 om 10:04 [-0400]:
Toggle quote (9 lines)
> The python scripts in ext/ are completely optional according to the
> README in that same directory.  Like taskwarrior, timewarrior can
> execute python scripts as hooks in response to various commands, but
> they're not necessary for base use.
> Maybe this is why debian adds the python requirement?  So hooks just
> work out of the box?  How does guix deal with optional dependencies
> like this?
>

If it increases the closure size a lot and does not provide much extra
functionality, the extra dependency (and the components that require
that dependency) is removed. (Alternatively the ext/ scripts can be
changed to use the 'python' in $PATH instead of a baked-in 'python',
though such things are avoided where feasible for robustness).

Even if they are optional, adding python might be required such that
the _correct_ python is used when cross-compiling. As a test, you
could try running "guix gc --references" on the timewarrior store item
-- if the output contains python, the ext/... is installed with python.

Probably most people would have python anyway, so I don't think it has
to be removed.

Looking at the output of "guix gc --references", it does indeed use
python from somewhere.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYqNbFxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7tP5AP0TSC6Uz5dEDZqeuaXCO97vrp9h
ejUUEww4GeMgOSs+8wD/eHxceU9/h6YZq4HDmSU7Kub/tcIKm+jfmYVyPny9Rg0=
=vzOv
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 10 Jun 16:56 +0200
(name . Zac Berkowitz)(address . zac.berkowitz@gmail.com)(address . 55874@debbugs.gnu.org)
98bbd6a0425170530af91a9908d9a4b519987e85.camel@telenet.be
Zac Berkowitz schreef op vr 10-06-2022 om 10:04 [-0400]:
Toggle quote (5 lines)
> According to the source
> (https://github.com/GothenburgBitFactory/timewarrior/blob/develop/INSTALL)
> asciidoctor is required to build the docs, but python is not a
> requirement at runtime.

Then something appears to be broken somewhere, because I'm not seeing
any docs (except for some README) in
</gnu/store/n2hl121g9qgvdpmx4qmsfr1d77hrpxps-timewarrior-1.4.3/>.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYqNbhRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7vY5AQDPAS5CgvqQGoXkQzBIqyF8CUm9
ydQq8ib0t4YGjWDIUgD5Ack/EcyXqYv5vbsueMCjAhj/ROrXRq6f3uOUoFasbQw=
=6gj7
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 10 Jun 17:00 +0200
(name . Zac Berkowitz)(address . zac.berkowitz@gmail.com)(address . 55874@debbugs.gnu.org)
fc7fa8e3118d9ed6cfc8d924c8c6722b8b763ccb.camel@telenet.be
Zac Berkowitz schreef op vr 10-06-2022 om 10:04 [-0400]:
Toggle quote (5 lines)
> The python scripts in ext/ are completely optional according to the
> README in that same directory.  Like taskwarrior, timewarrior can
> execute python scripts as hooks in response to various commands, but
> they're not necessary for base use.

Two comments:

* the scripts are installed in share/doc/timew, so I don't think they
are actually automatically or discoverable by the user, so FWIW
as-is they can be removed (removing the reference to python).
Alternatively you could look into making them functional, as some
other distros do.

* the scripts do subprocess.call(['timew', ...]). For robustness,
if these scripts are kept, the 'timew' needs to be replaced by the
/gnu/store/.../bin/timew (by using 'substitute*' in a phase).

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYqNccxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7pCpAQCtciXnri4wpXFvxKD0LtpitueA
DG5312lNxbRBHvcFLgEAxG/dwXis0huCBV6Tc5vM9GpbJte2YFAEF1XfrseR/g4=
=MmTW
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 10 Jun 17:00 +0200
(name . Zac Berkowitz)(address . zac.berkowitz@gmail.com)(address . 55874@debbugs.gnu.org)
5cd4cc70c147ec1e4615b6bbf917a36d88891c20.camel@telenet.be
Zac Berkowitz schreef op vr 10-06-2022 om 10:04 [-0400]:
Toggle quote (6 lines)
> Wouldn't say "learn" - I'm very new to lisps! The code here is mostly
> adapted from taskwarrior (same developer) and other snippets from
> gnu/packages.  I'm sure I grep'd for another package that required
> asciidoctor and adapted their portion of the code.
>

Ok, not all old packages have been converted yet.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYqNckRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7gWbAQDsYPiN97wObg9jYo3CFYJWodzF
KzF0Usg/SuCAQZXvbgD+Na0+Z8JTWhKQXdHNbocxV+/InsUr7miuOgny8Otq8wQ=
=nzto
-----END PGP SIGNATURE-----


Z
Z
Zac Berkowitz wrote on 13 Jun 20:14 +0200
Re: [bug#55874] [PATCH v2] Add timewarrior 1.4.3
(address . 55874@debbugs.gnu.org)
CANNGBf=5uZB_tOD=CpoHAgH5dB7KgjYZCwhR3Q=3mUgouZbdWw@mail.gmail.com
A new patch that addresses many of the issues from the first attempt:

- python moved to an input dependency. Eases use of bundled but
optional python scripts
- man pages built and installed in share/man/man1/ and share/man/man7/
- bash completions installed to etc/bash_completion.d/
- non-deterministic tests skipped using same patch from debian

That last one I'm sure if it's the best way to go. It still has the
original attribution within the patch file itself, which is good.
Alternatives would be equivalent changes through snippets (hard) or
re-implementing the patch ourselves (silly).

Zac

On Fri, Jun 10, 2022 at 11:00 AM Maxime Devos <maximedevos@telenet.be> wrote:
Toggle quote (9 lines)
>
> Zac Berkowitz schreef op vr 10-06-2022 om 10:04 [-0400]:
> > Wouldn't say "learn" - I'm very new to lisps! The code here is mostly
> > adapted from taskwarrior (same developer) and other snippets from
> > gnu/packages. I'm sure I grep'd for another package that required
> > asciidoctor and adapted their portion of the code.
> >
>
> Ok, not all old packages have been converted yet.
From 78ec019c21c25a7bdb34650d42b16f1b159042c3 Mon Sep 17 00:00:00 2001
From: Zac Berkowitz <zac.berkowitz@gmail.com>
Date: Fri, 13 May 2022 11:56:51 -0400
Subject: [PATCH] gnu: Add timewarrior.

* gnu/packages/task-management.scm (timewarrior): New variable
---
.../timewarrior-time-sensitive-tests.patch | 163 ++++++++++++++++++
gnu/packages/task-management.scm | 52 ++++++
2 files changed, 215 insertions(+)
create mode 100644 gnu/packages/patches/timewarrior-time-sensitive-tests.patch

Toggle diff (248 lines)
diff --git a/gnu/packages/patches/timewarrior-time-sensitive-tests.patch b/gnu/packages/patches/timewarrior-time-sensitive-tests.patch
new file mode 100644
index 0000000000..586d1aa261
--- /dev/null
+++ b/gnu/packages/patches/timewarrior-time-sensitive-tests.patch
@@ -0,0 +1,163 @@
+From: Gordon Ball <gordon@chronitis.net>
+Date: Sat, 23 Nov 2019 18:59:39 +0000
+Subject: skip tests which are sensitive to server time
+
+---
+ test/continue.t | 2 +-
+ test/export.t   | 1 +
+ test/help.t     | 1 +
+ test/lengthen.t | 1 +
+ test/move.t     | 2 ++
+ test/run_all    | 2 +-
+ test/shorten.t  | 1 +
+ test/summary.t  | 3 +++
+ test/tag.t      | 1 +
+ test/tags.t     | 1 +
+ 10 files changed, 13 insertions(+), 2 deletions(-)
+
+diff --git a/test/continue.t b/test/continue.t
+index 917699e..428f714 100755
+--- a/test/continue.t
++++ b/test/continue.t
+@@ -37,7 +37,7 @@ sys.path.append(os.path.dirname(os.path.abspath(__file__)))
+ 
+ from basetest import Timew, TestCase
+ 
+-
++@unittest.skip("Time-of-day sensitive")
+ class TestContinue(TestCase):
+     def setUp(self):
+         """Executed before each test in the class"""
+diff --git a/test/export.t b/test/export.t
+index c6726e6..8b511ff 100755
+--- a/test/export.t
++++ b/test/export.t
+@@ -62,6 +62,7 @@ class TestExport(TestCase):
+                                   expectedEnd=now_utc,
+                                   expectedTags=["foo"])
+ 
++    @unittest.skip("flaky")
+     def test_changing_exclusion_does_not_change_flattened_intervals(self):
+         """Changing exclusions does not change flattened intervals"""
+         now = datetime.now()
+diff --git a/test/help.t b/test/help.t
+index 786def0..9ecf5e6 100755
+--- a/test/help.t
++++ b/test/help.t
+@@ -58,6 +58,7 @@ class TestHelp(TestCase):
+         code, out2, err2 = self.t("-h")
+         self.assertEqual(out1, out2)
+ 
++    @unittest.skip("flaky")
+     def test_help_with_command_should_show_man_page(self):
+         """timew help with command should show man page"""
+         code, out, err = self.t("help start")
+diff --git a/test/lengthen.t b/test/lengthen.t
+index a6f1d77..f9ab54d 100755
+--- a/test/lengthen.t
++++ b/test/lengthen.t
+@@ -55,6 +55,7 @@ class TestLengthen(TestCase):
+         code, out, err = self.t.runError("lengthen @1 10mins")
+         self.assertIn('Cannot lengthen open interval @1', err)
+ 
++    @unittest.skip("time sensitive")
+     def test_lengthen_synthetic_interval(self):
+         """Lengthen a synthetic interval."""
+         now = datetime.now()
+diff --git a/test/move.t b/test/move.t
+index 2d7fdd9..b2336f5 100755
+--- a/test/move.t
++++ b/test/move.t
+@@ -145,6 +145,7 @@ class TestMove(TestCase):
+                                   expectedEnd="20170301T143000Z",
+                                   expectedTags=["bar"])
+ 
++    @unittest.skip("time sensitive")
+     def test_move_synthetic_interval_into_exclusion(self):
+         """Move a synthetic interval into exclusion"""
+         now = datetime.now()
+@@ -175,6 +176,7 @@ class TestMove(TestCase):
+                                 expectedTags=[],
+                                 description="unmodified interval")
+ 
++    @unittest.skip("time sensitive")
+     def test_move_synthetic_interval_away_from_exclusion(self):
+         """Move a synthetic interval away from exclusion"""
+         now = datetime.now()
+diff --git a/test/run_all b/test/run_all
+index ea7dd8f..afc6731 100755
+--- a/test/run_all
++++ b/test/run_all
+@@ -14,7 +14,7 @@ from queue import Queue, Empty
+ from subprocess import call, Popen, PIPE
+ from threading import Thread
+ 
+-TIMEOUT = .2
++TIMEOUT = 2.
+ 
+ 
+ def run_test(testqueue, outqueue, threadname):
+diff --git a/test/shorten.t b/test/shorten.t
+index 7058cc0..94e0067 100755
+--- a/test/shorten.t
++++ b/test/shorten.t
+@@ -69,6 +69,7 @@ class TestShorten(TestCase):
+         self.t("move @1 20170308T113000")
+         self.t("shorten @1 5min")  # Does not work.
+ 
++    @unittest.skip("time sensitive")
+     def test_shorten_synthetic_interval(self):
+         """Shorten a synthetic interval."""
+         now = datetime.now()
+diff --git a/test/summary.t b/test/summary.t
+index 6fd3352..f91e992 100755
+--- a/test/summary.t
++++ b/test/summary.t
+@@ -192,6 +192,7 @@ W10 2017-03-09 Thu @4 Tag1        8:43:08  9:38:15 0:55:07
+                                                            1:09:03
+ """, out)
+ 
++    @unittest.skip("fails w1-9")
+     def test_with_all_hint(self):
+         """Summary should work with :all hint"""
+         now = datetime.now()
+@@ -236,6 +237,7 @@ W{5} {2:%Y-%m-%d} {2:%a} @1 BAZ  10:00:00 11:00:00 1:00:00 1:00:00
+         self.assertIn("@1", out)
+         self.assertRegex(out, r'\s{30}0:00:02')
+ 
++    @unittest.skip("fails w1-9")
+     def test_with_named_date_yesterday(self):
+         """Summary should work with 'yesterday'"""
+         now = datetime.now()
+@@ -260,6 +262,7 @@ W{1} {0:%Y-%m-%d} {0:%a} @3 FOO  10:00:00 11:00:00 1:00:00 1:00:00
+ {2}                                                    1:00:00
+ """.format(yesterday, week_yesterday, " " if two_digit_week is True else "", "-" if two_digit_week is True else ""), out)
+ 
++    @unittest.skip("fails w1-9")
+     def test_with_named_date_today(self):
+         """Summary should work with 'today'"""
+         now = datetime.now()
+diff --git a/test/tag.t b/test/tag.t
+index 8b2f847..21b8c16 100755
+--- a/test/tag.t
++++ b/test/tag.t
+@@ -178,6 +178,7 @@ class TestTag(TestCase):
+         self.assertClosedInterval(j[0], expectedTags=["bar", "foo", "one"])
+         self.assertClosedInterval(j[1], expectedTags=["bar", "foo", "two"])
+ 
++    @unittest.skip("time sensitive")
+     def test_tag_synthetic_interval(self):
+         """Tag a synthetic interval."""
+         now = datetime.now()
+diff --git a/test/tags.t b/test/tags.t
+index 6cfe143..4f84d06 100755
+--- a/test/tags.t
++++ b/test/tags.t
+@@ -63,6 +63,7 @@ class TestTags(TestCase):
+         self.assertIn('foo', out)
+         self.assertIn('bar', out)
+ 
++    @unittest.skip("time sensitive")
+     def test_tags_filtered(self):
+         """Test that tags command filtering excludes tags that are outside the filter range"""
+         self.t("track 20160101T0100 - 20160101T1000 foo")
diff --git a/gnu/packages/task-management.scm b/gnu/packages/task-management.scm
index aeedbfbe6a..ced5e1e661 100644
--- a/gnu/packages/task-management.scm
+++ b/gnu/packages/task-management.scm
@@ -25,6 +25,7 @@ (define-module (gnu packages task-management)
   #: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)
@@ -38,6 +39,7 @@ (define-module (gnu packages task-management)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-xyz)
+  #:use-module (gnu packages ruby)
   #:use-module (gnu packages time)
   #:use-module (gnu packages tls)
   #:use-module (guix download)
@@ -145,6 +147,56 @@ (define-public taskwarrior
 and querying data, exposing task data in multiple formats to other tools.")
     (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)
+    (native-inputs
+     (list ruby-asciidoctor))
+    (inputs
+     (list gnutls `(,util-linux "lib") python))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (delete 'install-license-files) ; Already installed by package
+         (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* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bash-completion-install-dir
+                     (string-append out "/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"))))))))
+     (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"))
-- 
2.36.1
?