about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/smpeg2
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:36 +0000
committerAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:47 +0000
commit36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch)
treeb3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/development/libraries/smpeg2
parent4e31070265257dc67d120c27e0f75c2344fdfa9a (diff)
parentabf060725d7614bd3b9f96764262dfbc2f9c2199 (diff)
downloadnixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs
git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a
git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/smpeg2')
-rw-r--r--nixpkgs/pkgs/development/libraries/smpeg2/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/smpeg2/gcc6.patch33
-rw-r--r--nixpkgs/pkgs/development/libraries/smpeg2/sdl2.patch22
3 files changed, 99 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/smpeg2/default.nix b/nixpkgs/pkgs/development/libraries/smpeg2/default.nix
new file mode 100644
index 000000000000..900437864717
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/smpeg2/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, darwin, fetchsvn, autoconf, automake, pkgconfig, makeWrapper, SDL2 }:
+
+stdenv.mkDerivation rec {
+  name = "smpeg2-svn${version}";
+  version = "412";
+
+  src = fetchsvn {
+    url = svn://svn.icculus.org/smpeg/trunk;
+    rev = version;
+    sha256 = "1irf2d8f150j8cx8lbb0pz1rijap536crsz0mw871xrh6wd2fd96";
+  };
+
+  patches = [
+    ./gcc6.patch
+    ./sdl2.patch
+  ];
+
+  nativeBuildInputs = [ autoconf automake pkgconfig makeWrapper ];
+
+  buildInputs = [ SDL2 ]
+    ++ stdenv.lib.optional stdenv.isDarwin darwin.libobjc;
+
+  preConfigure = ''
+    sh autogen.sh
+  '';
+
+  postInstall = ''
+    sed -e 's,#include "\(SDL.*.h\)",#include <SDL2/\1>,' -i $out/include/smpeg2/*.h
+
+    wrapProgram $out/bin/smpeg2-config \
+      --prefix PATH ":" "${pkgconfig}/bin" \
+      --prefix PKG_CONFIG_PATH ":" "${SDL2.dev}/lib/pkgconfig"
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    homepage = http://icculus.org/smpeg/;
+    description = "SDL2 MPEG Player Library";
+    license = licenses.lgpl2;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ orivej ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/smpeg2/gcc6.patch b/nixpkgs/pkgs/development/libraries/smpeg2/gcc6.patch
new file mode 100644
index 000000000000..165feb4428c2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/smpeg2/gcc6.patch
@@ -0,0 +1,33 @@
+--- a/audio/hufftable.cpp
++++ b/audio/hufftable.cpp
+@@ -9,6 +9,7 @@
+ #include "config.h"
+ #endif
+ 
++#include <climits>
+ #include "MPEGaudio.h"
+ 
+ static const unsigned int
+@@ -550,11 +551,11 @@ htd33[ 31][2]={{ 16,  1},{  8,  1},{  4,
+ 
+ const HUFFMANCODETABLE MPEGaudio::ht[HTN]=
+ {
+-  { 0, 0-1, 0-1, 0,  0, htd33},
++  { 0, UINT_MAX, UINT_MAX, 0,  0, htd33},
+   { 1, 2-1, 2-1, 0,  7,htd01},
+   { 2, 3-1, 3-1, 0, 17,htd02},
+   { 3, 3-1, 3-1, 0, 17,htd03},
+-  { 4, 0-1, 0-1, 0,  0, htd33},
++  { 4, UINT_MAX, UINT_MAX, 0,  0, htd33},
+   { 5, 4-1, 4-1, 0, 31,htd05},
+   { 6, 4-1, 4-1, 0, 31,htd06},
+   { 7, 6-1, 6-1, 0, 71,htd07},
+@@ -564,7 +565,7 @@ const HUFFMANCODETABLE MPEGaudio::ht[HTN
+   {11, 8-1, 8-1, 0,127,htd11},
+   {12, 8-1, 8-1, 0,127,htd12},
+   {13,16-1,16-1, 0,511,htd13},
+-  {14, 0-1, 0-1, 0,  0, htd33},
++  {14, UINT_MAX, UINT_MAX, 0,  0, htd33},
+   {15,16-1,16-1, 0,511,htd15},
+   {16,16-1,16-1, 1,511,htd16},
+   {17,16-1,16-1, 2,511,htd16},
diff --git a/nixpkgs/pkgs/development/libraries/smpeg2/sdl2.patch b/nixpkgs/pkgs/development/libraries/smpeg2/sdl2.patch
new file mode 100644
index 000000000000..63bc352976ec
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/smpeg2/sdl2.patch
@@ -0,0 +1,22 @@
+diff --git a/smpeg2-config.in b/smpeg2-config.in
+index 5cce954..0e61939 100644
+--- a/smpeg2-config.in
++++ b/smpeg2-config.in
+@@ -42,7 +42,7 @@ while test $# -gt 0; do
+       if test @includedir@ != /usr/include ; then
+         includes=-I@includedir@
+       fi
+-      echo $includes -I@includedir@/smpeg2 `@SDL_CONFIG@ --cflags`
++      echo $includes -I@includedir@/smpeg2 `@SDL2_CONFIG@ --cflags`
+       ;;
+     --libs)
+       if [ "`uname`" = "SunOS" ]; then
+@@ -50,7 +50,7 @@ while test $# -gt 0; do
+       else
+         libdirs="-L@libdir@ @SMPEG_RLD_FLAGS@"
+       fi
+-      echo $libdirs -lsmpeg2 `@SDL_CONFIG@ --libs`
++      echo $libdirs -lsmpeg2 `@SDL2_CONFIG@ --libs`
+       ;;
+     *)
+       echo "${usage}" 1>&2