summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexei Colin2018-07-11 18:54:21 -0400
committerAlexei Colin2018-07-11 18:54:21 -0400
commit1d44a00bae146bd930c1c223a18af226b34de432 (patch)
tree1e481055a238c0de76511ce12caf93451f0cc2f6
downloadaur-1d44a00bae146bd930c1c223a18af226b34de432.tar.gz
zephyr-sdk v0.9.3
-rw-r--r--.SRCINFO41
-rw-r--r--.gitignore8
-rw-r--r--PKGBUILD84
-rw-r--r--zephyr-sdk.install4
-rw-r--r--zephyrrc2
5 files changed, 139 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..614b2d10d51e
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,41 @@
+# Generated by mksrcinfo v8
+# Wed Jul 11 22:54:17 UTC 2018
+pkgbase = zephyr-sdk
+ pkgdesc = SDK for Zephyr real-time operating system
+ pkgver = 0.9.3
+ pkgrel = 1
+ url = https://www.zephyrproject.org/
+ install = zephyr-sdk.install
+ arch = x86_64
+ license = Apache
+ makedepends = patchelf
+ depends = python-breathe
+ depends = python-sphinx
+ depends = python-docutils
+ depends = python-pyaml
+ depends = python-ply
+ depends = python-pip
+ depends = python-setuptools
+ depends = python-wheel
+ depends = python-pyelftools
+ depends = python-pyserial
+ depends = python-pykwalify
+ depends = git-spindle
+ depends = gitlint
+ depends = ninja
+ depends = gperf
+ depends = ccache
+ depends = doxygen
+ depends = dfu-util
+ depends = dtc
+ depends = cmake>=3.8.2
+ optdepends = pyocd: programming and debugging ARM MCUs
+ options = !strip
+ backup = etc/zephyrrc
+ source = https://github.com/zephyrproject-rtos/meta-zephyr-sdk/releases/download/0.9.3/zephyr-sdk-0.9.3-setup.run
+ source = zephyrrc
+ sha256sums = 8c805e192c3bf3031ac9033013a779bb8a32457051c8fa24f21e9dc9ed8644f0
+ sha256sums = 7a1257272c64bdec281283d391e3149cece065935c9e8394d6bece32d0f6fc05
+
+pkgname = zephyr-sdk
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..c3c070bee004
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,8 @@
+.*.swp
+.*.swo
+
+pkg/
+src/
+
+*.tar.xz
+*.run
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..cb256d1c85c4
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,84 @@
+# Maintainer: Alexei Colin <ac@alexeicolin.com>
+
+pkgname=zephyr-sdk
+pkgver=0.9.3
+pkgrel=1
+pkgdesc="SDK for Zephyr real-time operating system"
+arch=('x86_64')
+url="https://www.zephyrproject.org/"
+license=('Apache')
+depends=('python-breathe' 'python-sphinx' 'python-docutils' 'python-pyaml'
+ 'python-ply' 'python-pip' 'python-setuptools' 'python-wheel'
+ 'python-pyelftools' 'python-pyserial' 'python-pykwalify'
+ 'git-spindle' 'gitlint' 'ninja' 'gperf' 'ccache'
+ 'doxygen' 'dfu-util' 'dtc' 'cmake>=3.8.2')
+optdepends=('pyocd: programming and debugging ARM MCUs')
+makedepends=('patchelf')
+source=("https://github.com/zephyrproject-rtos/meta-zephyr-sdk/releases/download/${pkgver}/zephyr-sdk-${pkgver}-setup.run"
+ "zephyrrc")
+
+options=(!strip)
+backup=('etc/zephyrrc')
+install=$pkgname.install
+
+_installdir=/opt/zephyr-sdk
+_setupsh=setup.sh
+
+build() {
+ cd "$srcdir"
+}
+
+_list_toolchains() {
+ echo $(sed -n "s/\.\/zephyr-sdk-baremetal-x86_64-meta-toolchain-\([a-zA-Z0-9-]\+\)-toolchain-[0-9.]\+\.sh.*/\1/p" $1 | sort)
+}
+
+package ()
+{
+ cd "$srcdir"
+ mkdir -p $pkgdir/$_installdir
+ echo ">>> When asked, manually specify the path to the one printed above"
+ sh zephyr-sdk-0.9.3-setup.run --target $pkgdir/$_installdir --nochown --noexec --keep -- -d $pkgdir/$_installdir
+
+ # Add a flag to not relocate executables, because the path to pkgdir is invalid after installation
+ # -R disables relocation, -S saves the relocation script so that it can be run manually.
+ sed -i 's#^\(\./zephyr-sdk-x86_64-hosttools-standalone-[0-9.]\+sh\)#\1 -R -S#' $pkgdir/$_installdir/setup.sh
+
+ # Install hosttools always, but let the toolchains be selectable below:
+ echo ">>> Available toolchains: $(_list_toolchains $pkgdir/$_installdir/$_setupsh)"
+
+ local DISABLED_TOOLCHAINS=""
+ #local DISABLED_TOOLCHAINS="i586 arc iamcu mips32r2 nios2 xtensa riscv32"
+
+ echo ">>> Disabled toolchains: $(echo ${DISABLED_TOOLCHAINS} | xargs -n 1 | sort | xargs)"
+
+ for tc in $DISABLED_TOOLCHAINS
+ do
+ sed -i "/\.\/zephyr-sdk-baremetal-x86_64-meta-toolchain-${tc}-toolchain-[0-9.]\+\.sh.*/,+3d" $pkgdir/$_installdir/$_setupsh
+ done
+
+ echo ">>> Installing toolchains: $(_list_toolchains $pkgdir/$_installdir/$_setupsh)"
+
+ # Because we chose not to relocate binaries, we need to make the default path work.
+ # The version here is the toolchain version, in the filename of each toolchain.
+ #
+ # Alternatively, we can relocate the binaries, either using the stock relocation
+ # script or using:
+ #
+ # find $pkgdir/$_installdir -type f -executable -exec \
+ # patchelf --set-interpreter /opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/lib/ld-linux-x86-64.so.2 \
+ # --set-rpath /opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/lib:/opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/lib {} \;
+ #
+ local _ver="$(sed -n "s/^\.\/zephyr-sdk-baremetal-x86_64-meta-toolchain-[a-zA-Z0-9]\+-toolchain-\([0-9.]\+\)\.sh.*/\1/p" $pkgdir/$_installdir/$_setupsh | uniq)"
+ for v in $_ver
+ do
+ ln -s $_installdir $pkgdir/$_installdir/$v
+ done
+
+ bash -c "cd $pkgdir/$_installdir && ./$_setupsh -d $pkgdir/$_installdir"
+
+ install -Dm644 zephyrrc $pkgdir/etc/zephyrrc
+}
+
+# vim:set ts=2 sw=2 et:
+sha256sums=('8c805e192c3bf3031ac9033013a779bb8a32457051c8fa24f21e9dc9ed8644f0'
+ '7a1257272c64bdec281283d391e3149cece065935c9e8394d6bece32d0f6fc05')
diff --git a/zephyr-sdk.install b/zephyr-sdk.install
new file mode 100644
index 000000000000..15f96334b085
--- /dev/null
+++ b/zephyr-sdk.install
@@ -0,0 +1,4 @@
+post_install() {
+ echo ">>> Create a config file:"
+ echo ">>> cp /etc/zephyrrc ~/.zephyrrc"
+}
diff --git a/zephyrrc b/zephyrrc
new file mode 100644
index 000000000000..4c019bd1c85f
--- /dev/null
+++ b/zephyrrc
@@ -0,0 +1,2 @@
+export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
+export ZEPHYR_SDK_INSTALL_DIR=/opt/zephyr-sdk