1{ config
2, lib, stdenv
3, fetchurl
4, intltool
5, pkg-config
6, portaudio
7, SDL2
8, ffmpeg_4
9, udev
10, libusb1
11, libv4l
12, alsa-lib
13, gsl
14, libpng
15, sfml
16, pulseaudioSupport ? config.pulseaudio or stdenv.isLinux
17, libpulseaudio ? null
18, useQt ? false
19, qtbase ? null
20, wrapQtAppsHook ? null
21# can be turned off if used as a library
22, useGtk ? true
23, gtk3 ? null
24, wrapGAppsHook ? null
25}:
26
27assert pulseaudioSupport -> libpulseaudio != null;
28
29stdenv.mkDerivation rec {
30 version = "2.0.6";
31 pname = "guvcview";
32
33 src = fetchurl {
34 url = "mirror://sourceforge/project/guvcview/source/guvcview-src-${version}.tar.gz";
35 sha256 = "11byyfpkcik7wvf2qic77zjamfr2rhji97dpj1gy2fg1bvpiqf4m";
36 };
37
38 nativeBuildInputs = [
39 intltool
40 pkg-config
41 ]
42 ++ lib.optionals (useGtk) [ wrapGAppsHook ]
43 ++ lib.optionals (useQt) [ wrapQtAppsHook ]
44 ;
45
46 buildInputs = [
47 SDL2
48 alsa-lib
49 ffmpeg_4
50 libusb1
51 libv4l
52 portaudio
53 udev
54 gsl
55 libpng
56 sfml
57 ]
58 ++ lib.optionals (pulseaudioSupport) [ libpulseaudio ]
59 ++ lib.optionals (useGtk) [ gtk3 ]
60 ++ lib.optionals (useQt) [
61 qtbase
62 ]
63 ;
64 configureFlags = [
65 "--enable-sfml"
66 ]
67 ++ lib.optionals (useGtk) [ "--enable-gtk3" ]
68 ++ lib.optionals (useQt) [ "--enable-qt5" ]
69 ;
70
71 meta = with lib; {
72 description = "A simple interface for devices supported by the linux UVC driver";
73 homepage = "https://guvcview.sourceforge.net";
74 maintainers = [ maintainers.coconnor ];
75 license = licenses.gpl3;
76 platforms = platforms.linux;
77 };
78}