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