From fd877516f85ad8dcbef5f4fa29c91d17d4c19f48 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Tue, 23 Feb 2016 19:56:30 -0500 Subject: guix: Allow building package with Guile 2.2 pre-release. --- guix.scm | 96 +++++++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 56 insertions(+), 40 deletions(-) diff --git a/guix.scm b/guix.scm index c3216b8..8f26a04 100644 --- a/guix.scm +++ b/guix.scm @@ -52,6 +52,24 @@ (gnu packages maths) (gnu packages image)) +(define use-guile-2.2? + (string? (getenv "SLY_GUILE_NEXT"))) + +(define (package-with-guile p guile) + (package + (inherit p) + (inputs + (map (match-lambda + (("guile" _) + `("guile" ,guile)) + (input input)) + (package-inputs p))))) + +(define (package-with-guile-next-maybe p) + (if use-guile-2.2? + (package-with-guile p guile-next) + p)) + (define guile-sdl2 (package (name "guile-sdl2") @@ -60,10 +78,10 @@ (method git-fetch) (uri (git-reference (url "git://dthompson.us/guile-sdl2.git") - (commit "65c8e4d"))) + (commit "55c4eef"))) (sha256 (base32 - "0l2z7j5jy5v1zcrjvngnfqlla9975syjbgsixjz2r7fy83zd0xa8")))) + "1yckf6n2iwp5l3yz4y0rks5qbylnmfnpcxmlwl74aqyqfxd586ix")))) (build-system gnu-build-system) (arguments '(#:configure-flags @@ -102,43 +120,41 @@ SDL2 C shared library via the foreign function interface.") (home-page "https://git.dthompson.us/guile-sdl2.git") (license lgpl3+))) -(package - (name "sly") - (version "0.1") - (source (origin - (method git-fetch) - (uri (git-reference - (url "git://dthompson.us/sly.git") - (commit "9c8c44a"))) - (sha256 - (base32 - "021af35c2yz7hm8ax3mbxnrma0fbijplakl0xy61gjg3w89bjsll")))) - (build-system gnu-build-system) - (arguments - '(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'bootstrap - (lambda _ (zero? (system* "sh" "bootstrap"))))) - #:configure-flags - (list (string-append "--with-libfreeimage-prefix=" - (assoc-ref %build-inputs "freeimage")) - (string-append "--with-libgslcblas-prefix=" - (assoc-ref %build-inputs "gsl"))))) - (native-inputs - `(("pkg-config" ,pkg-config) - ("autoconf" ,autoconf) - ("automake" ,automake) - ("texinfo" ,texinfo))) - (propagated-inputs - `(("guile-sdl2" ,guile-sdl2) - ("guile-opengl" ,guile-opengl))) - (inputs - `(("guile" ,guile-2.0) - ("gsl" ,gsl) - ("mesa" ,mesa))) - (synopsis "2D/3D game engine for GNU Guile") - (description "Sly is a 2D/3D game engine written in Guile Scheme. +(define sly + (package + (name "sly") + (version "0.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "git://dthompson.us/sly.git") + (commit "9c8c44a"))) + (sha256 + (base32 + "021af35c2yz7hm8ax3mbxnrma0fbijplakl0xy61gjg3w89bjsll")))) + (build-system gnu-build-system) + (arguments + '(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'bootstrap + (lambda _ (zero? (system* "sh" "bootstrap"))))))) + (native-inputs + `(("pkg-config" ,pkg-config) + ("autoconf" ,autoconf) + ("automake" ,automake) + ("texinfo" ,texinfo))) + (propagated-inputs + `(("guile-sdl2" ,(package-with-guile-next-maybe guile-sdl2)) + ("guile-opengl" ,(package-with-guile-next-maybe guile-opengl)))) + (inputs + `(("guile" ,guile-2.0) + ("gsl" ,gsl) + ("mesa" ,mesa))) + (synopsis "2D/3D game engine for GNU Guile") + (description "Sly is a 2D/3D game engine written in Guile Scheme. Sly differs from most game engines in that it emphasizes functional reactive programming and live coding.") - (home-page "http://dthompson.us/pages/software/sly.html") - (license gpl3+)) + (home-page "http://dthompson.us/pages/software/sly.html") + (license gpl3+))) + +(package-with-guile-next-maybe sly) -- cgit v1.2.3