summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-08-27 22:08:32 +0200
committerLudovic Courtès <ludo@gnu.org>2019-08-27 22:11:25 +0200
commit91869e98395e540f89d0316a9f0f9b126a5af91d (patch)
treeb9c57ac742a475f76946bb4462c42f81c9be2096
parentwebsite: packages.json: Add "source". (diff)
downloadguix-artwork-91869e98395e540f89d0316a9f0f9b126a5af91d.tar.gz
website: packages.json: Add "location".
* website/apps/packages/builder.scm (packages-json-builder)[package->json]: Add "location".
-rw-r--r--website/apps/packages/builder.scm11
1 files changed, 10 insertions, 1 deletions
diff --git a/website/apps/packages/builder.scm b/website/apps/packages/builder.scm
index f1bb52b..309e762 100644
--- a/website/apps/packages/builder.scm
+++ b/website/apps/packages/builder.scm
@@ -41,6 +41,7 @@
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix svn-download)
+ #:use-module (guix utils) ;location
#:use-module (json)
#:use-module (ice-9 match)
#:export (builder))
@@ -124,7 +125,15 @@
`(("source" . ,(origin->json (package-source package))))
'())
("synopsis" . ,(package-synopsis package))
- ("homepage" . ,(package-home-page package))))
+ ("homepage" . ,(package-home-page package))
+ ,@(match (package-location package)
+ ((? location? location)
+ `(("location"
+ . ,(string-append (location-file location) ":"
+ (number->string
+ (+ 1 (location-line location)))))))
+ (#f
+ '()))))
(make-page "packages.json"
(list->vector (map package->json (all-packages)))