2019-10-02 18:03:44 +01:00
|
|
|
{ stdenv
|
|
|
|
, fetchurl
|
|
|
|
, lib
|
2021-01-19 06:50:56 +00:00
|
|
|
, pkg-config
|
2019-10-02 18:03:44 +01:00
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, gettext
|
|
|
|
, gobject-introspection
|
|
|
|
, python3
|
|
|
|
, gstreamer
|
|
|
|
, orc
|
|
|
|
, pango
|
|
|
|
, libtheora
|
|
|
|
, libintl
|
|
|
|
, libopus
|
2019-01-21 01:48:04 +00:00
|
|
|
, isocodes
|
|
|
|
, libjpeg
|
2019-05-01 17:44:08 +01:00
|
|
|
, libpng
|
2019-01-21 01:48:04 +00:00
|
|
|
, libvisual
|
|
|
|
, tremor # provides 'virbisidec'
|
2019-08-18 20:18:40 +01:00
|
|
|
, libGL
|
2019-10-02 18:03:44 +01:00
|
|
|
, enableX11 ? stdenv.isLinux
|
|
|
|
, libXv
|
2020-10-29 11:23:24 +00:00
|
|
|
, libXext
|
2019-10-02 18:03:44 +01:00
|
|
|
, enableWayland ? stdenv.isLinux
|
|
|
|
, wayland
|
2019-12-05 13:18:57 +00:00
|
|
|
, wayland-protocols
|
2019-10-02 18:03:44 +01:00
|
|
|
, enableAlsa ? stdenv.isLinux
|
|
|
|
, alsaLib
|
2019-05-01 17:44:08 +01: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.
|
2019-10-02 18:03:44 +01:00
|
|
|
, enableCocoa ? false
|
2021-03-04 20:01:51 +00:00
|
|
|
, Cocoa
|
|
|
|
, OpenGL
|
2019-05-01 17:44:08 +01:00
|
|
|
, enableGl ? (enableX11 || enableWayland || enableCocoa)
|
2019-10-02 18:03:44 +01:00
|
|
|
, enableCdparanoia ? (!stdenv.isDarwin)
|
|
|
|
, cdparanoia
|
2020-02-25 02:47:55 +00:00
|
|
|
, glib
|
2019-10-02 18:03:44 +01:00
|
|
|
}:
|
2013-12-23 15:36:37 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "gst-plugins-base";
|
2020-12-07 01:15:03 +00:00
|
|
|
version = "1.18.2";
|
2013-12-23 15:36:37 +00:00
|
|
|
|
2019-10-02 18:03:44 +01:00
|
|
|
outputs = [ "out" "dev" ];
|
2013-12-23 15:36:37 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-03-04 20:01:51 +00:00
|
|
|
url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz";
|
2020-12-07 01:15:03 +00:00
|
|
|
sha256 = "1b05kg46azrxxvq42c71071lfsnc34pw4vynnkczdqi6g0gzn16x";
|
2013-12-23 15:36:37 +00:00
|
|
|
};
|
|
|
|
|
2019-10-02 18:03:44 +01:00
|
|
|
patches = [
|
|
|
|
./fix_pkgconfig_includedir.patch
|
|
|
|
];
|
2016-04-24 13:39:30 +01:00
|
|
|
|
2019-01-21 01:48:04 +00:00
|
|
|
nativeBuildInputs = [
|
2019-10-02 18:03:44 +01:00
|
|
|
meson
|
|
|
|
ninja
|
2021-01-19 06:50:56 +00:00
|
|
|
pkg-config
|
2019-10-02 18:03:44 +01:00
|
|
|
python3
|
|
|
|
gettext
|
2020-02-25 02:47:55 +00:00
|
|
|
orc
|
|
|
|
glib
|
2019-10-02 18:03:44 +01:00
|
|
|
gobject-introspection
|
|
|
|
|
|
|
|
# docs
|
2020-10-01 23:31:58 +01:00
|
|
|
# TODO add hotdoc here
|
2020-02-25 02:47:55 +00:00
|
|
|
] ++ lib.optional enableWayland wayland;
|
2013-12-23 15:36:37 +00:00
|
|
|
|
2019-10-02 18:03:44 +01:00
|
|
|
buildInputs = [
|
|
|
|
orc
|
|
|
|
libtheora
|
|
|
|
libintl
|
|
|
|
libopus
|
|
|
|
isocodes
|
2019-05-01 17:44:08 +01:00
|
|
|
libpng
|
2019-10-02 18:03:44 +01:00
|
|
|
libjpeg
|
|
|
|
tremor
|
|
|
|
libGL
|
2019-05-01 17:44:08 +01:00
|
|
|
] ++ lib.optional (!stdenv.isDarwin) [
|
|
|
|
libvisual
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
pango
|
2021-03-04 20:01:51 +00:00
|
|
|
OpenGL
|
2019-12-05 13:18:57 +00:00
|
|
|
] ++ lib.optionals enableAlsa [
|
|
|
|
alsaLib
|
|
|
|
] ++ lib.optionals enableX11 [
|
2020-10-29 11:23:24 +00:00
|
|
|
libXext
|
2019-12-05 13:18:57 +00:00
|
|
|
libXv
|
|
|
|
pango
|
|
|
|
] ++ lib.optionals enableWayland [
|
|
|
|
wayland
|
|
|
|
wayland-protocols
|
2021-03-04 20:01:51 +00:00
|
|
|
] ++ lib.optional enableCocoa Cocoa
|
2019-10-02 18:03:44 +01:00
|
|
|
++ lib.optional enableCdparanoia cdparanoia;
|
2019-01-21 01:48:04 +00:00
|
|
|
|
2019-10-02 18:03:44 +01:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
gstreamer
|
|
|
|
];
|
2018-04-23 18:32:37 +01:00
|
|
|
|
2019-10-02 18:03:44 +01:00
|
|
|
mesonFlags = [
|
2019-01-21 01:48:04 +00:00
|
|
|
"-Dexamples=disabled" # requires many dependencies and probably not useful for our users
|
2020-10-01 23:31:58 +01:00
|
|
|
"-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing
|
2019-01-21 01:48:04 +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
|
2019-12-05 13:18:57 +00:00
|
|
|
"-Dgl_winsys=${lib.concatStringsSep "," (lib.optional enableX11 "x11" ++ lib.optional enableWayland "wayland" ++ lib.optional enableCocoa "cocoa")}"
|
2019-01-21 01:48:04 +00:00
|
|
|
]
|
|
|
|
++ lib.optional (!enableX11) "-Dx11=disabled"
|
|
|
|
# TODO How to disable Wayland?
|
2019-05-01 17:44:08 +01:00
|
|
|
++ lib.optional (!enableGl) "-Dgl=disabled"
|
2019-01-21 01:48:04 +00:00
|
|
|
++ lib.optional (!enableAlsa) "-Dalsa=disabled"
|
2019-05-01 17:44:08 +01:00
|
|
|
++ lib.optional (!enableCdparanoia) "-Dcdparanoia=disabled"
|
|
|
|
++ lib.optionals stdenv.isDarwin [
|
|
|
|
"-Dlibvisual=disabled"
|
|
|
|
];
|
2014-08-12 21:17:38 +01:00
|
|
|
|
2018-04-23 18:32:37 +01:00
|
|
|
postPatch = ''
|
2020-10-01 23:31:58 +01:00
|
|
|
patchShebangs \
|
|
|
|
common/scangobj-merge.py \
|
|
|
|
scripts/extract-release-date-from-doap-file.py
|
2018-03-31 14:16:56 +01:00
|
|
|
'';
|
2015-04-09 02:47:56 +01:00
|
|
|
|
2019-05-01 17:44:08 +01:00
|
|
|
# This package has some `_("string literal")` string formats
|
|
|
|
# that trip up clang with format security enabled.
|
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
|
2018-08-08 19:33:51 +01:00
|
|
|
doCheck = false; # fails, wants DRI access for OpenGL
|
|
|
|
|
2019-05-01 17:44:08 +01:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
2019-10-02 18:03:44 +01:00
|
|
|
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 ];
|
|
|
|
};
|
2013-12-23 15:36:37 +00:00
|
|
|
}
|