From: david larsson <david.larsson@selfhosted.xyz>
To: 51512@debbugs.gnu.org
Cc: Guix-patches <guix-patches-bounces+david.larsson=selfhosted.xyz@gnu.org>
Subject: [bug#51512] [PATCH v6 1/3]: gnu: Add bash-bcu.
Date: Tue, 23 May 2023 06:53:16 +0200 [thread overview]
Message-ID: <a547d109587966c125fdcc50a2a990df@selfhosted.xyz> (raw)
In-Reply-To: <3add15b77522d6e9ebd715a19d966666@selfhosted.xyz>
[-- Attachment #1: Type: text/plain, Size: 5090 bytes --]
From b0a982abeb698997bd124b56cb2d33f2fdbd5dac Mon Sep 17 00:00:00 2001
From: David Larsson <david.larsson@selfhosted.xyz>
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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-pydaemon.patch --]
[-- Type: text/x-diff; name=0001-gnu-Add-pydaemon.patch, Size: 5042 bytes --]
From b0a982abeb698997bd124b56cb2d33f2fdbd5dac Mon Sep 17 00:00:00 2001
From: David Larsson <david.larsson@selfhosted.xyz>
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
next prev parent reply other threads:[~2023-05-23 4:54 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-30 14:59 [bug#51512] [PATCH]: gnu: Add bash-bcu david larsson
2021-11-07 12:40 ` Tobias Geerinckx-Rice via Guix-patches via
2021-11-09 12:32 ` [bug#51512] [PATCH v 2]: " david larsson
2021-11-20 14:11 ` Tobias Geerinckx-Rice via Guix-patches via
2021-11-23 12:44 ` david larsson
2022-07-01 18:13 ` [bug#51512] [PATCH v 3]: " david larsson
2022-08-02 20:21 ` david larsson
2022-08-27 18:29 ` david larsson
2023-05-20 19:23 ` david larsson
2023-05-20 19:28 ` david larsson
2023-05-20 20:16 ` [bug#51512] [PATCH v 4]: " david larsson
2022-07-04 21:11 ` [bug#51512] [PATCH]: " ( via Guix-patches via
2022-07-04 21:21 ` ( via Guix-patches via
2023-05-21 6:58 ` [bug#51512] [PATCH v5]: " david larsson
2023-05-23 4:51 ` [bug#51512] [PATCH v6 0/3]: " david larsson
2023-05-23 4:53 ` david larsson [this message]
2023-05-23 4:55 ` [bug#51512] [PATCH v6 2/3]: gnu: Add guile-bash-for-bash-coding-utils david larsson
2023-05-23 4:56 ` [bug#51512] [PATCH v6 3/3]: gnu: Add bash-coding-utils david larsson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a547d109587966c125fdcc50a2a990df@selfhosted.xyz \
--to=david.larsson@selfhosted.xyz \
--cc=51512@debbugs.gnu.org \
--cc=guix-patches-bounces+david.larsson=selfhosted.xyz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).