push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,429 @@
{
lib,
stdenv,
fetchurl,
fetchpatch,
replaceVars,
meson,
ninja,
gettext,
pkg-config,
python3,
gst-plugins-base,
orc,
gstreamer,
gobject-introspection,
wayland-scanner,
enableZbar ? false,
faacSupport ? false,
faac,
opencvSupport ? false,
opencv4,
faad2,
# Enabling lcevcdecoder currently causes issues when attempting to decode regular h264 data
# warning: No decoder available for type 'video/x-h264, stream-format=(string)avc, [...], lcevc=(boolean)false, [...]
lcevcdecSupport ? false,
lcevcdec,
ldacbtSupport ? lib.meta.availableOn stdenv.hostPlatform ldacbt,
ldacbt,
liblc3,
libass,
lrdf,
ladspaH,
lcms2,
libnice,
webrtcAudioProcessingSupport ? lib.meta.availableOn stdenv.hostPlatform webrtc-audio-processing_1,
webrtc-audio-processing_1,
lilv,
lv2,
serd,
sord,
sratom,
libbs2b,
libmodplug,
libmpeg2,
libmicrodns,
openjpeg,
libopus,
librsvg,
bluez,
chromaprint,
curl,
fdk_aac,
flite,
gsm,
json-glib,
ajaSupport ? lib.meta.availableOn stdenv.hostPlatform libajantv2,
libajantv2,
libaom,
libdc1394,
libde265,
libdrm,
libdvdnav,
libdvdread,
libgudev,
qrencode,
libsndfile,
libusb1,
neon,
openal,
openexr,
openh264Support ? lib.meta.availableOn stdenv.hostPlatform openh264,
openh264,
libopenmpt,
pango,
rtmpdump,
sbc,
soundtouch,
spandsp,
srtp,
zbar,
wayland-protocols,
wildmidi,
svt-av1,
fluidsynth,
libva,
wayland,
libwebp,
gnutls,
mjpegtools,
libGL,
addDriverRunpath,
gtk3,
libintl,
game-music-emu,
openssl,
x265,
libxml2,
srt,
vo-aacenc,
libfreeaptx,
zxing-cpp,
usrsctp,
directoryListingUpdater,
enableGplPlugins ? true,
bluezSupport ? stdenv.hostPlatform.isLinux,
# Causes every application using GstDeviceMonitor to send mDNS queries every 2 seconds
microdnsSupport ? false,
# Checks meson.is_cross_build(), so even canExecute isn't enough.
enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform,
hotdoc,
guiSupport ? true,
gst-plugins-bad,
apple-sdk_gstreamer,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "gst-plugins-bad";
version = "1.26.5";
outputs = [
"out"
"dev"
];
src = fetchurl {
url = "https://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-${finalAttrs.version}.tar.xz";
hash = "sha256-mJDyYvOyqVZNy2KenraX13uT0fcYl+2hqBcLfc/nMpQ=";
};
patches = [
# Add fallback paths for nvidia userspace libraries
(replaceVars ./fix-paths.patch {
inherit (addDriverRunpath) driverLink;
})
];
nativeBuildInputs = [
meson
ninja
pkg-config
orc # for orcc
python3
gettext
gstreamer # for gst-tester-1.0
gobject-introspection
]
++ lib.optionals enableDocumentation [
hotdoc
]
++ lib.optionals (gst-plugins-base.waylandEnabled && stdenv.hostPlatform.isLinux) [
wayland-scanner
];
buildInputs = [
gst-plugins-base
orc
json-glib
lcms2
liblc3
libass
libbs2b
libmodplug
openjpeg
libopenmpt
libopus
librsvg
curl.dev
fdk_aac
gsm
libaom
libdc1394
libde265
libdvdnav
libdvdread
libnice
qrencode
libsndfile
libusb1
neon
openal
openexr
rtmpdump
pango
soundtouch
srtp
fluidsynth
libwebp
gnutls
game-music-emu
openssl
libxml2
libintl
srt
vo-aacenc
libfreeaptx
zxing-cpp
usrsctp
wildmidi
svt-av1
]
++ lib.optionals opencvSupport [
opencv4
]
++ lib.optionals enableZbar [
zbar
]
++ lib.optionals faacSupport [
faac
]
++ lib.optionals enableGplPlugins [
libmpeg2
mjpegtools
faad2
x265
]
++ lib.optionals bluezSupport [
bluez
]
++ lib.optionals microdnsSupport [
libmicrodns
]
++ lib.optionals openh264Support [
openh264
]
++ lib.optionals ajaSupport [
libajantv2
]
++ lib.optionals (gst-plugins-base.waylandEnabled && stdenv.hostPlatform.isLinux) [
libva # vaapi requires libva -> libdrm -> libpciaccess, which is Linux-only in nixpkgs
wayland
wayland-protocols
]
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
# TODO: mjpegtools uint64_t is not compatible with guint64 on Darwin
mjpegtools
chromaprint
flite
libdrm
libgudev
sbc
spandsp
# ladspa plug-in
ladspaH
lrdf # TODO: make build on Darwin
# lv2 plug-in
lilv
lv2
serd
sord
sratom
libGL
]
++ lib.optionals guiSupport [
gtk3
]
++ lib.optionals lcevcdecSupport [
lcevcdec
]
++ lib.optionals ldacbtSupport [
ldacbt
]
++ lib.optionals webrtcAudioProcessingSupport [
webrtc-audio-processing_1
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
apple-sdk_gstreamer
];
mesonFlags = [
"-Dexamples=disabled" # requires many dependencies and probably not useful for our users
"-Dglib_debug=disabled" # cast checks should be disabled on stable releases
"-Damfcodec=disabled" # Windows-only
"-Dandroidmedia=disabled" # Requires Android system.
"-Davtp=disabled"
"-Dcuda-nvmm=disabled"
"-Ddirectshow=disabled" # Windows-only
"-Dqt6d3d11=disabled" # Windows-only
"-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, also this is AGPL so update license when adding support
"-Dlcevcencoder=disabled" # not packaged 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"
"-Dnvcomp=disabled"
"-Dnvdswrapper=disabled"
"-Dopenni2=disabled" # not packaged in nixpkgs as of writing
"-Dopensles=disabled" # not packaged in nixpkgs as of writing
"-Dsvthevcenc=disabled" # required `SvtHevcEnc` library not packaged in nixpkgs as of writing
"-Dsvtjpegxs=disabled" # 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
"-Dgs=disabled" # depends on `google-cloud-cpp`
"-Donnx=disabled" # depends on `libonnxruntime` not packaged in nixpkgs as of writing
"-Dopenaptx=enabled" # since gstreamer-1.20.1 `libfreeaptx` is supported for circumventing the dubious license conflict with `libopenaptx`
"-Dopencv=${if opencvSupport then "enabled" else "disabled"}" # Reduces rebuild size when `config.cudaSupport = true`
"-Daja=${if ajaSupport then "enabled" else "disabled"}"
"-Dmicrodns=${if microdnsSupport then "enabled" else "disabled"}"
"-Dbluez=${if bluezSupport then "enabled" else "disabled"}"
(lib.mesonEnable "openh264" openh264Support)
(lib.mesonEnable "doc" enableDocumentation)
(lib.mesonEnable "directfb" false)
(lib.mesonEnable "lcevcdecoder" lcevcdecSupport)
]
++ lib.optionals (!stdenv.hostPlatform.isLinux) [
"-Ddoc=disabled" # needs gstcuda to be enabled which is Linux-only
]
++ lib.optionals (!stdenv.hostPlatform.isLinux || !stdenv.hostPlatform.isx86) [
"-Dnvcodec=disabled" # Linux-only, broken on non-x86
]
++ lib.optionals (!stdenv.hostPlatform.isLinux || !gst-plugins-base.waylandEnabled) [
"-Dva=disabled" # see comment on `libva` in `buildInputs`
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
"-Daja=disabled"
"-Dchromaprint=disabled"
"-Dflite=disabled"
"-Dkms=disabled" # renders to libdrm output
"-Dlv2=disabled"
"-Dsbc=disabled"
"-Dspandsp=disabled"
"-Ddvb=disabled"
"-Dfbdev=disabled"
"-Duvcgadget=disabled" # requires gudev
"-Duvch264=disabled" # requires gudev
"-Dv4l2codecs=disabled" # requires gudev
"-Dladspa=disabled" # requires lrdf
]
++
lib.optionals
(!stdenv.hostPlatform.isLinux || !stdenv.hostPlatform.isx86_64 || !gst-plugins-base.waylandEnabled)
[
"-Dqsv=disabled" # Linux (and Windows) x86 only, makes va required
]
++ lib.optionals (!gst-plugins-base.glEnabled) [
"-Dgl=disabled"
]
++ lib.optionals (!gst-plugins-base.waylandEnabled || !guiSupport) [
"-Dgtk3=disabled" # Wayland-based GTK sink
"-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"
]
++ (
if enableGplPlugins then
[
"-Dgpl=enabled"
]
else
[
"-Ddts=disabled"
"-Dfaad=disabled"
"-Diqa=disabled"
"-Dmpeg2enc=disabled"
"-Dmplex=disabled"
"-Dresindvd=disabled"
"-Dx265=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
passthru = {
tests = {
full = gst-plugins-bad.override {
enableZbar = true;
faacSupport = true;
opencvSupport = true;
};
lgplOnly = gst-plugins-bad.override {
enableGplPlugins = false;
};
};
updateScript = directoryListingUpdater { };
};
meta = with lib; {
description = "GStreamer Bad Plugins";
mainProgram = "gst-transcoder-1.0";
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 = if enableGplPlugins then licenses.gpl2Plus else licenses.lgpl2Plus;
platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ matthewbauer ];
};
})

