summary refs log tree commit diff
path: root/pkgs/os-specific/linux/guvcview/default.nix
blob: d780cade786590be204c6bd4415394d68a7041c0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{ config
, stdenv
, fetchurl
, intltool
, pkgconfig
, portaudio
, SDL2
, ffmpeg
, udev
, libusb1
, libv4l
, alsaLib
, gsl
, libpng
, sfml
, pulseaudioSupport ? config.pulseaudio or stdenv.isLinux
, libpulseaudio ? null
, useQt ? false
, qtbase ? null
, wrapQtAppsHook ? null
# can be turned off if used as a library
, useGtk ? true
, gtk3 ? null
, wrapGAppsHook ? null
}:

assert pulseaudioSupport -> libpulseaudio != null;

stdenv.mkDerivation rec {
  version = "2.0.6";
  pname = "guvcview";

  src = fetchurl {
    url = "mirror://sourceforge/project/guvcview/source/guvcview-src-${version}.tar.gz";
    sha256 = "11byyfpkcik7wvf2qic77zjamfr2rhji97dpj1gy2fg1bvpiqf4m";
  };

  nativeBuildInputs = [
    intltool
    pkgconfig
  ]
    ++ stdenv.lib.optionals (useGtk) [ wrapGAppsHook ]
    ++ stdenv.lib.optionals (useQt) [ wrapQtAppsHook ]
  ;

  buildInputs = [
    SDL2
    alsaLib
    ffmpeg
    libusb1
    libv4l
    portaudio
    udev
    gsl
    libpng
    sfml
  ] 
    ++ stdenv.lib.optionals (pulseaudioSupport) [ libpulseaudio ]
    ++ stdenv.lib.optionals (useGtk) [ gtk3 ]
    ++ stdenv.lib.optionals (useQt) [
      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";
    homepage = "http://guvcview.sourceforge.net";
    maintainers = [ maintainers.coconnor ];
    license = licenses.gpl3;
    platforms = platforms.linux;
  };
}