-
-
Notifications
You must be signed in to change notification settings - Fork 13.7k
/
default.nix
136 lines (121 loc) · 3.4 KB
/
default.nix
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
{ stdenv
, fetchurl
, meson
, ninja
, pkg-config
, gettext
, bison
, flex
, python3
, glib
, makeWrapper
, libcap
, elfutils # for libdw
, bash-completion
, lib
, Cocoa
, CoreServices
, rustc
, testers
, gobject-introspection
, buildPackages
, withIntrospection ? lib.meta.availableOn stdenv.hostPlatform gobject-introspection && stdenv.hostPlatform.emulatorAvailable buildPackages
, libunwind
, withLibunwind ?
lib.meta.availableOn stdenv.hostPlatform libunwind &&
lib.elem "libunwind" libunwind.meta.pkgConfigModules or []
# Checks meson.is_cross_build(), so even canExecute isn't enough.
, enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform, hotdoc
}:
stdenv.mkDerivation (finalAttrs: {
pname = "gstreamer";
version = "1.24.3";
outputs = [
"bin"
"out"
"dev"
];
separateDebugInfo = true;
src = let
inherit (finalAttrs) pname version;
in fetchurl {
url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz";
hash = "sha256-EiXvSjKfrhytxexyfaskmtVn6AcoeUk1Yc65HtNKpBQ=";
};
depsBuildBuild = [
pkg-config
];
strictDeps = true;
nativeBuildInputs = [
meson
ninja
pkg-config
gettext
bison
flex
python3
makeWrapper
glib
bash-completion
rustc
] ++ lib.optionals stdenv.isLinux [
libcap # for setcap binary
] ++ lib.optionals withIntrospection [
gobject-introspection
] ++ lib.optionals enableDocumentation [
hotdoc
];
buildInputs = [
bash-completion
] ++ lib.optionals stdenv.isLinux [
libcap
] ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform elfutils) [
elfutils
] ++ lib.optionals withLibunwind [
libunwind
] ++ lib.optionals stdenv.isDarwin [
Cocoa
CoreServices
];
propagatedBuildInputs = [
glib
];
mesonFlags = [
"-Ddbghelp=disabled" # not needed as we already provide libunwind and libdw, and dbghelp is a fallback to those
"-Dexamples=disabled" # requires many dependencies and probably not useful for our users
(lib.mesonEnable "introspection" withIntrospection)
(lib.mesonEnable "doc" enableDocumentation)
(lib.mesonEnable "libunwind" withLibunwind)
(lib.mesonEnable "libdw" withLibunwind)
];
postPatch = ''
patchShebangs \
gst/parse/get_flex_version.py \
gst/parse/gen_grammar.py.in \
gst/parse/gen_lex.py.in \
libs/gst/helpers/ptp_helper_post_install.sh \
scripts/extract-release-date-from-doap-file.py \
docs/gst-plugins-doc-cache-generator.py
'';
postInstall = ''
for prog in "$bin/bin/"*; do
# We can't use --suffix here due to quoting so we craft the export command by hand
wrapProgram "$prog" --run 'export GST_PLUGIN_SYSTEM_PATH_1_0=$GST_PLUGIN_SYSTEM_PATH_1_0''${GST_PLUGIN_SYSTEM_PATH_1_0:+:}$(unset _tmp; for profile in $NIX_PROFILES; do _tmp="$profile/lib/gstreamer-1.0''${_tmp:+:}$_tmp"; done; printf '%s' "$_tmp")'
done
'';
preFixup = ''
moveToOutput "share/bash-completion" "$bin"
'';
setupHook = ./setup-hook.sh;
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
meta = with lib; {
description = "Open source multimedia framework";
homepage = "https://gstreamer.freedesktop.org";
license = licenses.lgpl2Plus;
pkgConfigModules = [
"gstreamer-controller-1.0"
];
platforms = platforms.unix;
maintainers = with maintainers; [ ttuegel matthewbauer ];
};
})