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