2021-01-15 14:21:58 +01:00
|
|
|
{ lib, stdenv, fetchgit, fetchpatch, autoreconfHook
|
2021-01-17 03:30:45 +01:00
|
|
|
, pkg-config, libtool, boost, SDL
|
2017-06-16 12:58:02 +02:00
|
|
|
, glib, pango, gettext, curl, xorg
|
|
|
|
, libpng, libjpeg, giflib, speex, atk
|
|
|
|
|
|
|
|
# renderers
|
|
|
|
, enableAGG ? true, agg ? null
|
|
|
|
, enableCairo ? false, cairo ? null
|
2019-11-10 17:44:34 +01:00
|
|
|
, enableOpenGL ? false
|
|
|
|
, libGLU ? null
|
|
|
|
, libGL ? null
|
2017-06-16 12:58:02 +02:00
|
|
|
|
|
|
|
# GUI toolkits
|
2018-07-10 00:34:32 +02:00
|
|
|
, enableGTK ? true, gtk2 ? null, gnome2 ? null
|
2017-06-16 12:58:02 +02:00
|
|
|
, enableSDL ? false
|
|
|
|
, enableQt ? false, qt4 ? null
|
|
|
|
|
|
|
|
# media
|
2019-02-22 18:16:55 +01:00
|
|
|
, enableFFmpeg ? true, ffmpeg_2 ? null
|
2017-06-16 12:58:02 +02:00
|
|
|
|
|
|
|
# misc
|
2019-02-22 18:16:55 +01:00
|
|
|
, enableJemalloc ? true, jemalloc ? null
|
2017-06-16 12:58:02 +02:00
|
|
|
, enableHwAccel ? true
|
|
|
|
, enablePlugins ? false, xulrunner ? null, npapi_sdk ? null
|
|
|
|
}:
|
|
|
|
|
2021-01-15 14:21:58 +01:00
|
|
|
with lib;
|
2017-06-16 12:58:02 +02:00
|
|
|
|
2018-07-10 00:34:32 +02:00
|
|
|
let
|
2017-06-16 12:58:02 +02:00
|
|
|
available = x: x != null;
|
|
|
|
|
|
|
|
sound =
|
2018-11-16 23:50:38 +01:00
|
|
|
if enableFFmpeg then "ffmpeg" else "none";
|
2017-06-16 12:58:02 +02: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;
|
2019-11-10 17:44:34 +01:00
|
|
|
assert enableOpenGL -> all available [ libGLU libGL ];
|
2017-06-16 12:58:02 +02:00
|
|
|
|
|
|
|
# GUI toolkits
|
2018-07-10 00:34:32 +02:00
|
|
|
assert enableGTK -> all available [ gtk2 gnome2.gtkglext gnome2.GConf ];
|
2017-06-16 12:58:02 +02:00
|
|
|
assert enableSDL -> available SDL;
|
|
|
|
assert enableQt -> available qt4;
|
|
|
|
|
|
|
|
# media libraries
|
|
|
|
assert enableFFmpeg -> available ffmpeg_2 ;
|
|
|
|
|
|
|
|
# misc
|
|
|
|
assert enableJemalloc -> available jemalloc;
|
2019-11-10 17:44:34 +01:00
|
|
|
assert enableHwAccel -> all available [ libGLU libGL ];
|
2017-06-16 12:58:02 +02: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";
|
|
|
|
|
|
|
|
|
2019-08-13 23:52:01 +02:00
|
|
|
stdenv.mkDerivation {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "gnash";
|
2019-02-22 18:16:55 +01:00
|
|
|
version = "0.8.11-2019-30-01";
|
2017-06-16 12:58:02 +02:00
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = "git://git.sv.gnu.org/gnash.git";
|
2019-02-22 18:16:55 +01:00
|
|
|
rev = "583ccbc1275c7701dc4843ec12142ff86bb305b4";
|
|
|
|
sha256 = "0fh0bljn0i6ypyh6l99afi855p7ki7lm869nq1qj6k8hrrwhmfry";
|
2017-06-16 12:58:02 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i 's|jemalloc.h|jemalloc/jemalloc.h|' libbase/jemalloc_gnash.c
|
|
|
|
'';
|
|
|
|
|
2021-01-17 03:30:45 +01:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkg-config libtool ];
|
2017-06-16 12:58:02 +02:00
|
|
|
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 enableQt qt4
|
|
|
|
++ optional enableFFmpeg ffmpeg_2
|
|
|
|
++ optional enableJemalloc jemalloc
|
2019-11-10 17:44:34 +01:00
|
|
|
++ optional enableHwAccel [ libGL libGLU ]
|
|
|
|
++ optionals enableOpenGL [ libGL libGLU ]
|
2017-06-16 12:58:02 +02:00
|
|
|
++ optionals enablePlugins [ xulrunner npapi_sdk ]
|
2018-11-16 23:50:38 +01:00
|
|
|
++ optionals enableGTK [ gtk2 gnome2.gtkglext gnome2.GConf ];
|
2017-06-16 12:58:02 +02:00
|
|
|
|
2019-11-21 08:25:51 +01:00
|
|
|
patches = [
|
|
|
|
(fetchpatch { # fix compilation due to bad detection of libgif version: https://savannah.gnu.org/patch/index.php?9873
|
|
|
|
url = "https://savannah.gnu.org/patch/download.php?file_id=47859";
|
|
|
|
sha256 = "0aimayzgi5065gkcfcr8d5lkd9c0471q7dqmln42hjzq847n6d5y";
|
|
|
|
})
|
2020-02-07 00:37:06 +01:00
|
|
|
|
|
|
|
# Fix build with modern Pango
|
|
|
|
# https://savannah.gnu.org/bugs/index.php?57759
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://savannah.gnu.org/file/0001-Do-not-depend-on-pangox.patch?file_id=48366";
|
|
|
|
sha256 = "02x7sl5zwd1ld2n4b6bp16c5gk91qsap0spfbb5iwpglq3galv2l";
|
|
|
|
})
|
2019-11-21 08:25:51 +01:00
|
|
|
];
|
|
|
|
|
2021-01-15 14:21:58 +01:00
|
|
|
configureFlags = with lib; [
|
2017-06-16 12:58:02 +02:00
|
|
|
"--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 = {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://savannah.gnu.org/projects/gnash";
|
2017-06-16 12:58:02 +02:00
|
|
|
description = "A flash (SWF) player and browser plugin";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ rnhmjoj ];
|
|
|
|
};
|
|
|
|
}
|