unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* WIP SDL packages
@ 2013-11-19  3:12 David Thompson
  2013-11-19  7:58 ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: David Thompson @ 2013-11-19  3:12 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 553 bytes --]

Hello all,

Attached is a work-in-progress patch that adds SDL and SDL2 packages.

I'm having some trouble getting the dependencies sorted out. For
instance, pulseaudio is listed as an input but the configure script does
not detect pulseaudio support. Both packages build successfully, but
they are probably missing other optional dependencies.

Would anyone mind taking a look and giving some feedback?

Here is the nixpkgs definition for reference:
https://github.com/nbp/Nixpkgs/blob/master/pkgs/development/libraries/SDL/default.nix

Thanks,
- Dave

[-- Attachment #2: 0001-gnu-Add-SDL-and-SDL2.patch --]
[-- Type: text/x-patch, Size: 2222 bytes --]

From f58fb0c23c7acbffb164ef7aa7095c28a4c7b4e4 Mon Sep 17 00:00:00 2001
From: David Thompson <dthompson2@worcester.edu>
Date: Mon, 18 Nov 2013 22:01:19 -0500
Subject: [PATCH] gnu: Add SDL and SDL2.

* gnu/packages/sdl.scm (sdl, sdl2): New variables.
---
 gnu/packages/sdl.scm | 45 ++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 44 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/sdl.scm b/gnu/packages/sdl.scm
index ceb2173..dbc53bb 100644
--- a/gnu/packages/sdl.scm
+++ b/gnu/packages/sdl.scm
@@ -23,8 +23,51 @@
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages xorg)
-  #:export (libmikmod))
+  #:export (sdl
+            sdl2
+            libmikmod))
+
+(define sdl
+  (package
+    (name "sdl")
+    (version "1.2.15")
+    (source (origin
+             (method url-fetch)
+             (uri
+              (string-append "http://libsdl.org/release/SDL-"
+                             version ".tar.gz"))
+             (sha256
+              (base32
+               "005d993xcac8236fpvd1iawkz4wqjybkpn8dbwaliqz5jfkidlyn"))))
+    (build-system gnu-build-system)
+    (arguments '(#:tests? #f)) ; no check target
+    (inputs `(("libx11" ,libx11)
+              ("libxrandr" ,libxrandr)
+              ("mesa" ,mesa)
+              ("alsa-lib" ,alsa-lib)
+              ("pulseaudio" ,pulseaudio)))
+    (synopsis "Cross platform game development library")
+    (description "Simple DirectMedia Layer is a cross-platform development
+library designed to provide low level access to audio, keyboard, mouse,
+joystick, and graphics hardware.")
+    (home-page "http://libsdl.org/")
+    (license lgpl2.1)))
+
+(define sdl2
+  (package (inherit sdl)
+    (name "sdl2")
+    (version "2.0.0")
+    (source (origin
+             (method url-fetch)
+             (uri
+              (string-append "http://libsdl.org/release/SDL2-"
+                             version ".tar.gz"))
+             (sha256
+              (base32
+               "0y3in99brki7vc2mb4c0w39v70mf4h341mblhh8nmq4h7lawhskg"))))
+    (license bsd-3)))
 
 (define libmikmod
   (package
-- 
1.8.4.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: WIP SDL packages
  2013-11-19  3:12 WIP SDL packages David Thompson
@ 2013-11-19  7:58 ` Ludovic Courtès
  2013-11-20  0:51   ` David Thompson
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2013-11-19  7:58 UTC (permalink / raw)
  To: David Thompson; +Cc: guix-devel

Hi, David,

David Thompson <dthompson2@worcester.edu> skribis:

> Attached is a work-in-progress patch that adds SDL and SDL2 packages.

Nice!

> I'm having some trouble getting the dependencies sorted out. For
> instance, pulseaudio is listed as an input but the configure script does
> not detect pulseaudio support. Both packages build successfully, but
> they are probably missing other optional dependencies.
>
> Would anyone mind taking a look and giving some feedback?

I’ll do it if nobody gets to it before, but you could try building SDL
with --keep-failed, hit C-c C-c after the configure phase, and then
check in config.log what makes it think PulseAudio is unavailable.

Hmm, actually it may be that it just lacks pkg-config as an input, no?

HTH,
Ludo’.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: WIP SDL packages
  2013-11-19  7:58 ` Ludovic Courtès
@ 2013-11-20  0:51   ` David Thompson
  2013-11-20 11:15     ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: David Thompson @ 2013-11-20  0:51 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 183 bytes --]

On 11/19/2013 02:58 AM, Ludovic Courtès wrote:
> Hmm, actually it may be that it just lacks pkg-config as an input, no?

That was the issue. Thanks! Updated patch attached.

- Dave


[-- Attachment #2: 0001-gnu-Add-SDL-and-SDL2.patch --]
[-- Type: text/x-patch, Size: 2308 bytes --]

From 391b604b6c10c687e6d1a5a24cb0a6c16227af2e Mon Sep 17 00:00:00 2001
From: David Thompson <dthompson2@worcester.edu>
Date: Mon, 18 Nov 2013 22:01:19 -0500
Subject: [PATCH] gnu: Add SDL and SDL2.

* gnu/packages/sdl.scm (sdl, sdl2): New variables.
---
 gnu/packages/sdl.scm | 47 ++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 46 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/sdl.scm b/gnu/packages/sdl.scm
index ceb2173..e8fd65c 100644
--- a/gnu/packages/sdl.scm
+++ b/gnu/packages/sdl.scm
@@ -23,8 +23,53 @@
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages xorg)
-  #:export (libmikmod))
+  #:export (sdl
+            sdl2
+            libmikmod))
+
+(define sdl
+  (package
+    (name "sdl")
+    (version "1.2.15")
+    (source (origin
+             (method url-fetch)
+             (uri
+              (string-append "http://libsdl.org/release/SDL-"
+                             version ".tar.gz"))
+             (sha256
+              (base32
+               "005d993xcac8236fpvd1iawkz4wqjybkpn8dbwaliqz5jfkidlyn"))))
+    (build-system gnu-build-system)
+    (arguments '(#:tests? #f)) ; no check target
+    (inputs `(("libx11" ,libx11)
+              ("libxrandr" ,libxrandr)
+              ("mesa" ,mesa)
+              ("alsa-lib" ,alsa-lib)
+              ("pkg-config" ,pkg-config)
+              ("pulseaudio" ,pulseaudio)))
+    (synopsis "Cross platform game development library")
+    (description "Simple DirectMedia Layer is a cross-platform development
+library designed to provide low level access to audio, keyboard, mouse,
+joystick, and graphics hardware.")
+    (home-page "http://libsdl.org/")
+    (license lgpl2.1)))
+
+(define sdl2
+  (package (inherit sdl)
+    (name "sdl2")
+    (version "2.0.0")
+    (source (origin
+             (method url-fetch)
+             (uri
+              (string-append "http://libsdl.org/release/SDL2-"
+                             version ".tar.gz"))
+             (sha256
+              (base32
+               "0y3in99brki7vc2mb4c0w39v70mf4h341mblhh8nmq4h7lawhskg"))))
+    (license bsd-3)))
 
 (define libmikmod
   (package
-- 
1.8.4.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: WIP SDL packages
  2013-11-20  0:51   ` David Thompson
@ 2013-11-20 11:15     ` Ludovic Courtès
  2013-11-23 17:26       ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2013-11-20 11:15 UTC (permalink / raw)
  To: David Thompson; +Cc: guix-devel

David Thompson <dthompson2@worcester.edu> skribis:

> From 391b604b6c10c687e6d1a5a24cb0a6c16227af2e Mon Sep 17 00:00:00 2001
> From: David Thompson <dthompson2@worcester.edu>
> Date: Mon, 18 Nov 2013 22:01:19 -0500
> Subject: [PATCH] gnu: Add SDL and SDL2.
>
> * gnu/packages/sdl.scm (sdl, sdl2): New variables.

Pushed, thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: WIP SDL packages
  2013-11-20 11:15     ` Ludovic Courtès
@ 2013-11-23 17:26       ` Ludovic Courtès
  2014-01-25 22:09         ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2013-11-23 17:26 UTC (permalink / raw)
  To: David Thompson; +Cc: guix-devel

Commit 558a512 makes libx11 a propagated input, which seemed to be the
right thing.

I added SDL as an input for QEMU.  Now, when run directly, it just fails:

  Could not initialize SDL(No available video device) - exiting

Looking at strace, I found that it actually needed this:

  LD_LIBRARY_PATH=$(guix build libxext)/lib qemu-system-x86_64 ...

IOW it dlopen’s libXext by default.  To avoid the trouble, I think SDL
should either (1) have libXext in its RUNPATH, or (2) be explicitly
linked against it (which is essentially equivalent.)

WDYT?  Would you like to make that change?

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: WIP SDL packages
  2013-11-23 17:26       ` Ludovic Courtès
@ 2014-01-25 22:09         ` Ludovic Courtès
  2014-01-26 18:40           ` David Thompson
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2014-01-25 22:09 UTC (permalink / raw)
  To: David Thompson; +Cc: guix-devel

ludo@gnu.org (Ludovic Courtès) skribis:

> Commit 558a512 makes libx11 a propagated input, which seemed to be the
> right thing.
>
> I added SDL as an input for QEMU.  Now, when run directly, it just fails:
>
>   Could not initialize SDL(No available video device) - exiting
>
> Looking at strace, I found that it actually needed this:
>
>   LD_LIBRARY_PATH=$(guix build libxext)/lib qemu-system-x86_64 ...
>
> IOW it dlopen’s libXext by default.  To avoid the trouble, I think SDL
> should either (1) have libXext in its RUNPATH, or (2) be explicitly
> linked against it (which is essentially equivalent.)

FYI commit 22f33e6 goes with option (1).

Ludo’.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: WIP SDL packages
  2014-01-25 22:09         ` Ludovic Courtès
@ 2014-01-26 18:40           ` David Thompson
  0 siblings, 0 replies; 7+ messages in thread
From: David Thompson @ 2014-01-26 18:40 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

Ludovic Courtès <ludo@gnu.org> writes:
> FYI commit 22f33e6 goes with option (1).
>
> Ludo’.

Cool, thanks!

- Dave

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-01-26 18:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-19  3:12 WIP SDL packages David Thompson
2013-11-19  7:58 ` Ludovic Courtès
2013-11-20  0:51   ` David Thompson
2013-11-20 11:15     ` Ludovic Courtès
2013-11-23 17:26       ` Ludovic Courtès
2014-01-25 22:09         ` Ludovic Courtès
2014-01-26 18:40           ` David Thompson

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).