diff options
author | Michael Opdenacker <michael.opdenacker@bootlin.com> | 2022-06-22 10:26:23 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-06-22 22:41:58 +0100 |
commit | e13a057812ec639544c321db0aedf9c7c203953e (patch) | |
tree | ec6d8510f80895d9ee1365637a129e9ebace8957 /bitbake/doc/bitbake-user-manual | |
parent | 22a31b1ab291d567dd898127690b6f9f82697379 (diff) | |
download | poky-e13a057812ec639544c321db0aedf9c7c203953e.tar.gz |
bitbake: doc: bitbake-user-manual: document npm and npmsw fetchers
This addresses bug [YOCTO #10098]
(Bitbake rev: cca7999586317435d79bf53df4359cdd8bfadff4)
Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/doc/bitbake-user-manual')
-rw-r--r-- | bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst | 76 |
1 files changed, 74 insertions, 2 deletions
diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst index ea8a8aa70f..4dfb7889e8 100644 --- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst +++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst | |||
@@ -706,6 +706,80 @@ Here is an example URL:: | |||
706 | 706 | ||
707 | SRC_URI = "crate://crates.io/glob/0.2.11" | 707 | SRC_URI = "crate://crates.io/glob/0.2.11" |
708 | 708 | ||
709 | .. _npm-fetcher: | ||
710 | |||
711 | NPM Fetcher (``npm://``) | ||
712 | ------------------------ | ||
713 | |||
714 | This submodule fetches source code from an | ||
715 | `NPM <https://en.wikipedia.org/wiki/Npm_(software)>`__ | ||
716 | Javascript package registry. | ||
717 | |||
718 | The format for the :term:`SRC_URI` setting must be:: | ||
719 | |||
720 | SRC_URI = "npm://some.registry.url;OptionA=xxx;OptionB=xxx;..." | ||
721 | |||
722 | This fetcher supports the following parameters: | ||
723 | |||
724 | - *"package":* The NPM package name. This is a mandatory parameter. | ||
725 | |||
726 | - *"version":* The NPM package version. This is a mandatory parameter. | ||
727 | |||
728 | - *"downloadfilename":* Specifies the filename used when storing the downloaded file. | ||
729 | |||
730 | - *"destsuffix":* Specifies the directory to use to unpack the package (default: ``npm``). | ||
731 | |||
732 | Note that NPM fetcher only fetches the package source itself. The dependencies | ||
733 | can be fetched through the `npmsw-fetcher`_. | ||
734 | |||
735 | Here is an example URL with both fetchers:: | ||
736 | |||
737 | SRC_URI = " \ | ||
738 | npm://registry.npmjs.org/;package=cute-files;version=${PV} \ | ||
739 | npmsw://${THISDIR}/${BPN}/npm-shrinkwrap.json \ | ||
740 | " | ||
741 | |||
742 | See :yocto_docs:`Creating Node Package Manager (NPM) Packages | ||
743 | </dev-manual/common-tasks.html#creating-node-package-manager-npm-packages>` | ||
744 | in the Yocto Project manual for details about using | ||
745 | :yocto_docs:`devtool <https://docs.yoctoproject.org/ref-manual/devtool-reference.html>` | ||
746 | to automatically create a recipe from an NPM URL. | ||
747 | |||
748 | .. _npmsw-fetcher: | ||
749 | |||
750 | NPM shrinkwrap Fetcher (``npmsw://``) | ||
751 | ------------------------------------- | ||
752 | |||
753 | This submodule fetches source code from an | ||
754 | `NPM shrinkwrap <https://docs.npmjs.com/cli/v8/commands/npm-shrinkwrap>`__ | ||
755 | description file, which lists the dependencies | ||
756 | of an NPM package while locking their versions. | ||
757 | |||
758 | The format for the :term:`SRC_URI` setting must be:: | ||
759 | |||
760 | SRC_URI = "npmsw://some.registry.url;OptionA=xxx;OptionB=xxx;..." | ||
761 | |||
762 | This fetcher supports the following parameters: | ||
763 | |||
764 | - *"dev":* Set this parameter to ``1`` to install "devDependencies". | ||
765 | |||
766 | - *"destsuffix":* Specifies the directory to use to unpack the dependencies | ||
767 | (``${S}`` by default). | ||
768 | |||
769 | Note that the shrinkwrap file can also be provided by the recipe for | ||
770 | the package which has such dependencies, for example:: | ||
771 | |||
772 | SRC_URI = " \ | ||
773 | npm://registry.npmjs.org/;package=cute-files;version=${PV} \ | ||
774 | npmsw://${THISDIR}/${BPN}/npm-shrinkwrap.json \ | ||
775 | " | ||
776 | |||
777 | Such a file can automatically be generated using | ||
778 | :yocto_docs:`devtool <https://docs.yoctoproject.org/ref-manual/devtool-reference.html>` | ||
779 | as described in the :yocto_docs:`Creating Node Package Manager (NPM) Packages | ||
780 | </dev-manual/common-tasks.html#creating-node-package-manager-npm-packages>` | ||
781 | section of the Yocto Project. | ||
782 | |||
709 | Other Fetchers | 783 | Other Fetchers |
710 | -------------- | 784 | -------------- |
711 | 785 | ||
@@ -715,8 +789,6 @@ Fetch submodules also exist for the following: | |||
715 | 789 | ||
716 | - Mercurial (``hg://``) | 790 | - Mercurial (``hg://``) |
717 | 791 | ||
718 | - npm (``npm://``) | ||
719 | |||
720 | - OSC (``osc://``) | 792 | - OSC (``osc://``) |
721 | 793 | ||
722 | - Secure FTP (``sftp://``) | 794 | - Secure FTP (``sftp://``) |