From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id CIuZGWYI+2D7UAAAgWs5BA (envelope-from ) for ; Fri, 23 Jul 2021 20:20:22 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id QPJEFWYI+2CgJQAAbx9fmQ (envelope-from ) for ; Fri, 23 Jul 2021 18:20:22 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E83FFD6AA for ; Fri, 23 Jul 2021 20:20:21 +0200 (CEST) Received: from localhost ([::1]:44482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6zmX-0008Ax-2X for larch@yhetil.org; Fri, 23 Jul 2021 14:20:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52422) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6zmE-0008AB-Tq for guix-patches@gnu.org; Fri, 23 Jul 2021 14:20:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33034) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6zmE-00027k-MP for guix-patches@gnu.org; Fri, 23 Jul 2021 14:20:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m6zmE-0002DR-JQ for guix-patches@gnu.org; Fri, 23 Jul 2021 14:20:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49685] [PATCH] gnu: Add task-spooler. References: <20210721183504.9388-1-i.gankevich@spbu.ru> In-Reply-To: <20210721183504.9388-1-i.gankevich@spbu.ru> Resent-From: Ivan Gankevich Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 23 Jul 2021 18:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49685 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49685@debbugs.gnu.org Cc: Ivan Gankevich Received: via spool by 49685-submit@debbugs.gnu.org id=B49685.16270643938490 (code B ref 49685); Fri, 23 Jul 2021 18:20:02 +0000 Received: (at 49685) by debbugs.gnu.org; 23 Jul 2021 18:19:53 +0000 Received: from localhost ([127.0.0.1]:44579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6zm4-0002CR-Mr for submit@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 ) id 1m6zm1-0002B6-Vh for 49685@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@spbu.ru 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 Date: Fri, 23 Jul 2021 21:19:03 +0300 Message-Id: <20210723181902.8703-1-i.gankevich@spbu.ru> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1627064422; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=IkDBEJKooR46LF9GSM2hN2uNI8kH4UElqpXpeb6iUPU=; b=cg+9EzTS41HIyKefJmldRLyU79P4EVztke+rAowMXkkzlqsR3Q1i3Mu4Eql7MMk4pYx2Zt /wArdK+SV/GVS+nOfCtigVUGQ37yhQ7PHa5bBw4U9pK6bK9K6I7U5ZXQ0Ile54vVwXMFVb cc3xte9MzI4Hzjt4TBV61B1StWi9Pfz6UxqSpSBQSaM8EQ8zb/joaf7hfKTAr0bHG+vpYF G6agXuexDdYsB9O3BBkLpEfZhi+tP0KveEJ28Bfu3GLakxKspCTJOt52aXzSY1rsZYlwm7 EWMLEFe8US65W7Utlfx/mXMo1BRYlpmefBd6YyEDIQ+oMWiPV0Di2QhpMYwlFg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1627064422; a=rsa-sha256; cv=none; b=C+iUs8L0AtNaGJpcs6XpH+Uf4wYVWC3HLIBU6BR6ZpzV8k5mi9TvUFf+no+o/HCZR6YZzs 5F9OKaTf7brhOXyukfro1LLbtDbC2bi4mF7zm8425D2keCnfJNRPS83NPs1SnhIyuMrGRb gk2QaewN33SYuT+TH4UhXlsRjTHr7Aq2eyGLsM03a4UbxAK9MPkKpX6yRx4IBZEc/nOyvX h9vAIgmH5EuxB0E+1Tk6VPnH4hJVi7n4RlTLFYdArEd8+fYPmIW1aEvM9wzckBJ395PVnm X8Pnw3BVVj03CGPn5EpqehaV5rXOgMYYlibtO3AVIMsASZEaQHFFK+FeIJsMfQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=spbu.ru header.s=20180812 header.b=LgpQ8JvQ; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 1.08 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=spbu.ru header.s=20180812 header.b=LgpQ8JvQ; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: E83FFD6AA X-Spam-Score: 1.08 X-Migadu-Scanner: scn0.migadu.com X-TUID: pBeMKlWix9oa * 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 +;;; Copyright © 2021 Ivan Gankevich ;;; ;;; 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