pmaports/device/main/device-pine64-pinephone/APKBUILD

156 lines
3.9 KiB
Text
Raw Normal View History

# Reference: <https://postmarketos.org/devicepkg>
# Maintainer: Martijn Braam <martijn@brixit.nl>
# Co-Maintainer: Luca Weiss <luca@z3ntu.xyz>
# Co-Maintainer: Bart Ribbers <bribbers@disroot.org>
# Co-Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=device-pine64-pinephone
pkgver=0.19
pkgrel=0
pkgdesc="PINE64 PinePhone"
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
subpackages="
$pkgname-nonfree-firmware:nonfree_firmware
$pkgname-ofono
$pkgname-phosh
$pkgname-shelli
$pkgname-plasma-mobile:plasma_mobile
"
depends="
alsa-ucm-conf
atinout
eg25-manager
eg25-manager-openrc
gpsd
iw
linux-postmarketos-allwinner
mesa-dri-gallium
mesa-egl
postmarketos-base
u-boot-pinephone
uboot-tools
"
makedepends="devicepkg-dev"
install="$pkgname.post-install $pkgname.post-upgrade"
source="
00_alsa_pinephone_dshare.conf
10-pinephone-proximity.rules
60-flashlight.rules
70-wifi-pm.rules
90-modem-eg25.rules
deviceinfo
gpsd_device-hook.sh
gpsd_pinephone.initd
hwtest.ini
setup-modem.sh
setup-modem.sh.ofono
sysrq.conf
uboot-script.cmd
ucm/HiFi.conf
ucm/PinePhone.conf
ucm/VoiceCall.conf
"
# workaround to purge the -elogind subpackage that was previously
# created/installed
provides="$pkgname-elogind=$pkgver-r$pkgrel"
build() {
devicepkg_build $startdir $pkgname
mkimage \
-A arm \
-O linux \
-T script \
-C none \
-a 0 \
-e 0 \
-n postmarketos \
-d "$srcdir"/uboot-script.cmd \
"$srcdir"/boot.scr
}
package() {
devicepkg_package $startdir $pkgname
install -Dm644 "$srcdir"/boot.scr \
"$pkgdir"/boot/boot.scr
# Make /boot/allwinner/sun50i-a64-pine64-pinephone*.dtb resolve to
# /boot/sun50i-a64-pine64-pinephone*.dtb. This is because the device tree
# names in u-boot include the vendor and the one in postmarketOS doesn't.
ln -s .. "$pkgdir"/boot/allwinner
install -Dm644 "$srcdir"/hwtest.ini \
2019-09-09 11:54:06 +00:00
"$pkgdir"/usr/share/hwtest.ini
# GPS
install -Dm755 "$srcdir"/gpsd_pinephone.initd \
"$pkgdir"/etc/init.d/gpsd_pinephone
install -Dm755 "$srcdir"/gpsd_device-hook.sh \
"$pkgdir"/etc/gpsd/device-hook
install -D -m644 "$srcdir"/10-pinephone-proximity.rules \
"$pkgdir"/usr/lib/udev/rules.d/10-pinephone-proximity.rules
# Fix "sysrq: HELP..." messages in dmesg while playing audio
# (Headphone output interferes with the serial console on the headphone
# jack)
install -Dm644 "$srcdir"/sysrq.conf \
"$pkgdir"/etc/sysctl.d/sysrq.conf
# Alsa usecase manager config
install -Dm644 "$srcdir"/PinePhone.conf \
"$pkgdir"/usr/share/alsa/ucm2/PinePhone/PinePhone.conf
install -Dm644 "$srcdir"/HiFi.conf \
"$pkgdir"/usr/share/alsa/ucm2/PinePhone/HiFi.conf
install -Dm644 "$srcdir"/VoiceCall.conf \
"$pkgdir"/usr/share/alsa/ucm2/PinePhone/VoiceCall.conf
# Modem
install -Dm755 "$srcdir"/setup-modem.sh \
"$pkgdir"/usr/bin/pinephone_setup-modem
install -Dm644 "$srcdir"/90-modem-eg25.rules -t \
"$pkgdir"/usr/lib/udev/rules.d/
# Wifi / PM
install -Dm644 "$srcdir"/70-wifi-pm.rules -t \
"$pkgdir"/usr/lib/udev/rules.d/
}
ofono() {
pkgdesc="ofono support"
install_if="$pkgname=$pkgver-r$pkgrel ofono"
replaces="$pkgname"
install -Dm755 "$srcdir"/setup-modem.sh.ofono \
"$subpkgdir"/usr/bin/pinephone_setup-modem
}
nonfree_firmware() {
pkgdesc="Wifi, Bluetooth and Autofocus firmware"
depends="
linux-firmware-rtlwifi
linux-firmware-rtl_bt
firmware-pine64-rtl8723bt
firmware-pine64-ov5640
"
mkdir "$subpkgdir"
}
phosh() {
install_if="$pkgname=$pkgver-r$pkgrel postmarketos-ui-phosh"
depends="wys-pinephone"
mkdir "$subpkgdir"
}
plasma_mobile() {
install_if="$pkgname=$pkgver-r$pkgrel plasma-phone-components"
install -Dm644 "$srcdir"/60-flashlight.rules -t "$subpkgdir"/usr/lib/udev/rules.d/
}
shelli() {
install_if="$pkgname=$pkgver-r$pkgrel shelli"
# Alsa default audio must be stereo
install -Dm644 "$srcdir"/00_alsa_pinephone_dshare.conf \
"$subpkgdir"/etc/alsa/conf.d/00_alsa_pinephone_dshare.conf
}