bandwhich: 0.23.0 -> 0.23.1; move to by-name; nixfmt; useFetchCargoVendor (#356934)
[NixPkgs.git] / pkgs / applications / video / plex-media-player / default.nix
blobdeb9819e1be73e4d59020f6515d9ef5b7aa30d63
2   lib,
3   fetchFromGitHub,
4   fetchurl,
5   pkg-config,
6   cmake,
7   python3,
8   mkDerivation,
9   libX11,
10   libXrandr,
11   qtbase,
12   qtwebchannel,
13   qtwebengine,
14   qtx11extras,
15   libvdpau,
16   SDL2,
17   mpv,
18   libGL,
20 let
21   # During compilation, a CMake bundle is downloaded from `artifacts.plex.tv`,
22   # which then downloads a handful of web client-related files. To enable
23   # sandboxed builds, we manually download them and save them so these files
24   # are fetched ahead-of-time instead of during the CMake build. To update
25   # plex-media-player use the update.sh script, so the versions and hashes
26   # for these files are also updated!
27   depSrcs = import ./deps.nix { inherit fetchurl; };
29 mkDerivation rec {
30   pname = "plex-media-player";
31   version = "2.58.1";
32   vsnHash = "ae73e074";
34   src = fetchFromGitHub {
35     owner = "plexinc";
36     repo = "plex-media-player";
37     rev = "v${version}-${vsnHash}";
38     sha256 = "1q20fdp5d0blb0q6p2357bwdc2g65cadkgdp4w533ij2nyaxydjd";
39   };
41   nativeBuildInputs = [
42     pkg-config
43     cmake
44     python3
45   ];
46   buildInputs = [
47     libX11
48     libXrandr
49     qtbase
50     qtwebchannel
51     qtwebengine
52     qtx11extras
53     libvdpau
54     SDL2
55     mpv
56     libGL
57   ];
59   preConfigure = with depSrcs; ''
60     mkdir -p build/dependencies
61     ln -s ${webClient} build/dependencies/buildid-${webClientBuildId}.cmake
62     ln -s ${webClientDesktopHash} build/dependencies/web-client-desktop-${webClientDesktopBuildId}.tar.xz.sha1
63     ln -s ${webClientDesktop} build/dependencies/web-client-desktop-${webClientDesktopBuildId}.tar.xz
64     ln -s ${webClientTvHash} build/dependencies/web-client-tv-${webClientTvBuildId}.tar.xz.sha1
65     ln -s ${webClientTv} build/dependencies/web-client-tv-${webClientTvBuildId}.tar.xz
66   '';
68   cmakeBuildType = "RelWithDebInfo";
70   cmakeFlags = [ "-DQTROOT=${qtbase}" ];
72   # plexmediaplayer currently segfaults under wayland
73   qtWrapperArgs = [
74     "--set"
75     "QT_QPA_PLATFORM"
76     "xcb"
77   ];
79   passthru.updateScript = ./update.sh;
81   meta = with lib; {
82     description = "Streaming media player for Plex";
83     license = licenses.gpl2;
84     maintainers = with maintainers; [ b4dm4n ];
85     homepage = "https://plex.tv";
86     mainProgram = "plexmediaplayer";
87   };