View File

@@ -0,0 +1,48 @@
diff --git a/gst-libs/gst/cuda/gstcudaloader.cpp b/gst-libs/gst/cuda/gstcudaloader.cpp
index 11718b8..d4144c1 100644
--- a/gst-libs/gst/cuda/gstcudaloader.cpp
+++ b/gst-libs/gst/cuda/gstcudaloader.cpp
@@ -229,6 +229,11 @@ gst_cuda_load_library_once_func (void)
"CUDA plugin loader");
module = g_module_open (filename, G_MODULE_BIND_LAZY);
+
+ if (module == nullptr) {
+ module = g_module_open ("@driverLink@/lib/" CUDA_LIBNAME, G_MODULE_BIND_LAZY);
+ }
+
if (module == nullptr) {
GST_WARNING ("Could not open library %s, %s", filename, g_module_error ());
return;
diff --git a/sys/nvcodec/gstcuvidloader.c b/sys/nvcodec/gstcuvidloader.c
index c51a428..ea0e1b5 100644
--- a/sys/nvcodec/gstcuvidloader.c
+++ b/sys/nvcodec/gstcuvidloader.c
@@ -87,6 +87,11 @@ gst_cuvid_load_library (guint api_major_ver, guint api_minor_ver)
return TRUE;
module = g_module_open (filename, G_MODULE_BIND_LAZY);
+
+ if (module == NULL) {
+ module = g_module_open ("@driverLink@/lib/" NVCUVID_LIBNAME, G_MODULE_BIND_LAZY);
+ }
+
if (module == NULL) {
GST_WARNING ("Could not open library %s, %s", filename, g_module_error ());
return FALSE;
diff --git a/sys/nvcodec/gstnvenc.c b/sys/nvcodec/gstnvenc.c
index c65c85a..57232bb 100644
--- a/sys/nvcodec/gstnvenc.c
+++ b/sys/nvcodec/gstnvenc.c
@@ -919,6 +919,11 @@ gst_nvenc_load_library (guint * api_major_ver, guint * api_minor_ver)
};
module = g_module_open (NVENC_LIBRARY_NAME, G_MODULE_BIND_LAZY);
+
+ if (module == NULL) {
+ module = g_module_open ("@driverLink@/lib/" NVENC_LIBRARY_NAME, G_MODULE_BIND_LAZY);
+ }
+
if (module == NULL) {
GST_WARNING ("Could not open library %s, %s",
NVENC_LIBRARY_NAME, g_module_error ());

View File

@@ -0,0 +1,207 @@
{
stdenv,
fetchurl,
lib,
pkg-config,
meson,
ninja,
gettext,
python3,
gstreamer,
graphene,
orc,
pango,
libtheora,
libintl,
libopus,
isocodes,
libjpeg,
libpng,
tremor, # provides 'virbisidec'
libGL,
withIntrospection ?
lib.meta.availableOn stdenv.hostPlatform gobject-introspection
&& stdenv.hostPlatform.emulatorAvailable buildPackages,
buildPackages,
gobject-introspection,
enableX11 ? stdenv.hostPlatform.isLinux,
libXext,
libXi,
libXv,
libdrm,
enableWayland ? stdenv.hostPlatform.isLinux,
wayland-scanner,
wayland,
wayland-protocols,
enableAlsa ? stdenv.hostPlatform.isLinux,
alsa-lib,
enableCocoa ? stdenv.hostPlatform.isDarwin,
enableGl ? (enableX11 || enableWayland || enableCocoa),
enableCdparanoia ? (!stdenv.hostPlatform.isDarwin),
cdparanoia,
glib,
testers,
# Checks meson.is_cross_build(), so even canExecute isn't enough.
enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform,
hotdoc,
directoryListingUpdater,
apple-sdk_gstreamer,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "gst-plugins-base";
version = "1.26.5";
outputs = [
"out"
"dev"
];
separateDebugInfo = true;
src = fetchurl {
url = "https://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-${finalAttrs.version}.tar.xz";
hash = "sha256-8MDibL7apXcyy2pXjozBOhFkvxjXN9VcMzBhxS8MSNc=";
};
strictDeps = true;
depsBuildBuild = [
pkg-config
];
nativeBuildInputs = [
meson
ninja
pkg-config
python3
gettext
orc
glib
gstreamer
]
++ lib.optionals withIntrospection [
gobject-introspection
]
++ lib.optionals enableDocumentation [
hotdoc
]
++ lib.optionals enableWayland [
wayland-scanner
];
buildInputs = [
graphene
orc
libtheora
libintl
libopus
isocodes
libpng
libjpeg
tremor
pango
]
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
libdrm
libGL
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
apple-sdk_gstreamer
]
++ lib.optionals enableAlsa [
alsa-lib
]
++ lib.optionals enableX11 [
libXext
libXi
libXv
]
++ lib.optionals enableWayland [
wayland
wayland-protocols
]
++ lib.optional enableCdparanoia cdparanoia;
propagatedBuildInputs = [
gstreamer
]
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
libdrm
];
mesonFlags = [
"-Dglib_debug=disabled" # cast checks should be disabled on stable releases
"-Dexamples=disabled" # requires many dependencies and probably not useful for our users
# See https://github.com/GStreamer/gst-plugins-base/blob/d64a4b7a69c3462851ff4dcfa97cc6f94cd64aef/meson_options.txt#L15 for a list of choices
"-Dgl_winsys=${
lib.concatStringsSep "," (
lib.optional enableX11 "x11"
++ lib.optional enableWayland "wayland"
++ lib.optional enableCocoa "cocoa"
)
}"
(lib.mesonEnable "introspection" withIntrospection)
(lib.mesonEnable "doc" enableDocumentation)
(lib.mesonEnable "libvisual" false)
]
++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
"-Dtests=disabled"
]
++ lib.optionals (!enableX11) [
"-Dx11=disabled"
"-Dxi=disabled"
"-Dxshm=disabled"
"-Dxvideo=disabled"
]
# TODO How to disable Wayland?
++ lib.optional (!enableGl) "-Dgl=disabled"
++ lib.optional (!enableAlsa) "-Dalsa=disabled"
++ lib.optional (!enableCdparanoia) "-Dcdparanoia=disabled"
++ lib.optional stdenv.hostPlatform.isDarwin "-Ddrm=disabled";
postPatch = ''
patchShebangs \
scripts/meson-pkg-config-file-fixup.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;
updateScript = directoryListingUpdater { };
};
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
meta = with lib; {
description = "Base GStreamer plug-ins and helper libraries";
homepage = "https://gstreamer.freedesktop.org";
license = licenses.lgpl2Plus;
pkgConfigModules = [
"gstreamer-audio-1.0"
"gstreamer-base-1.0"
"gstreamer-net-1.0"
"gstreamer-video-1.0"
];
platforms = platforms.unix;
maintainers = with maintainers; [ matthewbauer ];
};
})

