[bug#78080,1/2] Revert "gnu: quickjs: Deprecate."

Message ID 394dff694fd2ddf53e5120d0d3eaeb9f03ca954b.1745714143.git.iyzsong@member.fsf.org
State New
Headers
Series [bug#78080,1/2] Revert "gnu: quickjs: Deprecate." |

Commit Message

cake--- via Guix-patches via April 27, 2025, 12:36 a.m. UTC
  From: 宋文武 <iyzsong@member.fsf.org>

It seems quickjs-ng and quickjs are not API compatible.
This fixes building tic80.

This reverts commit b94cf86a89ef0a6bf7ec2c8e52f64c5107888f55.

Change-Id: I3666ddbef8d1b2e71d49f9b14aef5a1be4b8495a
---
 gnu/packages/javascript.scm | 45 ++++++++++++++++++++++++++++++++++---
 1 file changed, 42 insertions(+), 3 deletions(-)


base-commit: bc9903f6570f070da39870bf9f5510882d71b269
  

Patch

diff --git a/gnu/packages/javascript.scm b/gnu/packages/javascript.scm
index 38edc2ff0ab..21222f00279 100644
--- a/gnu/packages/javascript.scm
+++ b/gnu/packages/javascript.scm
@@ -825,6 +825,48 @@  (define-public mujs
 roots, or wrestle with obscure build systems.")
     (license license:isc)))
 
+(define-public quickjs
+  (package
+    (name "quickjs")
+    (version "2024-01-13")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://bellard.org/quickjs/quickjs-"
+                                  version ".tar.xz"))
+              (sha256
+               (base32
+                "00rf45l1bx0yhlv11gn3bbyfqw9724c153bc93mlp9dzjpwghjrw"))
+              (snippet
+               #~(begin (use-modules (guix build utils))
+                        (for-each delete-file
+                                  '("doc/quickjs.pdf"
+                                    "doc/quickjs.html"
+                                    "doc/jsbignum.pdf"
+                                    "doc/jsbignum.html"))))))
+    (build-system gnu-build-system)
+    (arguments
+     (list #:make-flags
+           #~(list (string-append "PREFIX=" #$output)
+                   #$@(if (or (target-riscv64?)
+                              (target-ppc32?))
+                          '("LDFLAGS=-latomic")
+                          '()))
+           #:phases #~(modify-phases %standard-phases
+                        (delete 'configure)
+                        (replace 'check
+                          (lambda* (#:key tests? #:allow-other-keys)
+                            (when tests?
+                              (invoke "make" "microbench")))))))
+    (home-page "https://bellard.org/quickjs/")
+    (synopsis "Small embeddable Javascript engine")
+    (description "QuickJS supports the ES2023 specification including modules,
+asynchronous generators, proxies, BigInt, BigDecimal, BigFloat and operator
+overloading.  It can compile Javascript sources to executables with no external
+dependency.  It includes a command line interpreter with contextual colorization
+implemented in Javascript and a small built-in standard library with C library
+wrappers.")
+    (license license:expat)))
+
 (define-public test262-source
   (origin
     (method git-fetch)
@@ -912,9 +954,6 @@  (define-public quickjs-ng
     ;; 3-clause BSD license for test262
     (license (list license:expat license:bsd-3))))
 
-(define-public quickjs
-  (deprecated-package "quickjs" quickjs-ng))
-
 (define-public duktape
   (package
     (name "duktape")