2014-05-17 06:27:29 +01:00
|
|
|
{ stdenv, fetchurl, fetchpatch
|
2012-03-14 22:44:52 +00:00
|
|
|
, SDL, SDL_mixer, gstreamer, gst_plugins_base, gst_plugins_good
|
|
|
|
, gst_ffmpeg, speex
|
2008-10-14 09:26:00 +01:00
|
|
|
, libogg, libxml2, libjpeg, mesa, libpng, libungif, libtool
|
|
|
|
, boost, freetype, agg, dbus, curl, pkgconfig, gettext
|
2015-09-15 10:13:22 +01:00
|
|
|
, glib, gtk, gtkglext, pangox_compat, xlibsWrapper, ming, dejagnu, python, perl
|
2011-03-24 22:25:03 +00:00
|
|
|
, freefont_ttf, haxe, swftools
|
|
|
|
, lib, makeWrapper
|
|
|
|
, xulrunner }:
|
2006-09-24 13:23:13 +01:00
|
|
|
|
2009-09-20 15:10:16 +01:00
|
|
|
assert stdenv ? glibc;
|
|
|
|
|
2014-02-06 19:09:49 +00:00
|
|
|
let version = "0.8.10";
|
2014-05-17 06:27:29 +01:00
|
|
|
patch_CVE = fetchpatch {
|
2014-02-06 19:09:49 +00:00
|
|
|
url = "http://git.savannah.gnu.org/cgit/gnash.git/patch/?id=bb4dc77eecb6ed1b967e3ecbce3dac6c5e6f1527";
|
2014-05-17 06:27:29 +01:00
|
|
|
sha256 = "0ghnki5w7xf3qwfl1x6vhijpd6q608niyxrvh0g8dw5xavkvallk";
|
2014-02-06 19:09:49 +00:00
|
|
|
name = "CVE-2012-1175.patch";
|
|
|
|
};
|
|
|
|
in
|
2009-09-20 15:10:16 +01:00
|
|
|
|
2008-03-10 09:48:17 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2008-06-25 09:50:39 +01:00
|
|
|
name = "gnash-${version}";
|
2006-09-24 13:23:13 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2008-06-25 09:50:39 +01:00
|
|
|
url = "mirror://gnu/gnash/${version}/${name}.tar.bz2";
|
2012-04-05 23:34:11 +01:00
|
|
|
sha256 = "090j5lly5r6jzbnvlc3mhay6dsrd9sfrkjcgqaibm4nz8lp0f9cn";
|
2006-09-24 13:23:13 +01: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.
|
2014-10-11 09:51:47 +01:00
|
|
|
libs=$(echo "$NIX_LDFLAGS" | tr ' ' '\n' | sed -n 's/.*-L\(.*\).*/\1/p')
|
|
|
|
for lib in $libs; do
|
2008-03-10 09:48:17 +00:00
|
|
|
echo -n "$lib " >> macros/libslist
|
|
|
|
done
|
2015-04-26 18:54:51 +01:00
|
|
|
echo -n "${stdenv.glibc.out}/lib" >> macros/libslist
|
2008-06-25 09:50:39 +01: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 09:26:00 +01:00
|
|
|
buildInputs = [
|
2015-09-15 10:13:22 +01:00
|
|
|
gettext xlibsWrapper SDL SDL_mixer gstreamer gst_plugins_base gst_plugins_good
|
2012-03-14 22:44:52 +00:00
|
|
|
gst_ffmpeg speex libtool
|
2014-10-01 20:55:40 +01:00
|
|
|
libogg libxml2 libjpeg mesa libpng libungif boost freetype agg
|
2013-04-18 10:28:03 +01: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 09:26:00 +01:00
|
|
|
|
2011-03-24 22:25:03 +00:00
|
|
|
++ (stdenv.lib.optionals doCheck [
|
|
|
|
ming dejagnu python perl haxe swftools
|
|
|
|
]);
|
2008-10-14 09:26:00 +01:00
|
|
|
|
2010-08-23 15:52:48 +01:00
|
|
|
preConfigure =
|
|
|
|
'' configureFlags=" \
|
2015-10-11 15:21:43 +01:00
|
|
|
--with-sdl-incl=${SDL.dev}/include/SDL \
|
2010-08-23 15:52:48 +01:00
|
|
|
--with-npapi-plugindir=$out/plugins \
|
|
|
|
--enable-media=gst \
|
2012-04-05 23:34:11 +01:00
|
|
|
--without-gconf
|
2010-08-23 15:52:48 +01: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 15:52:48 +01: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 15:52:48 +01: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 15:52:48 +01: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 09:43:50 +01: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 16:24:31 +01:00
|
|
|
for prog in "$out/bin/"*
|
2008-11-12 08:37:39 +00:00
|
|
|
do
|
2014-02-28 01:03:07 +00:00
|
|
|
wrapProgram "$prog" --prefix GST_PLUGIN_SYSTEM_PATH ":" "$GST_PLUGIN_SYSTEM_PATH"
|
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/;
|
2014-08-24 15:21:08 +01:00
|
|
|
description = "A libre SWF (Flash) movie player";
|
2009-09-25 16:24:31 +01:00
|
|
|
|
|
|
|
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.
|
|
|
|
'';
|
|
|
|
|
2014-06-19 05:19:00 +01:00
|
|
|
license = stdenv.lib.licenses.gpl3Plus;
|
2009-09-25 16:24:31 +01:00
|
|
|
|
2015-01-13 21:33:24 +00:00
|
|
|
maintainers = [ ];
|
2009-09-25 16:24:31 +01:00
|
|
|
platforms = stdenv.lib.platforms.gnu;
|
2015-09-02 22:35:31 +01:00
|
|
|
broken = true;
|
2008-03-10 09:48:17 +00:00
|
|
|
};
|
2006-09-24 22:56:50 +01:00
|
|
|
} // {mozillaPlugin = "/plugins";}
|