summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 63145767945775407675d786d7f950805d8bc396 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Maintainer: Harrison <contact@htv04.com>

pkgname=facetimehd-data
pkgver=5.1.5769
pkgrel=1
pkgdesc='Sensor calibration data for the FacetimeHD (Broadcom 1570) PCIe webcam'
arch=('any')
url='https://github.com/patjak/facetimehd'
license=('custom')
makedepends=('unrar')
provides=('facetimehd-data')
replaces=('facetimehd-data')

source=('https://download.info.apple.com/Mac_OS_X/031-30890-20150812-ea191174-4130-11e5-a125-930911ba098f/bootcamp5.1.5769.zip')
sha256sums=('4ede2c8ef240708c850237a3e5911094ed6adae1734258e4639bc9069a814b1e')

# Based on instructions from https://github.com/patjak/facetimehd/wiki/Extracting-the-sensor-calibration-files
build() {
  # Extract AppleCamera64 data
  cd "$srcdir"
  rm -rf 'AppleCamera64'
  mkdir 'AppleCamera64'
  cd 'AppleCamera64'
  unrar x "$srcdir/BootCamp/Drivers/Apple/AppleCamera64.exe"

  # Extract sensor calibration data
  mkdir -p "$srcdir/$pkgname"
  dd bs=1 skip=1663920 count=33060 if='AppleCamera.sys' of="$srcdir/$pkgname/9112_01XX.dat"
  dd bs=1 skip=1644880 count=19040 if='AppleCamera.sys' of="$srcdir/$pkgname/1771_01XX.dat"
  dd bs=1 skip=1606800 count=19040 if='AppleCamera.sys' of="$srcdir/$pkgname/1871_01XX.dat"
  dd bs=1 skip=1625840 count=19040 if='AppleCamera.sys' of="$srcdir/$pkgname/1874_01XX.dat"
}

package() {
  cd "$srcdir/$pkgname"
  
  # Install facetimehd-data
  for FILE in '9112' '1771' '1871' '1874'
  do
    install -Dm644 "${FILE}_01XX.dat" "$pkgdir/usr/lib/firmware/facetimehd/${FILE}_01XX.dat"
  done
  
  # Install licenses
  for FILE in 'Arabic' 'BrazilianPortuguese' 'Czech' 'Danish' 'Dutch' 'English' 'Finnish' 'French' 'German' 'Hungarian' 'Italian' 'Japanese' 'Korean' 'Norwegian' 'Polish' 'Portuguese' 'Russian' 'SimplifiedChinese' 'Spanish' 'Swedish' 'TraditionalChinese' 'Turkish'
  do
    install -Dm644 "$srcdir/AppleCamera64/${FILE}License.txt" "$pkgdir/usr/share/licenses/$pkgname/${FILE}License.txt"
  done
}