diff options
| author | Maxim Cournoyer <maxim@guixotic.coop> | 2026-06-09 09:34:25 +0900 |
|---|---|---|
| committer | Maxim Cournoyer <maxim@guixotic.coop> | 2026-06-24 14:29:03 +0900 |
| commit | 7ee79c9e82245b83ef76c84b67466ad93bea84aa (patch) | |
| tree | e7b39892db8feef2a299ba19b20ef1303402e967 /doc | |
| parent | 9d3861b8904bc73e7290ad8412d6e667b9d0b35a (diff) | |
import: npm-binary: Add a '--binary' option.
This changes the default behavior of the 'npm-binary' importer to prefer using
pristine sources from Git when available, along with attempting to build the
package. It adds a '--binary' option to the importer to preserve the previous
behavior.
* guix/import/git.scm (get-tags): Export.
* guix/import/npm-binary.scm (<repository>): New JSON mapping.
(<package-revision>): Add a repository field.
(npm-package->package-sexp) [#:binary?]: New keyword. Update doc.
Conditionally splice #:phases argument.
<normalize-git-url, sexpify-git-tag/maybe>: New nested procedures.
(npm-package->package-sexp) [binary?]: Expand origin conditionally to BINARY?.
(npm-binary->guix-package) [#:binary?]: New keyword.
(npm-binary-recursive-import): Likewise.
* guix/import/utils.scm (git->origin) [#:eager?]: New keyword. Update doc.
* guix/scripts/import/npm-binary.scm (show-help): Document new --binary option.
(guix-import-npm-binary): Honor the new option.
Change-Id: I8e8c1c333faa8f5c96184ada064b63bdf2b4e165
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/guix.texi | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index d974a5cdf24..7950843c3c2 100644 --- a/doc/guix.texi +++ b/doc/guix.texi | |||
| @@ -15733,13 +15733,6 @@ guix import npm-binary buffer-crc32@@1.0.0 | |||
| 15733 | @end example | 15733 | @end example |
| 15734 | 15734 | ||
| 15735 | @quotation Note | 15735 | @quotation Note |
| 15736 | Generated package expressions skip the build step of the | ||
| 15737 | @code{node-build-system}. As such, generated package expressions often | ||
| 15738 | refer to transpiled or generated files, instead of being built from | ||
| 15739 | source. | ||
| 15740 | @end quotation | ||
| 15741 | |||
| 15742 | @quotation Note | ||
| 15743 | Currently, the generated package definition contains a phase to delete | 15736 | Currently, the generated package definition contains a phase to delete |
| 15744 | the development dependencies (@code{devDependencies}) from the | 15737 | the development dependencies (@code{devDependencies}) from the |
| 15745 | @file{package.json} file, if there are such dependencies, to reduce the | 15738 | @file{package.json} file, if there are such dependencies, to reduce the |
| @@ -15756,6 +15749,14 @@ Additional options include: | |||
| 15756 | Traverse the dependency graph of the given upstream package recursively | 15749 | Traverse the dependency graph of the given upstream package recursively |
| 15757 | and generate package expressions for all those packages that are not yet | 15750 | and generate package expressions for all those packages that are not yet |
| 15758 | in Guix. | 15751 | in Guix. |
| 15752 | @item --binary | ||
| 15753 | @itemx -b | ||
| 15754 | Import a binary NPM package. This means preferring the use of a | ||
| 15755 | @url{https://registry.npmjs.org/} source origin, which typically bundles | ||
| 15756 | pre-built artifacts, along removing the @code{build} phase to avoid | ||
| 15757 | rebuilding such artifacts from source. This should only be used as a | ||
| 15758 | last resort, as it is preferable building everything from source, to | ||
| 15759 | preserve referential transparency and the chain of trust. | ||
| 15759 | @end table | 15760 | @end table |
| 15760 | 15761 | ||
| 15761 | @item opam | 15762 | @item opam |
