Skip to content

Commit

Permalink
WIP adding support for aarch64 at 00:27 of 2020-09-25
Browse files Browse the repository at this point in the history
  • Loading branch information
nrobinson2000 committed Sep 25, 2020
1 parent c5bfa07 commit d4d52a9
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 27 deletions.
30 changes: 19 additions & 11 deletions aur/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,36 @@

pkgname=neopo-git
_gitname="neopo"
pkgver=2020.09.05 # TODO
pkgver=2020.09.25 # TODO
pkgrel=1
pkgdesc="A lightweight solution for local Particle development."
arch=('any')
url="https://neopo.xyz"
license=('custom')
depends=('libusb' 'lib32-glibc' 'python3' 'vim' 'git' 'perl-archive-zip')
install=neopo-git.install

# To get debugger working in Workbench:
# gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys C52048C0C0748FEE227D47A2702353E0F7E48EDB
# yay -S lib32-ncurses5-compat-libs

validpgpkeys=('C52048C0C0748FEE227D47A2702353E0F7E48EDB')
provides=('neopo')

install=neopo-git.install
source=('git+https://github.com/nrobinson2000/neopo.git')
md5sums=('SKIP')

## On x86_64
depends=('libusb' 'lib32-glibc' 'python3' 'vim' 'git' 'perl-archive-zip')
## On aarch64
# depends=('libusb' python3' 'vim' 'git' 'perl-archive-zip' 'dfu-util' 'node')

package() {
cd $_gitname
install -Dm 755 "neopo/neopo.py" "$pkgdir/usr/local/bin/neopo"
install -Dm 644 "neopo/neopo-completion" "$pkgdir/usr/share/bash-completion/completions/neopo"
install -Dm 644 "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
}

# To get debugger working in Workbench:

# gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys C52048C0C0748FEE227D47A2702353E0F7E48EDB
# yay -S lib32-ncurses5-compat-libs

# Also on aarch64, the node executable provided by particle-cli wrapper is actually armv7l
# Hack! Create a link to the current installed version of node:

# mv ~/.particle/node-v12*/bin/node ~/.particle/node-v12*/bin/node.old
# ln -s $(which node) ~/.particle/node-v12*/bin/node
47 changes: 31 additions & 16 deletions neopo/neopo.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,29 @@
CACHE_DIR = os.path.join(NEOPO_DEPS, "cache")
SCRIPTS_DIR = os.path.join(NEOPO_DEPS, "scripts")

# Raspberry Pi gcc-arm downloads
RPI_GCC_ARM = {
"5.3.1": {
"url": "https://github.com/nrobinson2000/neopo/releases/download/0.0.1/gcc-arm-v5.3.1-raspberry-pi.tar.gz",
"sha256": "5ff9b9406da9be17c17e0ec475f092b211cd158d826423d17c9fe6d1215db301"
# Precompiled gcc-arm for ARM platforms
ARM_GCC_ARM = {
"aarch64": {
"5.3.1": {
"url": "gcc-arm-v5.3.1-aarch64.tar.gz",
"sha256": "STILL COMPILING"
},

"9.2.1": {
"url": "https://github.com/nrobinson2000/neopo/releases/download/0.0.3/gcc-arm-v9.2.1-aarch64.tar.gz",
"sha256": "83526b6512ff59a5130dcb24603d60f10120c0f5409d23bd7417b19e1328a163"
}
},
"9.2.1": {
"url": "https://github.com/nrobinson2000/neopo/releases/download/0.0.2/gcc-arm-v9.2.1-raspberry-pi.tar.gz",
"sha256": "d963b551122d57057aaacc82e61ca6a05a524df14bb9fe28ca55b67494639fce"
}

"armv7l": {
"5.3.1": {
"url": "https://github.com/nrobinson2000/neopo/releases/download/0.0.1/gcc-arm-v5.3.1-raspberry-pi.tar.gz",
"sha256": "5ff9b9406da9be17c17e0ec475f092b211cd158d826423d17c9fe6d1215db301"
},
"9.2.1": {
"url": "https://github.com/nrobinson2000/neopo/releases/download/0.0.2/gcc-arm-v9.2.1-raspberry-pi.tar.gz",
"sha256": "d963b551122d57057aaacc82e61ca6a05a524df14bb9fe28ca55b67494639fce"
}}
}

# Windows tricks
Expand Down Expand Up @@ -323,12 +336,13 @@ def installOrUpdate(install, force):
system = platform.system().lower()
for dep in dependencies: depJSON.append(data[dep][system]["x64"][0])

# To support Raspberry Pi use my precompiled gcc-arm toolchain
if platform.machine() == "armv7l":
# Use my precompiled gcc-arm for ARM
installPlatform = platform.machine()
if installPlatform != "x86_64":
for dep in depJSON:
if dep["name"] == "gcc-arm":
dep["url"] = RPI_GCC_ARM[dep["version"]]["url"]
dep["sha256"] = RPI_GCC_ARM[dep["version"]]["sha256"]
dep["url"] = ARM_GCC_ARM[installPlatform][dep["version"]]["url"]
dep["sha256"] = ARM_GCC_ARM[installPlatform][dep["version"]]["sha256"]
break

# Update JSON cache files
Expand Down Expand Up @@ -541,11 +555,12 @@ def getCompilerData(version):
system = platform.system().lower()
compilers = data[system]["x64"]

installPlatform = platform.machine()
for compiler in compilers:
if compiler["version"] == version:
if platform.machine() == "armv7l":
compiler["url"] = RPI_GCC_ARM[version]["url"]
compiler["sha256"] = RPI_GCC_ARM[version]["sha256"]
if installPlatform != "x86_64":
compiler["url"] = ARM_GCC_ARM[installPlatform][version]["url"]
compiler["sha256"] = ARM_GCC_ARM[installPlatform][version]["sha256"]
return compiler
return False

Expand Down

0 comments on commit d4d52a9

Please sign in to comment.