diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/gstreamer')
19 files changed, 1370 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..5723323defd6 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/gstreamer/bad/default.nix @@ -0,0 +1,326 @@ +{ lib +, stdenv +, fetchurl +, fetchpatch +, meson +, ninja +, gettext +, pkg-config +, python3 +, gst-plugins-base +, orc +, gobject-introspection +, enableZbar ? false +, faacSupport ? false +, faac +, 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 +, 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 +, vo-aacenc +, VideoToolbox +, AudioToolbox +, AVFoundation +, CoreMedia +, CoreVideo +, Foundation +, MediaToolbox +}: + +stdenv.mkDerivation rec { + pname = "gst-plugins-bad"; + version = "1.18.2"; + + outputs = [ "out" "dev" ]; + + src = fetchurl { + url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz"; + sha256 = "06ildd4rl6cynirv3p00d2ddf5is9svj4i7mkahldzhq24pq5mca"; + }; + + patches = [ + # Use pkgconfig to inject the includedirs + ./fix_pkgconfig_includedir.patch + ] ++ lib.optionals stdenv.isDarwin [ + # Fix “error: cannot initialize a parameter of type 'unsigned long *' with an rvalue of type 'typename std::remove_reference<decltype(*(&opencv_dilate_erode_type))>::type *' (aka 'volatile unsigned long *')” on Darwin. + (fetchpatch { + url = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/commit/640a65bf966df065d41a511e2d76d1f26a2e770c.patch"; + sha256 = "E5pig+qEfR58Jticr6ydFxZOhM3ZJ8zgrf5K4BdiB/Y="; + includes = [ + "ext/opencv/gstcvdilateerode.cpp" + ]; + }) + ]; + + nativeBuildInputs = [ + meson + ninja + pkg-config + orc # for orcc + python3 + gettext + gobject-introspection + ] ++ lib.optionals stdenv.isLinux [ + wayland # for wayland-scanner + ]; + + buildInputs = [ + gst-plugins-base + orc + # gobject-introspection has to be in both nativeBuildInputs and + # buildInputs. The build tries to link against libgirepository-1.0.so + 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 + vo-aacenc + ] ++ lib.optionals enableZbar [ + zbar + ] ++ lib.optionals faacSupport [ + faac + ] ++ lib.optionals stdenv.isLinux [ + bluez + libva # vaapi requires libva -> libdrm -> libpciaccess, which is Linux-only in nixpkgs + wayland + wayland-protocols + ] ++ lib.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 + ] ++ lib.optionals stdenv.isDarwin [ + # 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 + "-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 + ] + ++ lib.optionals (!stdenv.isLinux) [ + "-Dva=disabled" # see comment on `libva` in `buildInputs` + ] + ++ lib.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 + ] ++ lib.optionals (!gst-plugins-base.glEnabled) [ + "-Dgl=disabled" + ] ++ lib.optionals (!gst-plugins-base.waylandEnabled) [ + "-Dwayland=disabled" + ] ++ lib.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" + ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + "-Dintrospection=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 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..3e00050ada2f --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/gstreamer/base/default.nix @@ -0,0 +1,156 @@ +{ stdenv +, fetchurl +, lib +, pkg-config +, 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 +, alsa-lib +# 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 +, Cocoa +, OpenGL +, enableGl ? (enableX11 || enableWayland || enableCocoa) +, enableCdparanoia ? (!stdenv.isDarwin) +, cdparanoia +, glib +}: + +stdenv.mkDerivation rec { + pname = "gst-plugins-base"; + version = "1.18.4"; + + outputs = [ "out" "dev" ]; + + src = fetchurl { + url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz"; + sha256 = "08w3ivbc6n4vdds2ap6q7l8zdk9if8417nznyqidf0adm0lk5r99"; + }; + + patches = [ + ./fix_pkgconfig_includedir.patch + ]; + + nativeBuildInputs = [ + meson + ninja + pkg-config + 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 + OpenGL + ] ++ lib.optionals enableAlsa [ + alsa-lib + ] ++ lib.optionals enableX11 [ + libXext + libXv + pango + ] ++ lib.optionals enableWayland [ + wayland + wayland-protocols + ] ++ lib.optional enableCocoa 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.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + "-Dintrospection=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 \ + 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..9cc1675de3ae --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/gstreamer/core/default.nix @@ -0,0 +1,116 @@ +{ stdenv +, fetchurl +, meson +, ninja +, pkg-config +, 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.4"; + + 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 = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz"; + sha256 = "1igv9l4hm21kp1jmlwlagzs7ly1vaxv1sbda29q8247372dwkvls"; + }; + + patches = [ + ./fix_pkgconfig_includedir.patch + ]; + + nativeBuildInputs = [ + meson + ninja + pkg-config + 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.buildPlatform != stdenv.hostPlatform) [ + "-Dintrospection=disabled" + ] ++ lib.optionals stdenv.isDarwin [ + # darwin.libunwind doesn't have pkg-config 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..d1c7233f0d48 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/gstreamer/default.nix @@ -0,0 +1,27 @@ +{ callPackage, AudioToolbox, AVFoundation, Cocoa, CoreFoundation, CoreMedia, CoreServices, CoreVideo, DiskArbitration, Foundation, IOKit, MediaToolbox, OpenGL, VideoToolbox }: + +{ + gstreamer = callPackage ./core { inherit CoreServices; }; + + gstreamermm = callPackage ./gstreamermm { }; + + gst-plugins-base = callPackage ./base { inherit Cocoa OpenGL; }; + + gst-plugins-good = callPackage ./good { inherit Cocoa; }; + + gst-plugins-bad = callPackage ./bad { inherit AudioToolbox AVFoundation CoreMedia CoreVideo Foundation MediaToolbox VideoToolbox; }; + + gst-plugins-ugly = callPackage ./ugly { inherit CoreFoundation DiskArbitration IOKit; }; + + gst-rtsp-server = callPackage ./rtsp-server { }; + + gst-libav = callPackage ./libav { }; + + gst-devtools = callPackage ./devtools { }; + + gst-editing-services = callPackage ./ges { }; + + gst-vaapi = callPackage ./vaapi { }; + + # 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..12cb6dac6f31 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/gstreamer/devtools/default.nix @@ -0,0 +1,64 @@ +{ lib, stdenv +, fetchurl +, meson +, ninja +, pkg-config +, gstreamer +, gst-plugins-base +, python3 +, gobject-introspection +, json-glib +}: + +stdenv.mkDerivation rec { + pname = "gst-devtools"; + version = "1.18.4"; + + src = fetchurl { + url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz"; + sha256 = "1kvcabcfzm7wqih3lzgrg9xjbn4xpx43d1m2zkkvab4i8161kggz"; + }; + + patches = [ + ./fix_pkgconfig_includedir.patch + ]; + + outputs = [ + "out" + "dev" + # "devdoc" # disabled until `hotdoc` is packaged in nixpkgs + ]; + + nativeBuildInputs = [ + meson + ninja + pkg-config + 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 + ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + "-Dintrospection=disabled" + ]; + + meta = with 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..840b0f252857 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/gstreamer/ges/default.nix @@ -0,0 +1,77 @@ +{ lib, stdenv +, fetchurl +, meson +, ninja +, pkg-config +, 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.4"; + + outputs = [ + "out" + "dev" + # "devdoc" # disabled until `hotdoc` is packaged in nixpkgs + ]; + + src = fetchurl { + url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz"; + sha256 = "010xg960qsh5dwmf0y9l1q13h0cymmrgapzla2zsw66ylxqbi1s6"; + }; + + patches = [ + ./fix_pkgconfig_includedir.patch + ]; + + nativeBuildInputs = [ + meson + ninja + pkg-config + 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 + ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + "-Dintrospection=disabled" + ]; + + postPatch = '' + patchShebangs \ + scripts/extract-release-date-from-doap-file.py + ''; + + meta = with 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..86684893efd3 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/gstreamer/good/default.nix @@ -0,0 +1,170 @@ +{ lib, stdenv +, fetchurl +, meson +, nasm +, ninja +, pkg-config +, python3 +, gst-plugins-base +, orc +, bzip2 +, gettext +, libv4l +, libdv +, libavc1394 +, libiec61883 +, libvpx +, speex +, flac +, taglib +, libshout +, cairo +, gdk-pixbuf +, aalib +, libcaca +, libsoup +, libpulseaudio +, libintl +, Cocoa +, lame +, mpg123 +, twolame +, gtkSupport ? false, gtk3 +, qt5Support ? false, qt5 +, raspiCameraSupport ? false, libraspberrypi +, enableJack ? true, libjack2 +, libXdamage +, libXext +, libXfixes +, ncurses +, wayland +, wayland-protocols +, xorg +, libgudev +, wavpack +}: + +assert raspiCameraSupport -> (stdenv.isLinux && stdenv.isAarch64); + +stdenv.mkDerivation rec { + pname = "gst-plugins-good"; + version = "1.18.4"; + + outputs = [ "out" "dev" ]; + + src = fetchurl { + url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz"; + sha256 = "1c1rpq709cy8maaykyn1n0kckj9c6fl3mhvixkk6xmdwkcx0xrdn"; + }; + + nativeBuildInputs = [ + pkg-config + python3 + meson + ninja + gettext + nasm + ] ++ lib.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 + ] ++ lib.optionals raspiCameraSupport [ + libraspberrypi + ] ++ lib.optionals gtkSupport [ + # for gtksink + gtk3 + ] ++ lib.optionals qt5Support (with qt5; [ + qtbase + qtdeclarative + qtwayland + qtx11extras + ]) ++ lib.optionals stdenv.isDarwin [ + Cocoa + ] ++ lib.optionals stdenv.isLinux [ + libv4l + libpulseaudio + libavc1394 + libiec61883 + libgudev + wayland + ] ++ lib.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 + ] ++ lib.optionals (!qt5Support) [ + "-Dqt5=disabled" + ] ++ lib.optionals (!gtkSupport) [ + "-Dgtk3=disabled" + ] ++ lib.optionals (!enableJack) [ + "-Djack=disabled" + ] ++ lib.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 + ] ++ lib.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; + + # must be explicitely set since 5590e365 + dontWrapQtApps = true; + + meta = with 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..7123aa0d3ac1 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/gstreamer/gstreamermm/default.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, fetchurl, pkg-config, file, glibmm, gst_all_1, gnome }: +stdenv.mkDerivation rec { + pname = "gstreamermm"; + version = "1.10.0"; + + src = fetchurl { + url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; + sha256 = "0q4dx9sncqbwgpzma0zvj6zssc279yl80pn8irb95qypyyggwn5y"; + }; + + outputs = [ "out" "dev" ]; + + nativeBuildInputs = [ pkg-config file ]; + + propagatedBuildInputs = [ glibmm gst_all_1.gst-plugins-base ]; + + enableParallelBuilding = true; + + passthru = { + updateScript = gnome.updateScript { + packageName = "gst_all_1.gstreamermm"; + versionPolicy = "odd-unstable"; + }; + }; + + meta = with 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..009a1555f770 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/gstreamer/libav/default.nix @@ -0,0 +1,55 @@ +{ stdenv +, lib +, fetchurl +, meson +, ninja +, pkg-config +, 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.4"; + + src = fetchurl { + url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz"; + sha256 = "15n3x3vhshqa3icw93g4vqmqd46122anzqvfxwn6q8famlxlcjil"; + }; + + outputs = [ "out" "dev" ]; + + nativeBuildInputs = [ + meson + ninja + gettext + pkg-config + 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..d66376b64996 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/gstreamer/rtsp-server/default.nix @@ -0,0 +1,76 @@ +{ lib, stdenv +, fetchurl +, meson +, ninja +, pkg-config +, python3 +, gettext +, gobject-introspection +, gst-plugins-base +, gst-plugins-bad +}: + +stdenv.mkDerivation rec { + pname = "gst-rtsp-server"; + version = "1.18.4"; + + src = fetchurl { + url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz"; + sha256 = "153c78klvzlmi86d0gmdf7w9crv11rkd4y82b14a0wdr83gbhsx4"; + }; + + 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 + pkg-config + 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 + ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + "-Dintrospection=disabled" + ]; + + postPatch = '' + patchShebangs \ + scripts/extract-release-date-from-doap-file.py + ''; + + meta = with 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..049e8a99f095 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/gstreamer/ugly/default.nix @@ -0,0 +1,83 @@ +{ stdenv +, fetchurl +, meson +, ninja +, pkg-config +, python3 +, gst-plugins-base +, orc +, gettext +, a52dec +, libcdio +, libdvdread +, libmad +, libmpeg2 +, x264 +, libintl +, lib +, opencore-amr +, IOKit +, CoreFoundation +, DiskArbitration +}: + +stdenv.mkDerivation rec { + pname = "gst-plugins-ugly"; + version = "1.18.4"; + + outputs = [ "out" "dev" ]; + + src = fetchurl { + url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz"; + sha256 = "0g6i4db1883q3j0l2gdv46fcqwiiaw63n6mhvsfcms1i1p7g1391"; + }; + + nativeBuildInputs = [ + meson + ninja + gettext + pkg-config + python3 + ]; + + buildInputs = [ + gst-plugins-base + orc + a52dec + libcdio + libdvdread + libmad + libmpeg2 + x264 + libintl + opencore-amr + ] ++ lib.optionals stdenv.isDarwin [ + 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..19e65c5a75eb --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/gstreamer/vaapi/default.nix @@ -0,0 +1,85 @@ +{ lib, stdenv +, fetchurl +, meson +, ninja +, pkg-config +, 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.4"; + + src = fetchurl { + url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz"; + sha256 = "1sia4l88z7kkxm2z9j20l43rqkrnsa47xccski10s5gkhsprinwj"; + }; + + outputs = [ + "out" + "dev" + # "devdoc" # disabled until `hotdoc` is packaged in nixpkgs + ]; + + nativeBuildInputs = [ + meson + ninja + pkg-config + 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 lib; { + description = "Set of VAAPI GStreamer Plug-ins"; + homepage = "https://gstreamer.freedesktop.org"; + license = licenses.lgpl21Plus; + maintainers = with maintainers; [ tstrobel ]; + platforms = platforms.linux; + }; +} |