diff options
| author | Sharlatan Hellseher <sharlatanus@gmail.com> | 2026-08-18 13:53:50 +0100 |
|---|---|---|
| committer | Sharlatan Hellseher <sharlatanus@gmail.com> | 2026-09-01 23:35:37 +0100 |
| commit | 59df9802c61d29d0ebe83f2b7b3d9c80f8ece58f (patch) | |
| tree | 9ed936f8cb2e0d5df5c4a26bef52dd8194c4f71e | |
| parent | 5a4dbdb7864bce7d4d2e7ea73be20f7232e3fa36 (diff) | |
gnu: Add node-preact.
* gnu/packages/node-xyz.scm (node-preact): New variable.
Relates-to: guix/guix!2572
| -rw-r--r-- | gnu/packages/node-xyz.scm | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/gnu/packages/node-xyz.scm b/gnu/packages/node-xyz.scm index 9aec88e468c..b9d45fb5d3f 100644 --- a/gnu/packages/node-xyz.scm +++ b/gnu/packages/node-xyz.scm | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | ;;; Copyright © 2022 Nicolas Graves <ngraves@ngraves.fr> | 8 | ;;; Copyright © 2022 Nicolas Graves <ngraves@ngraves.fr> |
| 9 | ;;; Copyright © 2023 Jelle Licht <jlicht@fsfe.org> | 9 | ;;; Copyright © 2023 Jelle Licht <jlicht@fsfe.org> |
| 10 | ;;; Copyright © 2024-2026 Daniel Khodabakhsh <d@niel.khodabakh.sh> | 10 | ;;; Copyright © 2024-2026 Daniel Khodabakhsh <d@niel.khodabakh.sh> |
| 11 | ;;; Copyright © 2026 Sharlatan Hellseher <sharlatanus@gmail.com> | ||
| 11 | ;;; | 12 | ;;; |
| 12 | ;;; This file is part of GNU Guix. | 13 | ;;; This file is part of GNU Guix. |
| 13 | ;;; | 14 | ;;; |
| @@ -2716,6 +2717,65 @@ particular cross-platform spellings of the PATH environment variable key.") | |||
| 2716 | (home-page (git-reference-url (origin-uri source))) | 2717 | (home-page (git-reference-url (origin-uri source))) |
| 2717 | (license license:expat))) | 2718 | (license license:expat))) |
| 2718 | 2719 | ||
| 2720 | (define-public node-preact | ||
| 2721 | (package | ||
| 2722 | (name "node-preact") | ||
| 2723 | (version "10.27.1") | ||
| 2724 | (source | ||
| 2725 | (origin | ||
| 2726 | (method git-fetch) | ||
| 2727 | (uri (git-reference | ||
| 2728 | (url "https://github.com/preactjs/preact") | ||
| 2729 | (commit version))) | ||
| 2730 | (file-name (git-file-name name version)) | ||
| 2731 | (sha256 | ||
| 2732 | (base32 "1d5glww3v25yc606aqsjgicwa9mav9fnjii8684ax1bsxy2gfgd2")))) | ||
| 2733 | (build-system node-build-system) | ||
| 2734 | (arguments | ||
| 2735 | (list | ||
| 2736 | #:tests? #f | ||
| 2737 | #:modules '((guix build node-build-system) | ||
| 2738 | (ice-9 match) | ||
| 2739 | (guix build utils)) | ||
| 2740 | #:phases | ||
| 2741 | #~(modify-phases %standard-phases | ||
| 2742 | (add-after 'patch-dependencies 'delete-dependencies | ||
| 2743 | (lambda _ | ||
| 2744 | (modify-json | ||
| 2745 | (delete-fields '(("scripts" "prepare") | ||
| 2746 | ("scripts" "build") | ||
| 2747 | ("scripts" "postbuild") | ||
| 2748 | ("devDependencies")) | ||
| 2749 | #:strict? #f)))) | ||
| 2750 | (replace 'build | ||
| 2751 | (lambda* (#:key inputs native-inputs #:allow-other-keys) | ||
| 2752 | (let ((esbuild (search-input-file inputs "/bin/esbuild"))) | ||
| 2753 | (for-each | ||
| 2754 | (match-lambda | ||
| 2755 | ((entry outfile format) | ||
| 2756 | (invoke esbuild entry | ||
| 2757 | (string-append "--outfile=" outfile) | ||
| 2758 | (string-append "--format=" format) | ||
| 2759 | "--bundle" "--platform=browser"))) | ||
| 2760 | '(("src/index.js" "dist/preact.js" "cjs") | ||
| 2761 | ("src/index.js" "dist/preact.mjs" "esm") | ||
| 2762 | ("src/index.js" "dist/preact.module.js" "esm") | ||
| 2763 | ("src/index.js" "dist/preact.umd.js" "iife") | ||
| 2764 | ("src/cjs.js" "dist/preact.min.js" "iife") | ||
| 2765 | ("hooks/src/index.js" "hooks/dist/hooks.js" "cjs") | ||
| 2766 | ("hooks/src/index.js" "hooks/dist/hooks.mjs" "esm") | ||
| 2767 | ("hooks/src/index.js" "hooks/dist/hooks.module.js" "esm") | ||
| 2768 | ("hooks/src/index.js" "hooks/dist/hooks.umd.js" "iife"))))))))) | ||
| 2769 | (native-inputs | ||
| 2770 | (list esbuild)) | ||
| 2771 | (home-page "https://preactjs.com") | ||
| 2772 | (synopsis "Fast 3kb React-compatible virtual DOM library") | ||
| 2773 | (description | ||
| 2774 | "Preact is a fast 3kB alternative to React with the same modern API. It | ||
| 2775 | provides the thinnest possible virtual DOM abstraction on top of the DOM, | ||
| 2776 | along with the @code{preact/hooks} addon for stateful function components.") | ||
| 2777 | (license license:expat))) | ||
| 2778 | |||
| 2719 | (define-public node-pbf | 2779 | (define-public node-pbf |
| 2720 | (package | 2780 | (package |
| 2721 | (name "node-pbf") | 2781 | (name "node-pbf") |
