mirror of
https://github.com/ptitSeb/box86.git
synced 2025-08-28 17:13:48 +02:00
51 lines
1.8 KiB
Text
51 lines
1.8 KiB
Text
# Maintainer: Jai-JAP <jai.jap.318@gmail.com>, SpacingBat3 <git@spacingbat3.anonaddy.com>
|
|
# Author: Sebastien Chevalier <ptitseb@box86.org>
|
|
pkgname=box86-rpi-git
|
|
pkgver=r4581.d698861
|
|
pkgrel=1
|
|
pkgdesc="Linux Userspace x86 Emulator with a twist, targeted at ARM Linux devices."
|
|
arch=('armv7h')
|
|
url="https://github.com/ptitSeb/box86"
|
|
license=('MIT')
|
|
optdepends=('gl4es: OpenGL 2 for GLES 2 devices')
|
|
makedepends=('git' 'cmake' 'make')
|
|
provides=("${pkgname%-git}" "${pkgname%-rpi-git}-git" "${pkgname%-rpi-git}")
|
|
conflicts=("${pkgname%-git}" "${pkgname%-rpi-git}-git" "${pkgname%-rpi-git}")
|
|
source=('git+https://github.com/ptitSeb/box86')
|
|
md5sums=('SKIP')
|
|
_pimodel=`tr -d '\0' < /sys/firmware/devicetree/base/model`
|
|
|
|
pkgver() {
|
|
cd "${srcdir}/${pkgname%-rpi-git}"
|
|
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
|
}
|
|
|
|
prepare() {
|
|
cd "${srcdir}/${pkgname%-rpi-git}"
|
|
# Check for Pi version number
|
|
if [[ ${_pimodel} =~ "Raspberry Pi 4" ]]; then
|
|
_piversion=4
|
|
elif [[ ${_pimodel} =~ "Raspberry Pi 3" ]]; then
|
|
_piversion=3
|
|
elif [[ ${_pimodel} =~ "Raspberry Pi 2" ]]; then
|
|
_piversion=2
|
|
else
|
|
# This RPI is not supported or this device is not a pi.
|
|
# We should cancel then the build.
|
|
echo -e "\033[01m\033[01;31m==> ERROR:\033[00;01m Your device is not supported! This script is for RPi model 4/3/2 (1/0 isn't supported).\033[00m"
|
|
exit 1
|
|
fi
|
|
echo -e "\033[01m\033[01;34m==> INFO:\033[00;01m Your detected Pi verion number is: \033[01;31m${_piversion}\033[01m.\033[00m"
|
|
[[ ! -d ./build ]] && mkdir build
|
|
cmake -B build -DRPI${_piversion}=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr
|
|
}
|
|
|
|
build() {
|
|
cd "${srcdir}/${pkgname%-rpi-git}/build"
|
|
make -j$(nproc)
|
|
}
|
|
|
|
package() {
|
|
cd "${srcdir}/${pkgname%-rpi-git}/build"
|
|
make DESTDIR="${pkgdir}/" install
|
|
}
|