From patchwork Tue May 23 04:53:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: david larsson X-Patchwork-Id: 50243 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 CA2D427BBE9; Tue, 23 May 2023 05:54:27 +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=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI,PDS_OTHER_BAD_TLD, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=no 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 E5A1127BBE2 for ; Tue, 23 May 2023 05:54:25 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1K2A-0006Af-1y; Tue, 23 May 2023 00:54:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1K27-00068b-Lc for guix-patches@gnu.org; Tue, 23 May 2023 00:54:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1K27-0005Gc-CR for guix-patches@gnu.org; Tue, 23 May 2023 00:54:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q1K27-0006YP-8V for guix-patches@gnu.org; Tue, 23 May 2023 00:54:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#51512] [PATCH v6 1/3]: gnu: Add bash-bcu. Resent-From: david larsson Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 23 May 2023 04:54:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51512 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 51512@debbugs.gnu.org Cc: Guix-patches Received: via spool by 51512-submit@debbugs.gnu.org id=B51512.168481761525132 (code B ref 51512); Tue, 23 May 2023 04:54:03 +0000 Received: (at 51512) by debbugs.gnu.org; 23 May 2023 04:53:35 +0000 Received: from localhost ([127.0.0.1]:37845 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1K1b-0006XF-Md for submit@debbugs.gnu.org; Tue, 23 May 2023 00:53:35 -0400 Received: from server0.selfhosted.xyz ([217.64.149.7]:56698) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1K1Y-0006Ww-JK for 51512@debbugs.gnu.org; Tue, 23 May 2023 00:53:30 -0400 Received: from server0.selfhosted.xyz (localhost [127.0.0.1]) by server0.selfhosted.xyz (Postfix) with ESMTP id 10F4A30F8694; Tue, 23 May 2023 06:53:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=selfhosted.xyz; s=dkim; t=1684817602; bh=3JLl+ZwNqZmmZwprVqfe/HeFSoaTiH9pASPbc9PGd1U=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=QZp605kRKdlfxaiNZgUoPqItnUnLO6YInnFlcM2mEdzHwX7sCrO2iZm8vsS0+eX65 zwCwH6Lus9Z7fKvu7OowkSGGjjfcPJCGdou6YJLDS+CnkX8ueaeEOEDhQIALSmLKSr pUTJcxHETrvCKjXnwy2Z9ES4kqjSf1opFLmX0LJ6Ldnl1yZqURuAZ8GI8ApkQdDc2G OKekEZmV/xRqO70RWegol7+Xvs2J3MSzFv8VY0MzfwTzqgPcNjsF3fKhvPiC8ZZf3H MVr/gYrKdAzMxPpt/8KKF8vK5DsFdB3XjmExEYNEoRtLkIgbrixZagP5TUFBo3YxTv Gj/Dxxk0o5PPw== X-Fuglu-Suspect: 0f2b0f02991f4fd5a68d67286f3c85ff X-Fuglu-Spamstatus: NO Received: from webmail.selfhosted.xyz (office.selfhosted.xyz [192.168.1.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: mail@selfhosted.xyz) by server0.selfhosted.xyz (Postfix) with ESMTPSA; Tue, 23 May 2023 06:53:17 +0200 (CEST) MIME-Version: 1.0 Date: Tue, 23 May 2023 06:53:16 +0200 From: david larsson In-Reply-To: <3add15b77522d6e9ebd715a19d966666@selfhosted.xyz> References: <3add15b77522d6e9ebd715a19d966666@selfhosted.xyz> Message-ID: X-Sender: david.larsson@selfhosted.xyz 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From b0a982abeb698997bd124b56cb2d33f2fdbd5dac Mon Sep 17 00:00:00 2001 From: David Larsson Date: Tue, 23 May 2023 05:31:06 +0200 Subject: [PATCH 1/3] gnu: Add pydaemon * gnu/packages/bash.scm (pydaemon): new variable. --- gnu/packages/bash.scm | 58 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) + (string-append pre #$(this-package-input "coreutils") "/bin/" command " ")) + (("(python3) " library _) + (string-append #$(file-append (this-package-input "python") + "/bin/python" + (version-major+minor + (package-version + (this-package-input + "python")))) + " "))))))) + (inputs (list coreutils netcat python socat util-linux)) + (synopsis "Use python from bash") + (description "With pydaemon you can pipe strings of python code to one +or multiple persistent python processes that keeps state, and get the results +back as strings. Can be used over either of a unix or tcp socket.") + (home-page "https://gitlab.com/methuselah-0/pydaemon") + (license license:gpl3)))) -- 2.39.1 From b0a982abeb698997bd124b56cb2d33f2fdbd5dac Mon Sep 17 00:00:00 2001 From: David Larsson Date: Tue, 23 May 2023 05:31:06 +0200 Subject: [PATCH 1/3] gnu: Add pydaemon * gnu/packages/bash.scm (pydaemon): new variable. --- gnu/packages/bash.scm | 58 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm index 43f38303f7..1650fdeb72 100644 --- a/gnu/packages/bash.scm +++ b/gnu/packages/bash.scm @@ -26,16 +26,19 @@ (define-module (gnu packages bash) #:use-module ((guix licenses) #:prefix license:) #:use-module (gnu packages) + #:use-module (gnu packages admin) #:use-module (gnu packages base) #:use-module (gnu packages bootstrap) #:use-module (gnu packages compression) #:use-module (gnu packages elf) #:use-module (gnu packages ncurses) + #:use-module (gnu packages networking) #:use-module (gnu packages readline) #:use-module (gnu packages bison) #:use-module (gnu packages linux) #:use-module (gnu packages libffi) #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) #:use-module (gnu packages guile) #:use-module (gnu packages version-control) #:use-module (gnu packages less) @@ -46,6 +49,7 @@ (define-module (gnu packages bash) #:use-module (guix gexp) #:use-module (guix monads) #:use-module (guix store) + #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (guix build-system trivial) #:autoload (guix gnupg) (gnupg-verify*) @@ -482,3 +486,57 @@ (define-public blesh which replaces the default GNU Readline. It adds syntax highlighting, auto suggestions, vim modes, and more to Bash interactive sessions.") (license license:bsd-3))) + +(define-public pydaemon + (let ((commit "dae2798a2c1caa56025c6da69c0d464f70d9c79a") + (revision "0")) + (package + (name "pydaemon") + (version (git-version "0.0.0" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (commit commit) + (url "https://gitlab.com/methuselah-0/pydaemon.git"))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1cbg48ljyjqw1vxcb0sqhg9cxx0vgs6ggsdg8yvj441s6gakp2sh")))) + (build-system trivial-build-system) + (arguments + (list #:modules '((guix build utils)) + #:builder + #~(begin + (use-modules (guix build utils)) + (with-directory-excursion #$(package-source this-package) + (mkdir-p (string-append (assoc-ref %outputs "out") "/bin")) + (copy-file "pydaemon.py" (string-append (assoc-ref %outputs "out") + "/bin/pydaemon.py")) + (copy-file "py-net-daemon.py" (string-append (assoc-ref %outputs "out") + "/bin/py-net-daemon.py")) + (copy-file "pydaemon.sh" (string-append (assoc-ref %outputs "out") + "/bin/pydaemon.sh")) + ;; Substitute paths to binaries directly in the shell scripts + (substitute* (find-files (string-append #$output "/bin") "\\.sh$") + (("flock ") (string-append #$(this-package-input "util-linux") "/bin/flock ")) + (("socat ") (string-append #$(this-package-input "socat") "/bin/socat ")) + (("nc ") (string-append #$(this-package-input "netcat") "/bin/nc ")) + (("( )(mkdir|cat|sleep|chown|id|kill|dirname) " all pre command _) + (string-append pre #$(this-package-input "coreutils") "/bin/" command " ")) + (("(\\()(mkdir|cat|sleep|chown|id|kill|dirname) " all pre command _) + (string-append pre #$(this-package-input "coreutils") "/bin/" command " ")) + (("(python3) " library _) + (string-append #$(file-append (this-package-input "python") + "/bin/python" + (version-major+minor + (package-version + (this-package-input + "python")))) + " "))))))) + (inputs (list coreutils netcat python socat util-linux)) + (synopsis "Use python from bash") + (description "With pydaemon you can pipe strings of python code to one +or multiple persistent python processes that keeps state, and get the results +back as strings. Can be used over either of a unix or tcp socket.") + (home-page "https://gitlab.com/methuselah-0/pydaemon") + (license license:gpl3)))) -- 2.39.1