2020-04-24 23:36:52 +00:00
{ stdenv
, fetchurl
, meson
2020-11-12 09:05:59 +00:00
, nasm
2020-04-24 23:36:52 +00:00
, ninja
, pkgconfig
, python3
, gst-plugins-base
, orc
, bzip2
, gettext
, libv4l
, libdv
, libavc1394
, libiec61883
, libvpx
, speex
, flac
, taglib
, libshout
, cairo
, gdk-pixbuf
, aalib
, libcaca
, libsoup
, libpulseaudio
, libintl
, darwin
, lame
, mpg123
, twolame
, gtkSupport ? false , gtk3 ? null
, enableJack ? true , libjack2
, libXdamage
, libXext
, libXfixes
, ncurses
2020-11-12 09:05:59 +00:00
, wayland
, wayland-protocols
2020-04-24 23:36:52 +00:00
, xorg
, libgudev
, wavpack
} :
assert gtkSupport -> gtk3 != null ;
let
inherit ( stdenv . lib ) optionals ;
in
stdenv . mkDerivation rec {
pname = " g s t - p l u g i n s - g o o 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 = " 1 b 4 b 3 a 6 f m 2 w y q p n x 3 0 0 p g 1 s z 0 1 m 9 q h f a j a d k 3 b 7 s b z i s g 8 v v q a b 3 " ;
2020-04-24 23:36:52 +00:00
} ;
nativeBuildInputs = [
pkgconfig
python3
meson
ninja
gettext
2020-11-12 09:05:59 +00:00
nasm
] ++ optionals stdenv . isLinux [
wayland-protocols
2020-04-24 23:36:52 +00:00
] ;
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
] ++ optionals gtkSupport [
# for gtksink
gtk3
] ++ optionals stdenv . isDarwin [
darwin . apple_sdk . frameworks . Cocoa
] ++ optionals stdenv . isLinux [
libv4l
libpulseaudio
libavc1394
libiec61883
libgudev
2020-11-12 09:05:59 +00:00
wayland
2020-04-24 23:36:52 +00:00
] ++ optionals enableJack [
libjack2
] ;
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
" - D q t 5 = d i s a b l e d " # not clear as of writing how to correctly pass in the required qt5 deps
] ++ optionals ( ! gtkSupport ) [
" - D g t k 3 = d i s a b l e d "
] ++ optionals ( ! enableJack ) [
" - D j a c k = d i s a b l e d "
] ++ optionals ( ! stdenv . isLinux ) [
" - D d v 1 3 9 4 = d i s a b l e d " # Linux only
" - D o s s 4 = d i s a b l e d " # Linux only
" - D o s s = d i s a b l e d " # Linux only
" - D p u l s e = d i s a b l e d " # TODO check if we can keep this enabled
" - D v 4 l 2 - g u d e v = d i s a b l e d " # Linux-only
" - D v 4 l 2 = d i s a b l e d " # Linux-only
" - D x i m a g e s r c = d i s a b l e d " # Linux-only
" - D p u l s e = d i s a b l e d " # TODO check if we can keep this enabled
2020-11-12 09:05:59 +00:00
] ++ optionals ( ! ( stdenv . isLinux && stdenv . hostPlatform . isAarch64 ) ) [
" - D r p i c a m s r c = d i s a b l e d " # only works on Linux aarch64, see https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/blob/428c9b60532917c0ac49c9d48b15bdcd00a1370b/sys/rpicamsrc/meson.build#L10
2020-04-24 23:36:52 +00:00
] ;
2020-11-12 09:05:59 +00:00
postPatch = ''
patchShebangs \
scripts/extract-release-date-from-doap-file.py
'' ;
2020-04-24 23:36:52 +00:00
NIX_LDFLAGS = [
# linking error on Darwin
# https://github.com/NixOS/nixpkgs/pull/70690#issuecomment-553694896
" - l n c u r s e s "
] ;
# fails 1 tests with "Unexpected critical/warning: g_object_set_is_valid_property: object class 'GstRtpStorage' has no property named ''"
doCheck = false ;
meta = with stdenv . lib ; {
description = " G S t r e a m e r G o o 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 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 ] ;
} ;
}