2014-05-17 07:27:29 +02:00
|
|
|
{ stdenv, fetchurl, fetchpatch
|
2012-03-14 23:44:52 +01:00
|
|
|
, SDL, SDL_mixer, gstreamer, gst_plugins_base, gst_plugins_good
|
|
|
|
, gst_ffmpeg, speex
|
2008-10-14 10:26:00 +02:00
|
|
|
, libogg, libxml2, libjpeg, mesa, libpng, libungif, libtool
|
|
|
|
, boost, freetype, agg, dbus, curl, pkgconfig, gettext
|
2013-04-18 11:28:03 +02:00
|
|
|
, glib, gtk, gtkglext, pangox_compat, x11, ming, dejagnu, python, perl
|
2011-03-24 23:25:03 +01:00
|
|
|
, freefont_ttf, haxe, swftools
|
|
|
|
, lib, makeWrapper
|
|
|
|
, xulrunner }:
|
2006-09-24 14:23:13 +02:00
|
|
|
|
2009-09-20 16:10:16 +02:00
|
|
|
assert stdenv ? glibc;
|
|
|
|
|
2014-02-06 20:09:49 +01:00
|
|
|
let version = "0.8.10";
|
2014-05-17 07:27:29 +02:00
|
|
|
patch_CVE = fetchpatch {
|
2014-02-06 20:09:49 +01:00
|
|
|
url = "http://git.savannah.gnu.org/cgit/gnash.git/patch/?id=bb4dc77eecb6ed1b967e3ecbce3dac6c5e6f1527";
|
2014-05-17 07:27:29 +02:00
|
|
|
sha256 = "0ghnki5w7xf3qwfl1x6vhijpd6q608niyxrvh0g8dw5xavkvallk";
|
2014-02-06 20:09:49 +01:00
|
|
|
name = "CVE-2012-1175.patch";
|
|
|
|
};
|
|
|
|
in
|
2009-09-20 16:10:16 +02:00
|
|
|
|
2008-03-10 10:48:17 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2008-06-25 10:50:39 +02:00
|
|
|
name = "gnash-${version}";
|
2006-09-24 14:23:13 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2008-06-25 10:50:39 +02:00
|
|
|
url = "mirror://gnu/gnash/${version}/${name}.tar.bz2";
|
2012-04-06 00:34:11 +02:00
|
|
|
sha256 = "090j5lly5r6jzbnvlc3mhay6dsrd9sfrkjcgqaibm4nz8lp0f9cn";
|
2006-09-24 14:23:13 +02:00
|
|
|
};
|
|
|
|
|
2008-03-10 10:48:17 +01:00
|
|
|
patchPhase = ''
|
2014-02-06 20:09:49 +01:00
|
|
|
patch -p1 < ${patch_CVE}
|
|
|
|
|
2008-03-10 10:48:17 +01: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 10:50:39 +02: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 23:25:03 +01:00
|
|
|
|
|
|
|
# Provide a default font.
|
|
|
|
sed -i "configure" \
|
|
|
|
-e 's|/usr/share/fonts/truetype/freefont/|${freefont_ttf}/share/fonts/truetype/|g'
|
2008-03-10 10:48:17 +01:00
|
|
|
'';
|
|
|
|
|
2011-03-24 23:25:03 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2008-03-10 10:48:17 +01:00
|
|
|
# XXX: KDE is supported as well so we could make it available optionally.
|
2008-10-14 10:26:00 +02:00
|
|
|
buildInputs = [
|
2012-03-14 23:44:52 +01:00
|
|
|
gettext x11 SDL SDL_mixer gstreamer gst_plugins_base gst_plugins_good
|
|
|
|
gst_ffmpeg speex libtool
|
2008-10-14 10:26:00 +02:00
|
|
|
libogg libxml2 libjpeg mesa libpng libungif boost freetype agg
|
2013-04-18 11:28:03 +02:00
|
|
|
dbus curl pkgconfig glib gtk gtkglext pangox_compat
|
2011-03-24 23:25:03 +01:00
|
|
|
xulrunner
|
2008-11-12 09:37:39 +01:00
|
|
|
makeWrapper
|
2011-03-24 23:25:03 +01:00
|
|
|
]
|
2008-10-14 10:26:00 +02:00
|
|
|
|
2011-03-24 23:25:03 +01:00
|
|
|
++ (stdenv.lib.optionals doCheck [
|
|
|
|
ming dejagnu python perl haxe swftools
|
|
|
|
]);
|
2008-10-14 10:26:00 +02:00
|
|
|
|
2010-08-23 16:52:48 +02:00
|
|
|
preConfigure =
|
|
|
|
'' configureFlags=" \
|
|
|
|
--with-sdl-incl=${SDL}/include/SDL \
|
|
|
|
--with-npapi-plugindir=$out/plugins \
|
|
|
|
--enable-media=gst \
|
2012-04-06 00:34:11 +02:00
|
|
|
--without-gconf
|
2010-08-23 16:52:48 +02:00
|
|
|
--enable-gui=gtk"
|
|
|
|
|
2012-03-14 23:44:52 +01: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 16:52:48 +02:00
|
|
|
# Work around this using GCC's $CPATH variable.
|
2012-03-14 23:44:52 +01:00
|
|
|
export CPATH="${gst_plugins_base}/include/gstreamer-0.10:${gst_plugins_good}/include/gstreamer-0.10"
|
2010-08-23 16:52:48 +02:00
|
|
|
echo "\$CPATH set to \`$CPATH'"
|
2011-03-24 23:25:03 +01:00
|
|
|
|
|
|
|
echo "\$GST_PLUGIN_PATH set to \`$GST_PLUGIN_PATH'"
|
2010-08-23 16:52:48 +02:00
|
|
|
'';
|
2008-03-10 10:48:17 +01:00
|
|
|
|
2014-02-08 02:28:02 +01:00
|
|
|
postConfigure = "echo '#define nullptr NULL' >> gnashconfig.h";
|
|
|
|
|
2008-03-10 16:05:32 +01:00
|
|
|
# Make sure `gtk-gnash' gets `libXext' in its `RPATH'.
|
|
|
|
NIX_LDFLAGS="-lX11 -lXext";
|
|
|
|
|
2011-03-24 23:25:03 +01:00
|
|
|
# XXX: Tests currently fail.
|
|
|
|
doCheck = false;
|
2008-10-15 10:43:50 +02:00
|
|
|
|
2012-01-18 21:16:00 +01:00
|
|
|
preInstall = ''mkdir -p $out/plugins'';
|
2008-11-12 09:37:39 +01: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 17:24:31 +02:00
|
|
|
for prog in "$out/bin/"*
|
2008-11-12 09:37:39 +01:00
|
|
|
do
|
2014-02-28 02:03:07 +01:00
|
|
|
wrapProgram "$prog" --prefix GST_PLUGIN_SYSTEM_PATH ":" "$GST_PLUGIN_SYSTEM_PATH"
|
2008-11-12 09:37:39 +01:00
|
|
|
done
|
|
|
|
'';
|
2008-03-10 14:24:11 +01:00
|
|
|
|
2008-03-10 10:48:17 +01:00
|
|
|
meta = {
|
|
|
|
homepage = http://www.gnu.org/software/gnash/;
|
2009-09-25 17:24:31 +02: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 10:48:17 +01:00
|
|
|
license = "GPLv3+";
|
2009-09-25 17:24:31 +02:00
|
|
|
|
|
|
|
maintainers = [ stdenv.lib.maintainers.ludo ];
|
|
|
|
platforms = stdenv.lib.platforms.gnu;
|
2008-03-10 10:48:17 +01:00
|
|
|
};
|
2006-09-24 23:56:50 +02:00
|
|
|
} // {mozillaPlugin = "/plugins";}
|