nixpkgs-suyu/pkgs/os-specific/linux/facetimehd/default.nix

62 lines
1.9 KiB
Nix
Raw Normal View History

{ stdenv, lib, fetchFromGitHub, kernel }:
2015-12-29 19:02:36 +01:00
# facetimehd is not supported for kernels older than 3.19";
2021-01-15 15:45:37 +01:00
assert lib.versionAtLeast kernel.version "3.19";
2015-12-29 19:02:36 +01:00
2016-10-15 13:41:53 +02:00
let
# Note: When updating this revision:
# 1. Also update pkgs/os-specific/linux/firmware/facetimehd-firmware/
# 2. Test the module and firmware change via:
# a. Give some applications a try (Skype, Hangouts, Cheese, etc.)
# b. Run: journalctl -f
# c. Then close the lid
# d. Then open the lid (and maybe press a key to wake it up)
# e. see if the module loads back (apps using the camera won't
# recover and will have to be restarted) and the camera
# still works.
2021-01-15 15:45:37 +01:00
srcParams = if (lib.versionAtLeast kernel.version "4.8") then
2016-10-15 13:41:53 +02:00
{ # Use mainline branch
2020-06-12 12:27:21 +02:00
version = "unstable-2020-04-16";
rev = "82626d4892eeb9eb704538bf0dc49a00725ff451";
sha256 = "118z6vjvhhcwvs4n3sgwwdagys9w718b8nkh6l9ic93732vv7cqx";
2016-10-15 13:41:53 +02:00
}
else
{ # Use master branch (broken on 4.8)
version = "unstable-2016-05-02";
rev = "5a7083bd98b38ef3bd223f7ee531d58f4fb0fe7c";
sha256 = "0d455kajvn5xav9iilqy7s1qvsy4yb8vzjjxx7bvcgp7aj9ljvdp";
}
;
in
2015-12-29 19:02:36 +01:00
stdenv.mkDerivation rec {
name = "facetimehd-${version}-${kernel.version}";
2016-10-15 13:41:53 +02:00
version = srcParams.version;
2015-12-29 19:02:36 +01:00
src = fetchFromGitHub {
owner = "patjak";
repo = "bcwc_pcie";
2016-10-15 13:41:53 +02:00
inherit (srcParams) rev sha256;
2015-12-29 19:02:36 +01:00
};
preConfigure = ''
export INSTALL_MOD_PATH="$out"
'';
hardeningDisable = [ "pic" ];
2018-01-01 01:34:09 +01:00
nativeBuildInputs = kernel.moduleBuildDependencies;
2016-02-21 11:40:34 +01:00
2015-12-29 19:02:36 +01:00
makeFlags = [
"KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
];
meta = with lib; {
homepage = "https://github.com/patjak/bcwc_pcie";
2015-12-29 19:02:36 +01:00
description = "Linux driver for the Facetime HD (Broadcom 1570) PCIe webcam";
license = licenses.gpl2;
maintainers = with maintainers; [ womfoo grahamc kraem ];
platforms = [ "i686-linux" "x86_64-linux" ];
2015-12-29 19:02:36 +01:00
};
}