View File

@@ -0,0 +1,162 @@
{
stdenv,
fetchurl,
meson,
ninja,
pkg-config,
gettext,
bison,
flex,
python3,
glib,
makeWrapper,
libcap,
elfutils, # for libdw
bash-completion,
lib,
testers,
rustc,
withRust ?
lib.any (lib.meta.platformMatch stdenv.hostPlatform) rustc.targetPlatforms
&& lib.all (p: !lib.meta.platformMatch stdenv.hostPlatform p) rustc.badTargetPlatforms,
gobject-introspection,
buildPackages,
withIntrospection ?
lib.meta.availableOn stdenv.hostPlatform gobject-introspection
&& stdenv.hostPlatform.emulatorAvailable buildPackages,
libunwind,
withLibunwind ?
lib.meta.availableOn stdenv.hostPlatform libunwind
&& lib.elem "libunwind" libunwind.meta.pkgConfigModules or [ ],
# Checks meson.is_cross_build(), so even canExecute isn't enough.
enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform,
hotdoc,
directoryListingUpdater,
apple-sdk_gstreamer,
}:
let
hasElfutils = lib.meta.availableOn stdenv.hostPlatform elfutils;
in
stdenv.mkDerivation (finalAttrs: {
pname = "gstreamer";
version = "1.26.5";
outputs = [
"bin"
"out"
"dev"
];
separateDebugInfo = true;
src = fetchurl {
url = "https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-${finalAttrs.version}.tar.xz";
hash = "sha256-Cn7bDntC2+a1dfzmGkgIo/ayDghaHq7LwCXQ7CHx53Q=";
};
depsBuildBuild = [
pkg-config
];
strictDeps = true;
nativeBuildInputs = [
meson
ninja
pkg-config
gettext
bison
flex
python3
makeWrapper
glib
bash-completion
]
++ lib.optionals stdenv.hostPlatform.isLinux [
libcap # for setcap binary
]
++ lib.optionals withIntrospection [
gobject-introspection
]
++ lib.optionals withRust [
rustc
]
++ lib.optionals enableDocumentation [
hotdoc
];
buildInputs = [
bash-completion
]
++ lib.optionals stdenv.hostPlatform.isLinux [
libcap
]
++ lib.optionals hasElfutils [
elfutils
]
++ lib.optionals withLibunwind [
libunwind
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
apple-sdk_gstreamer
];
propagatedBuildInputs = [
glib
];
mesonFlags = [
"-Dglib_debug=disabled" # cast checks should be disabled on stable releases
"-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
(lib.mesonEnable "ptp-helper" withRust)
(lib.mesonEnable "introspection" withIntrospection)
(lib.mesonEnable "doc" enableDocumentation)
(lib.mesonEnable "libunwind" withLibunwind)
(lib.mesonEnable "libdw" (withLibunwind && hasElfutils))
];
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 \
docs/gst-plugins-doc-cache-generator.py
'';
postInstall = ''
for prog in "$bin/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" "$bin"
'';
setupHook = ./setup-hook.sh;
passthru = {
tests = {
pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
};
updateScript = directoryListingUpdater { };
};
meta = with lib; {
description = "Open source multimedia framework";
homepage = "https://gstreamer.freedesktop.org";
license = licenses.lgpl2Plus;
pkgConfigModules = [
"gstreamer-controller-1.0"
];
platforms = platforms.unix;
maintainers = with maintainers; [
ttuegel
matthewbauer
];
};
})

