about summary refs log tree commit diff
path: root/nixpkgs/pkgs/desktops/deepin/deepin-movie-reborn/default.nix
blob: 6763292b626cbc761ec9b66d7c118d1accb4d2bf (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
{ stdenv
, mkDerivation
, fetchFromGitHub
, fetchpatch
, cmake
, pkgconfig
, qttools
, qtx11extras
, dtkcore
, dtkwidget
, ffmpeg
, ffmpegthumbnailer
, mpv
, pulseaudio
, libdvdnav
, libdvdread
, xorg
, deepin
}:

mkDerivation rec {
  pname = "deepin-movie-reborn";
  version = "5.0.0";

  src = fetchFromGitHub {
    owner = "linuxdeepin";
    repo = pname;
    rev = version;
    sha256 = "0cly8q0514a58s3h3wsvx9yxar7flz6i2q8xkrkfjias22b3z7b0";
  };

  outputs = [ "out" "dev" ];

  nativeBuildInputs = [
    cmake
    pkgconfig
    qttools
    deepin.setupHook
  ];

  buildInputs = [
    dtkcore
    dtkwidget
    ffmpeg
    ffmpegthumbnailer
    libdvdnav
    libdvdread
    mpv
    pulseaudio
    qtx11extras
    xorg.libXdmcp
    xorg.libXtst
    xorg.libpthreadstubs
    xorg.xcbproto
  ];

  patches = [
    # fix: build failed if cannot find dtk-settings tool
    (fetchpatch {
      url = "https://github.com/linuxdeepin/deepin-movie-reborn/commit/fbb307b.patch";
      sha256 = "0915za0khki0729rvcfpxkh6vxhqwc47cgcmjc90kfq1004221vx";
    })
  ];

  NIX_LDFLAGS = "-ldvdnav";

  postPatch = ''
    searchHardCodedPaths  # debugging

    sed -i src/libdmr/libdmr.pc.in -e "s,/usr,$out," -e 's,libdir=''${prefix}/,libdir=,'

    substituteInPlace src/deepin-movie.desktop \
      --replace "Exec=deepin-movie" "Exec=$out/bin/deepin-movie"
  '';

  passthru.updateScript = deepin.updateScript { inherit pname version src; };

  meta = with stdenv.lib; {
    description = "Deepin movie player";
    homepage = "https://github.com/linuxdeepin/deepin-movie-reborn";
    license = licenses.gpl3;
    platforms = platforms.linux;
    maintainers = with maintainers; [ romildo ];
  };
}