doc: Document building and installing from JSON files.
authorRicardo Wurmus <rekado@elephly.net>
Thu, 16 Apr 2020 20:22:51 +0000 (22:22 +0200)
committerRicardo Wurmus <rekado@elephly.net>
Thu, 16 Apr 2020 21:41:52 +0000 (23:41 +0200)
* doc/guix.texi (Invoking guix package): Augment pargraphs for
"--install-from-file".
(Invoking guix build): Document building from JSON files.
* doc/package-hello.json: New file.
* doc/local.mk (EXTRA_DIST): Add it.

doc/guix.texi
doc/local.mk
doc/package-hello.json [new file with mode: 0644]

index 5c4f90c..a475ebb 100644 (file)
@@ -2824,6 +2824,15 @@ in the root of their project source tree that can be used to test
 development snapshots and create reproducible development environments
 (@pxref{Invoking guix environment}).
 
+The @var{file} may also contain a JSON representation of one or more
+package definitions.  Running @code{guix package -f} on
+@file{hello.json} with the following contents would result in installing
+the package @code{greeter} after building @code{myhello}:
+
+@example
+@verbatiminclude package-hello.json
+@end example
+
 @item --remove=@var{package} @dots{}
 @itemx -r @var{package} @dots{}
 Remove the specified @var{package}s.
@@ -8550,6 +8559,15 @@ As an example, @var{file} might contain a package definition like this
 @include package-hello.scm
 @end lisp
 
+The @var{file} may also contain a JSON representation of one or more
+package definitions.  Running @code{guix build -f} on @file{hello.json}
+with the following contents would result in building the packages
+@code{myhello} and @code{greeter}:
+
+@example
+@verbatiminclude package-hello.json
+@end example
+
 @item --manifest=@var{manifest}
 @itemx -m @var{manifest}
 Build all packages listed in the given @var{manifest}
index 3805593..30c4a8c 100644 (file)
@@ -53,7 +53,8 @@ EXTRA_DIST +=                                 \
   $(DOT_VECTOR_GRAPHICS)                       \
   %D%/images/coreutils-size-map.eps            \
   %D%/environment-gdb.scm                      \
-  %D%/package-hello.scm
+  %D%/package-hello.scm                                \
+  %D%/package-hello.json
 
 OS_CONFIG_EXAMPLES_TEXI =                      \
   %D%/os-config-bare-bones.texi                        \
diff --git a/doc/package-hello.json b/doc/package-hello.json
new file mode 100644 (file)
index 0000000..a47e266
--- /dev/null
@@ -0,0 +1,31 @@
+[
+  {
+    "name": "myhello",
+    "version": "2.10",
+    "source": "mirror://gnu/hello/hello-2.10.tar.gz",
+    "build-system": "gnu",
+    "arguments": {
+      "tests?": false
+    }
+    "home-page": "https://www.gnu.org/software/hello/",
+    "synopsis": "Hello, GNU world: An example GNU package",
+    "description": "GNU Hello prints a greeting.",
+    "license": "GPL-3.0+",
+    "native-inputs": ["gettext"]
+  },
+  {
+    "name": "greeter",
+    "version": "1.0",
+    "source": "https://example.com/greeter-1.0.tar.gz",
+    "build-system": "gnu",
+    "arguments": {
+      "test-target": "foo",
+      "parallel-build?": false,
+    },
+    "home-page": "https://example.com/",
+    "synopsis": "Greeter using GNU Hello",
+    "description": "This is a wrapper around GNU Hello.",
+    "license": "GPL-3.0+",
+    "inputs": ["myhello", "hello"]
+  }
+]