gnu: artanis: Unbundled guile-json and version according to documentation.

* gnu/packages/guile.scm (artanis): Unbundled guile-json and version
according to documentation.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Adonay Felipe Nogueira 2017-07-28 11:18:03 -03:00 committed by Ludovic Courtès
parent 9081a776ea
commit 12235a124f
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 78 additions and 52 deletions

View File

@ -7,7 +7,7 @@
;;; Copyright © 2016 Erik Edrosa <erik.edrosa@gmail.com> ;;; Copyright © 2016 Erik Edrosa <erik.edrosa@gmail.com>
;;; Copyright © 2016 Eraim Flashner <efraim@flashner.co.il> ;;; Copyright © 2016 Eraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2016, 2017 Alex Kost <alezost@gmail.com> ;;; Copyright © 2016, 2017 Alex Kost <alezost@gmail.com>
;;; Copyright © 2016 Adonay "adfeno" Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> <adfeno@openmailbox.org> ;;; Copyright © 2016, 2017 Adonay "adfeno" Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> <adfeno@openmailbox.org>
;;; Copyright © 2016 Amirouche <amirouche@hypermove.net> ;;; Copyright © 2016 Amirouche <amirouche@hypermove.net>
;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org> ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2017 Andy Wingo <wingo@igalia.com> ;;; Copyright © 2017 Andy Wingo <wingo@igalia.com>
@ -384,55 +384,81 @@ program can be installed in one go.")
;;; ;;;
(define-public artanis (define-public artanis
(package (let ((release "0.2.1")
(name "artanis") (revision 3))
(version "0.2.1") (package
(source (origin (name "artanis")
(method url-fetch) (version (if (zero? revision)
(uri (string-append "mirror://gnu/artanis/artanis-" release
version ".tar.gz")) (string-append release "-"
(sha256 (number->string revision))))
(base32 (source (origin
"041ajcg2pz918kd9iqcj4inpzddc3impvz3r2nhlpbv8zrz011hn")))) (method url-fetch)
(build-system gnu-build-system) (uri (string-append "mirror://gnu/artanis/artanis-"
;; TODO: Add guile-dbi and guile-dbd optional dependencies. release ".tar.gz"))
(inputs `(("guile" ,guile-2.2))) (file-name (string-append name "-" version ".tar.gz"))
(native-inputs `(("bash" ,bash) ;for the `source' builtin (sha256
("pkgconfig" ,pkg-config) (base32
("util-linux" ,util-linux))) ;for the `script' command "041ajcg2pz918kd9iqcj4inpzddc3impvz3r2nhlpbv8zrz011hn"))
(arguments (modules '((guix build utils)))
'(#:make-flags (snippet
;; TODO: The documentation must be built with the `docs' target. '(begin
(let* ((out (assoc-ref %outputs "out")) (delete-file-recursively "artanis/third-party/json.scm")
(scm (string-append out "/share/guile/site/2.2")) (delete-file-recursively "artanis/third-party/json")
(go (string-append out "/lib/guile/2.2/site-ccache"))) (substitute* '("artanis/artanis.scm"
;; Don't use (%site-dir) for site paths. "artanis/oht.scm")
(list (string-append "MOD_PATH=" scm) (("(#:use-module \\()artanis third-party (json\\))" _
(string-append "MOD_COMPILED_PATH=" go))) use-module json)
#:test-target "test" (string-append use-module json)))
#:phases (substitute* "artanis/oht.scm"
(modify-phases %standard-phases (("([[:punct:][:space:]]+)(->json-string)([[:punct:][:space:]]+)"
(add-before 'install 'substitute-root-dir _ pre json-string post)
(lambda* (#:key outputs #:allow-other-keys) (string-append pre
(let ((out (assoc-ref outputs "out"))) "scm" json-string
(substitute* "Makefile" ;ignore the execution of bash.bashrc post)))
((" /etc/bash.bashrc") " /dev/null")) (substitute* "artanis/artanis.scm"
(substitute* "Makefile" ;set the root of config files to OUT (("[[:punct:][:space:]]+->json-string[[:punct:][:space:]]+")
((" /etc") (string-append " " out "/etc"))) ""))))))
(mkdir-p (string-append out "/bin")) ;for the `art' executable (build-system gnu-build-system)
#t))) ;; TODO: Add guile-dbi and guile-dbd optional dependencies.
(add-after 'install 'wrap-art (inputs `(("guile" ,guile-2.2)
(lambda* (#:key outputs #:allow-other-keys) ("guile-json" ,guile-json)))
(let* ((out (assoc-ref outputs "out")) (native-inputs `(("bash" ,bash) ;for the `source' builtin
(bin (string-append out "/bin")) ("pkgconfig" ,pkg-config)
(scm (string-append out "/share/guile/site/2.2")) ("util-linux" ,util-linux))) ;for the `script' command
(go (string-append out "/lib/guile/2.2/site-ccache"))) (arguments
(wrap-program (string-append bin "/art") '(#:make-flags
`("GUILE_LOAD_PATH" ":" prefix (,scm)) ;; TODO: The documentation must be built with the `docs' target.
`("GUILE_LOAD_COMPILED_PATH" ":" prefix (,go))) (let* ((out (assoc-ref %outputs "out"))
#t)))))) (scm (string-append out "/share/guile/site/2.2"))
(synopsis "Web application framework written in Guile") (go (string-append out "/lib/guile/2.2/site-ccache")))
(description "GNU Artanis is a web application framework written in Guile ;; Don't use (%site-dir) for site paths.
(list (string-append "MOD_PATH=" scm)
(string-append "MOD_COMPILED_PATH=" go)))
#:test-target "test"
#:phases
(modify-phases %standard-phases
(add-before 'install 'substitute-root-dir
(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
(substitute* "Makefile" ;ignore the execution of bash.bashrc
((" /etc/bash.bashrc") " /dev/null"))
(substitute* "Makefile" ;set the root of config files to OUT
((" /etc") (string-append " " out "/etc")))
(mkdir-p (string-append out "/bin")) ;for the `art' executable
#t)))
(add-after 'install 'wrap-art
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(bin (string-append out "/bin"))
(scm (string-append out "/share/guile/site/2.2"))
(go (string-append out "/lib/guile/2.2/site-ccache")))
(wrap-program (string-append bin "/art")
`("GUILE_LOAD_PATH" ":" prefix (,scm))
`("GUILE_LOAD_COMPILED_PATH" ":" prefix (,go)))
#t))))))
(synopsis "Web application framework written in Guile")
(description "GNU Artanis is a web application framework written in Guile
Scheme. A web application framework (WAF) is a software framework that is Scheme. A web application framework (WAF) is a software framework that is
designed to support the development of dynamic websites, web applications, web designed to support the development of dynamic websites, web applications, web
services and web resources. The framework aims to alleviate the overhead services and web resources. The framework aims to alleviate the overhead
@ -440,8 +466,8 @@ associated with common activities performed in web development. Artanis
provides several tools for web development: database access, templating provides several tools for web development: database access, templating
frameworks, session management, URL-remapping for RESTful, page caching, and frameworks, session management, URL-remapping for RESTful, page caching, and
more.") more.")
(home-page "https://www.gnu.org/software/artanis/") (home-page "https://www.gnu.org/software/artanis/")
(license (list license:gpl3+ license:lgpl3+)))) ;dual license (license (list license:gpl3+ license:lgpl3+))))) ;dual license
(define-public guile-reader (define-public guile-reader
(package (package