[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/04: website: packages.json: Add "location".
From: |
Ludovic Courtès |
Subject: |
03/04: website: packages.json: Add "location". |
Date: |
Tue, 27 Aug 2019 16:13:52 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix-artwork.
commit 91869e98395e540f89d0316a9f0f9b126a5af91d
Author: Ludovic Courtès <address@hidden>
Date: Tue Aug 27 22:08:32 2019 +0200
website: packages.json: Add "location".
* website/apps/packages/builder.scm (packages-json-builder)[package->json]:
Add "location".
---
website/apps/packages/builder.scm | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
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)))