guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 2/2] gnu: Add guile-sdl.


From: David Thompson
Subject: Re: [PATCH 2/2] gnu: Add guile-sdl.
Date: Sat, 08 Nov 2014 21:12:06 -0500
User-agent: Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu)

New patch!

>From 215bd5af729055196da818518c816f7fd08e6a06 Mon Sep 17 00:00:00 2001
From: David Thompson <address@hidden>
Date: Sun, 2 Nov 2014 11:55:21 -0500
Subject: [PATCH 2/2] gnu: Add guile-sdl.

* gnu/packages/sdl.scm (guile-sdl): New variable.
---
 gnu/packages/sdl.scm | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/gnu/packages/sdl.scm b/gnu/packages/sdl.scm
index 609088b..e94a83c 100644
--- a/gnu/packages/sdl.scm
+++ b/gnu/packages/sdl.scm
@@ -24,6 +24,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module ((gnu packages fontutils) #:prefix font:)
+  #:use-module (gnu packages guile)
   #:use-module (gnu packages image)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages mp3)
@@ -269,3 +270,54 @@ sdl-config assumes that all of the headers and libraries 
are in the same
 directory.")
     (home-page (package-home-page sdl))
     (license (package-license sdl))))
+
+(define-public guile-sdl
+  (package
+    (name "guile-sdl")
+    (version "0.5.1")
+    (source (origin
+              (method url-fetch)
+              (uri
+               (string-append "mirror://gnu/guile-sdl/guile-sdl-"
+                              version ".tar.xz"))
+              (sha256
+               (base32
+                "126n4rd0ydh6i2s11ari5k85iivradlf12zq13b34shf9k1wn5am"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ;; Required by test suite.
+       ("xorg-server" ,xorg-server)
+       ("libjpeg" ,libjpeg)))
+    (inputs
+     `(("guile" ,guile-2.0)
+       ("sdl-union" ,sdl-union)))
+    (arguments
+     '(#:configure-flags
+       (list (string-append "--with-sdl-prefix="
+                            (assoc-ref %build-inputs "sdl-union")))
+       #:parallel-build? #f ; parallel build fails
+       #:phases
+       (alist-cons-before
+        'configure 'fix-env-and-patch
+        (lambda* (#:key inputs #:allow-other-keys)
+          (setenv "GUILE_AUTO_COMPILE" "0")
+          ;; SDL_image needs to dlopen libjpeg in the test suite.
+          (setenv "LD_LIBRARY_PATH"
+                  (string-append (assoc-ref inputs "libjpeg") "/lib"))
+          ;; Change the site directory /site/2.0 like Guile expects.
+          (substitute* "build-aux/guile-baux/re-prefixed-site-dirs"
+            (("\"/site\"") "\"/site/2.0\"")))
+        (alist-cons-before
+         'check 'start-xorg-server
+         (lambda* (#:key inputs #:allow-other-keys)
+           ;; The test suite requires a running X server.
+           (system (format #f "~a/bin/Xvfb :1 &"
+                           (assoc-ref inputs "xorg-server")))
+           (setenv "DISPLAY" ":1"))
+         %standard-phases))))
+    (synopsis "SDL bindings for GNU Guile.")
+    (description "Guile-SDL is a set of modules that provide bindings for SDL
+to enable Guile programmers to do all the nice things you can do with SDL.")
+    (home-page "http://gnu.org/s/guile-sdl";)
+    (license gpl3+)))
-- 
2.1.1

-- 
David Thompson
Web Developer - Free Software Foundation - http://fsf.org
GPG Key: 0FF1D807
Support the FSF: https://fsf.org/donate

reply via email to

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