diff options
| author | Nicolas Graves <ngraves@ngraves.fr> | 2026-07-12 00:41:47 +0200 |
|---|---|---|
| committer | Maxim Cournoyer <maxim@guixotic.coop> | 2026-08-27 10:59:19 +0900 |
| commit | 9f382bc9c3608aa33d00b368bb51fdb80481aa3f (patch) | |
| tree | bae567c3fdedd3810cfe029fd280dab82786df5b /gnu/packages/node.scm | |
| parent | 90084084ecfe1a419aab8351bde00d11ff015aa8 (diff) | |
gnu: node-llparse-bootstrap: Avoid node-build-system.
* gnu/packages/node.scm (node-llparse-bootstrap)
[name]: Add -bootstrap suffix.
[build-system]: Switch to gnu-build-system + bootstrap-node-phases.
[arguments]: Improve style.
{node}: Drop it.
{phases}: Migrate accordingly.
[native-inputs]: Add node-bootstrap.
Change-Id: I5e4a2db417daf7443043c7efab3e45570f2f960a
Signed-off-by: Jelle Licht <jlicht@fsfe.org>
Diffstat (limited to 'gnu/packages/node.scm')
| -rw-r--r-- | gnu/packages/node.scm | 92 |
1 files changed, 49 insertions, 43 deletions
diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm index 74fc1fa2c59..79988f6d753 100644 --- a/gnu/packages/node.scm +++ b/gnu/packages/node.scm | |||
| @@ -649,7 +649,7 @@ Node.js and web browsers.") | |||
| 649 | 649 | ||
| 650 | (define-public node-llparse-bootstrap | 650 | (define-public node-llparse-bootstrap |
| 651 | (package | 651 | (package |
| 652 | (name "node-llparse") | 652 | (name "node-llparse-bootstrap") |
| 653 | (version "7.3.0") | 653 | (version "7.3.0") |
| 654 | (source | 654 | (source |
| 655 | (origin | 655 | (origin |
| @@ -659,48 +659,54 @@ Node.js and web browsers.") | |||
| 659 | (commit (string-append "v" version)))) | 659 | (commit (string-append "v" version)))) |
| 660 | (file-name (git-file-name name version)) | 660 | (file-name (git-file-name name version)) |
| 661 | (sha256 | 661 | (sha256 |
| 662 | (base32 | 662 | (base32 "09hqjcynkz5iv7aydzdwgs42r7y2zylplv0ff7w0vkdsgb08j22a")))) |
| 663 | "09hqjcynkz5iv7aydzdwgs42r7y2zylplv0ff7w0vkdsgb08j22a")) | 663 | (build-system gnu-build-system) |
| 664 | (modules '((guix build utils))) | ||
| 665 | (snippet | ||
| 666 | '(begin | ||
| 667 | ;; Fix imports for esbuild. | ||
| 668 | ;; https://github.com/evanw/esbuild/issues/477 | ||
| 669 | (substitute* '("src/compiler/index.ts" | ||
| 670 | "src/implementation/c/node/base.ts" | ||
| 671 | "src/implementation/c/node/table-lookup.ts" | ||
| 672 | "src/implementation/c/compilation.ts" | ||
| 673 | "src/implementation/c/helpers/match-sequence.ts" | ||
| 674 | "src/implementation/c/code/mul-add.ts") | ||
| 675 | (("\\* as assert") "assert") | ||
| 676 | (("\\* as debugAPI") "debugAPI")) | ||
| 677 | #t)))) | ||
| 678 | (build-system node-build-system) | ||
| 679 | (arguments | 664 | (arguments |
| 680 | `(#:node ,node-bootstrap | 665 | (list |
| 681 | #:tests? #f | 666 | #:tests? #f |
| 682 | #:phases | 667 | #:phases |
| 683 | (modify-phases %standard-phases | 668 | #~(modify-phases #$bootstrap-node-phases |
| 684 | (add-after 'patch-dependencies 'delete-dependencies | 669 | (add-after 'unpack 'fix-imports-for-esbuild |
| 685 | (lambda args | 670 | ;; https://github.com/evanw/esbuild/issues/477 |
| 686 | (modify-json (delete-dependencies | 671 | (lambda _ |
| 687 | `("@stylistic/eslint-plugin" | 672 | (substitute* '("src/compiler/index.ts" |
| 688 | "@typescript-eslint/eslint-plugin" | 673 | "src/implementation/c/node/base.ts" |
| 689 | "@typescript-eslint/parser" | 674 | "src/implementation/c/node/table-lookup.ts" |
| 690 | "@types/debug" | 675 | "src/implementation/c/compilation.ts" |
| 691 | "@types/mocha" | 676 | "src/implementation/c/helpers/match-sequence.ts" |
| 692 | "@types/node" | 677 | "src/implementation/c/code/mul-add.ts") |
| 693 | "esm" | 678 | (("\\* as assert") "assert") |
| 694 | "eslint" | 679 | (("\\* as debugAPI") "debugAPI")))) |
| 695 | "llparse-test-fixture" | 680 | (add-before 'configure 'patch-dependencies |
| 696 | "mocha" | 681 | (lambda* (#:key inputs #:allow-other-keys) |
| 697 | "ts-node" | 682 | #$(delete-dependencies* (list "@stylistic/eslint-plugin" |
| 698 | "tslint" | 683 | "@typescript-eslint/eslint-plugin" |
| 699 | "typescript"))))) | 684 | "@typescript-eslint/parser" |
| 700 | (replace 'build | 685 | "@types/debug" |
| 701 | (lambda* (#:key inputs #:allow-other-keys) | 686 | "@types/mocha" |
| 702 | (let ((esbuild (search-input-file inputs "/bin/esbuild"))) | 687 | "@types/node" |
| 703 | (invoke esbuild | 688 | "esm" |
| 689 | "eslint" | ||
| 690 | "llparse-test-fixture" | ||
| 691 | "mocha" | ||
| 692 | "ts-node" | ||
| 693 | "tslint" | ||
| 694 | "typescript")) | ||
| 695 | ;; Resolve dependencies manually. | ||
| 696 | (let* ((debug-path "lib/node_modules/debug") | ||
| 697 | (debug (search-input-directory inputs debug-path)) | ||
| 698 | (frontend-path "lib/node_modules/llparse-frontend") | ||
| 699 | (frontend (search-input-directory inputs frontend-path))) | ||
| 700 | (substitute* "package.json" | ||
| 701 | (("\"debug\": \".*") | ||
| 702 | (format #f "\"debug\": \"file://~a\"," debug)) | ||
| 703 | (("\"llparse-frontend\": \".*") | ||
| 704 | (format #f "\"llparse-frontend\": \"file://~a\"" | ||
| 705 | frontend)))))) | ||
| 706 | (add-before 'repack 'build | ||
| 707 | (lambda* (#:key inputs #:allow-other-keys) | ||
| 708 | (let ((esbuild (search-input-file inputs "/bin/esbuild"))) | ||
| 709 | (invoke esbuild | ||
| 704 | "--platform=node" | 710 | "--platform=node" |
| 705 | "--outfile=lib/api.js" | 711 | "--outfile=lib/api.js" |
| 706 | "--bundle" | 712 | "--bundle" |
| @@ -708,7 +714,7 @@ Node.js and web browsers.") | |||
| 708 | (inputs | 714 | (inputs |
| 709 | (list node-debug-bootstrap node-llparse-frontend-bootstrap)) | 715 | (list node-debug-bootstrap node-llparse-frontend-bootstrap)) |
| 710 | (native-inputs | 716 | (native-inputs |
| 711 | (list esbuild)) | 717 | (list esbuild node-bootstrap)) |
| 712 | (home-page "https://github.com/nodejs/llparse#readme") | 718 | (home-page "https://github.com/nodejs/llparse#readme") |
| 713 | (properties '((hidden? . #t))) | 719 | (properties '((hidden? . #t))) |
| 714 | (synopsis "Compile incremental parsers to C code") | 720 | (synopsis "Compile incremental parsers to C code") |
