gst_all_1: Fix evaluation on Darwin, fix gstreamer builds.
Commit be382109ad broke evaluation
on Darwin because it added these unconditional buildInputs
that don't evaluate on Darwin:
libnice librdf lilv lv2 serd sord sratom
This commit fixes it, and also fixes recently-added new dependencies
for other packages accordingly.
It further fixes the build of many gstreamer packages on Darwin.
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
, libopus
|
||||
, isocodes
|
||||
, libjpeg
|
||||
, libpng
|
||||
, libvisual
|
||||
, tremor # provides 'virbisidec'
|
||||
, libGL
|
||||
@@ -27,8 +28,12 @@
|
||||
, wayland
|
||||
, enableAlsa ? stdenv.isLinux
|
||||
, alsaLib
|
||||
# Enabling Cocoa seems to currently not work, giving compile
|
||||
# errors. Suspected is that a newer version than clang
|
||||
# is needed than 5.0 but it is not clear.
|
||||
, enableCocoa ? false
|
||||
, darwin
|
||||
, enableGl ? (enableX11 || enableWayland || enableCocoa)
|
||||
, enableCdparanoia ? (!stdenv.isDarwin)
|
||||
, cdparanoia
|
||||
}:
|
||||
@@ -68,11 +73,16 @@ stdenv.mkDerivation rec {
|
||||
libintl
|
||||
libopus
|
||||
isocodes
|
||||
libpng
|
||||
libjpeg
|
||||
tremor
|
||||
libGL
|
||||
] ++ lib.optional (!stdenv.isDarwin) libvisual
|
||||
++ lib.optional enableAlsa alsaLib
|
||||
] ++ lib.optional (!stdenv.isDarwin) [
|
||||
libvisual
|
||||
] ++ lib.optionals stdenv.isDarwin [
|
||||
pango
|
||||
darwin.apple_sdk.frameworks.OpenGL
|
||||
] ++ lib.optional enableAlsa alsaLib
|
||||
++ lib.optionals enableX11 [ libXv pango ]
|
||||
++ lib.optional enableWayland wayland
|
||||
++ lib.optional enableCocoa darwin.apple_sdk.frameworks.Cocoa
|
||||
@@ -85,6 +95,7 @@ stdenv.mkDerivation rec {
|
||||
mesonFlags = [
|
||||
"-Dexamples=disabled" # requires many dependencies and probably not useful for our users
|
||||
"-Dgl-graphene=disabled" # not packaged in nixpkgs as of writing
|
||||
"-Dgl_platform=[${lib.optionalString (enableX11 || enableWayland || enableCocoa) "auto"}]"
|
||||
# See https://github.com/GStreamer/gst-plugins-base/blob/d64a4b7a69c3462851ff4dcfa97cc6f94cd64aef/meson_options.txt#L15 for a list of choices
|
||||
"-Dgl_winsys=[${lib.concatStringsSep "," (lib.optional enableX11 "x11" ++ lib.optional enableWayland "wayland" ++ lib.optional enableCocoa "cocoa")}]"
|
||||
# We must currently disable gtk_doc API docs generation,
|
||||
@@ -98,15 +109,40 @@ stdenv.mkDerivation rec {
|
||||
]
|
||||
++ lib.optional (!enableX11) "-Dx11=disabled"
|
||||
# TODO How to disable Wayland?
|
||||
++ lib.optional (!enableGl) "-Dgl=disabled"
|
||||
++ lib.optional (!enableAlsa) "-Dalsa=disabled"
|
||||
++ lib.optional (!enableCdparanoia) "-Dcdparanoia=disabled";
|
||||
++ lib.optional (!enableCdparanoia) "-Dcdparanoia=disabled"
|
||||
++ lib.optionals stdenv.isDarwin [
|
||||
"-Dlibvisual=disabled"
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
patchShebangs common/scangobj-merge.py
|
||||
'';
|
||||
|
||||
# This package has some `_("string literal")` string formats
|
||||
# that trip up clang with format security enabled.
|
||||
hardeningDisable = [ "format" ];
|
||||
|
||||
doCheck = false; # fails, wants DRI access for OpenGL
|
||||
|
||||
passthru = {
|
||||
# Downstream `gst-*` packages depending on `gst-plugins-base`
|
||||
# have meson build options like 'gl' etc. that depend
|
||||
# on these features being built in `-base`.
|
||||
# If they are not built here, then the downstream builds
|
||||
# will fail, as they, too, use `-Dauto_features=enabled`
|
||||
# which would enable these options unconditionally.
|
||||
# That means we must communicate to these downstream packages
|
||||
# if the `-base` enabled these options or not, so that
|
||||
# the can enable/disable those features accordingly.
|
||||
# The naming `*Enabled` vs `enable*` is intentional to
|
||||
# distinguish inputs from outputs (what is to be built
|
||||
# vs what was built) and to make them easier to search for.
|
||||
glEnabled = enableGl;
|
||||
waylandEnabled = enableWayland;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Base GStreamer plug-ins and helper libraries";
|
||||
homepage = "https://gstreamer.freedesktop.org";
|
||||
|
||||
Reference in New Issue
Block a user