GNU bug report logs - #49685
[PATCH] gnu: Add task-spooler.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Ivan Gankevich <i.gankevich@HIDDEN>; Keywords: patch; dated Wed, 21 Jul 2021 18:38:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 49685 <at> debbugs.gnu.org:


Received: (at 49685) by debbugs.gnu.org; 23 Jul 2021 18:23:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 23 14:23:00 2021
Received: from localhost ([127.0.0.1]:44586 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m6zp6-0002Hn-AA
	for submit <at> debbugs.gnu.org; Fri, 23 Jul 2021 14:23:00 -0400
Received: from mail.spbu.ru ([195.70.197.23]:52269 helo=cgp2.pu.ru)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <i.gankevich@HIDDEN>) id 1m6zp4-0002HU-7w
 for 49685 <at> debbugs.gnu.org; Fri, 23 Jul 2021 14:22:59 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=simple/simple; d=spbu.ru;
 s=20180812; bh=wHCSqPLuiNo68Anj2itPdA8R0Or5fd36ikAT8K4PxU4=;
 h=In-Reply-To:Content-Transfer-Encoding:Content-Disposition:Content-Type:
 MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; b=Pe3WQP9s7NxUzk0
 EA0/JdhhOd98181hf94VH83sdjTQzVz5P+SOGd70Iqz1dBDctpcu/vubISs5x5nze/57Mgz/aoYny
 MpqDwlDxJVwWSxgfpi0nRvqW/7pJKRSYrwssHeoorVPs5JdI2LTk4Ji6IKKe8Y+DwJUdOyVVAsExF
 gftqwZ99VPTN65xHaSYic6hsQIXAm+9FYlxhb1M3pwA+Y8NVpUsjj7v1PRMBeM9bvyT/duPRZ5rki
 JhiKMMEXcFmjUmN4W4ulbEH+Sfq2umpmLMXD47cM4p2bIjC1mWKzkszIxATT12XfQN3LEMCVO6j+8
 GjllAZm69R4IPHQQ+ZQ==
Received: from [172.27.221.159] (account st018947@HIDDEN HELO localhost)
 by spbu.ru (CommuniGate Pro SMTP 6.2.15)
 with ESMTPSA id 173762824; Fri, 23 Jul 2021 21:22:52 +0300
