1{ mkDerivation
2, lib
3, fetchFromGitHub
4, extra-cmake-modules
5, qtbase
6, qtmultimedia
7, qttools
8, libGL
9, libX11
10, libass
11, openal
12, ffmpeg_4
13, libuchardet
14, alsa-lib
15, libpulseaudio
16, libva
17}:
18
19mkDerivation rec {
20 pname = "libqtav";
21 version = "unstable-2020-09-10";
22
23 nativeBuildInputs = [ extra-cmake-modules qttools ];
24 buildInputs = [
25 qtbase
26 qtmultimedia
27 libGL
28 libX11
29 libass
30 openal
31 ffmpeg_4
32 libuchardet
33 alsa-lib
34 libpulseaudio
35 libva
36 ];
37
38 src = fetchFromGitHub {
39 sha256 = "0qwrk40dihkbwmm7krz6qaqyn9v3qdjnd2k9b4s3a67x4403pib3";
40 rev = "2a470d2a8d2fe22fae969bee5d594909a07b350a";
41 repo = "QtAV";
42 owner = "wang-bin";
43 fetchSubmodules = true;
44 };
45
46 # Make sure libqtav finds its libGL dependency at both link and run time
47 # by adding libGL to rpath. Not sure why it wasn't done automatically like
48 # the other libraries as `libGL` is part of our `buildInputs`.
49 NIX_CFLAGS_LINK = "-Wl,-rpath,${libGL}/lib";
50
51 cmakeFlags = [
52 # RPATH of binary /nix/store/.../bin/... contains a forbidden reference to /build/
53 "-DCMAKE_SKIP_BUILD_RPATH=ON"
54 ];
55
56 preFixup = ''
57 mkdir -p "$out/bin"
58 cp -a "./bin/"* "$out/bin"
59 '';
60
61 stripDebugList = [ "lib" "libexec" "bin" "qml" ];
62
63 meta = with lib; {
64 description = "A multimedia playback framework based on Qt + FFmpeg";
65 #license = licenses.lgpl21; # For the libraries / headers only.
66 license = licenses.gpl3; # With the examples (under bin) and most likely some of the optional dependencies used.
67 homepage = "http://www.qtav.org/";
68 maintainers = [ maintainers.jraygauthier ];
69 platforms = platforms.linux;
70 };
71}