View File

@@ -0,0 +1,8 @@
addGstreamer1LibPath () {
if test -d "$1/lib/gstreamer-1.0"
then
addToSearchPath GST_PLUGIN_SYSTEM_PATH_1_0 "$1/lib/gstreamer-1.0"
fi
}
addEnvHooks "$hostOffset" addGstreamer1LibPath

View File

@@ -0,0 +1,52 @@
{
config,
lib,
callPackage,
ipu6ep-camera-hal,
ipu6epmtl-camera-hal,
apple-sdk_13,
}:
let
apple-sdk_gstreamer = apple-sdk_13;
in
{
inherit apple-sdk_gstreamer;
gstreamer = callPackage ./core { };
gstreamermm = callPackage ./gstreamermm { };
gst-plugins-base = callPackage ./base { };
gst-plugins-good = callPackage ./good { };
gst-plugins-bad = callPackage ./bad { };
gst-plugins-ugly = callPackage ./ugly { };
gst-plugins-rs = callPackage ./rs { };
gst-rtsp-server = callPackage ./rtsp-server { };
gst-libav = callPackage ./libav { };
gst-devtools = callPackage ./devtools { };
gst-editing-services = callPackage ./ges { };
gst-vaapi = callPackage ./vaapi { };
icamerasrc-ipu6 = callPackage ./icamerasrc { };
icamerasrc-ipu6ep = callPackage ./icamerasrc {
ipu6-camera-hal = ipu6ep-camera-hal;
};
icamerasrc-ipu6epmtl = callPackage ./icamerasrc {
ipu6-camera-hal = ipu6epmtl-camera-hal;
};
# note: gst-python is in ../../python-modules/gst-python - called under python3Packages
}
// lib.optionalAttrs config.allowAliases {
gst-plugins-viperfx = throw "'gst_all_1.gst-plugins-viperfx' was removed as it is broken and not maintained upstream"; # Added 2024-12-16
}

View File

@@ -0,0 +1,137 @@
{
lib,
stdenv,
fetchurl,
fetchpatch,
cairo,
meson,
ninja,
pkg-config,
gstreamer,
gst-plugins-base,
gst-plugins-bad,
gst-rtsp-server,
python3,
gobject-introspection,
rustPlatform,
rustc,
cargo,
json-glib,
# Checks meson.is_cross_build(), so even canExecute isn't enough.
enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform,
hotdoc,
directoryListingUpdater,
_experimental-update-script-combinators,
common-updater-scripts,
apple-sdk_gstreamer,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "gst-devtools";
version = "1.26.5";
outputs = [
"out"
"dev"
];
src = fetchurl {
url = "https://gstreamer.freedesktop.org/src/gst-devtools/gst-devtools-${finalAttrs.version}.tar.xz";
hash = "sha256-Y9Rqjv+ooiXiWkZLp1OKzoU/4NwecDZrJ8IIE15UAc4=";
};
cargoDeps = rustPlatform.fetchCargoVendor {
inherit (finalAttrs)
src
patches
cargoRoot
;
name = "gst-devtools-${finalAttrs.version}";
hash = "sha256-gU+SBvxwmrGiyeKXF3SA2ohIHNTS4ZBC+elB0u1QKRE=";
};
patches = [
# dots-viewer: sort static files
# https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9208
(fetchpatch {
url = "https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/b3099f78775eab1ac19a9e163c0386e01e74b768.patch";
stripLen = 2;
hash = "sha256-QRHqbZ6slYcwGl+o9Oi4jV+ANMorCED4cQV5qDS74eg=";
})
];
depsBuildBuild = [
pkg-config
];
nativeBuildInputs = [
meson
ninja
pkg-config
gobject-introspection
rustPlatform.cargoSetupHook
rustc
cargo
]
++ lib.optionals enableDocumentation [
hotdoc
];
buildInputs = [
cairo
python3
json-glib
]
++ lib.optionals (stdenv.hostPlatform.isDarwin) [
apple-sdk_gstreamer
];
propagatedBuildInputs = [
gstreamer
gst-plugins-base
gst-plugins-bad
gst-rtsp-server
];
mesonFlags = [
(lib.mesonEnable "doc" enableDocumentation)
];
cargoRoot = "dots-viewer";
passthru = {
updateScript =
let
updateSource = directoryListingUpdater { };
updateLockfile = {
command = [
"sh"
"-c"
''
PATH=${
lib.makeBinPath [
common-updater-scripts
]
}
update-source-version gst_all_1.gst-devtools --ignore-same-version --source-key=cargoDeps.vendorStaging > /dev/null
''
];
# Experimental feature: do not copy!
supportedFeatures = [ "silent" ];
};
in
_experimental-update-script-combinators.sequence [
updateSource
updateLockfile
];
};
meta = with lib; {
description = "Integration testing infrastructure for the GStreamer framework";
homepage = "https://gstreamer.freedesktop.org";
license = licenses.lgpl2Plus;
platforms = platforms.unix;
maintainers = [ ];
};
})

View File

@@ -0,0 +1,88 @@
{
lib,
stdenv,
fetchurl,
meson,
ninja,
pkg-config,
python3,
bash-completion,
gst-plugins-base,
gst-plugins-bad,
gst-devtools,
libxml2,
flex,
gettext,
gobject-introspection,
# Checks meson.is_cross_build(), so even canExecute isn't enough.
enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform,
hotdoc,
directoryListingUpdater,
apple-sdk_gstreamer,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "gst-editing-services";
version = "1.26.5";
outputs = [
"out"
"dev"
];
src = fetchurl {
url = "https://gstreamer.freedesktop.org/src/gst-editing-services/gst-editing-services-${finalAttrs.version}.tar.xz";
hash = "sha256-c0kAlE+Q7OXi85g8M1F4/aUAI/40KqdezZ2KnDi2TZ4=";
};
nativeBuildInputs = [
meson
ninja
pkg-config
gettext
gobject-introspection
python3
flex
]
++ lib.optionals enableDocumentation [
hotdoc
];
buildInputs = [
bash-completion
libxml2
gst-devtools
python3
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
apple-sdk_gstreamer
];
propagatedBuildInputs = [
gst-plugins-base
gst-plugins-bad
];
mesonFlags = [
(lib.mesonEnable "doc" enableDocumentation)
(lib.mesonEnable "tests" finalAttrs.finalPackage.doCheck)
];
postPatch = ''
patchShebangs \
scripts/extract-release-date-from-doap-file.py
'';
passthru = {
updateScript = directoryListingUpdater { };
};
meta = with lib; {
description = "Library for creation of audio/video non-linear editors";
mainProgram = "ges-launch-1.0";
homepage = "https://gstreamer.freedesktop.org";
license = licenses.lgpl2Plus;
platforms = platforms.unix;
maintainers = [ ];
};
})

