This commit was created by a combination of scripts and tools: - an ast-grep script to prefix things in meta with `lib.`, - a modified nixf-diagnose / nixf combination to remove unused `with lib;`, and - regular nixfmt. Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
61 lines
1.5 KiB
Nix
61 lines
1.5 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
cmake,
|
|
pkg-config,
|
|
libxml2,
|
|
udevCheckHook,
|
|
}:
|
|
|
|
stdenv.mkDerivation {
|
|
version = "0.3.0";
|
|
pname = "uvcdynctrl";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "cshorler";
|
|
repo = "webcam-tools";
|
|
rev = "bee2ef3c9e350fd859f08cd0e6745871e5f55cb9";
|
|
sha256 = "0s15xxgdx8lnka7vi8llbf6b0j4rhbjl6yp0qxaihysf890xj73s";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
cmake
|
|
pkg-config
|
|
udevCheckHook
|
|
];
|
|
buildInputs = [ libxml2 ];
|
|
|
|
prePatch = ''
|
|
local fixup_list=(
|
|
uvcdynctrl/CMakeLists.txt
|
|
uvcdynctrl/udev/rules/80-uvcdynctrl.rules
|
|
uvcdynctrl/udev/scripts/uvcdynctrl
|
|
)
|
|
for f in "''${fixup_list[@]}"; do
|
|
substituteInPlace "$f" \
|
|
--replace "/etc/udev" "$out/etc/udev" \
|
|
--replace "/lib/udev" "$out/lib/udev"
|
|
done
|
|
'';
|
|
|
|
postPatch = ''
|
|
substituteInPlace CMakeLists.txt \
|
|
--replace-fail "cmake_minimum_required (VERSION 2.6)" "cmake_minimum_required(VERSION 3.10)"
|
|
substituteInPlace libwebcam/CMakeLists.txt \
|
|
--replace-fail "cmake_minimum_required (VERSION 2.6)" "cmake_minimum_required(VERSION 3.10)"
|
|
substituteInPlace uvcdynctrl/CMakeLists.txt \
|
|
--replace-fail "cmake_minimum_required (VERSION 2.6)" "cmake_minimum_required(VERSION 3.10)"
|
|
'';
|
|
|
|
doInstallCheck = true;
|
|
|
|
meta = {
|
|
description = "Simple interface for devices supported by the linux UVC driver";
|
|
homepage = "https://guvcview.sourceforge.net";
|
|
license = lib.licenses.gpl3Plus;
|
|
maintainers = [ lib.maintainers.puffnfresh ];
|
|
platforms = lib.platforms.linux;
|
|
};
|
|
}
|