guvcview: enable to build with both qt5 and gtk3

This commit is contained in:
Doron Behar 2020-04-06 23:46:21 +03:00
parent ac0f42dee8
commit 6aaab573e2

View file

@ -3,7 +3,6 @@
, fetchurl
, intltool
, pkgconfig
, gtk3
, portaudio
, SDL2
, ffmpeg
@ -12,9 +11,17 @@
, libv4l
, alsaLib
, gsl
, wrapGAppsHook
, libpng
, sfml
, pulseaudioSupport ? config.pulseaudio or stdenv.isLinux
, libpulseaudio ? null
, useQt ? false
, qt5 ? null
, wrapQtAppsHook ? null
# can be turned off if used as a library
, useGtk ? true
, gtk3 ? null
, wrapGAppsHook ? null
}:
assert pulseaudioSupport -> libpulseaudio != null;
@ -31,20 +38,35 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [
intltool
pkgconfig
wrapGAppsHook
];
]
++ stdenv.lib.optionals (useGtk) [ wrapGAppsHook ]
++ stdenv.lib.optionals (useQt) [ wrapQtAppsHook ]
;
buildInputs = [
SDL2
alsaLib
ffmpeg
gtk3
libusb1
libv4l
portaudio
udev
gsl
] ++ stdenv.lib.optional pulseaudioSupport libpulseaudio;
libpng
sfml
]
++ stdenv.lib.optionals (pulseaudioSupport) [ libpulseaudio ]
++ stdenv.lib.optionals (useGtk) [ gtk3 ]
++ stdenv.lib.optionals (useQt) [
qt5.qtbase
]
;
configureFlags = [
"--enable-sfml"
]
++ stdenv.lib.optionals (useGtk) [ "--enable-gtk3" ]
++ stdenv.lib.optionals (useQt) [ "--enable-qt5" ]
;
meta = with stdenv.lib; {
description = "A simple interface for devices supported by the linux UVC driver";