From 8544fe567a34224a81f56a99069f87964ad0367a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 26 Jan 2006 14:01:08 +0000 Subject: [PATCH] * Added the OpenAL sound library. * Enabled (optional) 3D support in SDL. svn path=/nixpkgs/trunk/; revision=4594 --- pkgs/development/libraries/SDL/default.nix | 10 +- pkgs/development/libraries/openal/builder.sh | 8 ++ pkgs/development/libraries/openal/default.nix | 15 +++ .../libraries/openal/makefile.patch | 92 +++++++++++++++++++ pkgs/system/all-packages-generic.nix | 7 +- 5 files changed, 129 insertions(+), 3 deletions(-) create mode 100644 pkgs/development/libraries/openal/builder.sh create mode 100644 pkgs/development/libraries/openal/default.nix create mode 100644 pkgs/development/libraries/openal/makefile.patch diff --git a/pkgs/development/libraries/SDL/default.nix b/pkgs/development/libraries/SDL/default.nix index 902810d5aa7..7e085a69397 100644 --- a/pkgs/development/libraries/SDL/default.nix +++ b/pkgs/development/libraries/SDL/default.nix @@ -1,4 +1,6 @@ -{stdenv, fetchurl, x11}: +{stdenv, fetchurl, x11, openglSupport ? false, mesa ? null}: + +assert openglSupport -> mesa != null; stdenv.mkDerivation { name = "SDL-1.2.9"; @@ -6,7 +8,11 @@ stdenv.mkDerivation { url = http://www.libsdl.org/release/SDL-1.2.9.tar.gz; md5 = "80919ef556425ff82a8555ff40a579a0"; }; - buildInputs = [x11]; + buildInputs = [ + x11 + (if openglSupport then mesa else null) + ]; patches = [./no-cxx.patch]; NIX_CFLAGS_COMPILE = "-DBITS_PER_LONG=32"; /* !!! hack around kernel header bug */ + inherit openglSupport; } diff --git a/pkgs/development/libraries/openal/builder.sh b/pkgs/development/libraries/openal/builder.sh new file mode 100644 index 00000000000..c870497eb6c --- /dev/null +++ b/pkgs/development/libraries/openal/builder.sh @@ -0,0 +1,8 @@ +source $stdenv/setup + +preConfigure=preConfigure +preConfigure() { + ./autogen.sh +} + +genericBuild \ No newline at end of file diff --git a/pkgs/development/libraries/openal/default.nix b/pkgs/development/libraries/openal/default.nix new file mode 100644 index 00000000000..887a668b4e6 --- /dev/null +++ b/pkgs/development/libraries/openal/default.nix @@ -0,0 +1,15 @@ +{stdenv, fetchurl, alsaLib, autoconf, automake, libtool}: + +stdenv.mkDerivation { + name = "openal-0.0.8"; + src = fetchurl { + url = http://www.openal.org/openal_webstf/downloads/openal-0.0.8.tar.gz; + md5 = "0379bd39fc84454491ef38434a2e6e8d"; + }; + # Note: the autoconf/automake dependency can go once the Automake + # patch is unnecessary. + builder = ./builder.sh; + patches = [./makefile.patch]; + buildInputs = [alsaLib autoconf automake libtool]; + configureFlags = ["--disable-arts" "--enable-alsa"]; +} diff --git a/pkgs/development/libraries/openal/makefile.patch b/pkgs/development/libraries/openal/makefile.patch new file mode 100644 index 00000000000..a7feafeed95 --- /dev/null +++ b/pkgs/development/libraries/openal/makefile.patch @@ -0,0 +1,92 @@ +diff -rc openal-0.0.8-orig/configure.ac openal-0.0.8-new/configure.ac +*** openal-0.0.8-orig/configure.ac 2005-12-15 16:58:45.000000000 +0100 +--- openal-0.0.8-new/configure.ac 2006-01-26 14:28:47.000000000 +0100 +*************** +*** 530,535 **** +--- 530,537 ---- + fi + fi + ++ AM_CONDITIONAL([ARTSENABLED], [test -n "$HAVEARTS"]) ++ + # enable esd sound? + AC_ARG_ENABLE([esd], + [AS_HELP_STRING([--enable-esd], +*************** +*** 558,563 **** +--- 560,567 ---- + fi + fi + ++ AM_CONDITIONAL([ESDENABLED], [test -n "$HAVEESD"]) ++ + # enable wave output? + AC_ARG_ENABLE([waveout], + [AS_HELP_STRING([--enable-waveout], +*************** +*** 614,619 **** +--- 618,625 ---- + esac + fi + ++ AM_CONDITIONAL([SDLENABLED], [test -n "$HAVESDL"]) ++ + # enable directsound backend? + AC_ARG_ENABLE([dsound], + [AS_HELP_STRING([--enable-dsound], +diff -rc openal-0.0.8-orig/src/Makefile.am openal-0.0.8-new/src/Makefile.am +*** openal-0.0.8-orig/src/Makefile.am 2005-12-04 19:16:21.000000000 +0100 +--- openal-0.0.8-new/src/Makefile.am 2006-01-26 14:28:56.000000000 +0100 +*************** +*** 61,79 **** + arch/alsa/alsa.h + endif + + libopenal_la_SOURCES += \ + arch/interface/interface_sound.c \ + arch/interface/interface_sound.h \ + arch/interface/platform.h \ + arch/portable/cpu_caps.c \ +- arch/arts/arts.c \ +- arch/arts/arts.h \ +- arch/esd/esd.c \ +- arch/esd/esd.h \ + arch/null/null.c \ + arch/null/null.h \ +- arch/sdl/sdl.c \ +- arch/sdl/sdl.h \ + arch/waveout/waveout.c \ + arch/waveout/waveout.h + +--- 61,91 ---- + arch/alsa/alsa.h + endif + ++ if SDLENABLED ++ libopenal_la_SOURCES += \ ++ arch/sdl/sdl.c \ ++ arch/sdl/sdl.h ++ endif ++ ++ if ESDENABLED ++ libopenal_la_SOURCES += \ ++ arch/esd/esd.c \ ++ arch/esd/esd.h ++ endif ++ ++ if ARTSENABLED ++ libopenal_la_SOURCES += \ ++ arch/arts/arts.c \ ++ arch/arts/arts.h ++ endif ++ + libopenal_la_SOURCES += \ + arch/interface/interface_sound.c \ + arch/interface/interface_sound.h \ + arch/interface/platform.h \ + arch/portable/cpu_caps.c \ + arch/null/null.c \ + arch/null/null.h \ + arch/waveout/waveout.c \ + arch/waveout/waveout.h + diff --git a/pkgs/system/all-packages-generic.nix b/pkgs/system/all-packages-generic.nix index d4c7bf3382e..746d5325acd 100644 --- a/pkgs/system/all-packages-generic.nix +++ b/pkgs/system/all-packages-generic.nix @@ -1170,6 +1170,10 @@ rec { inherit fetchurl stdenv libgpgerror gnupg; }; + openal = import ../development/libraries/openal { + inherit fetchurl stdenv alsaLib autoconf automake libtool; + }; + ### DEVELOPMENT / LIBRARIES / JAVA saxon = (import ../development/libraries/java/saxon) { @@ -1425,7 +1429,8 @@ rec { readline = readline5; SDL = (import ../development/libraries/SDL) { - inherit fetchurl stdenv x11; + inherit fetchurl stdenv x11 mesa; + openglSupport = true; }; boehmgc = (import ../development/libraries/boehm-gc) {