2008-03-10 15:05:32 +00:00
|
|
|
{ stdenv, fetchurl
|
2012-03-14 22:44:52 +00:00
|
|
|
, SDL, SDL_mixer, gstreamer, gst_plugins_base, gst_plugins_good
|
|
|
|
, gst_ffmpeg, speex
|
2008-10-14 08:26:00 +00:00
|
|
|
, libogg, libxml2, libjpeg, mesa, libpng, libungif, libtool
|
|
|
|
, boost, freetype, agg, dbus, curl, pkgconfig, gettext
|
2013-04-18 09:28:03 +00:00
|
|
|
, glib, gtk, gtkglext, pangox_compat, x11, ming, dejagnu, python, perl
|
2011-03-24 22:25:03 +00:00
|
|
|
, freefont_ttf, haxe, swftools
|
|
|
|
, lib, makeWrapper
|
|
|
|
, xulrunner }:
|
2006-09-24 12:23:13 +00:00
|
|
|
|
2009-09-20 14:10:16 +00:00
|
|
|
assert stdenv ? glibc;
|
|
|
|
|
2014-02-06 19:09:49 +00:00
|
|
|
let version = "0.8.10";
|
|
|
|
patch_CVE = fetchurl {
|
|
|
|
url = "http://git.savannah.gnu.org/cgit/gnash.git/patch/?id=bb4dc77eecb6ed1b967e3ecbce3dac6c5e6f1527";
|
|
|
|
sha256 = "1g7ymbq9vxi0mwcgs2dpyd2sf30gaam7blza0ywiwj32f5wk62v1";
|
|
|
|
name = "CVE-2012-1175.patch";
|
|
|
|
};
|
|
|
|
in
|
2009-09-20 14:10:16 +00:00
|
|
|
|
2008-03-10 09:48:17 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2008-06-25 08:50:39 +00:00
|
|
|
name = "gnash-${version}";
|
2006-09-24 12:23:13 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2008-06-25 08:50:39 +00:00
|
|
|
url = "mirror://gnu/gnash/${version}/${name}.tar.bz2";
|
2012-04-05 22:34:11 +00:00
|
|
|
sha256 = "090j5lly5r6jzbnvlc3mhay6dsrd9sfrkjcgqaibm4nz8lp0f9cn";
|
2006-09-24 12:23:13 +00:00
|
|
|
};
|
|
|
|
|
2008-03-10 09:48:17 +00:00
|
|
|
patchPhase = ''
|
2014-02-06 19:09:49 +00:00
|
|
|
patch -p1 < ${patch_CVE}
|
|
|
|
|
2008-03-10 09:48:17 +00:00
|
|
|
# Add all libs to `macros/libslist', a list of library search paths.
|
|
|
|
for lib in ${lib.concatStringsSep " "
|
|
|
|
(map (lib: "\"${lib}\"/lib")
|
|
|
|
(buildInputs ++ [stdenv.glibc]))}
|
|
|
|
do
|
|
|
|
echo -n "$lib " >> macros/libslist
|
|
|
|
done
|
2008-06-25 08:50:39 +00:00
|
|
|
|
|
|
|
# Make sure to honor $TMPDIR, for chroot builds.
|
|
|
|
for file in configure gui/Makefile.in Makefile.in
|
|
|
|
do
|
|
|
|
sed -i "$file" -es'|/tmp/|$TMPDIR/|g'
|
|
|
|
done
|
2011-03-24 22:25:03 +00:00
|
|
|
|
|
|
|
# Provide a default font.
|
|
|
|
sed -i "configure" \
|
|
|
|
-e 's|/usr/share/fonts/truetype/freefont/|${freefont_ttf}/share/fonts/truetype/|g'
|
2008-03-10 09:48:17 +00:00
|
|
|
'';
|
|
|
|
|
2011-03-24 22:25:03 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2008-03-10 09:48:17 +00:00
|
|
|
# XXX: KDE is supported as well so we could make it available optionally.
|
2008-10-14 08:26:00 +00:00
|
|
|
buildInputs = [
|
2012-03-14 22:44:52 +00:00
|
|
|
gettext x11 SDL SDL_mixer gstreamer gst_plugins_base gst_plugins_good
|
|
|
|
gst_ffmpeg speex libtool
|
2008-10-14 08:26:00 +00:00
|
|
|
libogg libxml2 libjpeg mesa libpng libungif boost freetype agg
|
2013-04-18 09:28:03 +00:00
|
|
|
dbus curl pkgconfig glib gtk gtkglext pangox_compat
|
2011-03-24 22:25:03 +00:00
|
|
|
xulrunner
|
2008-11-12 08:37:39 +00:00
|
|
|
makeWrapper
|
2011-03-24 22:25:03 +00:00
|
|
|
]
|
2008-10-14 08:26:00 +00:00
|
|
|
|
2011-03-24 22:25:03 +00:00
|
|
|
++ (stdenv.lib.optionals doCheck [
|
|
|
|
ming dejagnu python perl haxe swftools
|
|
|
|
]);
|
2008-10-14 08:26:00 +00:00
|
|
|
|
2010-08-23 14:52:48 +00:00
|
|
|
preConfigure =
|
|
|
|
'' configureFlags=" \
|
|
|
|
--with-sdl-incl=${SDL}/include/SDL \
|
|
|
|
--with-npapi-plugindir=$out/plugins \
|
|
|
|
--enable-media=gst \
|
2012-04-05 22:34:11 +00:00
|
|
|
--without-gconf
|
2010-08-23 14:52:48 +00:00
|
|
|
--enable-gui=gtk"
|
|
|
|
|
2012-03-14 22:44:52 +00:00
|
|
|
# In `libmedia', Gnash compiles with "-I$gst_plugins_base/include",
|
|
|
|
# whereas it really needs "-I$gst_plugins_base/include/gstreamer-0.10".
|
2010-08-23 14:52:48 +00:00
|
|
|
# Work around this using GCC's $CPATH variable.
|
2012-03-14 22:44:52 +00:00
|
|
|
export CPATH="${gst_plugins_base}/include/gstreamer-0.10:${gst_plugins_good}/include/gstreamer-0.10"
|
2010-08-23 14:52:48 +00:00
|
|
|
echo "\$CPATH set to \`$CPATH'"
|
2011-03-24 22:25:03 +00:00
|
|
|
|
|
|
|
echo "\$GST_PLUGIN_PATH set to \`$GST_PLUGIN_PATH'"
|
2010-08-23 14:52:48 +00:00
|
|
|
'';
|
2008-03-10 09:48:17 +00:00
|
|
|
|
2014-02-08 01:28:02 +00:00
|
|
|
postConfigure = "echo '#define nullptr NULL' >> gnashconfig.h";
|
|
|
|
|
2008-03-10 15:05:32 +00:00
|
|
|
# Make sure `gtk-gnash' gets `libXext' in its `RPATH'.
|
|
|
|
NIX_LDFLAGS="-lX11 -lXext";
|
|
|
|
|
2011-03-24 22:25:03 +00:00
|
|
|
# XXX: Tests currently fail.
|
|
|
|
doCheck = false;
|
2008-10-15 08:43:50 +00:00
|
|
|
|
2012-01-18 20:16:00 +00:00
|
|
|
preInstall = ''mkdir -p $out/plugins'';
|
2008-11-12 08:37:39 +00:00
|
|
|
postInstall = ''
|
|
|
|
make install-plugins
|
|
|
|
|
|
|
|
# Wrap programs so the find the GStreamer plug-ins they need
|
|
|
|
# (e.g., gst-ffmpeg is needed to watch movies such as YouTube's).
|
2009-09-25 15:24:31 +00:00
|
|
|
for prog in "$out/bin/"*
|
2008-11-12 08:37:39 +00:00
|
|
|
do
|
2009-09-25 15:24:31 +00:00
|
|
|
wrapProgram "$prog" --prefix \
|
2008-11-12 08:37:39 +00:00
|
|
|
GST_PLUGIN_PATH ":" \
|
2012-03-14 22:44:52 +00:00
|
|
|
"${gst_plugins_base}/lib/gstreamer-0.10:${gst_plugins_good}/lib/gstreamer-0.10:${gst_ffmpeg}/lib/gstreamer-0.10"
|
2008-11-12 08:37:39 +00:00
|
|
|
done
|
|
|
|
'';
|
2008-03-10 13:24:11 +00:00
|
|
|
|
2008-03-10 09:48:17 +00:00
|
|
|
meta = {
|
|
|
|
homepage = http://www.gnu.org/software/gnash/;
|
2009-09-25 15:24:31 +00:00
|
|
|
description = "GNU Gnash, a libre SWF (Flash) movie player";
|
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
Gnash is a GNU Flash movie player. Flash is an animation file format
|
|
|
|
pioneered by Macromedia which continues to be supported by their
|
|
|
|
successor company, Adobe. Flash has been extended to include audio and
|
|
|
|
video content, and programs written in ActionScript, an
|
|
|
|
ECMAScript-compatible language. Gnash is based on GameSWF, and
|
|
|
|
supports most SWF v7 features and some SWF v8 and v9.
|
|
|
|
'';
|
|
|
|
|
2008-03-10 09:48:17 +00:00
|
|
|
license = "GPLv3+";
|
2009-09-25 15:24:31 +00:00
|
|
|
|
|
|
|
maintainers = [ stdenv.lib.maintainers.ludo ];
|
|
|
|
platforms = stdenv.lib.platforms.gnu;
|
2008-03-10 09:48:17 +00:00
|
|
|
};
|
2006-09-24 21:56:50 +00:00
|
|
|
} // {mozillaPlugin = "/plugins";}
|