2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv
|
|
|
|
, fetchurl
|
|
|
|
, lib
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, gettext
|
|
|
|
, gobject-introspection
|
|
|
|
, python3
|
|
|
|
, gstreamer
|
|
|
|
, orc
|
|
|
|
, pango
|
|
|
|
, libtheora
|
|
|
|
, libintl
|
|
|
|
, libopus
|
|
|
|
, isocodes
|
|
|
|
, libjpeg
|
|
|
|
, libpng
|
|
|
|
, libvisual
|
|
|
|
, tremor # provides 'virbisidec'
|
|
|
|
, libGL
|
|
|
|
, enableX11 ? stdenv.isLinux
|
|
|
|
, libXv
|
2020-11-12 09:05:59 +00:00
|
|
|
, libXext
|
2020-04-24 23:36:52 +00:00
|
|
|
, enableWayland ? stdenv.isLinux
|
|
|
|
, wayland
|
|
|
|
, wayland-protocols
|
|
|
|
, enableAlsa ? stdenv.isLinux
|
2021-06-28 23:13:55 +00:00
|
|
|
, alsa-lib
|
2020-04-24 23:36:52 +00:00
|
|
|
# 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
|
2021-03-09 03:18:52 +00:00
|
|
|
, Cocoa
|
|
|
|
, OpenGL
|
2020-04-24 23:36:52 +00:00
|
|
|
, enableGl ? (enableX11 || enableWayland || enableCocoa)
|
|
|
|
, enableCdparanoia ? (!stdenv.isDarwin)
|
|
|
|
, cdparanoia
|
|
|
|
, glib
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "gst-plugins-base";
|
2021-05-20 23:08:51 +00:00
|
|
|
version = "1.18.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
|
|
|
src = fetchurl {
|
2021-03-09 03:18:52 +00:00
|
|
|
url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz";
|
2021-05-20 23:08:51 +00:00
|
|
|
sha256 = "08w3ivbc6n4vdds2ap6q7l8zdk9if8417nznyqidf0adm0lk5r99";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
./fix_pkgconfig_includedir.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
meson
|
|
|
|
ninja
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
python3
|
|
|
|
gettext
|
|
|
|
orc
|
|
|
|
glib
|
|
|
|
gobject-introspection
|
|
|
|
|
|
|
|
# docs
|
2020-11-12 09:05:59 +00:00
|
|
|
# TODO add hotdoc here
|
2020-04-24 23:36:52 +00:00
|
|
|
] ++ lib.optional enableWayland wayland;
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
orc
|
|
|
|
libtheora
|
|
|
|
libintl
|
|
|
|
libopus
|
|
|
|
isocodes
|
|
|
|
libpng
|
|
|
|
libjpeg
|
|
|
|
tremor
|
|
|
|
libGL
|
|
|
|
] ++ lib.optional (!stdenv.isDarwin) [
|
|
|
|
libvisual
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
pango
|
2021-03-09 03:18:52 +00:00
|
|
|
OpenGL
|
2020-04-24 23:36:52 +00:00
|
|
|
] ++ lib.optionals enableAlsa [
|
2021-06-28 23:13:55 +00:00
|
|
|
alsa-lib
|
2020-04-24 23:36:52 +00:00
|
|
|
] ++ lib.optionals enableX11 [
|
2020-11-12 09:05:59 +00:00
|
|
|
libXext
|
2020-04-24 23:36:52 +00:00
|
|
|
libXv
|
|
|
|
pango
|
|
|
|
] ++ lib.optionals enableWayland [
|
|
|
|
wayland
|
|
|
|
wayland-protocols
|
2021-03-09 03:18:52 +00:00
|
|
|
] ++ lib.optional enableCocoa Cocoa
|
2020-04-24 23:36:52 +00:00
|
|
|
++ lib.optional enableCdparanoia cdparanoia;
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
gstreamer
|
|
|
|
];
|
|
|
|
|
|
|
|
mesonFlags = [
|
|
|
|
"-Dexamples=disabled" # requires many dependencies and probably not useful for our users
|
2020-11-12 09:05:59 +00:00
|
|
|
"-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing
|
2020-04-24 23:36:52 +00:00
|
|
|
"-Dgl-graphene=disabled" # not packaged in nixpkgs as of writing
|
|
|
|
# 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")}"
|
2021-07-21 07:28:18 +00:00
|
|
|
] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
|
|
|
|
"-Dintrospection=disabled"
|
2020-04-24 23:36:52 +00:00
|
|
|
]
|
|
|
|
++ 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.optionals stdenv.isDarwin [
|
|
|
|
"-Dlibvisual=disabled"
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
2020-11-12 09:05:59 +00:00
|
|
|
patchShebangs \
|
|
|
|
common/scangobj-merge.py \
|
|
|
|
scripts/extract-release-date-from-doap-file.py
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# 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";
|
|
|
|
license = licenses.lgpl2Plus;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ matthewbauer ];
|
|
|
|
};
|
|
|
|
}
|