From patchwork Mon Jun 13 18:14:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zac Berkowitz X-Patchwork-Id: 39956 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 6F09327BBEA; Mon, 13 Jun 2022 19:16:21 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 2D92E27BBE9 for ; Mon, 13 Jun 2022 19:16:20 +0100 (BST) Received: from localhost ([::1]:40274 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o0obr-00025S-AS for patchwork@mira.cbaines.net; Mon, 13 Jun 2022 14:16:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41736) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0oba-00025F-2G for guix-patches@gnu.org; Mon, 13 Jun 2022 14:16:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38234) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o0obZ-0007yE-Qr for guix-patches@gnu.org; Mon, 13 Jun 2022 14:16:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o0obZ-0005Pq-Mu for guix-patches@gnu.org; Mon, 13 Jun 2022 14:16:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55874] [PATCH v2] Add timewarrior 1.4.3 Resent-From: Zac Berkowitz Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 13 Jun 2022 18:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55874 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 55874@debbugs.gnu.org Received: via spool by 55874-submit@debbugs.gnu.org id=B55874.165514410720725 (code B ref 55874); Mon, 13 Jun 2022 18:16:01 +0000 Received: (at 55874) by debbugs.gnu.org; 13 Jun 2022 18:15:07 +0000 Received: from localhost ([127.0.0.1]:60364 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0oah-0005OC-2D for submit@debbugs.gnu.org; Mon, 13 Jun 2022 14:15:07 -0400 Received: from mail-il1-f177.google.com ([209.85.166.177]:42911) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0oae-0005NG-1v for 55874@debbugs.gnu.org; Mon, 13 Jun 2022 14:15:05 -0400 Received: by mail-il1-f177.google.com with SMTP id p1so4849843ilj.9 for <55874@debbugs.gnu.org>; Mon, 13 Jun 2022 11:15:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=D1epOSmB6FOp1voVVltBzphIl2xQ+tRUzCjbI94KRgk=; b=mvOTSdgY33A2RJfPlMDMCNrnMwC61l/xfNHL46HeGlcImsGnDL/CrtGNiaG9s2KDxG iijVRTweN8Fzjgv6TUwF4T5GAHsuhEzN2EXlyBJhRhOIolVjITyf7jClp97efWhzjwp9 QWsDRS+2MbPxNsaO1YJBaRcYRUHh3l/rGkX0QUghgsNuvixaCcE+jaxzj7hOk6BW2pUb WRA26RtzLe1lvNUuTl1lV4nf/2sD2LtEtWfZq380zh0U1a+W+w+mla9SyXZRJV1fOaHH YuOd1eUsdKma/qvt3VdPQoeJJjg8D5Ar+gZ6HmqXkMCkLZvK+AW7tmrEP7kNcSbihVRs EGKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=D1epOSmB6FOp1voVVltBzphIl2xQ+tRUzCjbI94KRgk=; b=5AQQCsLk7UNw66i04/hYXgvprY0ipG2oMcjtFQ5CSlr55pcNIeScBYq5vTuRhamP59 toxZwHi1y1GiqSnEGwvv4S9w5nDvgbW8SE4OW+4jv7wYz6fA3SdC0EirNFSJoLHhOCs0 Ybtefr1JCNcHS4OATKrgbDcQCucTLpodGI/ChvWo5mQOvKBVjfn9vhCh/lU+c1gq7CEq EqPOyjA/TiRM33BxMuFajfY+5v5LDNqKM+YONVwjXJmVXEBovoazzMj766RolvqCa9bA xx5jS3bEfXXOTIqo+Zz51KB1ctMaTmLykeRqIqt4RnoIveT/lJgascTeJelIBeCMWZYa AQmQ== X-Gm-Message-State: AJIora8622bDzPYe8U5K7cllIGvv4rB9rExZUceUQ89b5neDXQEdtT2G 6jEyHy2vB63pYW6GoskNMXq04ynKzf0JKUMtHj3WuCJR X-Google-Smtp-Source: AGRyM1sbLw5ekAU0uCzBZsG+iiJYNL76V3qHfI80e9mK4D558nvWua9MKBrNq0dHcZ0t1d0E2ZWQQlnynQ8GczgA2oQ= X-Received: by 2002:a92:c544:0:b0:2d3:9998:174a with SMTP id a4-20020a92c544000000b002d39998174amr584386ilj.257.1655144098182; Mon, 13 Jun 2022 11:14:58 -0700 (PDT) MIME-Version: 1.0 References: <56ba51f3df6a70e78518630ad45c3dfc07fdd2a9.camel@telenet.be> <5cd4cc70c147ec1e4615b6bbf917a36d88891c20.camel@telenet.be> In-Reply-To: <5cd4cc70c147ec1e4615b6bbf917a36d88891c20.camel@telenet.be> From: Zac Berkowitz Date: Mon, 13 Jun 2022 14:14:47 -0400 Message-ID: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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 wrote: > > 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 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 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 +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