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
|
|
|
|
, python3
|
|
|
|
, gstreamer
|
2023-04-29 16:46:19 +00:00
|
|
|
, graphene
|
2020-04-24 23:36:52 +00:00
|
|
|
, orc
|
|
|
|
, pango
|
|
|
|
, libtheora
|
|
|
|
, libintl
|
|
|
|
, libopus
|
|
|
|
, isocodes
|
|
|
|
, libjpeg
|
|
|
|
, libpng
|
|
|
|
, libvisual
|
|
|
|
, tremor # provides 'virbisidec'
|
|
|
|
, libGL
|
2022-08-12 12:06:08 +00:00
|
|
|
, gobject-introspection
|
2020-04-24 23:36:52 +00:00
|
|
|
, enableX11 ? stdenv.isLinux
|
2020-11-12 09:05:59 +00:00
|
|
|
, libXext
|
2023-04-29 16:46:19 +00:00
|
|
|
, libXi
|
|
|
|
, libXv
|
2024-05-15 15:35:15 +00:00
|
|
|
, libdrm
|
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
|
2023-04-29 16:46:19 +00:00
|
|
|
# TODO: fix once x86_64-darwin sdk updated
|
|
|
|
, enableCocoa ? (stdenv.isDarwin && stdenv.isAarch64)
|
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
|
2023-02-16 17:41:37 +00:00
|
|
|
, testers
|
2023-04-29 16:46:19 +00:00
|
|
|
# Checks meson.is_cross_build(), so even canExecute isn't enough.
|
|
|
|
, enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform
|
|
|
|
, hotdoc
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "gst-plugins-base";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "1.24.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
src = let
|
|
|
|
inherit (finalAttrs) pname version;
|
|
|
|
in fetchurl {
|
2021-03-09 03:18:52 +00:00
|
|
|
url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-KC8cyAZcm2Lragog+56DKPjlKW3yRYtyNtqnKcQa52k=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
strictDeps = true;
|
2022-08-12 12:06:08 +00:00
|
|
|
depsBuildBuild = [
|
|
|
|
pkg-config
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
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
|
2022-05-18 14:49:53 +00:00
|
|
|
gstreamer
|
|
|
|
gobject-introspection
|
2023-04-29 16:46:19 +00:00
|
|
|
] ++ lib.optionals enableDocumentation [
|
|
|
|
hotdoc
|
|
|
|
] ++ lib.optionals enableWayland [
|
|
|
|
wayland
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2023-04-29 16:46:19 +00:00
|
|
|
graphene
|
2020-04-24 23:36:52 +00:00
|
|
|
orc
|
|
|
|
libtheora
|
|
|
|
libintl
|
|
|
|
libopus
|
|
|
|
isocodes
|
|
|
|
libpng
|
|
|
|
libjpeg
|
|
|
|
tremor
|
2023-01-20 10:41:00 +00:00
|
|
|
pango
|
2022-10-30 15:09:59 +00:00
|
|
|
] ++ lib.optionals (!stdenv.isDarwin) [
|
2024-05-15 15:35:15 +00:00
|
|
|
libdrm
|
2023-07-15 17:15:38 +00:00
|
|
|
libGL
|
2020-04-24 23:36:52 +00:00
|
|
|
libvisual
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
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
|
2023-04-29 16:46:19 +00:00
|
|
|
libXi
|
2020-04-24 23:36:52 +00:00
|
|
|
libXv
|
|
|
|
] ++ 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
|
2024-05-15 15:35:15 +00:00
|
|
|
] ++ lib.optionals (!stdenv.isDarwin) [
|
|
|
|
libdrm
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
mesonFlags = [
|
|
|
|
"-Dexamples=disabled" # requires many dependencies and probably not useful for our users
|
|
|
|
# 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")}"
|
2023-04-29 16:46:19 +00:00
|
|
|
(lib.mesonEnable "doc" enableDocumentation)
|
2021-07-21 07:28:18 +00:00
|
|
|
] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
|
2021-09-18 10:52:07 +00:00
|
|
|
"-Dtests=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 [
|
2024-05-15 15:35:15 +00:00
|
|
|
"-Ddrm=disabled"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-Dlibvisual=disabled"
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
2020-11-12 09:05:59 +00:00
|
|
|
patchShebangs \
|
2022-02-10 20:34:41 +00:00
|
|
|
scripts/meson-pkg-config-file-fixup.py \
|
2020-11-12 09:05:59 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Base GStreamer plug-ins and helper libraries";
|
|
|
|
homepage = "https://gstreamer.freedesktop.org";
|
|
|
|
license = licenses.lgpl2Plus;
|
2023-02-16 17:41:37 +00:00
|
|
|
pkgConfigModules = [
|
|
|
|
"gstreamer-audio-1.0"
|
|
|
|
"gstreamer-base-1.0"
|
|
|
|
"gstreamer-net-1.0"
|
|
|
|
"gstreamer-video-1.0"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
2023-07-15 17:15:38 +00:00
|
|
|
maintainers = with maintainers; [ matthewbauer lilyinstarlight ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2023-02-16 17:41:37 +00:00
|
|
|
})
|