unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#47459] [PATCH] gnu: Add brython.
@ 2021-03-29  4:23 jgart via Guix-patches via
  2021-04-01 12:26 ` Ludovic Courtès
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: jgart via Guix-patches via @ 2021-03-29  4:23 UTC (permalink / raw)
  To: 47459; +Cc: lle-bout, rprior, a.pierre

[-- Attachment #1: Type: text/plain, Size: 141 bytes --]

Hi Guix!

Here is brython. Thank you!

This was an effort of today's Guix Packaging Meetup.

best regards,

jgart

libremiami.org

[-- Attachment #2: 0002-gnu-Add-brython.patch --]
[-- Type: application/octet-stream, Size: 3288 bytes --]

From 519c8d5e5369744cadbe4bc7607b0c4c8f05128a Mon Sep 17 00:00:00 2001
From: LibreMiami <packaging-guix@libremiami.org>
Date: Sun, 28 Mar 2021 21:13:31 -0400
Subject: [PATCH 2/2] gnu: Add brython.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/web.scm (brython): New variable.

Co-authored-by: Léo Le Bouter <lle-bout@zaclys.net>
Co-authored-by: jgart <jgart@dismail.de>
Co-authored-by: Ryan Prior <rprior@protonmail.com>
Co-authored-by: Andrea Pierré <a.pierre@zaclys.net>
---
 gnu/packages/web.scm | 58 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index ae41588037..2271592aec 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -8155,3 +8155,61 @@ provided by a TLS reverse proxy (e.g. tlstunnel, hitch or stunnel).")
       ;; "cpe:2.3:a:comelz:quark" package.  The proper fix is for (guix cve)
       ;; to account for "vendor names".
       (properties '((lint-hidden-cve . ("CVE-2019-15520")))))))
+
+(define-public brython
+  (package
+    (name "brython")
+    (version "3.9.1")
+    (source
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+              (url "https://github.com/brython-dev/brython")
+              (commit version)))
+        (file-name (git-file-name name version))
+        (sha256
+          (base32
+            "1rv9az92kl3y079ck0jfdp21p184qgyhqdiil3hk2fd2c5r3s8n2"))))
+    (build-system python-build-system)
+    (native-inputs
+     `(; 'install phase needs the python command
+       ("python" ,((package-input-rewriting
+                    `((,python . ,python-3.9))
+                    #:deep? #f) python-wrapper))))
+    (arguments
+     `(#:python ,python-3.9 ; required during build
+       #:tests? #f ; tests require npm packages
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'build
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; write access is required to .js files for minifying
+             (for-each
+              (lambda (vv) (chmod vv #o644))
+              (find-files "." "\\.js$"))
+
+             ;; patch build scripts to reference source directory properly
+             (substitute* (find-files "scripts" "\\.py$")
+               (("os\\.path\\.dirname\\(os\\.getcwd\\(\\)\\)")
+                (string-append "\"" (getcwd) "\"")))
+
+             (invoke "python3" "scripts/make_dist.py")
+             #t))
+         (replace 'install
+           (lambda args
+             ;; release tag contains an older python egg version
+             (substitute* (find-files "setup" "\\.py$")
+               (("3\\.9\\.0") "3.9.1"))
+
+             ;; setup.py is within 'setup' subdirectory
+             (with-directory-excursion "setup"
+               (invoke "python3" "setup.py" "sdist")
+               (apply (assoc-ref %standard-phases 'install) args))
+             #t)))))
+    (home-page "http://brython.info")
+    (synopsis
+      "Run python code in a web browser")
+    (description
+      "@code{Brython} is a compliant implementation of Python 3 that allows
+writing end-user applications in Python that run in the browser.")
+    (license license:bsd-3)))
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-09-29  1:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-29  4:23 [bug#47459] [PATCH] gnu: Add brython jgart via Guix-patches via
2021-04-01 12:26 ` Ludovic Courtès
2021-07-05 19:48 ` [bug#47459] [PATCH] * gnu/packages/web.scm (brython): New variable jgart via Guix-patches via
2021-07-05 22:29 ` [bug#47459] brython bump to 3.9.5 and fixes for core-updates branch jgart via Guix-patches via
2022-06-22 19:23   ` [bug#47459] [PATCH] gnu: Add brython Maxim Cournoyer
2022-09-28 18:24     ` bug#47459: " Maxim Cournoyer
2022-09-28 20:36       ` [bug#47459] " Ricardo Wurmus
2022-09-28 20:41         ` Ricardo Wurmus
2022-09-29  1:28           ` Maxim Cournoyer
2022-09-28 20:38       ` jgart via Guix-patches via

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).