diff options
author | Mx Kookie <kookie@spacekookie.de> | 2020-10-31 19:35:09 +0100 |
---|---|---|
committer | Mx Kookie <kookie@spacekookie.de> | 2020-10-31 19:35:09 +0100 |
commit | c4625b175f8200f643fd6e11010932ea44c78433 (patch) | |
tree | bce3f89888c8ac3991fa5569a878a9eab6801ccc /infra/libkookie/nixpkgs/pkgs/development/libraries/gstreamer/base | |
parent | 49f735974dd103039ddc4cb576bb76555164a9e7 (diff) | |
parent | d661aa56a8843e991261510c1bb28fdc2f6975ae (diff) |
Add 'infra/libkookie/' from commit 'd661aa56a8843e991261510c1bb28fdc2f6975ae'
git-subtree-dir: infra/libkookie
git-subtree-mainline: 49f735974dd103039ddc4cb576bb76555164a9e7
git-subtree-split: d661aa56a8843e991261510c1bb28fdc2f6975ae
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/development/libraries/gstreamer/base')
-rw-r--r-- | infra/libkookie/nixpkgs/pkgs/development/libraries/gstreamer/base/default.nix | 161 | ||||
-rw-r--r-- | infra/libkookie/nixpkgs/pkgs/development/libraries/gstreamer/base/fix_pkgconfig_includedir.patch | 15 |
2 files changed, 176 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/development/libraries/gstreamer/base/default.nix b/infra/libkookie/nixpkgs/pkgs/development/libraries/gstreamer/base/default.nix new file mode 100644 index 000000000000..79405e5077e0 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/development/libraries/gstreamer/base/default.nix @@ -0,0 +1,161 @@ +{ stdenv +, fetchurl +, lib +, pkgconfig +, meson +, ninja +, gettext +, gobject-introspection +, python3 +, gstreamer +, orc +, pango +, libtheora +, libintl +, libopus +, isocodes +, libjpeg +, libpng +, libvisual +, tremor # provides 'virbisidec' +, libGL +, gtk-doc +, docbook_xsl +, docbook_xml_dtd_43 +, enableX11 ? stdenv.isLinux +, libXv +, enableWayland ? stdenv.isLinux +, wayland +, wayland-protocols +, 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 +, glib +}: + +stdenv.mkDerivation rec { + pname = "gst-plugins-base"; + version = "1.16.2"; + + outputs = [ "out" "dev" ]; + + src = fetchurl { + url = "${meta.homepage}/src/${pname}/${pname}-${version}.tar.xz"; + sha256 = "0sl1hxlyq46r02k7z70v09vx1gi4rcypqmzra9jid93lzvi76gmi"; + }; + + patches = [ + ./fix_pkgconfig_includedir.patch + ]; + + nativeBuildInputs = [ + meson + ninja + pkgconfig + python3 + gettext + orc + glib + gobject-introspection + + # docs + gtk-doc + docbook_xsl + docbook_xml_dtd_43 + ] ++ lib.optional enableWayland wayland; + + buildInputs = [ + orc + libtheora + libintl + libopus + isocodes + libpng + libjpeg + tremor + libGL + ] ++ lib.optional (!stdenv.isDarwin) [ + libvisual + ] ++ lib.optionals stdenv.isDarwin [ + pango + darwin.apple_sdk.frameworks.OpenGL + ] ++ lib.optionals enableAlsa [ + alsaLib + ] ++ lib.optionals enableX11 [ + libXv + pango + ] ++ lib.optionals enableWayland [ + wayland + wayland-protocols + ] ++ lib.optional enableCocoa darwin.apple_sdk.frameworks.Cocoa + ++ lib.optional enableCdparanoia cdparanoia; + + propagatedBuildInputs = [ + gstreamer + ]; + + mesonFlags = [ + "-Dexamples=disabled" # requires many dependencies and probably not useful for our users + "-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")}" + # We must currently disable gtk_doc API docs generation, + # because it is not compatible with some features being disabled. + # See for example + # https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/564 + # for it failing because some Wayland symbols are missing. + # This problem appeared between 1.15.1 and 1.16.0. + # In 1.18 they should switch to hotdoc, which should make this issue irrelevant. + "-Dgtk_doc=disabled" + ] + ++ 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 = '' + 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"; + license = licenses.lgpl2Plus; + platforms = platforms.unix; + maintainers = with maintainers; [ matthewbauer ]; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/development/libraries/gstreamer/base/fix_pkgconfig_includedir.patch b/infra/libkookie/nixpkgs/pkgs/development/libraries/gstreamer/base/fix_pkgconfig_includedir.patch new file mode 100644 index 000000000000..04486a4647f9 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/development/libraries/gstreamer/base/fix_pkgconfig_includedir.patch @@ -0,0 +1,15 @@ +diff --git a/pkgconfig/meson.build b/pkgconfig/meson.build +index 04abfbee5..88c86b431 100644 +--- a/pkgconfig/meson.build ++++ b/pkgconfig/meson.build +@@ -2,8 +2,8 @@ pkgconf = configuration_data() + + pkgconf.set('prefix', get_option('prefix')) + pkgconf.set('exec_prefix', '${prefix}') +-pkgconf.set('libdir', '${prefix}/@0@'.format(get_option('libdir'))) +-pkgconf.set('includedir', '${prefix}/@0@'.format(get_option('includedir'))) ++pkgconf.set('libdir', join_paths(get_option('prefix'), get_option('libdir'))) ++pkgconf.set('includedir', join_paths(get_option('prefix'), get_option('includedir'))) + pkgconf.set('GST_API_VERSION', api_version) + pkgconf.set('VERSION', gst_version) + pkgconf.set('LIBM', libm.found() ? '-lm' : '') |