1{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, libxml2 }:
2
3stdenv.mkDerivation {
4 version = "0.3.0";
5 pname = "uvcdynctrl";
6
7 src = fetchFromGitHub {
8 owner = "cshorler";
9 repo = "webcam-tools";
10 rev = "bee2ef3c9e350fd859f08cd0e6745871e5f55cb9";
11 sha256 = "0s15xxgdx8lnka7vi8llbf6b0j4rhbjl6yp0qxaihysf890xj73s";
12 };
13
14 nativeBuildInputs = [ cmake pkg-config ];
15 buildInputs = [ libxml2 ];
16
17 prePatch = ''
18 local fixup_list=(
19 uvcdynctrl/CMakeLists.txt
20 uvcdynctrl/udev/rules/80-uvcdynctrl.rules
21 uvcdynctrl/udev/scripts/uvcdynctrl
22 )
23 for f in "''${fixup_list[@]}"; do
24 substituteInPlace "$f" \
25 --replace "/etc/udev" "$out/etc/udev" \
26 --replace "/lib/udev" "$out/lib/udev"
27 done
28 '';
29
30 meta = with lib; {
31 description = "A simple interface for devices supported by the linux UVC driver";
32 homepage = "https://guvcview.sourceforge.net";
33 license = licenses.gpl3Plus;
34 maintainers = [ maintainers.puffnfresh ];
35 platforms = platforms.linux;
36 };
37}