2017-06-16 11:58:02 +01:00
|
|
|
{ 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
|
2018-02-24 13:12:44 +00:00
|
|
|
, enableOpenGL ? false, libGLU_combined ? null
|
2017-06-16 11:58:02 +01:00
|
|
|
|
|
|
|
# GUI toolkits
|
2018-07-09 23:34:32 +01:00
|
|
|
, enableGTK ? true, gtk2 ? null, gnome2 ? null
|
2017-06-16 11:58:02 +01:00
|
|
|
, enableSDL ? false
|
|
|
|
, enableQt ? false, qt4 ? null
|
|
|
|
|
|
|
|
# media
|
|
|
|
, enableFFmpeg ? true, ffmpeg_2 ? null
|
|
|
|
|
|
|
|
# misc
|
|
|
|
, enableJemalloc ? true, jemalloc ? null
|
|
|
|
, enableHwAccel ? true
|
|
|
|
, enablePlugins ? false, xulrunner ? null, npapi_sdk ? null
|
|
|
|
}:
|
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
2018-07-09 23:34:32 +01:00
|
|
|
let
|
2017-06-16 11:58:02 +01:00
|
|
|
available = x: x != null;
|
|
|
|
|
|
|
|
sound =
|
2018-11-16 22:50:38 +00:00
|
|
|
if enableFFmpeg then "ffmpeg" else "none";
|
2017-06-16 11:58:02 +01:00
|
|
|
|
|
|
|
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;
|
2018-02-24 13:12:44 +00:00
|
|
|
assert enableOpenGL -> available libGLU_combined;
|
2017-06-16 11:58:02 +01:00
|
|
|
|
|
|
|
# GUI toolkits
|
2018-07-09 23:34:32 +01:00
|
|
|
assert enableGTK -> all available [ gtk2 gnome2.gtkglext gnome2.GConf ];
|
2017-06-16 11:58:02 +01:00
|
|
|
assert enableSDL -> available SDL;
|
|
|
|
assert enableQt -> available qt4;
|
|
|
|
|
|
|
|
# media libraries
|
|
|
|
assert enableFFmpeg -> available ffmpeg_2 ;
|
|
|
|
|
|
|
|
# misc
|
|
|
|
assert enableJemalloc -> available jemalloc;
|
2018-02-24 13:12:44 +00:00
|
|
|
assert enableHwAccel -> available libGLU_combined;
|
2017-06-16 11:58:02 +01:00
|
|
|
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
|
2018-02-24 13:12:44 +00:00
|
|
|
++ optional enableOpenGL libGLU_combined
|
2017-06-16 11:58:02 +01:00
|
|
|
++ optional enableQt qt4
|
|
|
|
++ optional enableFFmpeg ffmpeg_2
|
|
|
|
++ optional enableJemalloc jemalloc
|
2018-02-24 13:12:44 +00:00
|
|
|
++ optional enableHwAccel libGLU_combined
|
2017-06-16 11:58:02 +01:00
|
|
|
++ optionals enablePlugins [ xulrunner npapi_sdk ]
|
2018-11-16 22:50:38 +00:00
|
|
|
++ optionals enableGTK [ gtk2 gnome2.gtkglext gnome2.GConf ];
|
2017-06-16 11:58:02 +01:00
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|