mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-02 19:14:14 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
52 lines
1.2 KiB
Nix
52 lines
1.2 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchurl
|
|
, cmake
|
|
, pkg-config
|
|
, libxml2
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "libwebcam";
|
|
version = "0.2.5";
|
|
|
|
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
|
|
];
|
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
|
buildInputs = [ 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 = "Webcam-tools package";
|
|
platforms = platforms.linux;
|
|
license = licenses.lgpl3;
|
|
maintainers = with maintainers; [ jraygauthier ];
|
|
};
|
|
}
|