about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/video/xplayer/default.nix
blob: 20a9772021a918b0f14fd217c9e8ae67e6163ff2 (plain) (blame)
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
91
92
93
94
95
96
97
98
99
100
101
102
103
{ stdenv
, lib
, fetchFromGitHub
, autoreconfHook
, autoconf-archive
, clutter-gst
, clutter-gtk
, gettext
, glib
, gobject-introspection
, gst-plugins-bad
, gst-plugins-base
, gst-plugins-good
, gstreamer
, gtk-doc
, gtk3
, intltool
, itstool
, libpeas
, libxml2
, libxplayer-plparser
, pkg-config
, python3
, wrapGAppsHook
, xapp
, yelp-tools }:

let
  pythonenv = python3.withPackages (ps: [
    ps.pygobject3
    ps.dbus-python # For one plugin
  ]);
in

stdenv.mkDerivation rec {
  pname = "xplayer";
  version = "2.4.4";

  src = fetchFromGitHub {
    owner = "linuxmint";
    repo = pname;
    rev = version;
    sha256 = "sha256-o2vLNIELd1EYWG26t5gOpnamJrBJeg4P6fcLirkcmfM=";
  };

  # configure wants to find gst-inspect-1.0 via pkgconfig but
  # the gstreamer toolsdir points to the wrong derivation output
  postPatch = ''
    substituteInPlace configure.ac \
                      --replace '$gst10_toolsdir/gst-inspect-1.0' '${gstreamer}/bin/gst-inspect-1.0' \
  '';

  preBuild = ''
    makeFlagsArray+=(
      "INCLUDES=-I${glib.dev}/include/gio-unix-2.0"
      "CFLAGS=-Wno-error" # Otherwise a lot of deprecated warnings are treated as error
    )
  '';

  nativeBuildInputs = [
    autoreconfHook
    wrapGAppsHook
    autoconf-archive
    gettext
    gtk-doc
    intltool
    itstool
    pkg-config
    yelp-tools
    gobject-introspection
  ];

  buildInputs = [
    clutter-gst
    clutter-gtk
    glib
    gst-plugins-bad
    gst-plugins-base
    gst-plugins-good
    gstreamer
    gtk3
    libpeas
    libxml2
    libxplayer-plparser
    pythonenv
    xapp
    # to satisfy configure script
    pythonenv.pkgs.pygobject3
  ];

  postInstall = ''
    wrapProgram $out/bin/xplayer \
                --prefix PATH : ${lib.makeBinPath [ pythonenv ]}
  '';

  meta = with lib; {
    description = "A generic media player from Linux Mint";
    license = with licenses; [ gpl2Plus lgpl21Plus ];
    homepage = "https://github.com/linuxmint/xplayer";
    maintainers = with maintainers; [ tu-maurice bobby285271 ];
    platforms = platforms.linux;
  };
}