View File

@@ -0,0 +1,298 @@
{
lib,
stdenv,
fetchurl,
fetchpatch,
replaceVars,
meson,
nasm,
ninja,
pkg-config,
python3,
gst-plugins-base,
orc,
bzip2,
gettext,
libGL,
libv4l,
libdv,
libavc1394,
libiec61883,
libvpx,
libdrm,
speex,
opencore-amr,
flac,
taglib,
libshout,
cairo,
gdk-pixbuf,
aalib,
libcaca,
libsoup_3,
libpulseaudio,
libintl,
libxml2,
lame,
mpg123,
twolame,
gtkSupport ? false,
gtk3,
qt5Support ? false,
qt5,
qt6Support ? false,
qt6,
raspiCameraSupport ? false,
libraspberrypi,
enableJack ? true,
libjack2,
enableX11 ? stdenv.hostPlatform.isLinux,
xorg,
ncurses,
enableWayland ? stdenv.hostPlatform.isLinux,
wayland,
wayland-protocols,
libgudev,
wavpack,
glib,
openssl,
# Checks meson.is_cross_build(), so even canExecute isn't enough.
enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform,
hotdoc,
gst-plugins-good,
directoryListingUpdater,
apple-sdk_gstreamer,
}:
let
# MMAL is not supported on aarch64, see:
# https://github.com/raspberrypi/userland/issues/688
hostSupportsRaspiCamera = stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch32;
in
assert raspiCameraSupport -> hostSupportsRaspiCamera;
stdenv.mkDerivation (finalAttrs: {
pname = "gst-plugins-good";
version = "1.26.5";
outputs = [
"out"
"dev"
];
src = fetchurl {
url = "https://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-${finalAttrs.version}.tar.xz";
hash = "sha256-6whi6TQEsHPpjsUDUOzn5mheopNsq4EYwrjpOOLL6os=";
};
patches = [
# dlopen libsoup_3 with an absolute path
(replaceVars ./souploader.diff {
nixLibSoup3Path = "${lib.getLib libsoup_3}/lib";
})
];
strictDeps = true;
depsBuildBuild = [ pkg-config ];
nativeBuildInputs = [
pkg-config
python3
meson
ninja
gettext
nasm
orc
libshout
glib
]
++ lib.optionals enableDocumentation [
hotdoc
]
++ lib.optionals qt5Support (
with qt5;
[
qtbase
qttools
]
)
++ lib.optionals qt6Support (
with qt6;
[
qtbase
qttools
]
)
++ lib.optionals enableWayland [
wayland-protocols
];
buildInputs = [
gst-plugins-base
orc
bzip2
libdv
libvpx
speex
opencore-amr
flac
taglib
cairo
gdk-pixbuf
aalib
libcaca
libsoup_3
libshout
libxml2
lame
mpg123
twolame
libintl
ncurses
wavpack
openssl
]
++ lib.optionals raspiCameraSupport [
libraspberrypi
]
++ lib.optionals enableX11 [
xorg.libXext
xorg.libXfixes
xorg.libXdamage
xorg.libXtst
xorg.libXi
]
++ lib.optionals gtkSupport [
# for gtksink
gtk3
]
++ lib.optionals qt5Support (
with qt5;
[
qtbase
qtdeclarative
qtwayland
qtx11extras
]
)
++ lib.optionals qt6Support (
with qt6;
[
qtbase
qtdeclarative
qtwayland
]
)
++ lib.optionals stdenv.hostPlatform.isLinux [
libdrm
libGL
libv4l
libpulseaudio
libavc1394
libiec61883
libgudev
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
apple-sdk_gstreamer
]
++ lib.optionals enableWayland [
wayland
]
++ lib.optionals enableJack [
libjack2
];
mesonFlags = [
"-Dexamples=disabled" # requires many dependencies and probably not useful for our users
"-Dglib_debug=disabled" # cast checks should be disabled on stable releases
(lib.mesonEnable "doc" enableDocumentation)
]
++ lib.optionals (!qt5Support) [
"-Dqt5=disabled"
]
++ lib.optionals (!qt6Support) [
"-Dqt6=disabled"
]
++ lib.optionals (!gtkSupport) [
"-Dgtk3=disabled"
]
++ lib.optionals (!enableX11) [
"-Dximagesrc=disabled" # Linux-only
]
++ lib.optionals (!enableJack) [
"-Djack=disabled"
]
++ lib.optionals (!stdenv.hostPlatform.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
]
++ (
if raspiCameraSupport then
[
"-Drpi-lib-dir=${libraspberrypi}/lib"
]
else
[
"-Drpicamsrc=disabled"
]
);
postPatch = ''
patchShebangs \
scripts/extract-release-date-from-doap-file.py \
ext/qt6/qsb-wrapper.py
'';
env = {
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 explicitly set since 5590e365
dontWrapQtApps = true;
passthru = {
tests = {
gtk = gst-plugins-good.override {
gtkSupport = true;
};
qt5 = gst-plugins-good.override {
qt5Support = true;
};
qt6 = gst-plugins-good.override {
qt6Support = true;
};
}
// lib.optionalAttrs hostSupportsRaspiCamera {
raspiCamera = gst-plugins-good.override {
raspiCameraSupport = true;
};
};
updateScript = directoryListingUpdater { };
};
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 ];
};
})

View File

@@ -0,0 +1,13 @@
diff --git a/ext/soup/gstsouploader.c b/ext/soup/gstsouploader.c
index 41f3aa3783..451e15b40d 100644
--- a/ext/soup/gstsouploader.c
+++ b/ext/soup/gstsouploader.c
@@ -178,7 +178,7 @@ gst_soup_load_library (void)
GST_DEBUG ("LibSoup 2 found");
} else {
GST_DEBUG ("Trying all libsoups");
- libsoup_sonames[0] = LIBSOUP_3_SONAME;
+ libsoup_sonames[0] = "@nixLibSoup3Path@/" LIBSOUP_3_SONAME;
libsoup_sonames[1] = LIBSOUP_2_SONAME;
}

