20 , tremor # provides 'virbisidec'
22 , withIntrospection ? lib.meta.availableOn stdenv.hostPlatform gobject-introspection && stdenv.hostPlatform.emulatorAvailable buildPackages
24 , gobject-introspection
25 , enableX11 ? stdenv.hostPlatform.isLinux
30 , enableWayland ? stdenv.hostPlatform.isLinux
34 , enableAlsa ? stdenv.hostPlatform.isLinux
36 # TODO: fix once x86_64-darwin sdk updated
37 , enableCocoa ? (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64)
40 , enableGl ? (enableX11 || enableWayland || enableCocoa)
41 , enableCdparanoia ? (!stdenv.hostPlatform.isDarwin)
45 # Checks meson.is_cross_build(), so even canExecute isn't enough.
46 , enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform
50 stdenv.mkDerivation (finalAttrs: {
51 pname = "gst-plugins-base";
54 outputs = [ "out" "dev" ];
56 separateDebugInfo = true;
59 inherit (finalAttrs) pname version;
61 url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz";
62 hash = "sha256-69V7G+kkxuJPMn3VW6udj7quvl4dyPynhBgqsrEtI+s=";
78 ] ++ lib.optionals withIntrospection [
80 ] ++ lib.optionals enableDocumentation [
82 ] ++ lib.optionals enableWayland [
97 ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
101 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
103 ] ++ lib.optionals enableAlsa [
105 ] ++ lib.optionals enableX11 [
109 ] ++ lib.optionals enableWayland [
112 ] ++ lib.optional enableCocoa Cocoa
113 ++ lib.optional enableCdparanoia cdparanoia;
115 propagatedBuildInputs = [
117 ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
122 "-Dexamples=disabled" # requires many dependencies and probably not useful for our users
123 # See https://github.com/GStreamer/gst-plugins-base/blob/d64a4b7a69c3462851ff4dcfa97cc6f94cd64aef/meson_options.txt#L15 for a list of choices
124 "-Dgl_winsys=${lib.concatStringsSep "," (lib.optional enableX11 "x11" ++ lib.optional enableWayland "wayland" ++ lib.optional enableCocoa "cocoa")}"
125 (lib.mesonEnable "introspection" withIntrospection)
126 (lib.mesonEnable "doc" enableDocumentation)
127 ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
130 ++ lib.optional (!enableX11) "-Dx11=disabled"
131 # TODO How to disable Wayland?
132 ++ lib.optional (!enableGl) "-Dgl=disabled"
133 ++ lib.optional (!enableAlsa) "-Dalsa=disabled"
134 ++ lib.optional (!enableCdparanoia) "-Dcdparanoia=disabled"
135 ++ lib.optionals stdenv.hostPlatform.isDarwin [
137 "-Dlibvisual=disabled"
142 scripts/meson-pkg-config-file-fixup.py \
143 scripts/extract-release-date-from-doap-file.py
146 # This package has some `_("string literal")` string formats
147 # that trip up clang with format security enabled.
148 hardeningDisable = [ "format" ];
150 doCheck = false; # fails, wants DRI access for OpenGL
153 # Downstream `gst-*` packages depending on `gst-plugins-base`
154 # have meson build options like 'gl' etc. that depend
155 # on these features being built in `-base`.
156 # If they are not built here, then the downstream builds
157 # will fail, as they, too, use `-Dauto_features=enabled`
158 # which would enable these options unconditionally.
159 # That means we must communicate to these downstream packages
160 # if the `-base` enabled these options or not, so that
161 # the can enable/disable those features accordingly.
162 # The naming `*Enabled` vs `enable*` is intentional to
163 # distinguish inputs from outputs (what is to be built
164 # vs what was built) and to make them easier to search for.
165 glEnabled = enableGl;
166 waylandEnabled = enableWayland;
169 passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
172 description = "Base GStreamer plug-ins and helper libraries";
173 homepage = "https://gstreamer.freedesktop.org";
174 license = licenses.lgpl2Plus;
176 "gstreamer-audio-1.0"
179 "gstreamer-video-1.0"
181 platforms = platforms.unix;
182 maintainers = with maintainers; [ matthewbauer ];