zephyr-sdk v0.9.3

This commit is contained in:
Alexei Colin 2018-07-11 18:54:21 -04:00
commit 1d44a00bae
5 changed files with 139 additions and 0 deletions

41
.SRCINFO Normal file
View File

@ -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

8
.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
.*.swp
.*.swo
pkg/
src/
*.tar.xz
*.run

84
PKGBUILD Normal file
View File

@ -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')

4
zephyr-sdk.install Normal file
View File

@ -0,0 +1,4 @@
post_install() {
echo ">>> Create a config file:"
echo ">>> cp /etc/zephyrrc ~/.zephyrrc"
}

2
zephyrrc Normal file
View File

@ -0,0 +1,2 @@
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
export ZEPHYR_SDK_INSTALL_DIR=/opt/zephyr-sdk