View File

@@ -0,0 +1,68 @@
{
lib,
stdenv,
fetchurl,
fetchpatch,
pkg-config,
file,
glibmm,
gst_all_1,
gnome,
apple-sdk_gstreamer,
}:
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";
};
patches = [
(fetchpatch {
name = "${pname}-${version}.fix-build-against-glib-2.68.patch";
url = "https://gitlab.gnome.org/GNOME/gstreamermm/-/commit/37116547fb5f9066978e39b4cf9f79f2154ad425.patch";
sha256 = "sha256-YHtmOiOl4POwas3eWHsew3IyGK7Aq22MweBm3JPwyBM=";
})
];
outputs = [
"out"
"dev"
];
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
apple-sdk_gstreamer
];
nativeBuildInputs = [
pkg-config
file
];
propagatedBuildInputs = [
glibmm
gst_all_1.gst-plugins-base
];
enableParallelBuilding = true;
passthru = {
updateScript = gnome.updateScript {
attrPath = "gst_all_1.gstreamermm";
packageName = "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 ];
};
}

View File

@@ -0,0 +1,68 @@
{
lib,
stdenv,
fetchFromGitHub,
autoreconfHook,
pkg-config,
gst_all_1,
ipu6-camera-hal,
libdrm,
libva,
apple-sdk_gstreamer,
}:
stdenv.mkDerivation {
pname = "icamerasrc-${ipu6-camera-hal.ipuVersion}";
version = "unstable-2024-09-29";
src = fetchFromGitHub {
owner = "intel";
repo = "icamerasrc";
tag = "20240926_1446";
hash = "sha256-BpIZxkPmSVKqPntwBJjGmCaMSYFCEZHJa4soaMAJRWE=";
};
nativeBuildInputs = [
autoreconfHook
pkg-config
];
preConfigure = ''
# https://github.com/intel/ipu6-camera-hal/issues/1
export CHROME_SLIM_CAMHAL=ON
# https://github.com/intel/icamerasrc/issues/22
export STRIP_VIRTUAL_CHANNEL_CAMHAL=ON
'';
buildInputs = [
gst_all_1.gstreamer
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-bad
ipu6-camera-hal
libdrm
libva
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
apple-sdk_gstreamer
];
NIX_CFLAGS_COMPILE = [
"-Wno-error"
# gstcameradeinterlace.cpp:55:10: fatal error: gst/video/video.h: No such file or directory
"-I${gst_all_1.gst-plugins-base.dev}/include/gstreamer-1.0"
];
enableParallelBuilding = true;
passthru = {
inherit (ipu6-camera-hal) ipuVersion;
};
meta = with lib; {
description = "GStreamer Plugin for MIPI camera support through the IPU6/IPU6EP/IPU6SE on Intel Tigerlake/Alderlake/Jasperlake platforms";
homepage = "https://github.com/intel/icamerasrc/tree/icamerasrc_slim_api";
license = licenses.lgpl21Plus;
maintainers = [ ];
platforms = [ "x86_64-linux" ];
};
}

View File

@@ -0,0 +1,74 @@
{
stdenv,
lib,
fetchurl,
meson,
ninja,
pkg-config,
python3,
gstreamer,
gst-plugins-base,
gettext,
ffmpeg-headless,
# Checks meson.is_cross_build(), so even canExecute isn't enough.
enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform,
hotdoc,
directoryListingUpdater,
apple-sdk_gstreamer,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "gst-libav";
version = "1.26.5";
outputs = [
"out"
"dev"
];
src = fetchurl {
url = "https://gstreamer.freedesktop.org/src/gst-libav/gst-libav-${finalAttrs.version}.tar.xz";
hash = "sha256-1t4FiE70I3bdjN6JlA97UM7Zb09vUoiOdkzYIz508FI=";
};
nativeBuildInputs = [
meson
ninja
gettext
pkg-config
python3
]
++ lib.optionals enableDocumentation [
hotdoc
];
buildInputs = [
gstreamer
gst-plugins-base
ffmpeg-headless
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
apple-sdk_gstreamer
];
mesonFlags = [
(lib.mesonEnable "doc" enableDocumentation)
];
postPatch = ''
patchShebangs \
scripts/extract-release-date-from-doap-file.py
'';
passthru = {
updateScript = directoryListingUpdater { };
};
meta = with lib; {
description = "FFmpeg plugin for GStreamer";
homepage = "https://gstreamer.freedesktop.org";
license = licenses.lgpl2Plus;
platforms = platforms.unix;
maintainers = [ ];
};
})

View File

