2020-04-24 23:36:52 +00:00
{ stdenv
, fetchurl
, fetchpatch
, meson
, ninja
, gettext
, config
, pkgconfig
, python3
, gst-plugins-base
, orc
, gobject-introspection
, enableZbar ? false
, faacSupport ? false
, faac ? null
, faad2
, libass
, libkate
, libmms
, lrdf
, ladspaH
, libnice
, webrtc-audio-processing
, lilv
, lv2
, serd
, sord
, sratom
, libbs2b
, libmodplug
, mpeg2dec
2020-11-12 09:05:59 +00:00
, libmicrodns
2020-04-24 23:36:52 +00:00
, openjpeg
, libopus
, librsvg
, bluez
, chromaprint
, curl
, darwin
, directfb
, fdk_aac
, flite
, gsm
, libaom
, libdc1394
, libde265
, libdrm
, libdvdnav
, libdvdread
, libgudev
, libofa
, libsndfile
, libusb1
, neon
, openal
, opencv4
, openexr
, openh264
, pango
, rtmpdump
, sbc
, soundtouch
, spandsp
, srtp
, zbar
, wayland-protocols
, wildmidi
, fluidsynth
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
, libintl
, libgme
, openssl
, x265
, libxml2
, srt
} :
assert faacSupport -> faac != null ;
let
inherit ( stdenv . lib ) optional optionals ;
in stdenv . mkDerivation rec {
pname = " g s t - p l u g i n s - b a d " ;
2020-11-12 09:05:59 +00:00
version = " 1 . 1 8 . 0 " ;
2020-04-24 23:36:52 +00:00
outputs = [ " o u t " " d e v " ] ;
src = fetchurl {
url = " ${ meta . homepage } / s r c / ${ pname } / ${ pname } - ${ version } . t a r . x z " ;
2020-11-12 09:05:59 +00:00
sha256 = " 0 p q q q 5 b s 9 f j w c m b w g s g x s 2 d x 6 g z n h x s 7 i i 5 p m j k s l r 6 x m l f a p 0 p k " ;
2020-04-24 23:36:52 +00:00
} ;
patches = [
2020-11-12 09:05:59 +00:00
./fix_pkgconfig_includedir.patch
# Fixes srt usage failing with
# Failed to open SRT: failed to set SRTO_LINGER (reason: Operation not supported: Bad parameters)
# see https://github.com/Haivision/srt/issues/1374
# Remove when https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/commit/84f8dbd932029220ee86154dd85b241911ea3891
# is shown as being in a release tag that nixpkgs uses.
2020-04-24 23:36:52 +00:00
( fetchpatch {
2020-11-12 09:05:59 +00:00
name = " g s t r e a m e r - s r t o b j e c t - t y p e c a s t - S R T O _ L I N G E R - t o - l i n g e r . p a t c h " ;
url = " h t t p s : / / g i t l a b . f r e e d e s k t o p . o r g / g s t r e a m e r / g s t - p l u g i n s - b a d / - / c o m m i t / 8 4 f 8 d b d 9 3 2 0 2 9 2 2 0 e e 8 6 1 5 4 d d 8 5 b 2 4 1 9 1 1 e a 3 8 9 1 . p a t c h " ;
sha256 = " 0 5 9 6 l v g i 9 3 s j 3 y n 9 8 g r g m s r h n q h h q 7 f n j k 9 1 q i 4 x c 6 6 1 8 f p q m p 9 x " ;
2020-04-24 23:36:52 +00:00
} )
] ;
nativeBuildInputs = [
meson
ninja
pkgconfig
2020-11-12 09:05:59 +00:00
orc # for orcc
2020-04-24 23:36:52 +00:00
python3
gettext
gobject-introspection
] ++ 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
2020-11-12 09:05:59 +00:00
gobject-introspection
2020-04-24 23:36:52 +00:00
faad2
libass
libkate
libmms
webrtc-audio-processing # webrtc
libbs2b
libmodplug
mpeg2dec
2020-11-12 09:05:59 +00:00
libmicrodns
2020-04-24 23:36:52 +00:00
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
2020-11-12 09:05:59 +00:00
libva
2020-04-24 23:36:52 +00:00
libvdpau
libwebp
xvidcore
gnutls
libGL
libGLU
libgme
openssl
x265
libxml2
libintl
srt
] ++ optionals enableZbar [
zbar
] ++ optionals faacSupport [
faac
] ++ optionals stdenv . isLinux [
bluez
wayland
2020-11-12 09:05:59 +00:00
wayland-protocols
2020-04-24 23:36:52 +00:00
] ++ optionals ( ! stdenv . isDarwin ) [
# wildmidi requires apple's OpenAL
# TODO: package apple's OpenAL, fix wildmidi, include on Darwin
wildmidi
# TODO: mjpegtools uint64_t is not compatible with guint64 on Darwin
mjpegtools
chromaprint
directfb
flite
libdrm
libgudev
libnice
libofa
sbc
spandsp
# ladspa plug-in
ladspaH
lrdf # TODO: make build on Darwin
# lv2 plug-in
lilv
lv2
serd
sord
sratom
] ++ optionals stdenv . isDarwin ( with darwin . apple_sdk . frameworks ; [
# For unknown reasons the order is important, e.g. if
# VideoToolbox is last, we get:
# fatal error: 'VideoToolbox/VideoToolbox.h' file not found
VideoToolbox
AudioToolbox
AVFoundation
CoreMedia
CoreVideo
Foundation
MediaToolbox
] ) ;
mesonFlags = [
" - 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
2020-11-12 09:05:59 +00:00
" - D d o c = d i s a b l e d " # `hotdoc` not packaged in nixpkgs as of writing
2020-04-24 23:36:52 +00:00
2020-11-12 09:05:59 +00:00
" - D a v t p = d i s a b l e d "
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 " } "
" - D i q a = d i s a b l e d " # required `dssim` library not packaging in nixpkgs as of writing
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 m p t = d i s a b l e d " # `libopenmpt` not packaged in nixpkgs as of writing
" - 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
" - D s c t p = d i s a b l e d " # required `usrsctp` library 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 a c e n c = d i s a b l e d " # required `vo-aacenc` library 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
2020-11-12 09:05:59 +00:00
" - D z x i n g = d i s a b l e d " # required `zxing-cpp` library not packaged in nixpkgs as of writing
2020-04-24 23:36:52 +00:00
]
++ optionals stdenv . isDarwin [
" - D b l u e z = d i s a b l e d "
" - D c h r o m a p r i n t = d i s a b l e d "
" - D d i r e c t f b = 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 o f a = d i s a b l e d "
" - 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
" - D l a d s p a = d i s a b l e d " # requires lrdf
" - D w e b r t c = d i s a b l e d " # requires libnice, which as of writing doesn't work on Darwin in nixpkgs
" - D w i l d m i d i = d i s a b l e d " # see dependencies above
] ++ optionals ( ! gst-plugins-base . glEnabled ) [
" - D g l = d i s a b l e d " ]
++ optionals ( ! gst-plugins-base . waylandEnabled ) [
" - D w a y l a n d = d i s a b l e d "
] ++ optionals ( ! gst-plugins-base . glEnabled ) [
# `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 "
] ;
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
meta = with stdenv . lib ; {
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 .
'' ;
license = licenses . lgpl2Plus ;
platforms = platforms . linux ++ platforms . darwin ;
maintainers = with maintainers ; [ matthewbauer ] ;
} ;
}