lol
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 [
41 intltool
42 pkg-config
43 cmake
44 ]
45 ++ lib.optionals useGtk [ wrapGAppsHook3 ]
46 ++ lib.optionals useQt [ wrapQtAppsHook ];
47
48 buildInputs =
49 [
50 SDL2
51 alsa-lib
52 ffmpeg
53 libusb1
54 libv4l
55 portaudio
56 udev
57 gsl
58 libpng
59 sfml_2
60 ]
61 ++ lib.optionals pulseaudioSupport [ libpulseaudio ]
62 ++ lib.optionals useGtk [ gtk3 ]
63 ++ lib.optionals useQt [
64 qtbase
65 ];
66
67 configureFlags =
68 [
69 "--enable-sfml"
70 ]
71 ++ lib.optionals useGtk [ "--enable-gtk3" ]
72 ++ lib.optionals useQt [ "--enable-qt5" ];
73
74 meta = {
75 description = "Simple interface for devices supported by the linux UVC driver";
76 mainProgram = "guvcview";
77 homepage = "https://guvcview.sourceforge.net";
78 maintainers = [ lib.maintainers.coconnor ];
79 license = lib.licenses.gpl3;
80 platforms = lib.platforms.linux;
81 };
82})