nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 meson,
6 ninja,
7 pkg-config,
8 gst-plugins-base,
9 bzip2,
10 libva,
11 wayland,
12 wayland-protocols,
13 wayland-scanner,
14 libdrm,
15 udev,
16 libxv,
17 libxrandr,
18 libxext,
19 libx11,
20 libsm,
21 libice,
22 libxcb,
23 libGLU,
24 libGL,
25 gstreamer,
26 gst-plugins-bad,
27 nasm,
28 libvpx,
29 python3,
30 # Checks meson.is_cross_build(), so even canExecute isn't enough.
31 enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform,
32 hotdoc,
33 directoryListingUpdater,
34 apple-sdk_gstreamer,
35}:
36
37stdenv.mkDerivation (finalAttrs: {
38 pname = "gstreamer-vaapi";
39 version = "1.26.5";
40
41 outputs = [
42 "out"
43 "dev"
44 ];
45
46 src = fetchurl {
47 url = "https://gstreamer.freedesktop.org/src/gstreamer-vaapi/gstreamer-vaapi-${finalAttrs.version}.tar.xz";
48 hash = "sha256-tC1E22PzGVpvMyluHq0ywU0B7ydFK3Bo8aLYZiT1Xqk=";
49 };
50
51 nativeBuildInputs = [
52 meson
53 ninja
54 pkg-config
55 python3
56 bzip2
57 wayland-scanner
58 ]
59 ++ lib.optionals enableDocumentation [
60 hotdoc
61 ];
62
63 buildInputs = [
64 gstreamer
65 gst-plugins-base
66 gst-plugins-bad
67 libva
68 wayland
69 wayland-protocols
70 libdrm
71 udev
72 libx11
73 libxcb
74 libxext
75 libxv
76 libxrandr
77 libsm
78 libice
79 nasm
80 libvpx
81 ]
82 ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
83 libGL
84 libGLU
85 ]
86 ++ lib.optionals stdenv.hostPlatform.isDarwin [
87 apple-sdk_gstreamer
88 ];
89
90 strictDeps = true;
91
92 mesonFlags = [
93 "-Dexamples=disabled" # requires many dependencies and probably not useful for our users
94 (lib.mesonEnable "doc" enableDocumentation)
95 ];
96
97 postPatch = ''
98 patchShebangs \
99 scripts/extract-release-date-from-doap-file.py
100 '';
101
102 preFixup = ''
103 moveToOutput "lib/gstreamer-1.0/pkgconfig" "$dev"
104 '';
105
106 passthru = {
107 updateScript = directoryListingUpdater { };
108 };
109
110 meta = {
111 description = "Set of VAAPI GStreamer Plug-ins";
112 homepage = "https://gstreamer.freedesktop.org";
113 license = lib.licenses.lgpl21Plus;
114 platforms = lib.platforms.linux;
115 maintainers = [ ];
116 };
117})