2021-03-04 20:01:51 +00:00
{ lib
, stdenv
2019-10-02 17:04:26 +00:00
, fetchurl
2021-04-27 19:26:52 +00:00
, fetchpatch
2019-10-02 17:04:26 +00:00
, meson
, ninja
, gettext
2021-01-19 06:50:56 +00:00
, pkg-config
2019-10-02 17:04:26 +00:00
, python3
, gst-plugins-base
, orc
2019-01-21 01:48:04 +00:00
, gobject-introspection
2020-04-10 23:58:35 +00:00
, enableZbar ? false
2019-10-02 17:04:26 +00:00
, faacSupport ? false
2021-03-04 20:01:51 +00:00
, faac
2019-10-02 17:04:26 +00:00
, faad2
, libass
, libkate
, libmms
2020-03-22 23:18:53 +00:00
, lrdf
2019-10-02 17:04:26 +00:00
, ladspaH
, libnice
, webrtc-audio-processing
, lilv
, lv2
, serd
, sord
, sratom
, libbs2b
, libmodplug
, mpeg2dec
2020-10-01 22:31:58 +00:00
, libmicrodns
2019-10-02 17:04:26 +00:00
, openjpeg
, libopus
, librsvg
2019-01-21 01:48:04 +00:00
, bluez
, chromaprint
, curl
, directfb
, fdk_aac
, flite
2019-05-01 17:47:53 +00:00
, gsm
2019-01-21 01:48:04 +00:00
, libaom
, libdc1394
, libde265
, libdrm
, libdvdnav
, libdvdread
, libgudev
, libofa
, libsndfile
, libusb1
, neon
, openal
2019-10-02 17:04:26 +00:00
, opencv4
2019-01-21 01:48:04 +00:00
, openexr
, openh264
2021-09-05 00:55:49 +00:00
, libopenmpt
2019-01-21 01:48:04 +00:00
, pango
2019-05-01 17:48:38 +00:00
, rtmpdump
2019-01-21 01:48:04 +00:00
, sbc
, soundtouch
, spandsp
, srtp
, zbar
, wayland-protocols
2019-10-02 17:04:26 +00:00
, wildmidi
, fluidsynth
2020-10-01 22:31:58 +00:00
, libva
2019-10-02 17:04:26 +00:00
, libvdpau
, wayland
, libwebp
, xvidcore
, gnutls
, mjpegtools
2019-11-10 16:44:34 +00:00
, libGLU
, libGL
2019-10-02 17:04:26 +00:00
, libintl
, libgme
, openssl
, x265
, libxml2
2019-01-20 17:59:47 +00:00
, srt
2021-02-20 19:41:48 +00:00
, vo-aacenc
2021-03-04 20:01:51 +00:00
, VideoToolbox
, AudioToolbox
, AVFoundation
, CoreMedia
, CoreVideo
, Foundation
, MediaToolbox
2013-12-23 15:36:37 +00:00
} :
2021-03-04 20:01:51 +00:00
stdenv . mkDerivation rec {
2019-08-15 12:41:18 +00:00
pname = " g s t - p l u g i n s - b a d " ;
2020-12-07 01:15:03 +00:00
version = " 1 . 1 8 . 2 " ;
2013-12-23 15:36:37 +00:00
2019-10-02 17:04:26 +00:00
outputs = [ " o u t " " d e v " ] ;
2018-03-31 21:03:18 +00:00
2013-12-23 15:36:37 +00:00
src = fetchurl {
2021-03-04 20:01:51 +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 " ;
2020-12-07 01:15:03 +00:00
sha256 = " 0 6 i l d d 4 r l 6 c y n i r v 3 p 0 0 d 2 d d f 5 i s 9 s v j 4 i 7 m k a h l d z h q 2 4 p q 5 m c a " ;
2013-12-23 15:36:37 +00:00
} ;
2019-10-02 17:04:26 +00:00
patches = [
2021-02-20 19:41:48 +00:00
# Use pkgconfig to inject the includedirs
2019-10-02 17:04:26 +00:00
./fix_pkgconfig_includedir.patch
2021-04-27 19:26:52 +00:00
# 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 = " 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 / 6 4 0 a 6 5 b f 9 6 6 d f 0 6 5 d 4 1 a 5 1 1 e 2 d 7 6 d 1 f 2 6 a 2 e 7 7 0 c . p a t c h " ;
sha256 = " E 5 p i g + q E f R 5 8 J t i c r 6 y d F x Z O h M 3 Z J 8 z g r f 5 K 4 B d i B / Y = " ;
includes = [
" e x t / o p e n c v / g s t c v d i l a t e e r o d e . c p p "
] ;
} )
2019-10-02 17:04:26 +00:00
] ;
2016-04-24 12:39:30 +00:00
2019-01-21 01:48:04 +00:00
nativeBuildInputs = [
2019-10-02 17:04:26 +00:00
meson
ninja
2021-01-19 06:50:56 +00:00
pkg-config
2020-11-10 23:31:55 +00:00
orc # for orcc
2019-10-02 17:04:26 +00:00
python3
gettext
gobject-introspection
2021-03-04 20:01:51 +00:00
] ++ lib . optionals stdenv . isLinux [
2020-11-10 23:31:55 +00:00
wayland # for wayland-scanner
2019-01-21 01:48:04 +00:00
] ;
2013-12-23 15:36:37 +00:00
buildInputs = [
2019-10-02 17:04:26 +00:00
gst-plugins-base
orc
2021-02-20 19:41:48 +00:00
# gobject-introspection has to be in both nativeBuildInputs and
# buildInputs. The build tries to link against libgirepository-1.0.so
2020-11-10 23:31:55 +00:00
gobject-introspection
2019-10-02 17:04:26 +00:00
faad2
libass
libkate
libmms
webrtc-audio-processing # webrtc
2018-07-08 23:17:35 +00:00
libbs2b
2019-10-02 17:04:26 +00:00
libmodplug
mpeg2dec
2020-10-01 22:31:58 +00:00
libmicrodns
2019-10-02 17:04:26 +00:00
openjpeg
2021-09-05 00:55:49 +00:00
libopenmpt
2019-10-02 17:04:26 +00:00
libopus
librsvg
2019-01-21 01:48:04 +00:00
curl . dev
fdk_aac
2019-05-01 17:47:53 +00:00
gsm
2019-01-21 01:48:04 +00:00
libaom
libdc1394
libde265
libdvdnav
libdvdread
libsndfile
libusb1
2019-05-01 16:44:08 +00:00
mjpegtools
2019-01-21 01:48:04 +00:00
neon
openal
2019-10-02 17:04:26 +00:00
opencv4
2019-01-21 01:48:04 +00:00
openexr
openh264
2019-05-01 17:48:38 +00:00
rtmpdump
2019-01-21 01:48:04 +00:00
pango
soundtouch
srtp
2019-10-02 17:04:26 +00:00
fluidsynth
libvdpau
libwebp
xvidcore
gnutls
2019-11-10 16:44:34 +00:00
libGL
libGLU
2019-10-02 17:04:26 +00:00
libgme
openssl
x265
libxml2
2018-03-14 19:15:06 +00:00
libintl
2019-01-20 17:59:47 +00:00
srt
2021-02-20 19:41:48 +00:00
vo-aacenc
2021-03-04 20:01:51 +00:00
] ++ lib . optionals enableZbar [
2019-10-02 17:04:26 +00:00
zbar
2021-03-04 20:01:51 +00:00
] ++ lib . optionals faacSupport [
2019-10-02 17:04:26 +00:00
faac
2021-03-04 20:01:51 +00:00
] ++ lib . optionals stdenv . isLinux [
2019-05-01 16:44:08 +00:00
bluez
2020-11-17 21:36:07 +00:00
libva # vaapi requires libva -> libdrm -> libpciaccess, which is Linux-only in nixpkgs
2019-10-02 17:04:26 +00:00
wayland
2020-11-10 23:31:55 +00:00
wayland-protocols
2021-03-04 20:01:51 +00:00
] ++ lib . optionals ( ! stdenv . isDarwin ) [
2015-04-09 01:54:51 +00:00
# wildmidi requires apple's OpenAL
# TODO: package apple's OpenAL, fix wildmidi, include on Darwin
2019-10-02 17:04:26 +00:00
wildmidi
2018-02-23 18:34:26 +00:00
# TODO: mjpegtools uint64_t is not compatible with guint64 on Darwin
2019-10-02 17:04:26 +00:00
mjpegtools
2019-05-01 16:44:08 +00:00
chromaprint
directfb
flite
libdrm
libgudev
libnice
libofa
sbc
spandsp
# ladspa plug-in
ladspaH
2020-03-22 23:18:53 +00:00
lrdf # TODO: make build on Darwin
2019-05-01 16:44:08 +00:00
# lv2 plug-in
lilv
lv2
serd
sord
sratom
2021-03-04 20:01:51 +00:00
] ++ lib . optionals stdenv . isDarwin [
2019-05-01 16:44:08 +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
CoreMedia
CoreVideo
Foundation
MediaToolbox
2021-03-04 20:01:51 +00:00
] ;
2015-04-09 01:54:51 +00:00
2019-01-21 01:48:04 +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
2020-10-01 22:31:58 +00:00
" - D d o c = d i s a b l e d " # `hotdoc` not packaged in nixpkgs as of writing
2021-10-13 20:53:14 +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
2019-01-21 01:48:04 +00:00
2020-10-01 22:31:58 +00:00
" - D a v t p = d i s a b l e d "
2019-01-21 01:48:04 +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"
2019-07-23 14:30:56 +00:00
" - D z b a r = ${ if enableZbar then " e n a b l e d " else " d i s a b l e d " } "
2019-01-21 01:48:04 +00:00
" - 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-10-01 22:31:58 +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
2019-01-21 01:48:04 +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
" - D s c t p = d i s a b l e d " # required `usrsctp` library not packaged in nixpkgs as of writing
2020-10-01 22:31:58 +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
2019-01-21 01:48:04 +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-10-01 22:31:58 +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
2019-01-21 01:48:04 +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-10-01 22:31:58 +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
2019-05-01 16:44:08 +00:00
]
2021-03-04 20:01:51 +00:00
++ lib . optionals ( ! stdenv . isLinux ) [
2020-11-17 21:36:07 +00:00
" - D v a = d i s a b l e d " # see comment on `libva` in `buildInputs`
]
2021-03-04 20:01:51 +00:00
++ lib . optionals stdenv . isDarwin [
2019-05-01 16:44:08 +00:00
" - 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
2020-11-17 21:36:07 +00:00
" - D v 4 l 2 c o d e c s = d i s a b l e d " # requires gudev
2019-05-01 16:44:08 +00:00
" - 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
2021-03-04 20:01:51 +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 ) [
2019-05-01 16:44:08 +00:00
" - D w a y l a n d = d i s a b l e d "
2021-03-04 20:01:51 +00:00
] ++ lib . optionals ( ! gst-plugins-base . glEnabled ) [
2019-05-01 16:44:08 +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 "
2021-06-21 20:00:46 +00:00
] ++ lib . optionals ( stdenv . buildPlatform != stdenv . hostPlatform ) [
" - D i n t r o s p e c t i o n = d i s a b l e d "
2019-01-21 01:48:04 +00:00
] ;
2020-11-10 23:31:55 +00:00
# Argument list too long
strictDeps = true ;
2020-10-01 22:31:58 +00:00
postPatch = ''
patchShebangs \
scripts/extract-release-date-from-doap-file.py
'' ;
2019-05-01 16:44:08 +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 " ] ;
2018-04-25 03:20:18 +00:00
doCheck = false ; # fails 20 out of 58 tests, expensive
2021-01-21 17:00:13 +00:00
meta = with lib ; {
2019-10-02 17:04:26 +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 .
'' ;
license = licenses . lgpl2Plus ;
platforms = platforms . linux ++ platforms . darwin ;
maintainers = with maintainers ; [ matthewbauer ] ;
} ;
2013-12-23 15:36:37 +00:00
}