Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / applications / video / xplayer / default.nix
blob20a9772021a918b0f14fd217c9e8ae67e6163ff2
1 { stdenv
2 , lib
3 , fetchFromGitHub
4 , autoreconfHook
5 , autoconf-archive
6 , clutter-gst
7 , clutter-gtk
8 , gettext
9 , glib
10 , gobject-introspection
11 , gst-plugins-bad
12 , gst-plugins-base
13 , gst-plugins-good
14 , gstreamer
15 , gtk-doc
16 , gtk3
17 , intltool
18 , itstool
19 , libpeas
20 , libxml2
21 , libxplayer-plparser
22 , pkg-config
23 , python3
24 , wrapGAppsHook
25 , xapp
26 , yelp-tools }:
28 let
29   pythonenv = python3.withPackages (ps: [
30     ps.pygobject3
31     ps.dbus-python # For one plugin
32   ]);
35 stdenv.mkDerivation rec {
36   pname = "xplayer";
37   version = "2.4.4";
39   src = fetchFromGitHub {
40     owner = "linuxmint";
41     repo = pname;
42     rev = version;
43     sha256 = "sha256-o2vLNIELd1EYWG26t5gOpnamJrBJeg4P6fcLirkcmfM=";
44   };
46   # configure wants to find gst-inspect-1.0 via pkgconfig but
47   # the gstreamer toolsdir points to the wrong derivation output
48   postPatch = ''
49     substituteInPlace configure.ac \
50                       --replace '$gst10_toolsdir/gst-inspect-1.0' '${gstreamer}/bin/gst-inspect-1.0' \
51   '';
53   preBuild = ''
54     makeFlagsArray+=(
55       "INCLUDES=-I${glib.dev}/include/gio-unix-2.0"
56       "CFLAGS=-Wno-error" # Otherwise a lot of deprecated warnings are treated as error
57     )
58   '';
60   nativeBuildInputs = [
61     autoreconfHook
62     wrapGAppsHook
63     autoconf-archive
64     gettext
65     gtk-doc
66     intltool
67     itstool
68     pkg-config
69     yelp-tools
70     gobject-introspection
71   ];
73   buildInputs = [
74     clutter-gst
75     clutter-gtk
76     glib
77     gst-plugins-bad
78     gst-plugins-base
79     gst-plugins-good
80     gstreamer
81     gtk3
82     libpeas
83     libxml2
84     libxplayer-plparser
85     pythonenv
86     xapp
87     # to satisfy configure script
88     pythonenv.pkgs.pygobject3
89   ];
91   postInstall = ''
92     wrapProgram $out/bin/xplayer \
93                 --prefix PATH : ${lib.makeBinPath [ pythonenv ]}
94   '';
96   meta = with lib; {
97     description = "A generic media player from Linux Mint";
98     license = with licenses; [ gpl2Plus lgpl21Plus ];
99     homepage = "https://github.com/linuxmint/xplayer";
100     maintainers = with maintainers; [ tu-maurice bobby285271 ];
101     platforms = platforms.linux;
102   };