diff options
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | guix-web/view.scm | 36 |
2 files changed, 16 insertions, 22 deletions
@@ -32,7 +32,7 @@ Dependencies * [GNU Guile](https://gnu.org/s/guile) >= 2.0.5 * [GNU Guix](https://gnu.org/s/guix) >= 0.6 -* [guile-json](https://github.com/aconchillo/guile-json) >= 0.3.1 +* [guile-json](https://github.com/aconchillo/guile-json) >= 0.4.0 Copyright --------- diff --git a/guix-web/view.scm b/guix-web/view.scm index 831fc7b..162e16b 100644 --- a/guix-web/view.scm +++ b/guix-web/view.scm @@ -106,27 +106,21 @@ (define (serialize-inputs packages) (map package->json (filter package? (map second packages)))) - (if serialize-inputs? - (json - (object - ("name" ,(package-name package)) - ("version" ,(package-version package)) - ("synopsis" ,(package-synopsis package)) - ("description" ,(package-description package)) - ("homepage" ,(package-home-page package)) - ("license" ,(serialize-license package)) - ("inputs" ,(serialize-inputs (package-inputs package))) - ("native-inputs" ,(serialize-inputs (package-native-inputs package))) - ("propagated-inputs" ,(serialize-inputs - (package-propagated-inputs package))))) - (json - (object - ("name" ,(package-name package)) - ("version" ,(package-version package)) - ("synopsis" ,(package-synopsis package)) - ("description" ,(package-description package)) - ("homepage" ,(package-home-page package)) - ("license" ,(serialize-license package)))))) + (json + (object + ("name" ,(package-name package)) + ("version" ,(package-version package)) + ("synopsis" ,(package-synopsis package)) + ("description" ,(package-description package)) + ("homepage" ,(package-home-page package)) + ("license" ,(serialize-license package)) + ,@(if serialize-inputs? + `(("inputs" ,(serialize-inputs (package-inputs package))) + ("native-inputs" ,(serialize-inputs + (package-native-inputs package))) + ("propagated-inputs" ,(serialize-inputs + (package-propagated-inputs package)))) + '())))) (define (all-packages-json) (map package->json (fold-packages cons '()))) |