~ruther/guix-local

0353a510cfc06d5210d2e07e405f578c408b5edb — Liliana Marie Prikler 6 months ago 5bbed7e
build-system: renpy: Migrate to (json).

* guix/build/renpy-build-system.scm: Use (json) rather than (guix build json).
(install, install-desktop-file): Replace ‘read-json’ with ‘json->scm’.
* guix/build-system/renpy.scm (default-guile-json): New variable.
(%renpy-build-system-modules): Adjust accordingly.
(renpy-build): Add guile-json argument and use it as extension.

Fixes guix/guix#2618.
2 files changed, 25 insertions(+), 19 deletions(-)

M guix/build-system/renpy.scm
M guix/build/renpy-build-system.scm
M guix/build-system/renpy.scm => guix/build-system/renpy.scm +22 -16
@@ 37,10 37,13 @@
  "Return the default Ren'py package, resolved lazily."
  (@* (gnu packages game-development) renpy))

(define (default-guile-json)
  "Return the default Guile JSON package, resolved lazily."
  (@* (gnu packages guile) guile-json-4))

(define %renpy-build-system-modules
  ;; Build-side modules imported by default.
  `((guix build renpy-build-system)
    (guix build json)
    (guix build python-build-system)
    ,@%default-gnu-imported-modules))



@@ 81,26 84,29 @@
                      (search-paths '())
                      (system (%current-system))
                      (guile #f)
                      (guile-json (default-guile-json))
                      (imported-modules %renpy-build-system-modules)
                      (modules '((guix build renpy-build-system)
                                 (guix build utils))))
  "Build SOURCE using RENPY, and with INPUTS."
  (define builder
    (with-imported-modules imported-modules
      #~(begin
          (use-modules #$@(sexp->gexp modules))
          (renpy-build #:name #$name
                       #:source #+source
                       #:configure-flags #$configure-flags
                       #:system #$system
                       #:phases #$phases
                       #:outputs #$(outputs->gexp outputs)
                       #:output #$output
                       #:game #$game
                       #:search-paths '#$(sexp->gexp
                                          (map search-path-specification->sexp
                                               search-paths))
                       #:inputs #$(input-tuples->gexp inputs)))))
    (with-extensions (list guile-json)
      (with-imported-modules imported-modules
        #~(begin
            (use-modules #$@(sexp->gexp modules))
            (renpy-build #:name #$name
                         #:source #+source
                         #:configure-flags #$configure-flags
                         #:system #$system
                         #:phases #$phases
                         #:outputs #$(outputs->gexp outputs)
                         #:output #$output
                         #:game #$game
                         #:search-paths
                         '#$(sexp->gexp
                             (map search-path-specification->sexp
                                  search-paths))
                         #:inputs #$(input-tuples->gexp inputs))))))

  (mlet %store-monad ((guile (package->derivation (or guile (default-guile))
                                                  system #:graft? #f)))

M guix/build/renpy-build-system.scm => guix/build/renpy-build-system.scm +3 -3
@@ 19,10 19,10 @@
(define-module (guix build renpy-build-system)
  #:use-module ((guix build gnu-build-system) #:prefix gnu:)
  #:use-module ((guix build python-build-system) #:prefix python:)
  #:use-module (guix build json)
  #:use-module (guix build utils)
  #:use-module (ice-9 match)
  #:use-module (ice-9 ftw)
  #:use-module (json)
  #:use-module (srfi srfi-1)
  #:use-module (srfi srfi-26)
  #:export (%standard-phases


@@ 43,7 43,7 @@
  (let* ((out (assoc-ref outputs output))
         (json-dump (call-with-input-file (string-append game
                                                         "/renpy-build.json")
                      read-json))
                      json->scm))
         (build (assoc-ref json-dump "build"))
         (executable-name (assoc-ref build "executable_name"))
         (directory-name (assoc-ref build "directory_name")))


@@ 67,7 67,7 @@
  (let* ((out (assoc-ref outputs output))
         (json-dump (call-with-input-file (string-append game
                                                         "/renpy-build.json")
                      read-json))
                      json->scm))
         (build (assoc-ref json-dump "build"))
         (directory-name (assoc-ref build "directory_name"))
         (executable-name (assoc-ref build "executable_name")))