Date: Fri, 23 Jul 2021 21:22:52 +0300
From: Ivan Gankevich <i.gankevich@HIDDEN>
To: Maxime Devos <maximedevos@HIDDEN>
Subject: Re: [bug#49685] [PATCH] gnu: Add task-spooler.
Message-ID: <YPsI/G+zDMlTVoZI@surge>
References: <20210721183504.9388-1-i.gankevich@HIDDEN>
 <e653b01880415556c8f30e0508be89618cecaddd.camel@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <e653b01880415556c8f30e0508be89618cecaddd.camel@HIDDEN>
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 49685
Cc: 49685 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

>> +    (arguments
>> +      `(#:make-flags
>> +        (let ((c-flags "-g -O2"))
>> +          (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
>> +                "CC=gcc"
>
>This shoul be ,(string-append "CC=" (cc-for-target)), such that the cross-compiler
>is used when cross-compililng.

Fixed!


>> +                (string-append "CFLAGS=" c-flags)
>> +                (string-append "LDFLAGS=" c-flags)))
>
>Why are you adding "-g -O2" to LDFLAGS? I understand adding it to CFLAGS,
>but I don't see why it would be added to CFLAGS.

You’re right. Removed LDFLAGS.


>> +              ;; Patch gzip/sendmail/shell paths.
>> +              (substitute* "execute.c"
>> +                (("execlp\\(\"gzip\"") (format #f "execlp(\"~a\"" (which "gzip"))))
>
>This needs to be (search-input-file "bin/gzip") instead of (which "gzip")
>for cross-compilation purposes ('which' searches for a native "gzip" in $PATH)
>'search-input-file' is not yet defined on 'master' (it's only on 'core-updates'
>currently), so you could do something like
>
>  (string-append (assoc-ref inputs "gzip") "/bin/gzip")

Changed “which” to “string-append” here and everywhere else.


>If you fix 'sendemail' to install things in "sbin" instead of
>"usr/sbin", then you can do (search-input-file inputs "bin/sendmail").

I’ve sent a separate patch that fixes /sbin and /bin directories for “sendmail”.

Thank you for the review, Maxime!




Information forwarded to guix-patches@HIDDEN:
bug#49685; Package guix-patches. Full text available.

Message received at 49685 <at> debbugs.gnu.org:


Received: (at 49685) by debbugs.gnu.org; 23 Jul 2021 18:19:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 23 14:19:53 2021
Received: from localhost ([127.0.0.1]:44579 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m6zm4-0002CR-Mr
	for submit <at> debbugs.gnu.org; Fri, 23 Jul 2021 14:19:53 -0400
Received: from mail.spbu.ru ([195.70.197.23]:32864 helo=cgp2.pu.ru)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <i.gankevich@HIDDEN>) id 1m6zm1-0002B6-Vh
 for 49685 <at> debbugs.gnu.org; Fri, 23 Jul 2021 14:19:51 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=simple/simple; d=spbu.ru;
 s=20180812; bh=iXxhN91oV31jMCB4UYJ2LI9m0j7aYz3yASA3toNcnEE=;
 h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject
 :Cc:To:From; b=LgpQ8JvQgaSrX5v7P0FKzY+ubi+vPejhPZkGp2QBehVQmkvoanBUM5fEvLZ2Q/
 eLqGK9Nh3nLXLBgYokBocdiQWPrQMWLOgyrlc+2PFZq1Wjd5ojxYAM0wPAgABeYfAUCMdf4MezZu+
 Ngycdjv3t8+EZzk3mwnsxNSBi8ECfvDF7A1cqEcRKQmo+6AHd308MY0PDa4Jeg8pgNHTKuvRLLJMp
 B8KXAedqKUeERawKco1EJwgBWL5eH8ugot7dFwqkf6/qpQ9jY8gv6mat37loHsrLIA/L9FGYcgJHH
 eEAw/2ZXwKUGQMIVC6Dg39SW8rX+E4c1NkmjfQH6xlVhB0UiQ==
Received: from [172.27.221.159] (account st018947@HIDDEN HELO
 localhost.localdomain) by spbu.ru (CommuniGate Pro SMTP 6.2.15)
 with ESMTPSA id 173762376; Fri, 23 Jul 2021 21:19:24 +0300
From: Ivan Gankevich <i.gankevich@HIDDEN>
To: 49685 <at> debbugs.gnu.org
Subject: [PATCH] gnu: Add task-spooler.
Date: Fri, 23 Jul 2021 21:19:03 +0300
Message-Id: <20210723181902.8703-1-i.gankevich@HIDDEN>
X-Mailer: git-send-email 2.32.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 49685
Cc: Ivan Gankevich <i.gankevich@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* gnu/packages/task-runners.scm (task-spooler): New variable.
---
 gnu/packages/task-runners.scm | 64 +++++++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)

diff --git a/gnu/packages/task-runners.scm b/gnu/packages/task-runners.scm
index 49a07fa3bd..237a6ec1b6 100644
--- a/gnu/packages/task-runners.scm
+++ b/gnu/packages/task-runners.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2021 Stefan Reichör <stefan@HIDDEN>
+;;; Copyright © 2021 Ivan Gankevich <i.gankevich@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -19,8 +20,14 @@
 (define-module (gnu packages task-runners)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
+  #:use-module (guix download)
   #:use-module (guix git-download)
+  #:use-module (guix utils)
+  #:use-module (gnu packages bash)
+  #:use-module (gnu packages compression)
   #:use-module (gnu packages golang)
+  #:use-module (gnu packages mail)
+  #:use-module (guix build-system gnu)
   #:use-module (guix build-system go))
 
 (define-public run
@@ -47,3 +54,60 @@
 using a Runfile.")
     (home-page "https://github.com/TekWizely/run")
     (license license:expat)))
+
+(define-public task-spooler
+  (package
+    (name "task-spooler")
+    (version "1.0.1")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append
+               "https://vicerveza.homeunix.net/~viric/soft/ts/ts-" version ".tar.gz"))
+        (sha256 (base32 "0y32sm2i2jxs88c307h76449fynk75p9qfw1k11l5ixrn03z67pl"))))
+    (build-system gnu-build-system)
+    (arguments
+      `(#:make-flags
+        (let ((c-flags "-g -O2"))
+          (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
+                ,(string-append "CC=" (cc-for-target))
+                (string-append "CFLAGS=" c-flags)))
+        #:phases
+        (modify-phases %standard-phases
+          (delete 'configure) ;; no configuration script
+          (add-after 'unpack 'rename-and-patch-paths
+            (lambda _
+              ;; Rename "ts" to "tsp" to not interfere with "ts" command
+              ;; from moreutils package.
+              (rename-file "ts.1" "tsp.1");
+              (substitute* '("Makefile" "testbench.sh")
+                (("\\bts\\b") "tsp"))
+              ;; Patch gzip/sendmail/shell paths.
+              (substitute* "execute.c"
+                (("execlp\\(\"gzip\"")
+                 (format #f "execlp(\"~a/bin/gzip\""
+                         (assoc-ref %build-inputs "gzip"))))
+              (substitute* "list.c"
+                (("/bin/sh\\b") (which "sh")))
+              (substitute* "env.c"
+                (("execlp\\(\"/bin/sh\"")
+                 (format #f "execlp(\"~a/bin/sh\""
+                         (assoc-ref %build-inputs "bash"))))
+              (substitute* "mail.c"
+                (("execl\\(\"/usr/sbin/sendmail\"")
+                 (format #f "execl(\"~a/sbin/sendmail\""
+                         (assoc-ref %build-inputs "sendmail"))))))
+          (replace 'check
+            (lambda* (#:key tests? #:allow-other-keys)
+              (when tests?
+                (setenv "PATH" (string-join (list (getenv "PATH") (getcwd)) ":"))
+                (invoke "./testbench.sh")))))))
+    (inputs
+      `(("bash" ,bash-minimal)
+        ("gzip" ,gzip)
+        ("sendmail" ,sendmail)))
+    (synopsis "UNIX task queue system")
+    (description "Task spooler let users run shell commands asynchronously
+one after the other in a separate process.")
+    (home-page "https://vicerveza.homeunix.net/~viric/soft/ts/")
+    (license license:gpl2+)))
-- 
2.32.0





Information forwarded to guix-patches@HIDDEN:
bug#49685; Package guix-patches. Full text available.

Message received at 49685 <at> debbugs.gnu.org:


Received: (at 49685) by debbugs.gnu.org; 23 Jul 2021 18:19:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 23 14:19:26 2021
Received: from localhost ([127.0.0.1]:44572 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m6zle-0002B8-2w
	for submit <at> debbugs.gnu.org; Fri, 23 Jul 2021 14:19:26 -0400
Received: from mail.spbu.ru ([195.70.197.23]:57335 helo=cgp2.pu.ru)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <i.gankevich@HIDDEN>) id 1m6zlQ-0002Ad-Vb
 for 49685 <at> debbugs.gnu.org; Fri, 23 Jul 2021 14:19:24 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=simple/simple; d=spbu.ru;
 s=20180812; bh=fOLy2ghORIfusXr8o51t0zcEYosDI62zJYsECoax1Qw=;
 h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To:From;
 b=TAS44N1UflkbrcKFbJslAF6PeL/XScs5mlieMc416Se+bIEX4TBAPHKU1ml/wJP1rAPqV2MOJI
 Mqgq5pUSK4HLVSQKsTBPbIGb0MZQERqfEj2sBFJ6J/jsEv3O7SOWwfpZurTEyQ+SQUX8PS3qMZpII
 74TJntry61IdReCTcRvGKvB/xAQnTvhaJL77Gx8v1BC+AJ8/IpXZiHtwnDvIExE0AZrBS3nX9VrQ1
 NDWWFC+KnT65k0L/4+bMWuBM8V7FT0SaSWvM3k6Y4tT8r0lCkbTKAACjBJBaLDYHPLTmRBUS1TBgP
 7cNz4cP1hENY9Hj/Fmi/FVBuTpkZJBSN7esmg==
Received: from [172.27.221.159] (account st018947@HIDDEN HELO
 localhost.localdomain) by spbu.ru (CommuniGate Pro SMTP 6.2.15)
 with ESMTPSA id 173762293; Fri, 23 Jul 2021 21:18:50 +0300
From: Ivan Gankevich <i.gankevich@HIDDEN>
To: 49685 <at> debbugs.gnu.org
Subject: [PATCH] gnu: sendmail: Install executables to $prefix/sbin and
 $prefix/bin directories.
Date: Fri, 23 Jul 2021 21:15:39 +0300
Message-Id: <20210723181538.8402-1-i.gankevich@HIDDEN>
X-Mailer: git-send-email 2.32.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 49685
Cc: Ivan Gankevich <i.gankevich@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Currently "sendmail" installs executables to $PREFIX/usr/sbin and
$PREFIX/usr/bin directories. This patch changes them to $PREFIX/sbin and
$PREFIX/bin respectively. Also this patch fixes broken symlinks in
$PREFIX/bin and updates package definitions that use old sendmail paths.

* gnu/packages/mail.scm (sendmail): Set new paths.
 [arguments]<#:phases>{replace-/usr}: Remove /usr prefix.
 [arguments]<#:phases>{post-install}: Fix broken symlinks
 [arguments]<#:phases>{configure}: Set paths without /usr prefix.
* gnu/packages/mail.scm (claws-mail): Use new sendmail paths.
* gnu/packages/version-control.scm (python-git-multimail): Use new
  sendmail paths.
---
 gnu/packages/mail.scm            | 28 ++++++++++++++++++++++++----
 gnu/packages/version-control.scm |  2 +-
 2 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index f0f1540cc9..a76a56694c 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -1635,7 +1635,7 @@ compresses it.")
              (let* ((mailutils (assoc-ref inputs "mailutils"))
                     (inc (string-append mailutils "/bin/mu-mh/inc"))
                     (send-mail (assoc-ref inputs "sendmail"))
-                    (sendmail (string-append send-mail "/usr/sbin/sendmail")))
+                    (sendmail (string-append send-mail "/sbin/sendmail")))
                (substitute* "src/common/defs.h"
                  (("/usr/bin/mh/inc") inc)
                  (("/usr/sbin/sendmail") sendmail)))))
@@ -2881,6 +2881,13 @@ powerful user customization features.")
              (substitute* "devtools/bin/Build"
                (("SHELL=/bin/sh") (string-append "SHELL=" (which "sh"))))
              #t))
+         (add-before 'build 'replace-/usr
+           (lambda _
+             (substitute*
+               '("devtools/OS/Linux"
+                 "cf/ostype/mklinux.m4"
+                 "cf/ostype/linux.m4")
+               (("/usr/sbin") "/sbin"))))
          (replace 'configure
            (lambda _
 
@@ -2892,6 +2899,11 @@ powerful user customization features.")
              (with-output-to-file "devtools/Site/site.config.m4"
                (lambda ()
                  (format #t "
+define(`confEBINDIR', `/sbin')
+define(`confSBINDIR', `/sbin')
+define(`confMBINDIR', `/sbin')
+define(`confUBINDIR', `/bin')
+define(`confLINKS', `')
 define(`confCC', `gcc')
 define(`confOPTIMIZE', `-g -O2')
 define(`confLIBS', `-lresolv')
@@ -2910,13 +2922,21 @@ define(`confINST_DEP', `')
          (add-before 'install 'pre-install
            (lambda _
              (let ((out (assoc-ref %outputs "out")))
-               (mkdir-p (string-append out "/usr/bin"))
-               (mkdir-p (string-append out "/usr/sbin"))
+               (mkdir-p (string-append out "/bin"))
+               (mkdir-p (string-append out "/sbin"))
                (mkdir-p (string-append out "/etc/mail"))
                (setenv "DESTDIR" out)
                (with-directory-excursion "cf/cf"
                  (invoke "sh" "Build" "install-cf"))
-               #t))))
+               #t)))
+         (add-after 'install 'post-install
+           (lambda _
+               ;; Make symbolic links manually, because build script uses
+               ;; absolute paths for them and ignores DESTDIR.
+               (for-each
+                 (lambda (name)
+                   (symlink "../sbin/sendmail" (string-append %output "/bin/" name)))
+                 '("hoststat" "newaliases" "mailq" "purgestat")))))
        ;; There is no make check.  There are some post installation tests, but those
        ;; require root privileges
        #:tests? #f))
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 7c1dbe8b26..814a87904e 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -1036,7 +1036,7 @@ a built-in cache to decrease server I/O pressure.")
                                "'"))
                (("/usr/sbin/sendmail")
                 (string-append (assoc-ref inputs "sendmail")
-                               "/usr/sbin/sendmail")))
+                               "/sbin/sendmail")))
              #t)))))
     (inputs
      `(("git" ,git)
-- 
2.32.0





Information forwarded to guix-patches@HIDDEN:
bug#49685; Package guix-patches. Full text available.

Message received at 49685 <at> debbugs.gnu.org:


Received: (at 49685) by debbugs.gnu.org; 21 Jul 2021 19:00:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 21 15:00:49 2021
Received: from localhost ([127.0.0.1]:38607 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m6HSb-0007yI-9V
	for submit <at> debbugs.gnu.org; Wed, 21 Jul 2021 15:00:49 -0400
Received: from albert.telenet-ops.be ([195.130.137.90]:39928)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maximedevos@HIDDEN>) id 1m6HSY-0007y9-Jt
 for 49685 <at> debbugs.gnu.org; Wed, 21 Jul 2021 15:00:47 -0400
Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be
 ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d])
 by albert.telenet-ops.be with bizsmtp
 id Xv0k2500D0mfAB406v0kH0; Wed, 21 Jul 2021 21:00:44 +0200
Message-ID: <e653b01880415556c8f30e0508be89618cecaddd.camel@HIDDEN>
Subject: Re: [bug#49685] [PATCH] gnu: Add task-spooler.
From: Maxime Devos <maximedevos@HIDDEN>
To: Ivan Gankevich <i.gankevich@HIDDEN>, 49685 <at> debbugs.gnu.org
Date: Wed, 21 Jul 2021 21:00:26 +0200
In-Reply-To: <20210721183504.9388-1-i.gankevich@HIDDEN>
References: <20210721183504.9388-1-i.gankevich@HIDDEN>
Content-Type: multipart/signed; micalg="pgp-sha512";
 protocol="application/pgp-signature"; boundary="=-xixty6XcRO0UrIgtQFAX"
User-Agent: Evolution 3.34.2 
MIME-Version: 1.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21;
 t=1626894045; bh=cObyyAcb2yWpzqPLv/D5CjTSRgszHgfS96TlkXBofoQ=;
 h=Subject:From:To:Date:In-Reply-To:References;
 b=maRZYbkISam79Dx+Y90/bo71zkyuosbXd254Zqy/EGaJlTlCSzhkDAybhAKKF23Ez
 nPj7g+L3EhoiBcl/bPG8enph5Ge3PR0XTCAulFdr51MFfjRD1ZeQp22TnpRyOXGYUb
 TBkbaB4ESJKSoT/TlUU8i0sUkzhoNpms30wtAtBanVjzW/FX186zTXWYxrDSWsSwQ5
 KD/b8oPFOR1LTIHdlUQViiKLXSPfrRhbsEmXSjXOcN+wKQHbvAlynDa1xuCD7bpP4v
 ZmC1yvi6n9osZcHCNFsM2BepqcmWiJRT+rxQSeHk6QLKFj7wyJKI0J3mR6sqlM5gRW
 TPw8E5jdcpvkA==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 49685
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)


--=-xixty6XcRO0UrIgtQFAX
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Ivan Gankevich schreef op wo 21-07-2021 om 21:35 [+0300]:
> +(define-public task-spooler
> +  (package
> +    (name "task-spooler")
> +    (version "1.0.1")
> +    (source
> +      (origin
> +        (method url-fetch)
> +        (uri (string-append
> +               "https://vicerveza.homeunix.net/~viric/soft/ts/ts-" versi=
on ".tar.gz"))
> +        (sha256 (base32 "0y32sm2i2jxs88c307h76449fynk75p9qfw1k11l5ixrn03=
z67pl"))))
> +    (build-system gnu-build-system)
> +    (arguments
> +      `(#:make-flags
> +        (let ((c-flags "-g -O2"))
> +          (list (string-append "PREFIX=3D" (assoc-ref %outputs "out"))
> +                "CC=3Dgcc"

This shoul be ,(string-append "CC=3D" (cc-for-target)), such that the cross=
-compiler
is used when cross-compililng.

> +                (string-append "CFLAGS=3D" c-flags)
> +                (string-append "LDFLAGS=3D" c-flags)))

Why are you adding "-g -O2" to LDFLAGS? I understand adding it to CFLAGS,
but I don't see why it would be added to CFLAGS.

> +        #:phases
> +        (modify-phases %standard-phases
> +          (delete 'configure) ;; no configuration script
> +          (add-after 'unpack 'rename-and-patch-paths
> +            (lambda _
> +              ;; Rename "ts" to "tsp" to not interfere with "ts" command
> +              ;; from moreutils package.
> +              (rename-file "ts.1" "tsp.1");
> +              (substitute* '("Makefile" "testbench.sh")
> +                (("\\bts\\b") "tsp"))
> +              ;; Patch gzip/sendmail/shell paths.
> +              (substitute* "execute.c"
> +                (("execlp\\(\"gzip\"") (format #f "execlp(\"~a\"" (which=
 "gzip"))))

This needs to be (search-input-file "bin/gzip") instead of (which "gzip")
for cross-compilation purposes ('which' searches for a native "gzip" in $PA=
TH)
'search-input-file' is not yet defined on 'master' (it's only on 'core-upda=
tes'
currently), so you could do something like

  (string-append (assoc-ref inputs "gzip") "/bin/gzip")

> +              (substitute* "list.c"
> +                (("/bin/sh\\b") (which "sh")))

Ditto (and you need to add "bash-minimal" to "inputs").

> +              (substitute* "env.c"
> +                (("execlp\\(\"/bin/sh\"") (format #f "execlp(\"~a\"" (wh=
ich "sh"))))

Ditto.

> +              (substitute* "mail.c"
> +                (("execl\\(\"/usr/sbin/sendmail\"")
> +                 (format #f "execl(\"~a/usr/sbin/sendmail\""
> +                         (assoc-ref %build-inputs "sendmail"))))))

If you fix 'sendemail' to install things in "sbin" instead of
"usr/sbin", then you can do (search-input-file inputs "bin/sendmail").

> +          (replace 'check
> +            (lambda* (#:key tests? #:allow-other-keys)
> +              (when tests?
> +                (setenv "PATH" (string-join (list (getenv "PATH") (getcw=
d)) ":"))

Greetings,
Maxime.

--=-xixty6XcRO0UrIgtQFAX
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

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

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYPhuyhccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7lLVAQDttromNVh3RsKLN8QcOj2Fdsz+
C5q40UyLlG0NmyR59QEA1fhdVIZHkp5KJ+6t7NMpEEeoWksTg/v3EmOSGpbSugs=
=R7c/
-----END PGP SIGNATURE-----

--=-xixty6XcRO0UrIgtQFAX--





Information forwarded to guix-patches@HIDDEN:
bug#49685; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 21 Jul 2021 18:37:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 21 14:37:15 2021
Received: from localhost ([127.0.0.1]:38583 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m6H5m-0007Jy-UF
	for submit <at> debbugs.gnu.org; Wed, 21 Jul 2021 14:37:15 -0400
Received: from lists.gnu.org ([209.51.188.17]:52584)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <i.gankevich@HIDDEN>) id 1m6H5l-0007Jr-S1
 for submit <at> debbugs.gnu.org; Wed, 21 Jul 2021 14:37:14 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:50074)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <i.gankevich@HIDDEN>)
 id 1m6H5k-0001ny-SJ
 for guix-patches@HIDDEN; Wed, 21 Jul 2021 14:37:13 -0400
Received: from mail.spbu.ru ([195.70.197.23]:37757 helo=cgp2.pu.ru)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256)
 (Exim 4.90_1) (envelope-from <i.gankevich@HIDDEN>)
 id 1m6H5g-0008Pi-Fh
 for guix-patches@HIDDEN; Wed, 21 Jul 2021 14:37:12 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=simple/simple; d=spbu.ru;
 s=20180812; bh=VaP5Xy8qowNl31BRkyB4rqn8ZzJZXO104v/PzOd5dN4=;
 h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject
 :Cc:To:From; b=Z25fjak3zs2f86ahZy2WEbDxCt5VfU+T3jyldN6QBEgL5NRIw5s1JwHSGbZG/2
 D4vQCvVwYR7vqboZHRK8LZmR74RcgkJkWb8RifhtoJIQE0aUkCK5fwiIfaN3znqi5z7pE3QUA1GMl
 vgSFGfUgVTagWOgd/p2x/qMrStLoFdk4+ifKNUEWN0W4aUJ41Isj9shaTwr2ovBCtpYGbUGwkHxft
 IL53iVN9QgFQLu6Wo+oy4jYXE+Yxjb3fKN3HB/kwxL2GGr5pudq05hpVjwWpGQbzyKcWLfPyU5KRR
 jZx2lbmLngpispDKBoU10xc6cT7Vm9Azxx0Or8tAd4ctFrixA==
Received: from [172.27.221.159] (account st018947@HIDDEN HELO
 localhost.localdomain) by spbu.ru (CommuniGate Pro SMTP 6.2.15)
 with ESMTPSA id 173293618; Wed, 21 Jul 2021 21:37:04 +0300
From: Ivan Gankevich <i.gankevich@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH] gnu: Add task-spooler.
Date: Wed, 21 Jul 2021 21:35:05 +0300
Message-Id: <20210721183504.9388-1-i.gankevich@HIDDEN>
X-Mailer: git-send-email 2.32.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=195.70.197.23; envelope-from=i.gankevich@HIDDEN;
 helo=cgp2.pu.ru
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
Cc: Ivan Gankevich <i.gankevich@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

* gnu/packages/task-runners.scm (task-spooler): New variable.
---
 gnu/packages/task-runners.scm | 58 +++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/gnu/packages/task-runners.scm b/gnu/packages/task-runners.scm
index 49a07fa3bd..5b47076696 100644
--- a/gnu/packages/task-runners.scm
+++ b/gnu/packages/task-runners.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2021 Stefan Reichör <stefan@HIDDEN>
+;;; Copyright © 2021 Ivan Gankevich <i.gankevich@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -19,8 +20,12 @@
 (define-module (gnu packages task-runners)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
+  #:use-module (guix download)
   #:use-module (guix git-download)
+  #:use-module (gnu packages compression)
   #:use-module (gnu packages golang)
+  #:use-module (gnu packages mail)
+  #:use-module (guix build-system gnu)
   #:use-module (guix build-system go))
 
 (define-public run
@@ -47,3 +52,56 @@
 using a Runfile.")
     (home-page "https://github.com/TekWizely/run")
     (license license:expat)))
+
+(define-public task-spooler
+  (package
+    (name "task-spooler")
+    (version "1.0.1")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append
+               "https://vicerveza.homeunix.net/~viric/soft/ts/ts-" version ".tar.gz"))
+        (sha256 (base32 "0y32sm2i2jxs88c307h76449fynk75p9qfw1k11l5ixrn03z67pl"))))
+    (build-system gnu-build-system)
+    (arguments
+      `(#:make-flags
+        (let ((c-flags "-g -O2"))
+          (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
+                "CC=gcc"
+                (string-append "CFLAGS=" c-flags)
+                (string-append "LDFLAGS=" c-flags)))
+        #:phases
+        (modify-phases %standard-phases
+          (delete 'configure) ;; no configuration script
+          (add-after 'unpack 'rename-and-patch-paths
+            (lambda _
+              ;; Rename "ts" to "tsp" to not interfere with "ts" command
+              ;; from moreutils package.
+              (rename-file "ts.1" "tsp.1");
+              (substitute* '("Makefile" "testbench.sh")
+                (("\\bts\\b") "tsp"))
+              ;; Patch gzip/sendmail/shell paths.
+              (substitute* "execute.c"
+                (("execlp\\(\"gzip\"") (format #f "execlp(\"~a\"" (which "gzip"))))
+              (substitute* "list.c"
+                (("/bin/sh\\b") (which "sh")))
+              (substitute* "env.c"
+                (("execlp\\(\"/bin/sh\"") (format #f "execlp(\"~a\"" (which "sh"))))
+              (substitute* "mail.c"
+                (("execl\\(\"/usr/sbin/sendmail\"")
+                 (format #f "execl(\"~a/usr/sbin/sendmail\""
+                         (assoc-ref %build-inputs "sendmail"))))))
+          (replace 'check
+            (lambda* (#:key tests? #:allow-other-keys)
+              (when tests?
+                (setenv "PATH" (string-join (list (getenv "PATH") (getcwd)) ":"))
+                (invoke "./testbench.sh")))))))
+    (inputs
+      `(("gzip" ,gzip)
+        ("sendmail" ,sendmail)))
+    (synopsis "UNIX task queue system")
+    (description "Task spooler let users run shell commands asynchronously
+one after the other in a separate process.")
+    (home-page "https://vicerveza.homeunix.net/~viric/soft/ts/")
+    (license license:gpl2+)))
-- 
2.32.0





Acknowledgement sent to Ivan Gankevich <i.gankevich@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#49685; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 23 Jul 2021 18:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.