facetimehd-firmware: init at 1.43

+53
+51
pkgs/os-specific/linux/firmware/facetimehd-firmware/default.nix
··· 1 + { stdenv, fetchurl, cpio, xz, pkgs }: 2 + 3 + let 4 + 5 + version = "1.43"; 6 + 7 + dmgRange = "420107885-421933300"; # the whole download is 1.3GB, this cuts it down to 2MB 8 + 9 + firmwareIn = "./System/Library/Extensions/AppleCameraInterface.kext/Contents/MacOS/AppleCameraInterface"; 10 + firmwareOut = "firmware.bin"; 11 + firmwareOffset = "81920"; 12 + firmwareSize = "603715"; 13 + 14 + # separated this here as the script will fail without the 'exit 0' 15 + unpack = pkgs.writeScriptBin "unpack" '' 16 + xzcat -Q $src | cpio --format odc -i -d ${firmwareIn} 17 + exit 0 18 + ''; 19 + 20 + in 21 + 22 + stdenv.mkDerivation { 23 + 24 + name = "facetimehd-firmware-${version}"; 25 + 26 + src = fetchurl { 27 + url = "https://support.apple.com/downloads/DL1849/en_US/osxupd10.11.2.dmg"; 28 + sha256 = "1jw6sy9vj27amfak83cs2c7q856y4mk1wix3rl4q10yvd9bl4k9x"; 29 + curlOpts = "-r ${dmgRange}"; 30 + }; 31 + 32 + phases = [ "buildPhase" ]; 33 + 34 + buildInputs = [ cpio xz ]; 35 + 36 + buildPhase = '' 37 + ${unpack}/bin/unpack 38 + dd bs=1 skip=${firmwareOffset} count=${firmwareSize} if=${firmwareIn} of=${firmwareOut}.gz &> /dev/null 39 + mkdir -p $out/lib/firmware/facetimehd 40 + gunzip -c ${firmwareOut}.gz > $out/lib/firmware/facetimehd/${firmwareOut} 41 + ''; 42 + 43 + meta = with stdenv.lib; { 44 + description = "facetimehd firmware"; 45 + homepage = https://support.apple.com/downloads/DL1849; 46 + license = licenses.unfree; 47 + maintainers = [ maintainers.womfoo ]; 48 + platforms = platforms.linux; 49 + }; 50 + 51 + }
+2
pkgs/top-level/all-packages.nix
··· 9938 9938 9939 9939 eject = utillinux; 9940 9940 9941 + facetimehd-firmware = callPackage ../os-specific/linux/firmware/facetimehd-firmware { }; 9942 + 9941 9943 fanctl = callPackage ../os-specific/linux/fanctl { 9942 9944 iproute = iproute.override { enableFan = true; }; 9943 9945 };