2008-03-10 15:05:32 +00:00
|
|
|
{ stdenv, fetchurl
|
2010-08-23 15:52:48 +01:00
|
|
|
, SDL, SDL_mixer, gstreamer, gstPluginsBase, gstPluginsGood
|
|
|
|
, gstFfmpeg, speex
|
2008-10-14 09:26:00 +01:00
|
|
|
, libogg, libxml2, libjpeg, mesa, libpng, libungif, libtool
|
|
|
|
, boost, freetype, agg, dbus, curl, pkgconfig, gettext
|
2011-03-24 22:25:03 +00:00
|
|
|
, glib, gtk, gtkglext, x11, ming, dejagnu, python, perl
|
|
|
|
, 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;
|
|
|
|
|
2011-03-24 22:25:03 +00:00
|
|
|
let version = "0.8.9"; 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";
|
2011-03-24 22:25:03 +00:00
|
|
|
sha256 = "1ga8khwaympj4fphhpyqx6ddcikv0zmcpnlykcipny1xy33bs3gr";
|
2006-09-24 13:23:13 +01:00
|
|
|
};
|
|
|
|
|
2008-03-10 09:48:17 +00:00
|
|
|
patchPhase = ''
|
|
|
|
# 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 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 = [
|
2010-08-23 15:52:48 +01:00
|
|
|
gettext x11 SDL SDL_mixer gstreamer gstPluginsBase gstPluginsGood
|
|
|
|
gstFfmpeg speex libtool
|
2008-10-14 09:26:00 +01:00
|
|
|
libogg libxml2 libjpeg mesa libpng libungif boost freetype agg
|
2010-08-23 15:52:48 +01:00
|
|
|
dbus curl pkgconfig glib gtk gtkglext
|
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=" \
|
|
|
|
--with-sdl-incl=${SDL}/include/SDL \
|
|
|
|
--with-npapi-plugindir=$out/plugins \
|
|
|
|
--enable-media=gst \
|
|
|
|
--enable-gui=gtk"
|
|
|
|
|
|
|
|
# In `libmedia', Gnash compiles with "-I$gstPluginsBase/include",
|
|
|
|
# whereas it really needs "-I$gstPluginsBase/include/gstreamer-0.10".
|
|
|
|
# Work around this using GCC's $CPATH variable.
|
|
|
|
export CPATH="${gstPluginsBase}/include/gstreamer-0.10:${gstPluginsGood}/include/gstreamer-0.10"
|
|
|
|
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
|
|
|
|
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
|
|
|
|
2008-03-10 13:24:11 +00:00
|
|
|
preInstall = ''ensureDir $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
|
2009-09-25 16:24:31 +01:00
|
|
|
wrapProgram "$prog" --prefix \
|
2008-11-12 08:37:39 +00:00
|
|
|
GST_PLUGIN_PATH ":" \
|
2010-08-23 15:52:48 +01:00
|
|
|
"${gstPluginsBase}/lib/gstreamer-0.10:${gstPluginsGood}/lib/gstreamer-0.10:${gstFfmpeg}/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 16:24:31 +01: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 16:24:31 +01:00
|
|
|
|
|
|
|
maintainers = [ stdenv.lib.maintainers.ludo ];
|
|
|
|
platforms = stdenv.lib.platforms.gnu;
|
2008-03-10 09:48:17 +00:00
|
|
|
};
|
2006-09-24 22:56:50 +01:00
|
|
|
} // {mozillaPlugin = "/plugins";}
|