@@ -3,25 +3,40 @@
33# facetimehd is not supported for kernels older than 3.19";
44assert stdenv.lib.versionAtLeast kernel.version "3.19";
55
6+let
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+ srcParams = if (stdenv.lib.versionAtLeast kernel.version "4.8") then
18+ { # Use mainline branch
19+ version = "unstable-2016-10-09";
20+ rev = "887d0f531ef7b91457be519474136c3355c5132b";
21+ sha256 = "0bayahnxar1q6wvf9cb6p8gsfw98w0wqp715hs4r7apmddwk9v7n";
22+ }
23+ else
24+ { # Use master branch (broken on 4.8)
25+ version = "unstable-2016-05-02";
26+ rev = "5a7083bd98b38ef3bd223f7ee531d58f4fb0fe7c";
27+ sha256 = "0d455kajvn5xav9iilqy7s1qvsy4yb8vzjjxx7bvcgp7aj9ljvdp";
28+ }
29+ ;
30+in
31+
632stdenv.mkDerivation rec {
733 name = "facetimehd-${version}-${kernel.version}";
8− version = "git-20160503";
34+ version = srcParams.version;
935
1036 src = fetchFromGitHub {
1137 owner = "patjak";
1238 repo = "bcwc_pcie";
13− # Note: When updating this revision:
14− # 1. Also update pkgs/os-specific/linux/firmware/facetimehd-firmware/
15− # 2. Test the module and firmware change via:
16− # a. Give some applications a try (Skype, Hangouts, Cheese, etc.)
17− # b. Run: journalctl -f
18− # c. Then close the lid
19− # d. Then open the lid (and maybe press a key to wake it up)
20− # e. see if the module loads back (apps using the camera won't
21− # recover and will have to be restarted) and the camera
22− # still works.
23− rev = "5a7083bd98b38ef3bd223f7ee531d58f4fb0fe7c";
24− sha256 = "0d455kajvn5xav9iilqy7s1qvsy4yb8vzjjxx7bvcgp7aj9ljvdp";
39+ inherit (srcParams) rev sha256;
2540 };
2641
2742 preConfigure = ''