2021-03-09 03:18:52 +00:00
{ lib
, stdenv
2020-04-24 23:36:52 +00:00
, fetchurl
2022-10-21 18:38:19 +00:00
, substituteAll
2020-04-24 23:36:52 +00:00
, meson
, ninja
, gettext
2021-02-05 17:12:51 +00:00
, pkg-config
2020-04-24 23:36:52 +00:00
, python3
, gst-plugins-base
, orc
2022-02-10 20:34:41 +00:00
, gstreamer
2020-04-24 23:36:52 +00:00
, gobject-introspection
, enableZbar ? false
, faacSupport ? false
2021-03-09 03:18:52 +00:00
, faac
2023-07-15 17:15:38 +00:00
, opencvSupport ? false
, opencv4
2020-04-24 23:36:52 +00:00
, faad2
2022-02-10 20:34:41 +00:00
, ldacbt
2020-04-24 23:36:52 +00:00
, libass
, libkate
, lrdf
, ladspaH
2022-10-21 18:38:19 +00:00
, lcms2
2020-04-24 23:36:52 +00:00
, libnice
, webrtc-audio-processing
, lilv
, lv2
, serd
, sord
, sratom
, libbs2b
, libmodplug
2022-02-10 20:34:41 +00:00
, libmpeg2
2020-11-12 09:05:59 +00:00
, libmicrodns
2020-04-24 23:36:52 +00:00
, openjpeg
, libopus
, librsvg
, bluez
, chromaprint
, curl
, fdk_aac
, flite
, gsm
2022-02-10 20:34:41 +00:00
, json-glib
2020-04-24 23:36:52 +00:00
, libaom
, libdc1394
, libde265
, libdrm
, libdvdnav
, libdvdread
, libgudev
2022-02-10 20:34:41 +00:00
, qrencode
2020-04-24 23:36:52 +00:00
, libsndfile
, libusb1
, neon
, openal
2023-04-29 16:46:19 +00:00
, openexr_3
2020-04-24 23:36:52 +00:00
, openh264
2021-09-18 10:52:07 +00:00
, libopenmpt
2020-04-24 23:36:52 +00:00
, pango
, rtmpdump
, sbc
, soundtouch
, spandsp
, srtp
, zbar
, wayland-protocols
, wildmidi
, fluidsynth
2020-11-12 09:05:59 +00:00
, libva
2020-04-24 23:36:52 +00:00
, libvdpau
, wayland
, libwebp
, xvidcore
, gnutls
, mjpegtools
, libGLU
, libGL
2022-10-21 18:38:19 +00:00
, addOpenGLRunpath
2023-04-29 16:46:19 +00:00
, gtk3
2020-04-24 23:36:52 +00:00
, libintl
2022-09-09 14:08:57 +00:00
, game-music-emu
2020-04-24 23:36:52 +00:00
, openssl
, x265
, libxml2
, srt
2021-03-09 03:18:52 +00:00
, vo-aacenc
2022-04-27 09:35:20 +00:00
, libfreeaptx
2022-09-30 11:47:45 +00:00
, zxing-cpp
2023-07-15 17:15:38 +00:00
, usrsctp
2021-03-09 03:18:52 +00:00
, VideoToolbox
, AudioToolbox
, AVFoundation
2023-04-29 16:46:19 +00:00
, Cocoa
2021-03-09 03:18:52 +00:00
, CoreMedia
, CoreVideo
, Foundation
, MediaToolbox
2022-02-10 20:34:41 +00:00
, enableGplPlugins ? true
2022-06-26 10:26:21 +00:00
, bluezSupport ? stdenv . isLinux
2023-05-24 13:37:59 +00:00
# Causes every application using GstDeviceMonitor to send mDNS queries every 2 seconds
, microdnsSupport ? false
2023-04-29 16:46:19 +00:00
# Checks meson.is_cross_build(), so even canExecute isn't enough.
, enableDocumentation ? stdenv . hostPlatform == stdenv . buildPlatform , hotdoc
2023-07-15 17:15:38 +00:00
, guiSupport ? true , directfb
2020-04-24 23:36:52 +00:00
} :
2021-03-09 03:18:52 +00:00
stdenv . mkDerivation rec {
2020-04-24 23:36:52 +00:00
pname = " g s t - p l u g i n s - b a d " ;
2024-02-29 20:09:43 +00:00
version = " 1 . 2 2 . 9 " ;
2020-04-24 23:36:52 +00:00
outputs = [ " o u t " " d e v " ] ;
src = fetchurl {
2021-03-09 03:18:52 +00:00
url = " h t t p s : / / g s t r e a m e r . f r e e d e s k t o p . o r g / s r c / ${ pname } / ${ pname } - ${ version } . t a r . x z " ;
2024-02-29 20:09:43 +00:00
hash = " s h a 2 5 6 - G 8 Z d D 9 X 1 O j Y 2 V k 7 9 P 8 8 x j D 7 c 3 s O c Q Q m l A 8 H 8 g g O E C h 0 = " ;
2020-04-24 23:36:52 +00:00
} ;
2022-10-21 18:38:19 +00:00
patches = [
# Add fallback paths for nvidia userspace libraries
( substituteAll {
src = ./fix-paths.patch ;
inherit ( addOpenGLRunpath ) driverLink ;
} )
] ;
2020-04-24 23:36:52 +00:00
nativeBuildInputs = [
meson
ninja
2021-02-05 17:12:51 +00:00
pkg-config
2020-11-12 09:05:59 +00:00
orc # for orcc
2020-04-24 23:36:52 +00:00
python3
gettext
2022-02-10 20:34:41 +00:00
gstreamer # for gst-tester-1.0
2020-04-24 23:36:52 +00:00
gobject-introspection
2023-04-29 16:46:19 +00:00
] ++ lib . optionals enableDocumentation [
hotdoc
2021-03-09 03:18:52 +00:00
] ++ lib . optionals stdenv . isLinux [
2020-11-12 09:05:59 +00:00
wayland # for wayland-scanner
2020-04-24 23:36:52 +00:00
] ;
buildInputs = [
gst-plugins-base
orc
2022-02-10 20:34:41 +00:00
json-glib
2022-10-21 18:38:19 +00:00
lcms2
2022-02-10 20:34:41 +00:00
ldacbt
2020-04-24 23:36:52 +00:00
libass
libkate
2022-02-10 20:34:41 +00:00
webrtc-audio-processing # required by webrtcdsp
#webrtc-audio-processing_1 # required by isac
2020-04-24 23:36:52 +00:00
libbs2b
libmodplug
openjpeg
2021-09-18 10:52:07 +00:00
libopenmpt
2020-04-24 23:36:52 +00:00
libopus
librsvg
curl . dev
fdk_aac
gsm
libaom
libdc1394
libde265
libdvdnav
libdvdread
2023-07-15 17:15:38 +00:00
libnice
2022-02-10 20:34:41 +00:00
qrencode
2020-04-24 23:36:52 +00:00
libsndfile
libusb1
neon
openal
2023-04-29 16:46:19 +00:00
openexr_3
2020-04-24 23:36:52 +00:00
openh264
rtmpdump
pango
soundtouch
srtp
fluidsynth
libvdpau
libwebp
xvidcore
gnutls
2022-09-09 14:08:57 +00:00
game-music-emu
2020-04-24 23:36:52 +00:00
openssl
libxml2
libintl
srt
2021-03-09 03:18:52 +00:00
vo-aacenc
2022-04-27 09:35:20 +00:00
libfreeaptx
2022-09-30 11:47:45 +00:00
zxing-cpp
2023-07-15 17:15:38 +00:00
usrsctp
2023-08-04 22:07:22 +00:00
wildmidi
2023-07-15 17:15:38 +00:00
] ++ lib . optionals opencvSupport [
opencv4
2021-03-09 03:18:52 +00:00
] ++ lib . optionals enableZbar [
2020-04-24 23:36:52 +00:00
zbar
2021-03-09 03:18:52 +00:00
] ++ lib . optionals faacSupport [
2020-04-24 23:36:52 +00:00
faac
2022-02-10 20:34:41 +00:00
] ++ lib . optionals enableGplPlugins [
libmpeg2
mjpegtools
faad2
x265
2022-06-26 10:26:21 +00:00
] ++ lib . optionals bluezSupport [
2020-04-24 23:36:52 +00:00
bluez
2023-05-24 13:37:59 +00:00
] ++ lib . optionals microdnsSupport [
libmicrodns
2022-06-26 10:26:21 +00:00
] ++ lib . optionals stdenv . isLinux [
2020-11-21 19:51:51 +00:00
libva # vaapi requires libva -> libdrm -> libpciaccess, which is Linux-only in nixpkgs
2020-04-24 23:36:52 +00:00
wayland
2020-11-12 09:05:59 +00:00
wayland-protocols
2021-03-09 03:18:52 +00:00
] ++ lib . optionals ( ! stdenv . isDarwin ) [
2020-04-24 23:36:52 +00:00
# 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
2023-07-15 17:15:38 +00:00
libGL
libGLU
] ++ lib . optionals guiSupport [
gtk3
] ++ lib . optionals ( stdenv . isLinux && guiSupport ) [
directfb
2021-03-09 03:18:52 +00:00
] ++ lib . optionals stdenv . isDarwin [
2020-04-24 23:36:52 +00:00
# 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
2023-04-29 16:46:19 +00:00
Cocoa
2020-04-24 23:36:52 +00:00
CoreMedia
CoreVideo
Foundation
MediaToolbox
2021-03-09 03:18:52 +00:00
] ;
2020-04-24 23:36:52 +00:00
mesonFlags = [
" - D e x a m p l e s = d i s a b l e d " # requires many dependencies and probably not useful for our users
2021-10-14 00:43:12 +00:00
" - D g l i b - a s s e r t s = d i s a b l e d " # asserts should be disabled on stable releases
2020-04-24 23:36:52 +00:00
2023-04-29 16:46:19 +00:00
" - D a m f c o d e c = d i s a b l e d " # Windows-only
2020-11-12 09:05:59 +00:00
" - D a v t p = d i s a b l e d "
2023-04-29 16:46:19 +00:00
" - D d i r e c t s h o w = d i s a b l e d " # Windows-only
2020-04-24 23:36:52 +00:00
" - D d t s = d i s a b l e d " # required `libdca` library not packaged in nixpkgs as of writing, and marked as "BIG FAT WARNING: libdca is still in early development"
" - D z b a r = ${ if enableZbar then " e n a b l e d " else " d i s a b l e d " } "
" - D f a a c = ${ if faacSupport then " e n a b l e d " else " d i s a b l e d " } "
2022-02-10 20:34:41 +00:00
" - D i q a = d i s a b l e d " # required `dssim` library not packaging in nixpkgs as of writing, also this is AGPL so update license when adding support
2020-11-12 09:05:59 +00:00
" - D m a g i c l e a p = d i s a b l e d " # required `ml_audio` library not packaged in nixpkgs as of writing
2020-04-24 23:36:52 +00:00
" - D m s d k = d i s a b l e d " # 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?).
" - D m u s e p a c k = d i s a b l e d "
" - D o p e n n i 2 = d i s a b l e d " # not packaged in nixpkgs as of writing
" - D o p e n s l e s = d i s a b l e d " # not packaged in nixpkgs as of writing
2020-11-12 09:05:59 +00:00
" - D s v t h e v c e n c = d i s a b l e d " # required `SvtHevcEnc` library not packaged in nixpkgs as of writing
2020-04-24 23:36:52 +00:00
" - D t e l e t e x t = d i s a b l e d " # required `zvbi` library not packaged in nixpkgs as of writing
" - D t i n y a l s a = d i s a b l e d " # not packaged in nixpkgs as of writing
" - D v o a m r w b e n c = d i s a b l e d " # required `vo-amrwbenc` library not packaged in nixpkgs as of writing
" - D v u l k a n = d i s a b l e d " # Linux-only, and we haven't figured out yet which of the vulkan nixpkgs it needs
" - D w a s a p i = d i s a b l e d " # not packaged in nixpkgs as of writing / no Windows support
2020-11-12 09:05:59 +00:00
" - D w a s a p i 2 = d i s a b l e d " # not packaged in nixpkgs as of writing / no Windows support
2020-04-24 23:36:52 +00:00
" - D w p e = d i s a b l e d " # required `wpe-webkit` library not packaged in nixpkgs as of writing
2022-02-10 20:34:41 +00:00
" - D i s a c = d i s a b l e d " # depends on `webrtc-audio-coding-1` not compatible with 0.3
" - D g s = d i s a b l e d " # depends on `google-cloud-cpp`
" - D o n n x = d i s a b l e d " # depends on `libonnxruntime` not packaged in nixpkgs as of writing
2022-04-27 09:35:20 +00:00
" - D o p e n a p t x = e n a b l e d " # since gstreamer-1.20.1 `libfreeaptx` is supported for circumventing the dubious license conflict with `libopenaptx`
2023-07-15 17:15:38 +00:00
" - D o p e n c v = ${ if opencvSupport then " e n a b l e d " else " d i s a b l e d " } " # Reduces rebuild size when `config.cudaSupport = true`
2023-05-24 13:37:59 +00:00
" - D m i c r o d n s = ${ if microdnsSupport then " e n a b l e d " else " d i s a b l e d " } "
2022-06-26 10:26:21 +00:00
" - D b l u e z = ${ if bluezSupport then " e n a b l e d " else " d i s a b l e d " } "
2023-04-29 16:46:19 +00:00
( lib . mesonEnable " d o c " enableDocumentation )
2020-04-24 23:36:52 +00:00
]
2021-03-09 03:18:52 +00:00
++ lib . optionals ( ! stdenv . isLinux ) [
2023-04-29 16:46:19 +00:00
" - D d o c = d i s a b l e d " # needs gstcuda to be enabled which is Linux-only
" - D n v c o d e c = d i s a b l e d " # Linux-only
2020-11-21 19:51:51 +00:00
" - D v a = d i s a b l e d " # see comment on `libva` in `buildInputs`
2023-07-15 17:15:38 +00:00
] ++ lib . optionals ( ! stdenv . isLinux || ! guiSupport ) [
" - D d i r e c t f b = d i s a b l e d "
2020-11-21 19:51:51 +00:00
]
2021-03-09 03:18:52 +00:00
++ lib . optionals stdenv . isDarwin [
2020-04-24 23:36:52 +00:00
" - D c h r o m a p r i n t = d i s a b l e d "
" - D f l i t e = d i s a b l e d "
" - D k m s = d i s a b l e d " # renders to libdrm output
" - D l v 2 = d i s a b l e d "
" - D s b c = d i s a b l e d "
" - D s p a n d s p = d i s a b l e d "
" - D d v b = d i s a b l e d "
" - D f b d e v = d i s a b l e d "
" - D u v c h 2 6 4 = d i s a b l e d " # requires gudev
2020-11-21 19:51:51 +00:00
" - D v 4 l 2 c o d e c s = d i s a b l e d " # requires gudev
2020-04-24 23:36:52 +00:00
" - D l a d s p a = d i s a b l e d " # requires lrdf
2023-04-29 16:46:19 +00:00
] ++ lib . optionals ( ! stdenv . isLinux || ! stdenv . isx86_64 ) [
" - D q s v = d i s a b l e d " # Linux (and Windows) x86 only
2021-03-09 03:18:52 +00:00
] ++ lib . optionals ( ! gst-plugins-base . glEnabled ) [
" - D g l = d i s a b l e d "
] ++ lib . optionals ( ! gst-plugins-base . waylandEnabled ) [
2023-04-29 16:46:19 +00:00
" - D g t k 3 = d i s a b l e d " # Wayland-based GTK sink
2020-04-24 23:36:52 +00:00
" - D w a y l a n d = d i s a b l e d "
2021-03-09 03:18:52 +00:00
] ++ lib . optionals ( ! gst-plugins-base . glEnabled ) [
2020-04-24 23:36:52 +00:00
# `applemedia/videotexturecache.h` requires `gst/gl/gl.h`,
# but its meson build system does not declare the dependency.
" - D a p p l e m e d i a = d i s a b l e d "
2022-02-10 20:34:41 +00:00
] ++ ( if enableGplPlugins then [
" - D g p l = e n a b l e d "
] else [
" - D d t s = d i s a b l e d "
" - D f a a d = d i s a b l e d "
" - D i q a = d i s a b l e d "
" - D m p e g 2 e n c = d i s a b l e d "
" - D m p l e x = d i s a b l e d "
" - D r e s i n d v d = d i s a b l e d "
" - D x 2 6 5 = d i s a b l e d "
] ) ;
2020-04-24 23:36:52 +00:00
2020-11-12 09:05:59 +00:00
# Argument list too long
strictDeps = true ;
postPatch = ''
patchShebangs \
scripts/extract-release-date-from-doap-file.py
'' ;
2020-04-24 23:36:52 +00:00
# This package has some `_("string literal")` string formats
# that trip up clang with format security enabled.
hardeningDisable = [ " f o r m a t " ] ;
doCheck = false ; # fails 20 out of 58 tests, expensive
2021-02-05 17:12:51 +00:00
meta = with lib ; {
2020-04-24 23:36:52 +00:00
description = " G S t r e a m e r B a d P l u g i n s " ;
homepage = " h t t p s : / / g s t r e a m e r . f r e e d e s k t o p . o r g " ;
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 .
'' ;
2022-02-10 20:34:41 +00:00
license = if enableGplPlugins then licenses . gpl2Plus else licenses . lgpl2Plus ;
2020-04-24 23:36:52 +00:00
platforms = platforms . linux ++ platforms . darwin ;
2023-07-15 17:15:38 +00:00
maintainers = with maintainers ; [ matthewbauer lilyinstarlight ] ;
2020-04-24 23:36:52 +00:00
} ;
}