1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
{ stdenv, fetchurl, pkgconfig
, pythonPackages, pyrex096, ffmpeg, boost, glib, gtk2, webkitgtk2, libsoup
, taglib, sqlite
, libtorrentRasterbar, glib_networking, gsettings_desktop_schemas
, gst_python, gst_plugins_base, gst_plugins_good, gst_ffmpeg
, enableBonjour ? false, avahi ? null
}:
assert enableBonjour -> avahi != null;
with stdenv.lib;
let
inherit (pythonPackages) python buildPythonApplication;
version = "6.0";
in buildPythonApplication rec {
name = "miro-${version}";
src = fetchurl {
url = "http://ftp.osuosl.org/pub/pculture.org/miro/src/${name}.tar.gz";
sha256 = "0sq25w365i1fz95398vxql3yjl5i6mq77mnmlhmn0pgyg111k3am";
};
setSourceRoot = ''
sourceRoot=${name}/linux
'';
patches = [ ./gconf.patch ];
postPatch = ''
patch -p1 -d .. < "${./youtube-feeds.patch}"
sed -i -e 's/\$(shell which python)/python/' Makefile
sed -i -e 's|/usr/bin/||' -e 's|/usr||' \
-e 's/BUILD_TIME[^,]*/BUILD_TIME=0/' setup.py
sed -i -e 's|default="/usr/bin/ffmpeg"|default="${ffmpeg.bin}/bin/ffmpeg"|' \
plat/options.py
sed -i -e 's|/usr/share/miro/themes|'"$out/share/miro/themes"'|' \
-e 's/gnome-open/xdg-open/g' \
-e '/RESOURCE_ROOT =.*(/,/)/ {
c RESOURCE_ROOT = '"'$out/share/miro/resources/'"'
}' \
plat/resources.py
'' + optionalString enableBonjour ''
sed -i -e 's|ctypes.cdll.LoadLibrary( *|ctypes.CDLL("${avahi}/lib/" +|' \
../lib/libdaap/pybonjour.py
'';
# Disabled for now, because it requires networking and even if we skip those
# tests, the whole test run takes around 10-20 minutes.
doCheck = false;
checkPhase = ''
HOME="$TEMPDIR" LANG=en_US.UTF-8 python miro.real --unittest
'';
preInstall = ''
# see https://bitbucket.org/pypa/setuptools/issue/130/install_data-doesnt-respect-prefix
${python.interpreter} setup.py install_data --root=$out
sed -i '/data_files=data_files/d' setup.py
'';
postInstall = ''
mv "$out/bin/miro.real" "$out/bin/miro"
wrapProgram "$out/bin/miro" \
--prefix GST_PLUGIN_SYSTEM_PATH : "$GST_PLUGIN_SYSTEM_PATH" \
--prefix GIO_EXTRA_MODULES : "${glib_networking.out}/lib/gio/modules" \
--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH:$out/share"
'';
buildInputs = with pythonPackages; [ pygtk pygobject ] ++ [
pkgconfig pyrex096 ffmpeg boost glib gtk2 webkitgtk2 libsoup
taglib gsettings_desktop_schemas sqlite
];
propagatedBuildInputs = with pythonPackages; [
pygobject pygtk pycurl sqlite3 mutagen pycairo dbus-python
pywebkitgtk] ++ [ libtorrentRasterbar
gst_python gst_plugins_base gst_plugins_good gst_ffmpeg
] ++ optional enableBonjour avahi;
meta = {
homepage = "http://www.getmiro.com/";
description = "Video and audio feed aggregator";
license = licenses.gpl2Plus;
maintainers = [ maintainers.aszlig ];
platforms = platforms.linux;
};
}
|