diff options
Diffstat (limited to 'pkgs/os-specific/linux/libwebcam/default.nix')
-rw-r--r-- | pkgs/os-specific/linux/libwebcam/default.nix | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/libwebcam/default.nix b/pkgs/os-specific/linux/libwebcam/default.nix new file mode 100644 index 000000000000..aadecfdc8b5e --- /dev/null +++ b/pkgs/os-specific/linux/libwebcam/default.nix @@ -0,0 +1,55 @@ +{ lib +, stdenv +, fetchurl +, cmake +, pkgconfig +, libxml2 +}: + +stdenv.mkDerivation rec { + pname = "libwebcam"; + version = "0.2.5"; + name = "${pname}-${version}"; + + src = fetchurl { + url = "mirror://sourceforge/project/${pname}/source/${pname}-src-${version}.tar.gz"; + sha256 = "0hcxv8di83fk41zjh0v592qm7c0v37a3m3n3lxavd643gff1k99w"; + }; + + patches = [ + ./uvcdynctrl_symlink_support_and_take_data_dir_from_env.patch + ]; + + buildInputs = [ + cmake + pkgconfig + libxml2 + ]; + + postPatch = '' + substituteInPlace ./uvcdynctrl/CMakeLists.txt \ + --replace "/lib/udev" "$out/lib/udev" + + substituteInPlace ./uvcdynctrl/udev/scripts/uvcdynctrl \ + --replace 'debug=0' 'debug=''${NIX_UVCDYNCTRL_UDEV_DEBUG:-0}' \ + --replace 'uvcdynctrlpath=uvcdynctrl' "uvcdynctrlpath=$out/bin/uvcdynctrl" + + substituteInPlace ./uvcdynctrl/udev/rules/80-uvcdynctrl.rules \ + --replace "/lib/udev" "$out/lib/udev" + ''; + + + preConfigure = '' + cmakeFlagsArray=( + $cmakeFlagsArray + "-DCMAKE_INSTALL_PREFIX=$out" + ) + ''; + + meta = with lib; { + description = "The webcam-tools package"; + platforms = platforms.linux; + licenses = with licenses; [ lgpl3 ]; + maintainers = with maintainers; [ jraygauthier ]; + }; +}
\ No newline at end of file |