summaryrefslogtreecommitdiffstats
path: root/pkgs/misc/gnash
diff options
context:
space:
mode:
authorrnhmjoj <micheleguerinirocco@me.com>2017-06-16 12:58:02 +0200
committerrnhmjoj <micheleguerinirocco@me.com>2017-06-19 15:08:57 +0200
commit7f89293051e96549bd7f1ef0f0a148d459a16766 (patch)
treea0b3fd3154a834277527a151ed8be1b8e8e80ad2 /pkgs/misc/gnash
parentba1330b12e654f28f090a554be3b52ef8e01e046 (diff)
gnash: init at 0.8.11-2017-03-08
Diffstat (limited to 'pkgs/misc/gnash')
-rw-r--r--pkgs/misc/gnash/default.nix120
1 files changed, 120 insertions, 0 deletions
diff --git a/pkgs/misc/gnash/default.nix b/pkgs/misc/gnash/default.nix
new file mode 100644
index 000000000000..d7a6cebcc563
--- /dev/null
+++ b/pkgs/misc/gnash/default.nix
@@ -0,0 +1,120 @@
+{ stdenv, fetchgit, autoreconfHook
+, pkgconfig, libtool, boost, SDL
+, glib, pango, gettext, curl, xorg
+, libpng, libjpeg, giflib, speex, atk
+
+# renderers
+, enableAGG ? true, agg ? null
+, enableCairo ? false, cairo ? null
+, enableOpenGL ? false, mesa ? null
+
+# GUI toolkits
+, enableGTK ? true, gtk2 ? null, gnome2 ? null, gnome3 ? null
+, enableSDL ? false
+, enableQt ? false, qt4 ? null
+
+# media
+, enableFFmpeg ? true, ffmpeg_2 ? null
+, enableGstreamer ? false, gst-plugins-base ? null
+ , gst-plugins-ugly ? null
+ , gst-ffmpeg ? null
+
+# misc
+, enableJemalloc ? true, jemalloc ? null
+, enableHwAccel ? true
+, enablePlugins ? false, xulrunner ? null, npapi_sdk ? null
+}:
+
+with stdenv.lib;
+
+let
+ available = x: x != null;
+
+ sound =
+ if enableFFmpeg then "ffmpeg" else
+ if enableGstreamer then "gst" else "none";
+
+ renderers = []
+ ++ optional enableAGG "agg"
+ ++ optional enableCairo "cairo"
+ ++ optional enableOpenGL "opengl";
+
+ toolkits = []
+ ++ optional enableGTK "gtk"
+ ++ optional enableSDL "sdl"
+ ++ optional enableQt "qt4";
+
+in
+
+# renderers
+assert enableAGG -> available agg;
+assert enableCairo -> available cairo;
+assert enableOpenGL -> available mesa;
+
+# GUI toolkits
+assert enableGTK -> all available [ gtk2 gnome2.gtkglext gnome3.gconf ];
+assert enableSDL -> available SDL;
+assert enableQt -> available qt4;
+
+# media libraries
+assert enableFFmpeg -> available ffmpeg_2 ;
+assert enableGstreamer -> all available [ gst-plugins-base gst-plugins-ugly gst-ffmpeg ];
+
+# misc
+assert enableJemalloc -> available jemalloc;
+assert enableHwAccel -> available mesa;
+assert enablePlugins -> all available [ xulrunner npapi_sdk ];
+
+assert length toolkits == 0 -> throw "at least one GUI toolkit must be enabled";
+assert length renderers == 0 -> throw "at least one renderer must be enabled";
+
+
+stdenv.mkDerivation rec {
+ name = "gnash-${version}";
+ version = "0.8.11-2017-03-08";
+
+ src = fetchgit {
+ url = "git://git.sv.gnu.org/gnash.git";
+ rev = "8a11e60585db4ed6bc4eafadfbd9b3123ced45d9";
+ sha256 = "1qas084gc4s9cb2jbwi2s1h4hk7m92xmrsb596sd14h0i44dai02";
+ };
+
+ postPatch = ''
+ sed -i 's|jemalloc.h|jemalloc/jemalloc.h|' libbase/jemalloc_gnash.c
+ '';
+
+ nativeBuildInputs = [ autoreconfHook pkgconfig libtool ];
+ buildInputs = [
+ glib gettext boost curl SDL speex
+ xorg.libXmu xorg.libSM xorg.libXt
+ libpng libjpeg giflib pango atk
+ ] ++ optional enableAGG agg
+ ++ optional enableCairo cairo
+ ++ optional enableOpenGL mesa
+ ++ optional enableQt qt4
+ ++ optional enableFFmpeg ffmpeg_2
+ ++ optional enableJemalloc jemalloc
+ ++ optional enableHwAccel mesa
+ ++ optionals enablePlugins [ xulrunner npapi_sdk ]
+ ++ optionals enableGTK [ gtk2 gnome2.gtkglext gnome3.gconf ]
+ ++ optionals enableGstreamer [ gst-plugins-base gst-plugins-ugly gst-ffmpeg ];
+
+ configureFlags = with stdenv.lib; [
+ "--with-boost-incl=${boost.dev}/include"
+ "--with-boost-lib=${boost.out}/lib"
+ "--enable-renderer=${concatStringsSep "," renderers}"
+ "--enable-gui=${concatStringsSep "," toolkits}"
+ "--enable-media=${sound}"
+ "--with-npapi-install=prefix"
+ (enableFeature enablePlugins "plugins")
+ (enableFeature enableJemalloc "jemalloc")
+ (optionalString enableHwAccel "--enable-device=egl")
+ ];
+
+ meta = {
+ homepage = https://savannah.gnu.org/projects/gnash;
+ description = "A flash (SWF) player and browser plugin";
+ license = licenses.gpl3;
+ maintainers = with maintainers; [ rnhmjoj ];
+ };
+}