1{ stdenv, lib, fetchFromGitHub, kernel }:
2
3stdenv.mkDerivation rec {
4 name = "facetimehd-${version}-${kernel.version}";
5 version = "0.5.18";
6
7 # Note: When updating this revision:
8 # 1. Also update pkgs/os-specific/linux/firmware/facetimehd-firmware/
9 # 2. Test the module and firmware change via:
10 # a. Give some applications a try (Skype, Hangouts, Cheese, etc.)
11 # b. Run: journalctl -f
12 # c. Then close the lid
13 # d. Then open the lid (and maybe press a key to wake it up)
14 # e. see if the module loads back (apps using the camera won't
15 # recover and will have to be restarted) and the camera
16 # still works.
17 src = fetchFromGitHub {
18 owner = "patjak";
19 repo = "facetimehd";
20 rev = version;
21 sha256 = "sha256-UO8t2zrfdJlu4uzhhyWOuHIjJNVezIq3nUPGZeW/KJU=";
22 };
23
24 preConfigure = ''
25 export INSTALL_MOD_PATH="$out"
26 '';
27
28 hardeningDisable = [ "pic" ];
29
30 nativeBuildInputs = kernel.moduleBuildDependencies;
31
32 makeFlags = [
33 "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
34 ];
35
36 meta = with lib; {
37 homepage = "https://github.com/patjak/bcwc_pcie";
38 description = "Linux driver for the Facetime HD (Broadcom 1570) PCIe webcam";
39 license = licenses.gpl2;
40 maintainers = with maintainers; [ womfoo grahamc kraem ];
41 platforms = [ "i686-linux" "x86_64-linux" ];
42 };
43}