From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adonay Felipe Nogueira Subject: bug#27590: artanis has a bundled and customized copy of guile-json package Date: Fri, 28 Jul 2017 11:28:21 -0300 Message-ID: <87a83oiqka.fsf@openmailbox.org> References: <87mv8i4tkj.fsf@openmailbox.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38111) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1db6K9-0004IK-Tr for bug-guix@gnu.org; Fri, 28 Jul 2017 10:33:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1db6K6-0002Ob-5L for bug-guix@gnu.org; Fri, 28 Jul 2017 10:33:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:57495) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1db6K6-0002Nn-0i for bug-guix@gnu.org; Fri, 28 Jul 2017 10:33:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1db6K5-0006qU-KT for bug-guix@gnu.org; Fri, 28 Jul 2017 10:33:01 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87mv8i4tkj.fsf@openmailbox.org> (Adonay Felipe Nogueira's message of "Wed, 05 Jul 2017 15:39:08 -0300") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 27590@debbugs.gnu.org --=-=-= Content-Type: text/plain The following patch is an attempt to fix this. I noticed that the '->json-string procedure doesn't exist in the official guile-json. I tried checking for it also in multiple revisions, but couldn't find it. Due to my lack of understanding on how both GNU Artanis and guile-json work internally, I assume however that '->json-string was similar to 'scm->json-string. --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename="gnu packages guile (artanis).patch" Content-Transfer-Encoding: quoted-printable >From 8ec0eaaa0e552e7d99be369a4251b2577ac927ac Mon Sep 17 00:00:00 2001 From: Adonay Felipe Nogueira Date: Fri, 28 Jul 2017 11:18:03 -0300 Subject: [PATCH] gnu: artanis: Unbundled guile-json and version according to documentation. * gnu/packages/guile.scm (artanis): Unbundled guile-json and version according to documentation. --- gnu/packages/guile.scm | 129 +++++++++++++++++++++++++++++----------------= ---- 1 file changed, 77 insertions(+), 52 deletions(-) diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index f1ffc0e..3bcfbc0 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm @@ -7,7 +7,7 @@ ;;; Copyright =C2=A9 2016 Erik Edrosa ;;; Copyright =C2=A9 2016 Eraim Flashner ;;; Copyright =C2=A9 2016, 2017 Alex Kost -;;; Copyright =C2=A9 2016 Adonay "adfeno" Felipe Nogueira +;;; Copyright =C2=A9 2016, 2017 Adonay "adfeno" Felipe Nogueira ;;; Copyright =C2=A9 2016 Amirouche ;;; Copyright =C2=A9 2016 Jan Nieuwenhuizen ;;; Copyright =C2=A9 2017 Andy Wingo @@ -67,6 +67,7 @@ #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) + #:use-module (guix build utils) #:use-module (guix build-system gnu) #:use-module (guix build-system trivial) #:use-module (guix utils) @@ -384,55 +385,79 @@ program can be installed in one go.") ;;; =20 (define-public artanis - (package - (name "artanis") - (version "0.2.1") - (source (origin - (method url-fetch) - (uri (string-append "mirror://gnu/artanis/artanis-" - version ".tar.gz")) - (sha256 - (base32 - "041ajcg2pz918kd9iqcj4inpzddc3impvz3r2nhlpbv8zrz011hn")))) - (build-system gnu-build-system) - ;; TODO: Add guile-dbi and guile-dbd optional dependencies. - (inputs `(("guile" ,guile-2.2))) - (native-inputs `(("bash" ,bash) ;for the `source' builtin - ("pkgconfig" ,pkg-config) - ("util-linux" ,util-linux))) ;for the `script' command - (arguments - '(#:make-flags - ;; TODO: The documentation must be built with the `docs' target. - (let* ((out (assoc-ref %outputs "out")) - (scm (string-append out "/share/guile/site/2.2")) - (go (string-append out "/lib/guile/2.2/site-ccache"))) - ;; Don't use (%site-dir) for site paths. - (list (string-append "MOD_PATH=3D" scm) - (string-append "MOD_COMPILED_PATH=3D" 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.bash= rc - ((" /etc/bash.bashrc") " /dev/null")) - (substitute* "Makefile" ;set the root of config files to O= UT - ((" /etc") (string-append " " out "/etc"))) - (mkdir-p (string-append out "/bin")) ;for the `art' executab= le - #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 Gu= ile + (let ((release "0.2.1") + (revision 3)) + (package + (name "artanis") + (version (if (zero? revision) + release + (string-append release "-" + (number->string revision)))) + (source (origin + (method url-fetch) + (uri (string-append "mirror://gnu/artanis/artanis-" + release ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "041ajcg2pz918kd9iqcj4inpzddc3impvz3r2nhlpbv8zrz011hn")) + (modules '((guix build utils))) + (snippet + '(begin + (delete-file-recursively "artanis/third-party/json.scm= ") + (delete-file-recursively "artanis/third-party/json") + (substitute* '("artanis/artanis.scm" + "artanis/oht.scm") + (("(#:use-module \\()artanis third-party (json\\))" = _ use-module json) + (string-append use-module json))) + (substitute* "artanis/oht.scm" + (("([[:punct:][:space:]]+)(->json-string)([[:punct:]= [:space:]]+)" _ pre json-string post) + (string-append pre + "scm" json-string + post))) + (substitute* "artanis/artanis.scm" + (("[[:punct:][:space:]]+->json-string[[:punct:][:spa= ce:]]+") + "")))))) + (build-system gnu-build-system) + ;; TODO: Add guile-dbi and guile-dbd optional dependencies. + (inputs `(("guile" ,guile-2.2) + ("guile-json" ,guile-json))) + (native-inputs `(("bash" ,bash) ;for the `source' buil= tin + ("pkgconfig" ,pkg-config) + ("util-linux" ,util-linux))) ;for the `script' comm= and + (arguments + '(#:make-flags + ;; TODO: The documentation must be built with the `docs' target. + (let* ((out (assoc-ref %outputs "out")) + (scm (string-append out "/share/guile/site/2.2")) + (go (string-append out "/lib/guile/2.2/site-ccache"))) + ;; Don't use (%site-dir) for site paths. + (list (string-append "MOD_PATH=3D" scm) + (string-append "MOD_COMPILED_PATH=3D" 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.b= ashrc + ((" /etc/bash.bashrc") " /dev/null")) + (substitute* "Makefile" ;set the root of config files t= o OUT + ((" /etc") (string-append " " out "/etc"))) + (mkdir-p (string-append out "/bin")) ;for the `art' execu= table + #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 designed to support the development of dynamic websites, web applications,= web services and web resources. The framework aims to alleviate the overhead @@ -440,8 +465,8 @@ associated with common activities performed in web deve= lopment. Artanis provides several tools for web development: database access, templating frameworks, session management, URL-remapping for RESTful, page caching, a= nd more.") - (home-page "https://www.gnu.org/software/artanis/") - (license (list license:gpl3+ license:lgpl3+)))) ;dual license + (home-page "https://www.gnu.org/software/artanis/") + (license (list license:gpl3+ license:lgpl3+))))) ;dual license =20 (define-public guile-reader (package --=20 1.9.1 --=-=-=--