guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/03: build/cargo-build-system: Use bundled json instead of guile-json.


From: guix-commits
Subject: 03/03: build/cargo-build-system: Use bundled json instead of guile-json.
Date: Tue, 16 Jul 2019 03:56:28 -0400 (EDT)

dannym pushed a commit to branch master
in repository guix.

commit 4fde0030d42068b347d7af58ed3b746c5ea2f877
Author: Robert Vollmert <address@hidden>
Date:   Mon Jul 15 21:41:55 2019 +0200

    build/cargo-build-system: Use bundled json instead of guile-json.
    
    * guix/build/cargo-build-system.scm: Use (gnu build json) instead
    of (json parser).
    * guix/build-system/cargo.scm: Import (gnu build json) instead of
    (json parser).
    
    Signed-off-by: Danny Milosavljevic <address@hidden>
---
 guix/build-system/cargo.scm       | 2 +-
 guix/build/cargo-build-system.scm | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/guix/build-system/cargo.scm b/guix/build-system/cargo.scm
index fa211d4..10a1bac 100644
--- a/guix/build-system/cargo.scm
+++ b/guix/build-system/cargo.scm
@@ -61,7 +61,7 @@ to NAME and VERSION."
 (define %cargo-build-system-modules
   ;; Build-side modules imported by default.
   `((guix build cargo-build-system)
-    (json parser)
+    (guix build json)
     ,@%cargo-utils-modules))
 
 (define* (cargo-build store name inputs
diff --git a/guix/build/cargo-build-system.scm 
b/guix/build/cargo-build-system.scm
index e4e62dd..f38de16 100644
--- a/guix/build/cargo-build-system.scm
+++ b/guix/build/cargo-build-system.scm
@@ -20,6 +20,7 @@
 
 (define-module (guix build cargo-build-system)
   #:use-module ((guix build gnu-build-system) #:prefix gnu:)
+  #:use-module (guix build json)
   #:use-module (guix build utils)
   #:use-module (guix build cargo-utils)
   #:use-module (ice-9 popen)
@@ -27,7 +28,6 @@
   #:use-module (ice-9 ftw)
   #:use-module (ice-9 format)
   #:use-module (ice-9 match)
-  #:use-module (json parser)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26)
   #:export (%standard-phases
@@ -42,15 +42,15 @@
 (define (manifest-targets)
   "Extract all targets from the Cargo.toml manifest"
   (let* ((port (open-input-pipe "cargo read-manifest"))
-         (data (json->scm port))
-         (targets (hash-ref data "targets" '())))
+         (data (read-json port))
+         (targets (or (assoc-ref data "targets") '())))
     (close-port port)
     targets))
 
 (define (has-executable-target?)
   "Check if the current cargo project declares any binary targets."
   (let* ((bin? (lambda (kind) (string=? kind "bin")))
-         (get-kinds (lambda (dep) (hash-ref dep "kind")))
+         (get-kinds (lambda (dep) (assoc-ref dep "kind")))
          (bin-dep? (lambda (dep) (find bin? (get-kinds dep)))))
     (find bin-dep? (manifest-targets))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]