Skip to content

Commit

Permalink
Merge pull request #239 from SpacingBat3/master
Browse files Browse the repository at this point in the history
PKGBUILDs for Arch Linux.
  • Loading branch information
ptitSeb committed Nov 2, 2020
2 parents a66d0b3 + 34828b6 commit e5a5511
Show file tree
Hide file tree
Showing 8 changed files with 300 additions and 0 deletions.
38 changes: 38 additions & 0 deletions archlinux/PKGBUILD-arm
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Maintainer: SpacingBat3 <youremail@domain.com>
# 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
}
38 changes: 38 additions & 0 deletions archlinux/PKGBUILD-gameshell
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Maintainer: SpacingBat3 <youremail@domain.com>
# 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
}
38 changes: 38 additions & 0 deletions archlinux/PKGBUILD-odroid
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Maintainer: SpacingBat3 <youremail@domain.com>
# 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
}
38 changes: 38 additions & 0 deletions archlinux/PKGBUILD-pandora
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Maintainer: SpacingBat3 <youremail@domain.com>
# 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
}
38 changes: 38 additions & 0 deletions archlinux/PKGBUILD-pyra
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Maintainer: SpacingBat3 <youremail@domain.com>
# 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
}
52 changes: 52 additions & 0 deletions archlinux/PKGBUILD-raspberrypi
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Maintainer: SpacingBat3 <youremail@domain.com>
# Contributor: Sebastien Chevalier
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')
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}"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

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
cmake .. -DRPI${_piversion}=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
}
37 changes: 37 additions & 0 deletions archlinux/PKGBUILD-x86
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Maintainer: SpacingBat3 <youremail@domain.com>
# 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
}
21 changes: 21 additions & 0 deletions archlinux/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# The directory containing all PKGBUILDs for BOX86
## FAQ
### 1. How to use it?
Just download the `PKGBUILD-<your-platform>` (no need to download the whole repository), go to directory where you downloaded and type:
```sh
mv ./PKGBUILD-<your-platform> ./PKGBUILD
cd ..
makepkg -si
```
This will copy the PKGBUILD for your platform (where you type your platform name instead of `<your-platform>`), 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.

### 2. What platforms are currently supported.
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/) 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`).

0 comments on commit e5a5511

Please sign in to comment.