about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/gstreamer
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/gstreamer')
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/bad/default.nix309
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/bad/fix_pkgconfig_includedir.patch15
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/base/default.nix153
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/base/fix_pkgconfig_includedir.patch15
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/core/default.nix114
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/core/fix_pkgconfig_includedir.patch17
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/core/setup-hook.sh9
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/devtools/default.nix62
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/devtools/fix_pkgconfig_includedir.patch15
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/ges/default.nix75
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/ges/fix_pkgconfig_includedir.patch15
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/good/default.nix165
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/gstreamermm/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/libav/default.nix55
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/rtsp-server/default.nix74
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/rtsp-server/fix_pkgconfig_includedir.patch15
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/ugly/default.nix81
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/vaapi/default.nix85
19 files changed, 1337 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/bad/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/bad/default.nix
new file mode 100644
index 000000000000..49343e79c878
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/bad/default.nix
@@ -0,0 +1,309 @@
+{ stdenv
+, fetchurl
+, fetchpatch
+, meson
+, ninja
+, gettext
+, config
+, pkgconfig
+, python3
+, gst-plugins-base
+, orc
+, gobject-introspection
+, enableZbar ? false
+, faacSupport ? false
+, faac ? null
+, faad2
+, libass
+, libkate
+, libmms
+, lrdf
+, ladspaH
+, libnice
+, webrtc-audio-processing
+, lilv
+, lv2
+, serd
+, sord
+, sratom
+, libbs2b
+, libmodplug
+, mpeg2dec
+, libmicrodns
+, openjpeg
+, libopus
+, librsvg
+, bluez
+, chromaprint
+, curl
+, darwin
+, directfb
+, fdk_aac
+, flite
+, gsm
+, libaom
+, libdc1394
+, libde265
+, libdrm
+, libdvdnav
+, libdvdread
+, libgudev
+, libofa
+, libsndfile
+, libusb1
+, neon
+, openal
+, opencv4
+, openexr
+, openh264
+, pango
+, rtmpdump
+, sbc
+, soundtouch
+, spandsp
+, srtp
+, zbar
+, wayland-protocols
+, wildmidi
+, fluidsynth
+, libva
+, libvdpau
+, wayland
+, libwebp
+, xvidcore
+, gnutls
+, mjpegtools
+, libGLU
+, libGL
+, libintl
+, libgme
+, openssl
+, x265
+, libxml2
+, srt
+}:
+
+assert faacSupport -> faac != null;
+
+let
+  inherit (stdenv.lib) optional optionals;
+in stdenv.mkDerivation rec {
+  pname = "gst-plugins-bad";
+  version = "1.18.2";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "${meta.homepage}/src/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "06ildd4rl6cynirv3p00d2ddf5is9svj4i7mkahldzhq24pq5mca";
+  };
+
+  patches = [
+    ./fix_pkgconfig_includedir.patch
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkgconfig
+    orc # for orcc
+    python3
+    gettext
+    gobject-introspection
+  ] ++ optionals stdenv.isLinux [
+    wayland # for wayland-scanner
+  ];
+
+  buildInputs = [
+    gst-plugins-base
+    orc
+    gobject-introspection
+    faad2
+    libass
+    libkate
+    libmms
+    webrtc-audio-processing # webrtc
+    libbs2b
+    libmodplug
+    mpeg2dec
+    libmicrodns
+    openjpeg
+    libopus
+    librsvg
+    curl.dev
+    fdk_aac
+    gsm
+    libaom
+    libdc1394
+    libde265
+    libdvdnav
+    libdvdread
+    libsndfile
+    libusb1
+    mjpegtools
+    neon
+    openal
+    opencv4
+    openexr
+    openh264
+    rtmpdump
+    pango
+    soundtouch
+    srtp
+    fluidsynth
+    libvdpau
+    libwebp
+    xvidcore
+    gnutls
+    libGL
+    libGLU
+    libgme
+    openssl
+    x265
+    libxml2
+    libintl
+    srt
+  ] ++ optionals enableZbar [
+    zbar
+  ] ++ optionals faacSupport [
+    faac
+  ] ++ optionals stdenv.isLinux [
+    bluez
+    libva # vaapi requires libva -> libdrm -> libpciaccess, which is Linux-only in nixpkgs
+    wayland
+    wayland-protocols
+  ] ++ optionals (!stdenv.isDarwin) [
+    # wildmidi requires apple's OpenAL
+    # TODO: package apple's OpenAL, fix wildmidi, include on Darwin
+    wildmidi
+    # TODO: mjpegtools uint64_t is not compatible with guint64 on Darwin
+    mjpegtools
+
+    chromaprint
+    directfb
+    flite
+    libdrm
+    libgudev
+    libnice
+    libofa
+    sbc
+    spandsp
+
+    # ladspa plug-in
+    ladspaH
+    lrdf # TODO: make build on Darwin
+
+    # lv2 plug-in
+    lilv
+    lv2
+    serd
+    sord
+    sratom
+  ] ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
+    # For unknown reasons the order is important, e.g. if
+    # VideoToolbox is last, we get:
+    #     fatal error: 'VideoToolbox/VideoToolbox.h' file not found
+    VideoToolbox
+    AudioToolbox
+    AVFoundation
+    CoreMedia
+    CoreVideo
+    Foundation
+    MediaToolbox
+  ]);
+
+  mesonFlags = [
+    "-Dexamples=disabled" # requires many dependencies and probably not useful for our users
+    "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing
+
+    "-Davtp=disabled"
+    "-Ddts=disabled" # required `libdca` library not packaged in nixpkgs as of writing, and marked as "BIG FAT WARNING: libdca is still in early development"
+    "-Dzbar=${if enableZbar then "enabled" else "disabled"}"
+    "-Dfaac=${if faacSupport then "enabled" else "disabled"}"
+    "-Diqa=disabled" # required `dssim` library not packaging in nixpkgs as of writing
+    "-Dmagicleap=disabled" # required `ml_audio` library not packaged in nixpkgs as of writing
+    "-Dmsdk=disabled" # not packaged in nixpkgs as of writing / no Windows support
+    # As of writing, with `libmpcdec` in `buildInputs` we get
+    #   "Could not find libmpcdec header files, but Musepack was enabled via options"
+    # This is likely because nixpkgs has the header in libmpc/mpcdec.h
+    # instead of mpc/mpcdec.h, like Arch does. The situation is not trivial.
+    # There are apparently 2 things called `libmpcdec` from the same author:
+    #   * http://svn.musepack.net/libmpcdec/trunk/src/
+    #   * http://svn.musepack.net/libmpc/trunk/include/mpc/
+    # Fixing it likely requires to first figure out with upstream which one
+    # is needed, and then patching upstream to find it (though it probably
+    # already works on Arch?).
+    "-Dmusepack=disabled"
+    "-Dopenmpt=disabled" # `libopenmpt` not packaged in nixpkgs as of writing
+    "-Dopenni2=disabled" # not packaged in nixpkgs as of writing
+    "-Dopensles=disabled" # not packaged in nixpkgs as of writing
+    "-Dsctp=disabled" # required `usrsctp` library not packaged in nixpkgs as of writing
+    "-Dsvthevcenc=disabled" # required `SvtHevcEnc` library not packaged in nixpkgs as of writing
+    "-Dteletext=disabled" # required `zvbi` library not packaged in nixpkgs as of writing
+    "-Dtinyalsa=disabled" # not packaged in nixpkgs as of writing
+    "-Dvoaacenc=disabled" # required `vo-aacenc` library not packaged in nixpkgs as of writing
+    "-Dvoamrwbenc=disabled" # required `vo-amrwbenc` library not packaged in nixpkgs as of writing
+    "-Dvulkan=disabled" # Linux-only, and we haven't figured out yet which of the vulkan nixpkgs it needs
+    "-Dwasapi=disabled" # not packaged in nixpkgs as of writing / no Windows support
+    "-Dwasapi2=disabled" # not packaged in nixpkgs as of writing / no Windows support
+    "-Dwpe=disabled" # required `wpe-webkit` library not packaged in nixpkgs as of writing
+    "-Dzxing=disabled" # required `zxing-cpp` library not packaged in nixpkgs as of writing
+  ]
+  ++ optionals (!stdenv.isLinux) [
+    "-Dva=disabled" # see comment on `libva` in `buildInputs`
+  ]
+  ++ optionals stdenv.isDarwin [
+    "-Dbluez=disabled"
+    "-Dchromaprint=disabled"
+    "-Ddirectfb=disabled"
+    "-Dflite=disabled"
+    "-Dkms=disabled" # renders to libdrm output
+    "-Dofa=disabled"
+    "-Dlv2=disabled"
+    "-Dsbc=disabled"
+    "-Dspandsp=disabled"
+    "-Ddvb=disabled"
+    "-Dfbdev=disabled"
+    "-Duvch264=disabled" # requires gudev
+    "-Dv4l2codecs=disabled" # requires gudev
+    "-Dladspa=disabled" # requires lrdf
+    "-Dwebrtc=disabled" # requires libnice, which as of writing doesn't work on Darwin in nixpkgs
+    "-Dwildmidi=disabled" # see dependencies above
+  ] ++ optionals (!gst-plugins-base.glEnabled) [
+    "-Dgl=disabled"]
+  ++ optionals (!gst-plugins-base.waylandEnabled) [
+    "-Dwayland=disabled"
+  ] ++ optionals (!gst-plugins-base.glEnabled) [
+    # `applemedia/videotexturecache.h` requires `gst/gl/gl.h`,
+    # but its meson build system does not declare the dependency.
+    "-Dapplemedia=disabled"
+  ];
+
+  # Argument list too long
+  strictDeps = true;
+
+  postPatch = ''
+    patchShebangs \
+      scripts/extract-release-date-from-doap-file.py
+  '';
+
+  # This package has some `_("string literal")` string formats
+  # that trip up clang with format security enabled.
+  hardeningDisable = [ "format" ];
+
+  doCheck = false; # fails 20 out of 58 tests, expensive
+
+  meta = with stdenv.lib; {
+    description = "GStreamer Bad Plugins";
+    homepage = "https://gstreamer.freedesktop.org";
+    longDescription = ''
+      a set of plug-ins that aren't up to par compared to the
+      rest.  They might be close to being good quality, but they're missing
+      something - be it a good code review, some documentation, a set of tests,
+      a real live maintainer, or some actual wide use.
+    '';
+    license = licenses.lgpl2Plus;
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ matthewbauer ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/bad/fix_pkgconfig_includedir.patch b/nixpkgs/pkgs/development/libraries/gstreamer/bad/fix_pkgconfig_includedir.patch
new file mode 100644
index 000000000000..c687fffc9c08
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/bad/fix_pkgconfig_includedir.patch
@@ -0,0 +1,15 @@
+diff --git a/pkgconfig/meson.build b/pkgconfig/meson.build
+index 271f327f3..7e2afa754 100644
+--- a/pkgconfig/meson.build
++++ b/pkgconfig/meson.build
+@@ -2,8 +2,8 @@ pkgconf = configuration_data()
+ 
+ pkgconf.set('prefix', join_paths(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)
+ 
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/base/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/base/default.nix
new file mode 100644
index 000000000000..4728e49c5162
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/base/default.nix
@@ -0,0 +1,153 @@
+{ stdenv
+, fetchurl
+, lib
+, pkgconfig
+, meson
+, ninja
+, gettext
+, gobject-introspection
+, python3
+, gstreamer
+, orc
+, pango
+, libtheora
+, libintl
+, libopus
+, isocodes
+, libjpeg
+, libpng
+, libvisual
+, tremor # provides 'virbisidec'
+, libGL
+, enableX11 ? stdenv.isLinux
+, libXv
+, libXext
+, 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.18.2";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "${meta.homepage}/src/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "1b05kg46azrxxvq42c71071lfsnc34pw4vynnkczdqi6g0gzn16x";
+  };
+
+  patches = [
+    ./fix_pkgconfig_includedir.patch
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkgconfig
+    python3
+    gettext
+    orc
+    glib
+    gobject-introspection
+
+    # docs
+    # TODO add hotdoc here
+  ] ++ 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 [
+    libXext
+    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
+    "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing
+    "-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")}"
+  ]
+  ++ 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 \
+      scripts/extract-release-date-from-doap-file.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/nixpkgs/pkgs/development/libraries/gstreamer/base/fix_pkgconfig_includedir.patch b/nixpkgs/pkgs/development/libraries/gstreamer/base/fix_pkgconfig_includedir.patch
new file mode 100644
index 000000000000..04486a4647f9
--- /dev/null
+++ b/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' : '')
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/core/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/core/default.nix
new file mode 100644
index 000000000000..0d33d28196ca
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/core/default.nix
@@ -0,0 +1,114 @@
+{ stdenv
+, fetchurl
+, meson
+, ninja
+, pkgconfig
+, gettext
+, gobject-introspection
+, bison
+, flex
+, python3
+, glib
+, makeWrapper
+, libcap
+, libunwind
+, darwin
+, elfutils # for libdw
+, bash-completion
+, lib
+, CoreServices
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gstreamer";
+  version = "1.18.2";
+
+  outputs = [
+    "out"
+    "dev"
+    # "devdoc" # disabled until `hotdoc` is packaged in nixpkgs, see:
+    # - https://github.com/NixOS/nixpkgs/pull/98767
+    # - https://github.com/NixOS/nixpkgs/issues/98769#issuecomment-702296551
+  ];
+  outputBin = "dev";
+
+  src = fetchurl {
+    url = "${meta.homepage}/src/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "0ijlmvr660m8zn09xlmnq1ajrziqsivp2hig5a9mabhcjx7ypkb6";
+  };
+
+  patches = [
+    ./fix_pkgconfig_includedir.patch
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkgconfig
+    gettext
+    bison
+    flex
+    python3
+    makeWrapper
+    glib
+    gobject-introspection
+    bash-completion
+
+    # documentation
+    # TODO add hotdoc here
+  ];
+
+  buildInputs = [
+    bash-completion
+  ] ++ lib.optionals stdenv.isLinux [
+    libcap
+    libunwind
+    elfutils
+  ] ++ lib.optionals stdenv.isDarwin [
+    CoreServices
+  ];
+
+  propagatedBuildInputs = [
+    glib
+  ];
+
+  mesonFlags = [
+    "-Ddbghelp=disabled" # not needed as we already provide libunwind and libdw, and dbghelp is a fallback to those
+    "-Dexamples=disabled" # requires many dependencies and probably not useful for our users
+    "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing
+  ] ++ lib.optionals stdenv.isDarwin [
+    # darwin.libunwind doesn't have pkgconfig definitions so meson doesn't detect it.
+    "-Dlibunwind=disabled"
+    "-Dlibdw=disabled"
+  ];
+
+  postPatch = ''
+    patchShebangs \
+      gst/parse/get_flex_version.py \
+      gst/parse/gen_grammar.py.in \
+      gst/parse/gen_lex.py.in \
+      libs/gst/helpers/ptp_helper_post_install.sh \
+      scripts/extract-release-date-from-doap-file.py
+  '';
+
+  postInstall = ''
+    for prog in "$dev/bin/"*; do
+        # We can't use --suffix here due to quoting so we craft the export command by hand
+        wrapProgram "$prog" --run 'export GST_PLUGIN_SYSTEM_PATH_1_0=$GST_PLUGIN_SYSTEM_PATH_1_0''${GST_PLUGIN_SYSTEM_PATH_1_0:+:}$(unset _tmp; for profile in $NIX_PROFILES; do _tmp="$profile/lib/gstreamer-1.0''${_tmp:+:}$_tmp"; done; printf '%s' "$_tmp")'
+    done
+  '';
+
+  preFixup = ''
+    moveToOutput "share/bash-completion" "$dev"
+  '';
+
+  setupHook = ./setup-hook.sh;
+
+  meta = with lib ;{
+    description = "Open source multimedia framework";
+    homepage = "https://gstreamer.freedesktop.org";
+    license = licenses.lgpl2Plus;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ ttuegel matthewbauer ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/core/fix_pkgconfig_includedir.patch b/nixpkgs/pkgs/development/libraries/gstreamer/core/fix_pkgconfig_includedir.patch
new file mode 100644
index 000000000000..db1684269350
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/core/fix_pkgconfig_includedir.patch
@@ -0,0 +1,17 @@
+diff --git a/pkgconfig/meson.build b/pkgconfig/meson.build
+index edb0586c2..7ed46dfce 100644
+--- a/pkgconfig/meson.build
++++ b/pkgconfig/meson.build
+@@ -2,8 +2,8 @@ pkgconf = configuration_data()
+ 
+ pkgconf.set('prefix', join_paths(get_option('prefix')))
+ pkgconf.set('exec_prefix', '${prefix}')
+-pkgconf.set('libdir', '${prefix}/@0@'.format(get_option('libdir')))
+-pkgconf.set('libexecdir', '${prefix}/@0@'.format(get_option('libexecdir')))
+-pkgconf.set('includedir', '${prefix}/@0@'.format(get_option('includedir')))
++pkgconf.set('libdir', join_paths(get_option('prefix'), get_option('libdir')))
++pkgconf.set('libexecdir', join_paths(get_option('prefix'), get_option('libexecdir')))
++pkgconf.set('includedir', join_paths(get_option('prefix'), get_option('includedir')))
+ pkgconf.set('GST_API_VERSION', apiversion)
+ pkgconf.set('VERSION', gst_version)
+ pkgconf.set('LIBM', mathlib.found() ? '-lm' : '')
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/core/setup-hook.sh b/nixpkgs/pkgs/development/libraries/gstreamer/core/setup-hook.sh
new file mode 100644
index 000000000000..026a4e5f55a0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/core/setup-hook.sh
@@ -0,0 +1,9 @@
+addGstreamer1LibPath () {
+    if test -d "$1/lib/gstreamer-1.0"
+    then
+        export GST_PLUGIN_SYSTEM_PATH_1_0="${GST_PLUGIN_SYSTEM_PATH_1_0-}${GST_PLUGIN_SYSTEM_PATH_1_0:+:}$1/lib/gstreamer-1.0"
+    fi
+}
+
+addEnvHooks "$hostOffset" addGstreamer1LibPath
+
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/default.nix
new file mode 100644
index 000000000000..1fdd67d836e7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/default.nix
@@ -0,0 +1,29 @@
+{ callPackage, CoreServices }:
+
+rec {
+  gstreamer = callPackage ./core { inherit CoreServices; };
+
+  gstreamermm = callPackage ./gstreamermm { };
+
+  gst-plugins-base = callPackage ./base { inherit gstreamer; };
+
+  gst-plugins-good = callPackage ./good { inherit gst-plugins-base; };
+
+  gst-plugins-bad = callPackage ./bad { inherit gst-plugins-base; };
+
+  gst-plugins-ugly = callPackage ./ugly { inherit gst-plugins-base; };
+
+  gst-rtsp-server = callPackage ./rtsp-server { inherit gst-plugins-base gst-plugins-bad; };
+
+  gst-libav = callPackage ./libav { inherit gst-plugins-base; };
+
+  gst-devtools = callPackage ./devtools { inherit gstreamer gst-plugins-base; };
+
+  gst-editing-services = callPackage ./ges { inherit gst-plugins-base gst-plugins-bad gst-devtools; };
+
+  gst-vaapi = callPackage ./vaapi {
+    inherit gst-plugins-base gstreamer gst-plugins-bad;
+  };
+
+  # note: gst-python is in ./python/default.nix - called under pythonPackages
+}
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/devtools/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/devtools/default.nix
new file mode 100644
index 000000000000..6743a5ecd675
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/devtools/default.nix
@@ -0,0 +1,62 @@
+{ stdenv
+, fetchurl
+, meson
+, ninja
+, pkgconfig
+, gstreamer
+, gst-plugins-base
+, python3
+, gobject-introspection
+, json-glib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gst-devtools";
+  version = "1.18.2";
+
+  src = fetchurl {
+    url = "${meta.homepage}/src/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "0mhascwvgirgh7b5dykpnk06f7f5g62gh3sl30i6kygiidqkv9vf";
+  };
+
+  patches = [
+    ./fix_pkgconfig_includedir.patch
+  ];
+
+  outputs = [
+    "out"
+    "dev"
+    # "devdoc" # disabled until `hotdoc` is packaged in nixpkgs
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkgconfig
+    gobject-introspection
+
+    # documentation
+    # TODO add hotdoc here
+  ];
+
+  buildInputs = [
+    python3
+    json-glib
+  ];
+
+  propagatedBuildInputs = [
+    gstreamer
+    gst-plugins-base
+  ];
+
+  mesonFlags = [
+    "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Integration testing infrastructure for the GStreamer framework";
+    homepage = "https://gstreamer.freedesktop.org";
+    license = licenses.lgpl2Plus;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/devtools/fix_pkgconfig_includedir.patch b/nixpkgs/pkgs/development/libraries/gstreamer/devtools/fix_pkgconfig_includedir.patch
new file mode 100644
index 000000000000..ff19c7cbf6f8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/devtools/fix_pkgconfig_includedir.patch
@@ -0,0 +1,15 @@
+diff --git a/validate/pkgconfig/meson.build b/validate/pkgconfig/meson.build
+index a612b21b..c017eaff 100644
+--- a/validate/pkgconfig/meson.build
++++ b/validate/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', apiversion)
+ pkgconf.set('VERSION', gst_version)
+
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/ges/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/ges/default.nix
new file mode 100644
index 000000000000..75e065e6d2be
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/ges/default.nix
@@ -0,0 +1,75 @@
+{ stdenv
+, fetchurl
+, meson
+, ninja
+, pkgconfig
+, python3
+, bash-completion
+, gst-plugins-base
+, gst-plugins-bad
+, gst-devtools
+, libxml2
+, flex
+, gettext
+, gobject-introspection
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gst-editing-services";
+  version = "1.18.2";
+
+  outputs = [
+    "out"
+    "dev"
+    # "devdoc" # disabled until `hotdoc` is packaged in nixpkgs
+  ];
+
+  src = fetchurl {
+    url = "${meta.homepage}/src/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "0pv2k8zlpn3vv2sdlspi3m63ixcwzi90pjly2ypbkg59ab97rb15";
+  };
+
+  patches = [
+    ./fix_pkgconfig_includedir.patch
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkgconfig
+    gettext
+    gobject-introspection
+    gst-devtools
+    python3
+    flex
+
+    # documentation
+    # TODO add hotdoc here
+  ];
+
+  buildInputs = [
+    bash-completion
+    libxml2
+  ];
+
+  propagatedBuildInputs = [
+    gst-plugins-base
+    gst-plugins-bad
+  ];
+
+  mesonFlags = [
+    "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing
+  ];
+
+  postPatch = ''
+    patchShebangs \
+      scripts/extract-release-date-from-doap-file.py
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Library for creation of audio/video non-linear editors";
+    homepage = "https://gstreamer.freedesktop.org";
+    license = licenses.lgpl2Plus;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/ges/fix_pkgconfig_includedir.patch b/nixpkgs/pkgs/development/libraries/gstreamer/ges/fix_pkgconfig_includedir.patch
new file mode 100644
index 000000000000..1e12f3bbfbea
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/ges/fix_pkgconfig_includedir.patch
@@ -0,0 +1,15 @@
+diff --git a/pkgconfig/meson.build b/pkgconfig/meson.build
+index a612b21b..c017eaff 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', apiversion)
+ pkgconf.set('VERSION', gst_version)
+ 
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/good/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/good/default.nix
new file mode 100644
index 000000000000..d4c3b99c7ca9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/good/default.nix
@@ -0,0 +1,165 @@
+{ stdenv
+, fetchurl
+, meson
+, nasm
+, ninja
+, pkgconfig
+, python3
+, gst-plugins-base
+, orc
+, bzip2
+, gettext
+, libv4l
+, libdv
+, libavc1394
+, libiec61883
+, libvpx
+, speex
+, flac
+, taglib
+, libshout
+, cairo
+, gdk-pixbuf
+, aalib
+, libcaca
+, libsoup
+, libpulseaudio
+, libintl
+, darwin
+, lame
+, mpg123
+, twolame
+, gtkSupport ? false, gtk3 ? null
+, raspiCameraSupport ? false, libraspberrypi ? null
+, enableJack ? true, libjack2
+, libXdamage
+, libXext
+, libXfixes
+, ncurses
+, wayland
+, wayland-protocols
+, xorg
+, libgudev
+, wavpack
+}:
+
+assert gtkSupport -> gtk3 != null;
+assert raspiCameraSupport -> ((libraspberrypi != null) && stdenv.isLinux && stdenv.isAarch64);
+
+let
+  inherit (stdenv.lib) optionals;
+in
+stdenv.mkDerivation rec {
+  pname = "gst-plugins-good";
+  version = "1.18.2";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "${meta.homepage}/src/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "1929nhjsvbl4bw37nfagnfsnxz737cm2x3ayz9ayrn9lwkfm45zp";
+  };
+
+  nativeBuildInputs = [
+    pkgconfig
+    python3
+    meson
+    ninja
+    gettext
+    nasm
+  ] ++ optionals stdenv.isLinux [
+    wayland-protocols
+  ];
+
+  buildInputs = [
+    gst-plugins-base
+    orc
+    bzip2
+    libdv
+    libvpx
+    speex
+    flac
+    taglib
+    cairo
+    gdk-pixbuf
+    aalib
+    libcaca
+    libsoup
+    libshout
+    lame
+    mpg123
+    twolame
+    libintl
+    libXdamage
+    libXext
+    libXfixes
+    ncurses
+    xorg.libXfixes
+    xorg.libXdamage
+    wavpack
+  ] ++ optionals raspiCameraSupport [
+    libraspberrypi
+  ] ++ optionals gtkSupport [
+    # for gtksink
+    gtk3
+  ] ++ optionals stdenv.isDarwin [
+    darwin.apple_sdk.frameworks.Cocoa
+  ] ++ optionals stdenv.isLinux [
+    libv4l
+    libpulseaudio
+    libavc1394
+    libiec61883
+    libgudev
+    wayland
+  ] ++ optionals enableJack [
+    libjack2
+  ];
+
+  mesonFlags = [
+    "-Dexamples=disabled" # requires many dependencies and probably not useful for our users
+    "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing
+    "-Dqt5=disabled" # not clear as of writing how to correctly pass in the required qt5 deps
+  ] ++ optionals (!gtkSupport) [
+    "-Dgtk3=disabled"
+  ] ++ optionals (!enableJack) [
+    "-Djack=disabled"
+  ] ++ optionals (!stdenv.isLinux) [
+    "-Ddv1394=disabled" # Linux only
+    "-Doss4=disabled" # Linux only
+    "-Doss=disabled" # Linux only
+    "-Dpulse=disabled" # TODO check if we can keep this enabled
+    "-Dv4l2-gudev=disabled" # Linux-only
+    "-Dv4l2=disabled" # Linux-only
+    "-Dximagesrc=disabled" # Linux-only
+    "-Dpulse=disabled" # TODO check if we can keep this enabled
+  ] ++ optionals (!raspiCameraSupport) [
+    "-Drpicamsrc=disabled"
+  ];
+
+  postPatch = ''
+    patchShebangs \
+      scripts/extract-release-date-from-doap-file.py
+  '';
+
+  NIX_LDFLAGS = [
+    # linking error on Darwin
+    # https://github.com/NixOS/nixpkgs/pull/70690#issuecomment-553694896
+    "-lncurses"
+  ];
+
+  # fails 1 tests with "Unexpected critical/warning: g_object_set_is_valid_property: object class 'GstRtpStorage' has no property named ''"
+  doCheck = false;
+
+  meta = with stdenv.lib; {
+    description = "GStreamer Good Plugins";
+    homepage = "https://gstreamer.freedesktop.org";
+    longDescription = ''
+      a set of plug-ins that we consider to have good quality code,
+      correct functionality, our preferred license (LGPL for the plug-in
+      code, LGPL or LGPL-compatible for the supporting library).
+    '';
+    license = licenses.lgpl2Plus;
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ matthewbauer ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/gstreamermm/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/gstreamermm/default.nix
new file mode 100644
index 000000000000..35c278da03b1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/gstreamermm/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchurl, pkgconfig, file, glibmm, gst_all_1, gnome3 }:
+stdenv.mkDerivation rec {
+  pname = "gstreamermm";
+  version = "1.10.0";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "0q4dx9sncqbwgpzma0zvj6zssc279yl80pn8irb95qypyyggwn5y";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ pkgconfig file ];
+
+  propagatedBuildInputs = [ glibmm gst_all_1.gst-plugins-base ];
+
+  enableParallelBuilding = true;
+
+  passthru = {
+    updateScript = gnome3.updateScript {
+      packageName = pname;
+      versionPolicy = "none"; # Unpredictable version stability
+    };
+  };
+
+  meta = with stdenv.lib; {
+    description = "C++ interface for GStreamer";
+    homepage = "https://gstreamer.freedesktop.org/bindings/cplusplus.html";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ romildo ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/libav/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/libav/default.nix
new file mode 100644
index 000000000000..c75d439cd53f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/libav/default.nix
@@ -0,0 +1,55 @@
+{ stdenv
+, lib
+, fetchurl
+, meson
+, ninja
+, pkgconfig
+, python3
+, gst-plugins-base
+, gettext
+, libav
+}:
+
+# Note that since gst-libav-1.6, libav is actually ffmpeg. See
+# https://gstreamer.freedesktop.org/releases/1.6/ for more info.
+
+stdenv.mkDerivation rec {
+  pname = "gst-libav";
+  version = "1.18.2";
+
+  src = fetchurl {
+    url = "${meta.homepage}/src/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "0jbzams9ggk3sq9ywv4gsl9rghyn203l2582m6l5c1sz9ka9m5in";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    gettext
+    pkgconfig
+    python3
+  ];
+
+  buildInputs = [
+    gst-plugins-base
+    libav
+  ];
+
+  mesonFlags = [
+    "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing
+  ];
+
+  postPatch = ''
+    patchShebangs \
+      scripts/extract-release-date-from-doap-file.py
+  '';
+
+  meta = with lib; {
+    description = "FFmpeg/libav plugin for GStreamer";
+    homepage = "https://gstreamer.freedesktop.org";
+    license = licenses.lgpl2Plus;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/rtsp-server/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/rtsp-server/default.nix
new file mode 100644
index 000000000000..4167b1727769
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/rtsp-server/default.nix
@@ -0,0 +1,74 @@
+{ stdenv
+, fetchurl
+, meson
+, ninja
+, pkgconfig
+, python3
+, gettext
+, gobject-introspection
+, gst-plugins-base
+, gst-plugins-bad
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gst-rtsp-server";
+  version = "1.18.2";
+
+  src = fetchurl {
+    url = "${meta.homepage}/src/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "1qjlp7az0hkzxvq53hwnp55sp6xhbybfwzaj66hp45jslsmj4fcp";
+  };
+
+  outputs = [
+    "out"
+    "dev"
+    # "devdoc" # disabled until `hotdoc` is packaged in nixpkgs
+  ];
+
+  patches = [
+    # To use split outputs, we need this so double prefix won't be used in the
+    # pkg-config files. Hopefully, this won't be needed on the next release,
+    # _if_
+    # https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/merge_requests/1
+    # will be merged. For the current release, this merge request won't apply.
+    ./fix_pkgconfig_includedir.patch
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    gettext
+    gobject-introspection
+    pkgconfig
+    python3
+
+    # documentation
+    # TODO add hotdoc here
+  ];
+
+  buildInputs = [
+    gst-plugins-base
+    gst-plugins-bad
+  ];
+
+  mesonFlags = [
+    "-Dexamples=disabled" # requires many dependencies and probably not useful for our users
+    "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing
+  ];
+
+  postPatch = ''
+    patchShebangs \
+      scripts/extract-release-date-from-doap-file.py
+  '';
+
+  meta = with stdenv.lib; {
+    description = "GStreamer RTSP server";
+    homepage = "https://gstreamer.freedesktop.org";
+    longDescription = ''
+      A library on top of GStreamer for building an RTSP server.
+    '';
+    license = licenses.lgpl2Plus;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ bkchr ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/rtsp-server/fix_pkgconfig_includedir.patch b/nixpkgs/pkgs/development/libraries/gstreamer/rtsp-server/fix_pkgconfig_includedir.patch
new file mode 100644
index 000000000000..d31fe19fb0fe
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/rtsp-server/fix_pkgconfig_includedir.patch
@@ -0,0 +1,15 @@
+diff --git i/pkgconfig/meson.build w/pkgconfig/meson.build
+index 8ed8299..594cbfe 100644
+--- i/pkgconfig/meson.build
++++ w/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)
+ 
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/ugly/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/ugly/default.nix
new file mode 100644
index 000000000000..1cdc0a519300
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/ugly/default.nix
@@ -0,0 +1,81 @@
+{ stdenv
+, fetchurl
+, meson
+, ninja
+, pkgconfig
+, python3
+, gst-plugins-base
+, orc
+, gettext
+, a52dec
+, libcdio
+, libdvdread
+, libmad
+, libmpeg2
+, x264
+, libintl
+, lib
+, opencore-amr
+, darwin
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gst-plugins-ugly";
+  version = "1.18.2";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "${meta.homepage}/src/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "1nwbcv5yaib3d8icvyja3zf6lyjf5zf1hndbijrhj8j7xlia0dx3";
+  };
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    gettext
+    pkgconfig
+    python3
+  ];
+
+  buildInputs = [
+    gst-plugins-base
+    orc
+    a52dec
+    libcdio
+    libdvdread
+    libmad
+    libmpeg2
+    x264
+    libintl
+    opencore-amr
+  ] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
+    IOKit
+    CoreFoundation
+    DiskArbitration
+  ]);
+
+  mesonFlags = [
+    "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing
+    "-Dsidplay=disabled" # sidplay / sidplay/player.h isn't packaged in nixpkgs as of writing
+  ];
+
+  postPatch = ''
+    patchShebangs \
+      scripts/extract-release-date-from-doap-file.py
+  '';
+
+  meta = with lib; {
+    description = "Gstreamer Ugly Plugins";
+    homepage = "https://gstreamer.freedesktop.org";
+    longDescription = ''
+      a set of plug-ins that have good quality and correct functionality,
+      but distributing them might pose problems.  The license on either
+      the plug-ins or the supporting libraries might not be how we'd
+      like. The code might be widely known to present patent problems.
+    '';
+    license = licenses.lgpl2Plus;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ matthewbauer ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/vaapi/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/vaapi/default.nix
new file mode 100644
index 000000000000..52a6cb27894b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/vaapi/default.nix
@@ -0,0 +1,85 @@
+{ stdenv
+, fetchurl
+, meson
+, ninja
+, pkgconfig
+, gst-plugins-base
+, bzip2
+, libva
+, wayland
+, libdrm
+, udev
+, xorg
+, libGLU
+, libGL
+, gstreamer
+, gst-plugins-bad
+, nasm
+, libvpx
+, python3
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gstreamer-vaapi";
+  version = "1.18.2";
+
+  src = fetchurl {
+    url = "${meta.homepage}/src/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "1h67n7wk1297rzynknbyv44gdacblvkcvb37x8yxi5d0zms2qywc";
+  };
+
+  outputs = [
+    "out"
+    "dev"
+    # "devdoc" # disabled until `hotdoc` is packaged in nixpkgs
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkgconfig
+    bzip2
+
+    # documentation
+    # TODO add hotdoc here
+  ];
+
+  buildInputs = [
+    gstreamer
+    gst-plugins-base
+    gst-plugins-bad
+    libva
+    wayland
+    libdrm
+    udev
+    xorg.libX11
+    xorg.libXext
+    xorg.libXv
+    xorg.libXrandr
+    xorg.libSM
+    xorg.libICE
+    libGL
+    libGLU
+    nasm
+    libvpx
+    python3
+  ];
+
+  mesonFlags = [
+    "-Dexamples=disabled" # requires many dependencies and probably not useful for our users
+    "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing
+  ];
+
+  postPatch = ''
+    patchShebangs \
+      scripts/extract-release-date-from-doap-file.py
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Set of VAAPI GStreamer Plug-ins";
+    homepage = "https://gstreamer.freedesktop.org";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ tstrobel ];
+    platforms = platforms.linux;
+  };
+}