@@ -0,0 +1,293 @@
{
lib,
stdenv,
fetchFromGitLab,
fetchpatch,
rustPlatform,
meson,
ninja,
python3,
pkg-config,
rustc,
cargo,
cargo-c,
lld,
nasm,
cmake,
gstreamer,
gst-plugins-base,
gst-plugins-bad,
gtk4,
cairo,
csound,
dav1d,
libsodium,
libwebp,
openssl,
pango,
gst-plugins-good,
nix-update-script,
# specifies a limited subset of plugins to build (the default `null` means all plugins supported on the stdenv platform)
plugins ? null,
withGtkPlugins ? true,
# Checks meson.is_cross_build(), so even canExecute isn't enough.
enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform && plugins == null,
hotdoc,
mopidy,
apple-sdk_gstreamer,
}:
let
# populated from meson_options.txt (manually for now, but that might change in the future)
validPlugins = {
# audio
audiofx = [ ];
claxon = [ ];
csound = [ csound ];
lewton = [ ];
spotify = [ ];
# generic
file = [ ];
sodium = [ libsodium ];
threadshare = [ ];
# mux
flavors = [ ];
fmp4 = [ ];
mp4 = [ ];
# net
aws = [ openssl ];
hlssink3 = [ ];
ndi = [ ];
onvif = [ pango ];
raptorq = [ ];
reqwest = [ openssl ];
rtp = [ ];
webrtc = [
gst-plugins-bad
openssl
];
webrtchttp = [
gst-plugins-bad
openssl
];
# text
textahead = [ ];
json = [ ];
regex = [ ];
textwrap = [ ];
# utils
fallbackswitch = [ gtk4 ];
livesync = [ gtk4 ];
togglerecord = [ gtk4 ];
tracers = [ ];
uriplaylistbin = [ ];
# video
cdg = [ ];
closedcaption = [ pango ];
dav1d = [ dav1d ];
ffv1 = [ ];
gif = [ ];
gtk4 = [ gtk4 ];
hsv = [ ];
png = [ ];
rav1e = [ ];
videofx = [ cairo ];
webp = [ libwebp ];
};
selectedPlugins =
if plugins != null then
lib.unique (lib.sort lib.lessThan plugins)
else
lib.subtractLists (
[
"csound" # tests have weird failure on x86, does not currently work on arm or darwin
"livesync" # tests have suspicious intermittent failure, see https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/357
]
++ lib.optionals stdenv.hostPlatform.isAarch64 [
"raptorq" # pointer alignment failure in tests on aarch64
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
"reqwest" # tests hang on darwin
"threadshare" # tests cannot bind to localhost on darwin
"uriplaylistbin" # thread reqwest-internal-sync-runtime attempred to create a NULL object (in test_cache)
"webp" # not supported on darwin (upstream crate issue)
]
++ lib.optionals (!gst-plugins-base.glEnabled || !withGtkPlugins) [
# these require gstreamer-gl
"gtk4"
"livesync"
"fallbackswitch"
"togglerecord"
]
) (lib.attrNames validPlugins);
invalidPlugins = lib.subtractLists (lib.attrNames validPlugins) selectedPlugins;
in
assert lib.assertMsg (invalidPlugins == [ ])
"Invalid gst-plugins-rs plugin${
lib.optionalString (lib.length invalidPlugins > 1) "s"
}: ${lib.concatStringsSep ", " invalidPlugins}";
stdenv.mkDerivation (finalAttrs: {
pname = "gst-plugins-rs";
version = "0.14.1";
outputs = [
"out"
"dev"
];
src = fetchFromGitLab {
domain = "gitlab.freedesktop.org";
owner = "gstreamer";
repo = "gst-plugins-rs";
rev = finalAttrs.version;
hash = "sha256-gCT/ZcXR9VePXYtEENXxgBNvA84KT1OYUR8kSyLBzrI=";
# TODO: temporary workaround for case-insensitivity problems with color-name crate - https://github.com/annymosse/color-name/pull/2
postFetch = ''
sedSearch="$(cat <<\EOF | sed -ze 's/\n/\\n/g'
\[\[package\]\]
name = "color-name"
version = "\([^"\n]*\)"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "[^"\n]*"
EOF
)"
sedReplace="$(cat <<\EOF | sed -ze 's/\n/\\n/g'
[[package]]
name = "color-name"
version = "\1"
source = "git+https://github.com/lilyinstarlight/color-name#cac0ed5b7d2e0682c08c9bfd13089d5494e81b9a"
EOF
)"
sed -i -ze "s|$sedSearch|$sedReplace|g" $out/Cargo.lock
'';
};
cargoDeps = rustPlatform.fetchCargoVendor {
inherit (finalAttrs) src patches;
name = "gst-plugins-rs-${finalAttrs.version}";
hash = "sha256-sX3P5qrG0M/vJkvzvJGzv4fcMn6FvrLPOUh++vKJ/gY=";
};
patches = [
# Related to https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/723
./ignore-tests.patch
(fetchpatch {
name = "x264enc-test-fix.patch";
url = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/commit/c0c9888d66e107f9e0b6d96cd3a85961c7e97d9a.diff";
hash = "sha256-/ILdPDjI20k5l9Qf/klglSuhawmFUs9mR+VhBnQqsWw=";
})
];
strictDeps = true;
nativeBuildInputs = [
rustPlatform.cargoSetupHook
meson
ninja
python3
python3.pkgs.tomli
pkg-config
rustc
cargo
cargo-c
nasm
]
# aws-lc-rs has no pregenerated bindings for exotic platforms
# https://aws.github.io/aws-lc-rs/platform_support.html
++ lib.optionals (!(stdenv.hostPlatform.isx86 || stdenv.hostPlatform.isAarch64)) [
cmake
rustPlatform.bindgenHook
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
lld
]
++ lib.optionals enableDocumentation [
hotdoc
];
env = lib.optionalAttrs stdenv.hostPlatform.isDarwin { NIX_CFLAGS_LINK = "-fuse-ld=lld"; };
buildInputs = [
gstreamer
gst-plugins-base
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
apple-sdk_gstreamer
]
++ lib.concatMap (plugin: lib.getAttr plugin validPlugins) selectedPlugins;
checkInputs = [
gst-plugins-good
gst-plugins-bad
];
mesonFlags = (map (plugin: lib.mesonEnable plugin true) selectedPlugins) ++ [
(lib.mesonOption "sodium-source" "system")
(lib.mesonEnable "tests" finalAttrs.finalPackage.doCheck)
(lib.mesonEnable "doc" enableDocumentation)
];
# turn off all auto plugins since we use a list of plugins we generate
mesonAutoFeatures = "disabled";
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
# csound lib dir must be manually specified for it to build
preConfigure = ''
export CARGO_BUILD_JOBS=$NIX_BUILD_CORES
patchShebangs dependencies.py
''
+ lib.optionalString (lib.elem "csound" selectedPlugins) ''
export CSOUND_LIB_DIR=${lib.getLib csound}/lib
'';
mesonCheckFlags = [ "--verbose" ];
preCheck = ''
# Fontconfig error: No writable cache directories
export XDG_CACHE_HOME=$(mktemp -d)
'';
doInstallCheck =
(lib.elem "webp" selectedPlugins) && !stdenv.hostPlatform.isStatic && stdenv.hostPlatform.isElf;
installCheckPhase = ''
runHook preInstallCheck
readelf -a $out/lib/gstreamer-1.0/libgstrswebp.so | grep -F 'Shared library: [libwebpdemux.so'
runHook postInstallCheck
'';
passthru = {
updateScript = nix-update-script {
# use numbered releases rather than gstreamer-* releases
# this matches upstream's recommendation: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/470#note_2202772
extraArgs = [
"--version-regex"
"([0-9.]+)"
];
};
};
meta = with lib; {
description = "GStreamer plugins written in Rust";
mainProgram = "gst-webrtc-signalling-server";
homepage = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs";
license = with licenses; [
mpl20
asl20
mit
lgpl21Plus
];
platforms = platforms.unix;
maintainers = [ ];
};
})

View File

