pkgname=device-lg-hammerhead
pkgver=1
pkgrel=17
pkgdesc="Google Nexus 5"
url="https://github.com/postmarketOS"
arch="noarch"
license="MIT"
depends="linux-lg-hammerhead linux-firmware mkbootimg msm-fb-refresher mesa-dri-swrast"
makedepends=""
install=""
subpackages="$pkgname-weston $pkgname-x11"
source="
	deviceinfo
	90-android-touch-dev.rules
	profile.sh
	bcmdhd.cal
	weston.ini
	xorg.conf
"
options="!check"

package() {
	install -Dm644 "$srcdir"/deviceinfo \
		"$pkgdir"/etc/deviceinfo
	install -Dm644 "$srcdir"/90-android-touch-dev.rules \
		"$pkgdir"/etc/udev/rules.d/90-android-touch-dev.rules
	install -Dm644 "$srcdir"/profile.sh \
		"$pkgdir"/etc/profile.d/00-$pkgname.sh
	install -Dm644 "$srcdir"/bcmdhd.cal \
		"$pkgdir"/etc/wifi/bcmdhd.cal

	# Disable v4l (video4linux), because without the camera firmware
	# blobs this makes dev hang with the kernel this device uses (#1033)
	ln -s /dev/null "$pkgdir"/etc/udev/rules.d/60-persistent-v4l.rules
}

x11() {
	install_if="$pkgname xorg-server"
	depends="
		libinput
		xf86-input-libinput
		xf86-video-fbdev"
	install -Dm644 "$srcdir"/xorg.conf \
		"$subpkgdir"/etc/X11/xorg.conf.d/10-hammerhead.conf
}

weston() {
	install_if="$pkgname weston"
	install -Dm644 "$srcdir"/weston.ini \
		"$subpkgdir"/etc/xdg/weston/weston.ini
}

sha512sums="be2eba28f0b766917c9369c2f72f337bbb987076f6bd0c80b023bcdcc68684077a375209ac967b038dc018f6633c6795544bad87b2180c04b981660a4d713b41  deviceinfo
ee25f3d0377f027d108593eb7953b8db49d7f05a5c36a0c8ca7e7849d15e3c217bc1ac97d77a66e28d2db4b81c0f50b905639911276da40321d2b6cca7f797df  90-android-touch-dev.rules
d04013c17caf77a87ebea167dbe48f7efa9c9d3123c5743d359f3ea8ccc6b268fa021535a4bf8291eb4a352f0c92f6eb527da0db340421f53bc1cc439a453306  profile.sh
32652ef366694f34dec31f316a38aca96700e3a5a3eac1f8d192e3c5de7b91e480b1c0fcd8e7c80a51692dc3737020ebbb2e5d3779436e82fb18822089c63055  bcmdhd.cal
4f321242005b4da012322a8e9bce14a3734281d6ab410f60e7c9c28a6df905876ccce65c3b914233f351118718ccd81b9be41724ee2099ca36d40b4cfff46b93  weston.ini
f86ef35730b89bcc8160c08db7a7fcd0970adf60c0b77af68bac397de49c0d1783e6b8db1762380c9bf874aff2d030c6f44ecb75c803d69e79ede11376409369  xorg.conf"