From d548ee48c1bc95f14063b45f5c497187338bd6e2 Mon Sep 17 00:00:00 2001 From: SpacingBat3 <57194920+SpacingBat3@users.noreply.github.com> Date: Sun, 25 Oct 2020 23:19:36 +0100 Subject: [PATCH 1/3] Added a RPI4B PKGBUILD. It is possible now to install the `box86` using the PKBUILD providen in the repository. --- archlinux/PKGBUILD-RPi4B | 43 ++++++++++++++++++++++++++++++++++++++++ archlinux/README.md | 19 ++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 archlinux/PKGBUILD-RPi4B create mode 100644 archlinux/README.md diff --git a/archlinux/PKGBUILD-RPi4B b/archlinux/PKGBUILD-RPi4B new file mode 100644 index 0000000000..13a7e310a9 --- /dev/null +++ b/archlinux/PKGBUILD-RPi4B @@ -0,0 +1,43 @@ +# Maintainer: SpacingBat3 +# Contributor: Sebastien Chevalier +pkgname=box86-rpi4b-git +pkgver=r2798.0edc0374 +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') +#depends=() # IDK dependencies of box86, I'll try provide them soon. +#optdepends=('gl4es') # No need for that on RPi4B +makedepends=('git' 'cmake' 'make') +provides=("${pkgname%-git}") +conflicts=("${pkgname%-git}") +source=('git+https://github.com/ptitSeb/box86') +md5sums=('SKIP') + +pkgver() { + cd "$srcdir/${pkgname%-git}" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +prepare() { + cd "${srcdir}/${pkgname%-git}" + if [[ ! -d ./build ]]; then + mkdir build && cd build + # Build for RPi4 only: + cmake .. -DRPI4=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo + fi +} + +build() { + cd "$srcdir/${pkgname%-git}/build" + make -j$(nproc) +} + +# Unused right now: +#check() {} + +package() { + cd "$srcdir/${pkgname%-git}/build" + make DESTDIR="${pkgdir}/" install +} diff --git a/archlinux/README.md b/archlinux/README.md new file mode 100644 index 0000000000..92792bbc22 --- /dev/null +++ b/archlinux/README.md @@ -0,0 +1,19 @@ +# The directory containing all PKGBUILDs for BOX86 +## FAQ +### 1. How to use it? +You just jump to this directory in your local git repository and type this command: +```sh +cp ./PKGBUILD- ../PKGBUILD +cd .. +makepkg -si +``` +This will copy the PKGBUILD for your platform (where you type your platform name instead of ), build it and install the PKGBUILD on 32-bit Archlinux ARM. If you don't know your platform name, just check the directory for all PKGBUILD and find the one you want to install the box86 with. + +In the future, I'll try to do an unified PKGBUILD for all platforms that will recognize your platform automatically. +### 2. What platforms are currently supported. +Only RPi4B right now, but that will change in the nearest future. +### 3. Any advantages with that sollution? +This might give you some advantages like those: +- automatic updates (with some AUR frontends like [`pamac-aur`](https://aur.archlinux.org/packages/pamac-aur/)); +- easily uninstall with `pacman -R` when no needed (no need other scripts nor Makefile to do this); +- your `box86` installation is recognized as a package (where it wasn't when installing with `make install`). From 957ba007238fb0cc5a406ad09e7e5875c01b9a4b Mon Sep 17 00:00:00 2001 From: SpacingBat3 <57194920+SpacingBat3@users.noreply.github.com> Date: Sat, 31 Oct 2020 16:46:58 +0100 Subject: [PATCH 2/3] Added a PKGBUILD for other raspberries. Added a unified PKGBUILD to install box86 on all RPi-based machines (that are fully supported by box86) and did some changes to README.md. --- .../{PKGBUILD-RPi4B => PKGBUILD-raspberrypi} | 25 +++++++++++++------ archlinux/README.md | 12 +++++---- 2 files changed, 24 insertions(+), 13 deletions(-) rename archlinux/{PKGBUILD-RPi4B => PKGBUILD-raspberrypi} (50%) diff --git a/archlinux/PKGBUILD-RPi4B b/archlinux/PKGBUILD-raspberrypi similarity index 50% rename from archlinux/PKGBUILD-RPi4B rename to archlinux/PKGBUILD-raspberrypi index 13a7e310a9..4dcfe904c8 100644 --- a/archlinux/PKGBUILD-RPi4B +++ b/archlinux/PKGBUILD-raspberrypi @@ -1,19 +1,19 @@ # Maintainer: SpacingBat3 # Contributor: Sebastien Chevalier -pkgname=box86-rpi4b-git +pkgname=box86-rpi-git pkgver=r2798.0edc0374 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') -#depends=() # IDK dependencies of box86, I'll try provide them soon. -#optdepends=('gl4es') # No need for that on RPi4B +optdepends=('gl4es: OpenGL 2 for GLES 2 devices') makedepends=('git' 'cmake' 'make') provides=("${pkgname%-git}") conflicts=("${pkgname%-git}") source=('git+https://github.com/ptitSeb/box86') md5sums=('SKIP') +_pimodel=`tr -d '\0' < /sys/firmware/devicetree/base/model` pkgver() { cd "$srcdir/${pkgname%-git}" @@ -22,10 +22,22 @@ pkgver() { prepare() { cd "${srcdir}/${pkgname%-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 + # Your RPI is not supported or this device is not a pi, cancel build then + 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 not 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" if [[ ! -d ./build ]]; then mkdir build && cd build - # Build for RPi4 only: - cmake .. -DRPI4=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo + cmake .. -DRPI${_piversion}=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo fi } @@ -34,9 +46,6 @@ build() { make -j$(nproc) } -# Unused right now: -#check() {} - package() { cd "$srcdir/${pkgname%-git}/build" make DESTDIR="${pkgdir}/" install diff --git a/archlinux/README.md b/archlinux/README.md index 92792bbc22..c1780f4b6b 100644 --- a/archlinux/README.md +++ b/archlinux/README.md @@ -1,17 +1,19 @@ # The directory containing all PKGBUILDs for BOX86 ## FAQ ### 1. How to use it? -You just jump to this directory in your local git repository and type this command: +Just download the `PKGBUILD-` (no need to download the whole repository), go to directory where you downloaded and type: ```sh -cp ./PKGBUILD- ../PKGBUILD +mv ./PKGBUILD- ./PKGBUILD cd .. makepkg -si ``` -This will copy the PKGBUILD for your platform (where you type your platform name instead of ), build it and install the PKGBUILD on 32-bit Archlinux ARM. If you don't know your platform name, just check the directory for all PKGBUILD and find the one you want to install the box86 with. +This will copy the PKGBUILD for your platform (where you type your platform name instead of ``), build it and install the PKGBUILD on 32-bit Archlinux ARM. + +In the future, I might try to do an unified PKGBUILD for all platforms that will recognize your platform automatically. -In the future, I'll try to do an unified PKGBUILD for all platforms that will recognize your platform automatically. ### 2. What platforms are currently supported. -Only RPi4B right now, but that will change in the nearest future. +Currently there's a PKGBUILD for Raspberry Pi devices only. Please note RPi 1 and 0 are not supported right now (those need additional effort to build for them, like building without the DYNAREC support). + ### 3. Any advantages with that sollution? This might give you some advantages like those: - automatic updates (with some AUR frontends like [`pamac-aur`](https://aur.archlinux.org/packages/pamac-aur/)); From 34828b66a29c06035043ac0a69111bf8d27dfc5e Mon Sep 17 00:00:00 2001 From: SpacingBat3 <57194920+SpacingBat3@users.noreply.github.com> Date: Sat, 31 Oct 2020 17:35:06 +0100 Subject: [PATCH 3/3] Added a PKGBUILDs for other platforms. --- archlinux/PKGBUILD-arm | 38 ++++++++++++++++++++++++++++++++++++ archlinux/PKGBUILD-gameshell | 38 ++++++++++++++++++++++++++++++++++++ archlinux/PKGBUILD-odroid | 38 ++++++++++++++++++++++++++++++++++++ archlinux/PKGBUILD-pandora | 38 ++++++++++++++++++++++++++++++++++++ archlinux/PKGBUILD-pyra | 38 ++++++++++++++++++++++++++++++++++++ archlinux/PKGBUILD-x86 | 37 +++++++++++++++++++++++++++++++++++ archlinux/README.md | 4 ++-- 7 files changed, 229 insertions(+), 2 deletions(-) create mode 100644 archlinux/PKGBUILD-arm create mode 100644 archlinux/PKGBUILD-gameshell create mode 100644 archlinux/PKGBUILD-odroid create mode 100644 archlinux/PKGBUILD-pandora create mode 100644 archlinux/PKGBUILD-pyra create mode 100644 archlinux/PKGBUILD-x86 diff --git a/archlinux/PKGBUILD-arm b/archlinux/PKGBUILD-arm new file mode 100644 index 0000000000..8590e6b30a --- /dev/null +++ b/archlinux/PKGBUILD-arm @@ -0,0 +1,38 @@ +# Maintainer: SpacingBat3 +# Contributor: Sebastien Chevalier +pkgname=box86-arm-git +pkgver=r2798.0edc0374 +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}") +conflicts=("${pkgname%-git}") +source=('git+https://github.com/ptitSeb/box86') +md5sums=('SKIP') + +pkgver() { + cd "$srcdir/${pkgname%-git}" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +prepare() { + cd "${srcdir}/${pkgname%-git}" + if [[ ! -d ./build ]]; then + mkdir build && cd build + cmake .. -DARM_DYNAREC=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo + fi +} + +build() { + cd "$srcdir/${pkgname%-git}/build" + make -j$(nproc) +} + +package() { + cd "$srcdir/${pkgname%-git}/build" + make DESTDIR="${pkgdir}/" install +} diff --git a/archlinux/PKGBUILD-gameshell b/archlinux/PKGBUILD-gameshell new file mode 100644 index 0000000000..c90f4a92ad --- /dev/null +++ b/archlinux/PKGBUILD-gameshell @@ -0,0 +1,38 @@ +# Maintainer: SpacingBat3 +# Contributor: Sebastien Chevalier +pkgname=box86-gameshell-git +pkgver=r2798.0edc0374 +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}") +conflicts=("${pkgname%-git}") +source=('git+https://github.com/ptitSeb/box86') +md5sums=('SKIP') + +pkgver() { + cd "$srcdir/${pkgname%-git}" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +prepare() { + cd "${srcdir}/${pkgname%-git}" + if [[ ! -d ./build ]]; then + mkdir build && cd build + cmake .. -DGAMESHELL=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo + fi +} + +build() { + cd "$srcdir/${pkgname%-git}/build" + make -j$(nproc) +} + +package() { + cd "$srcdir/${pkgname%-git}/build" + make DESTDIR="${pkgdir}/" install +} diff --git a/archlinux/PKGBUILD-odroid b/archlinux/PKGBUILD-odroid new file mode 100644 index 0000000000..a300c3bde1 --- /dev/null +++ b/archlinux/PKGBUILD-odroid @@ -0,0 +1,38 @@ +# Maintainer: SpacingBat3 +# Contributor: Sebastien Chevalier +pkgname=box86-odroid-git +pkgver=r2798.0edc0374 +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}") +conflicts=("${pkgname%-git}") +source=('git+https://github.com/ptitSeb/box86') +md5sums=('SKIP') + +pkgver() { + cd "$srcdir/${pkgname%-git}" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +prepare() { + cd "${srcdir}/${pkgname%-git}" + if [[ ! -d ./build ]]; then + mkdir build && cd build + cmake .. -DODROID=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo + fi +} + +build() { + cd "$srcdir/${pkgname%-git}/build" + make -j$(nproc) +} + +package() { + cd "$srcdir/${pkgname%-git}/build" + make DESTDIR="${pkgdir}/" install +} diff --git a/archlinux/PKGBUILD-pandora b/archlinux/PKGBUILD-pandora new file mode 100644 index 0000000000..13c4d65c67 --- /dev/null +++ b/archlinux/PKGBUILD-pandora @@ -0,0 +1,38 @@ +# Maintainer: SpacingBat3 +# Contributor: Sebastien Chevalier +pkgname=box86-pandora-git +pkgver=r2798.0edc0374 +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}") +conflicts=("${pkgname%-git}") +source=('git+https://github.com/ptitSeb/box86') +md5sums=('SKIP') + +pkgver() { + cd "$srcdir/${pkgname%-git}" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +prepare() { + cd "${srcdir}/${pkgname%-git}" + if [[ ! -d ./build ]]; then + mkdir build && cd build + cmake .. -DPANDORA=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo + fi +} + +build() { + cd "$srcdir/${pkgname%-git}/build" + make -j$(nproc) +} + +package() { + cd "$srcdir/${pkgname%-git}/build" + make DESTDIR="${pkgdir}/" install +} diff --git a/archlinux/PKGBUILD-pyra b/archlinux/PKGBUILD-pyra new file mode 100644 index 0000000000..8cffbde150 --- /dev/null +++ b/archlinux/PKGBUILD-pyra @@ -0,0 +1,38 @@ +# Maintainer: SpacingBat3 +# Contributor: Sebastien Chevalier +pkgname=box86-pyra-git +pkgver=r2798.0edc0374 +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}") +conflicts=("${pkgname%-git}") +source=('git+https://github.com/ptitSeb/box86') +md5sums=('SKIP') + +pkgver() { + cd "$srcdir/${pkgname%-git}" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +prepare() { + cd "${srcdir}/${pkgname%-git}" + if [[ ! -d ./build ]]; then + mkdir build && cd build + cmake .. -DPYRA=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo + fi +} + +build() { + cd "$srcdir/${pkgname%-git}/build" + make -j$(nproc) +} + +package() { + cd "$srcdir/${pkgname%-git}/build" + make DESTDIR="${pkgdir}/" install +} diff --git a/archlinux/PKGBUILD-x86 b/archlinux/PKGBUILD-x86 new file mode 100644 index 0000000000..3e7eaab780 --- /dev/null +++ b/archlinux/PKGBUILD-x86 @@ -0,0 +1,37 @@ +# Maintainer: SpacingBat3 +# Contributor: Sebastien Chevalier +pkgname=box86-x86-git +pkgver=r2798.0edc0374 +pkgrel=1 +pkgdesc="Linux Userspace x86 Emulator with a twist, targeted at ARM Linux devices." +arch=('i386') +url="https://github.com/ptitSeb/box86" +license=('MIT') +makedepends=('git' 'cmake' 'make') +provides=("${pkgname%-git}") +conflicts=("${pkgname%-git}") +source=('git+https://github.com/ptitSeb/box86') +md5sums=('SKIP') + +pkgver() { + cd "$srcdir/${pkgname%-git}" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +prepare() { + cd "${srcdir}/${pkgname%-git}" + if [[ ! -d ./build ]]; then + mkdir build && cd build + cmake .. -DLD80BITS=1 -DNOALIGN=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo + fi +} + +build() { + cd "$srcdir/${pkgname%-git}/build" + make -j$(nproc) +} + +package() { + cd "$srcdir/${pkgname%-git}/build" + make DESTDIR="${pkgdir}/" install +} diff --git a/archlinux/README.md b/archlinux/README.md index c1780f4b6b..171afc238b 100644 --- a/archlinux/README.md +++ b/archlinux/README.md @@ -12,10 +12,10 @@ This will copy the PKGBUILD for your platform (where you type your platform name In the future, I might try to do an unified PKGBUILD for all platforms that will recognize your platform automatically. ### 2. What platforms are currently supported. -Currently there's a PKGBUILD for Raspberry Pi devices only. Please note RPi 1 and 0 are not supported right now (those need additional effort to build for them, like building without the DYNAREC support). +All specified in [COMPILE.md](../COMPILE.md). ### 3. Any advantages with that sollution? This might give you some advantages like those: -- automatic updates (with some AUR frontends like [`pamac-aur`](https://aur.archlinux.org/packages/pamac-aur/)); +- automatic updates (with some AUR frontends like [`pamac-aur`](https://aur.archlinux.org/packages/pamac-aur/) or [`yay`](https://aur.archlinux.org/packages/yay)); - easily uninstall with `pacman -R` when no needed (no need other scripts nor Makefile to do this); - your `box86` installation is recognized as a package (where it wasn't when installing with `make install`).