@@ -0,0 +1,20 @@
diff --git a/utils/uriplaylistbin/tests/uriplaylistbin.rs b/utils/uriplaylistbin/tests/uriplaylistbin.rs
index 3489eaa8..569635d6 100644
--- a/utils/uriplaylistbin/tests/uriplaylistbin.rs
+++ b/utils/uriplaylistbin/tests/uriplaylistbin.rs
@@ -388,6 +388,7 @@ fn multi_audio() {
assert_eq!(current_uri_index, 2);
}
+#[ignore = "Unknown failure"]
#[test]
fn multi_audio_video() {
let (_events, current_iteration, current_uri_index, eos) = test(
@@ -403,6 +404,7 @@ fn multi_audio_video() {
assert_eq!(current_uri_index, 1);
}
+#[ignore = "Unknown failure"]
#[test]
fn iterations() {
let (_events, current_iteration, current_uri_index, eos) = test(

View File

@@ -0,0 +1,79 @@
{
stdenv,
lib,
fetchurl,
meson,
ninja,
pkg-config,
python3,
gettext,
gobject-introspection,
gst-plugins-base,
gst-plugins-bad,
# Checks meson.is_cross_build(), so even canExecute isn't enough.
enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform,
hotdoc,
directoryListingUpdater,
apple-sdk_gstreamer,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "gst-rtsp-server";
version = "1.26.5";
outputs = [
"out"
"dev"
];
src = fetchurl {
url = "https://gstreamer.freedesktop.org/src/gst-rtsp-server/gst-rtsp-server-${finalAttrs.version}.tar.xz";
hash = "sha256-Mo3/JFdBloPypPBsoRnP0ivrYyzuGtaDBZEhMyU1PEQ=";
};
nativeBuildInputs = [
meson
ninja
gettext
gobject-introspection
pkg-config
python3
]
++ lib.optionals enableDocumentation [
hotdoc
];
buildInputs = [
gst-plugins-base
gst-plugins-bad
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
apple-sdk_gstreamer
];
mesonFlags = [
"-Dglib_debug=disabled" # cast checks should be disabled on stable releases
"-Dexamples=disabled" # requires many dependencies and probably not useful for our users
(lib.mesonEnable "doc" enableDocumentation)
];
postPatch = ''
patchShebangs \
scripts/extract-release-date-from-doap-file.py
'';
passthru = {
updateScript = directoryListingUpdater { };
};
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 ];
};
})

View File

@@ -0,0 +1,119 @@
{
stdenv,
fetchurl,
meson,
ninja,
pkg-config,
python3,
gst-plugins-base,
orc,
gettext,
a52dec,
libcdio,
libdvdread,
libmad,
libmpeg2,
x264,
libintl,
lib,
enableGplPlugins ? true,
# Checks meson.is_cross_build(), so even canExecute isn't enough.
enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform,
hotdoc,
directoryListingUpdater,
gst-plugins-ugly,
apple-sdk_gstreamer,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "gst-plugins-ugly";
version = "1.26.5";
outputs = [
"out"
"dev"
];
src = fetchurl {
url = "https://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-${finalAttrs.version}.tar.xz";
hash = "sha256-PfxDQ1vpfhEIFrrG1gKw8gagOFRieWg9nSU3L/En21I=";
};
nativeBuildInputs = [
meson
ninja
gettext
pkg-config
python3
]
++ lib.optionals enableDocumentation [
hotdoc
];
buildInputs = [
gst-plugins-base
orc
libintl
]
++ lib.optionals enableGplPlugins [
a52dec
libcdio
libdvdread
libmad
libmpeg2
x264
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
apple-sdk_gstreamer
];
mesonFlags = [
"-Dglib_debug=disabled" # cast checks should be disabled on stable releases
"-Dsidplay=disabled" # sidplay / sidplay/player.h isn't packaged in nixpkgs as of writing
(lib.mesonEnable "doc" enableDocumentation)
]
++ (
if enableGplPlugins then
[
"-Dgpl=enabled"
]
else
[
"-Da52dec=disabled"
"-Dcdio=disabled"
"-Ddvdread=disabled"
"-Dmpeg2dec=disabled"
"-Dsidplay=disabled"
"-Dx264=disabled"
]
);
postPatch = ''
patchShebangs \
scripts/extract-release-date-from-doap-file.py
'';
passthru = {
tests = {
lgplOnly = gst-plugins-ugly.override {
enableGplPlugins = false;
};
};
updateScript = directoryListingUpdater { };
};
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 = if enableGplPlugins then licenses.gpl2Plus else licenses.lgpl2Plus;
platforms = platforms.unix;
maintainers = with maintainers; [ matthewbauer ];
};
})

View File

@@ -0,0 +1,107 @@
{
lib,
stdenv,
fetchurl,
meson,
ninja,
pkg-config,
gst-plugins-base,
bzip2,
libva,
wayland,
wayland-protocols,
wayland-scanner,
libdrm,
udev,
xorg,
libGLU,
libGL,
gstreamer,
gst-plugins-bad,
nasm,
libvpx,
python3,
# Checks meson.is_cross_build(), so even canExecute isn't enough.
enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform,
hotdoc,
directoryListingUpdater,
apple-sdk_gstreamer,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "gstreamer-vaapi";
version = "1.26.5";
outputs = [
"out"
"dev"
];
src = fetchurl {
url = "https://gstreamer.freedesktop.org/src/gstreamer-vaapi/gstreamer-vaapi-${finalAttrs.version}.tar.xz";
hash = "sha256-tC1E22PzGVpvMyluHq0ywU0B7ydFK3Bo8aLYZiT1Xqk=";
};
nativeBuildInputs = [
meson
ninja
pkg-config
python3
bzip2
wayland-scanner
]
++ lib.optionals enableDocumentation [
hotdoc
];
buildInputs = [
gstreamer
gst-plugins-base
gst-plugins-bad
libva
wayland
wayland-protocols
libdrm
udev
xorg.libX11
xorg.libxcb
xorg.libXext
xorg.libXv
xorg.libXrandr
xorg.libSM
xorg.libICE
nasm
libvpx
]
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
libGL
libGLU
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
apple-sdk_gstreamer
];
strictDeps = true;
mesonFlags = [
"-Dexamples=disabled" # requires many dependencies and probably not useful for our users
(lib.mesonEnable "doc" enableDocumentation)
];
postPatch = ''
patchShebangs \
scripts/extract-release-date-from-doap-file.py
'';
passthru = {
updateScript = directoryListingUpdater { };
};
meta = with lib; {
description = "Set of VAAPI GStreamer Plug-ins";
homepage = "https://gstreamer.freedesktop.org";
license = licenses.lgpl21Plus;
platforms = platforms.linux;
maintainers = [ ];
};
})