This commit is contained in:
Alexei Colin 2020-07-18 11:48:22 -04:00
parent 23aa11fc21
commit cb5392e829
3 changed files with 90 additions and 71 deletions

View File

@ -1,34 +1,40 @@
pkgbase = zephyr-sdk pkgbase = zephyr-sdk
pkgdesc = SDK for Zephyr real-time operating system pkgdesc = SDK for Zephyr real-time operating system
pkgver = 0.11.2 pkgver = 0.11.4
pkgrel = 1 pkgrel = 1
url = https://www.zephyrproject.org/ url = https://www.zephyrproject.org/
install = zephyr-sdk.install install = zephyr-sdk.install
arch = x86_64 arch = x86_64
license = Apache license = Apache
makedepends = patchelf makedepends = patchelf
depends = python-breathe depends = python-breathe>=4.9.1
depends = python-sphinx depends = python-docutils>=0.14
depends = python-docutils depends = python-pyaml>=5.1
depends = python-pyaml depends = python-ply>=3.10
depends = python-ply
depends = python-pip depends = python-pip
depends = python-setuptools depends = python-setuptools
depends = python-wheel depends = python-wheel
depends = python-pyelftools depends = python-pyelftools>=0.24
depends = python-pyserial depends = python-pyserial
depends = python-pykwalify depends = python-pykwalify
depends = python-pillow depends = python-pillow
depends = python-anytree depends = python-anytree
depends = python-intelhex depends = python-intelhex
depends = python-packaging depends = python-packaging
depends = pyocd depends = python-progress
depends = python-pyserial depends = python-pyserial
depends = python-cbor
depends = python-psutil
depends = python-pytest depends = python-pytest
depends = python-mock>=4.0.1
depends = python-colorama
depends = python-coverage
depends = gcovr
depends = python-sphinx>=1.7.5
depends = python-sphinx_rtd_theme depends = python-sphinx_rtd_theme
depends = python-sphinxcontrib-svg2pdfconverter depends = python-sphinxcontrib-svg2pdfconverter
depends = python-tabulate depends = python-tabulate
depends = python-west depends = python-west>=0.7.2
depends = git-spindle depends = git-spindle
depends = gitlint depends = gitlint
depends = ninja depends = ninja
@ -41,12 +47,12 @@ pkgbase = zephyr-sdk
depends = cmake>=3.8.2 depends = cmake>=3.8.2
optdepends = pyocd: programming and debugging ARM MCUs optdepends = pyocd: programming and debugging ARM MCUs
options = !strip options = !strip
source = https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.11.2/zephyr-sdk-0.11.2-setup.run source = https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.11.4/zephyr-sdk-0.11.4-setup.run
source = zephyrrc source = zephyrrc
source = setup-unattended.patch source = setup-unattended.patch
sha256sums = 0f620b7bb03e951cb3c57bde6c2f2449e0fb0ae876828d832eff843d6d72f789 sha256sums = f61041a7cd7beec9c8f826e7aa1215a4c34c309c56a3dc0967b8b3401633d1b4
sha256sums = 7a1257272c64bdec281283d391e3149cece065935c9e8394d6bece32d0f6fc05 sha256sums = 7a1257272c64bdec281283d391e3149cece065935c9e8394d6bece32d0f6fc05
sha256sums = e4ed1da3cb5a64e99f2d0f2b3b83dba44b36c778c80ef0de57bd70a708ed3d5e sha256sums = cc57a1304ae53bf155f32d41a5b527fb207716f027e4997ccb7b14c09064c7dc
pkgname = zephyr-sdk pkgname = zephyr-sdk

View File

@ -1,7 +1,7 @@
# Maintainer: Alexei Colin <ac@alexeicolin.com> # Maintainer: Alexei Colin <ac@alexeicolin.com>
pkgname=zephyr-sdk pkgname=zephyr-sdk
pkgver=0.11.2 pkgver=0.11.4
pkgrel=1 pkgrel=1
pkgdesc="SDK for Zephyr real-time operating system" pkgdesc="SDK for Zephyr real-time operating system"
arch=('x86_64') arch=('x86_64')
@ -11,22 +11,25 @@ license=('Apache')
# Some of these are dependencies of Zephyr RTOS, but instructions for Zephyr # Some of these are dependencies of Zephyr RTOS, but instructions for Zephyr
# tell user to pip install, so let's add them here instead. (See # tell user to pip install, so let's add them here instead. (See
# zephyr/scripts/requirements.txt in Zephyr distribution) # zephyr/scripts/requirements.txt in Zephyr distribution)
# missing: junit2html # Missing (not packaged for Arch): junit2html, canopen, sphinx-tabs
depends=('python-breathe' 'python-sphinx' 'python-docutils' 'python-pyaml' depends=('python-breathe>=4.9.1' 'python-docutils>=0.14'
'python-ply' 'python-pip' 'python-setuptools' 'python-wheel' 'python-pyaml>=5.1'
'python-pyelftools' 'python-pyserial' 'python-pykwalify' 'python-ply>=3.10' 'python-pip' 'python-setuptools' 'python-wheel'
'python-pyelftools>=0.24' 'python-pyserial' 'python-pykwalify'
'python-pillow' 'python-anytree' 'python-intelhex' 'python-packaging' 'python-pillow' 'python-anytree' 'python-intelhex' 'python-packaging'
'pyocd' 'python-pyserial' 'python-progress' 'python-pyserial' 'python-cbor' 'python-psutil'
'python-pytest' 'python-sphinx_rtd_theme' 'python-pytest' 'python-mock>=4.0.1' 'python-colorama'
'python-coverage' 'gcovr'
'python-sphinx>=1.7.5' 'python-sphinx_rtd_theme'
'python-sphinxcontrib-svg2pdfconverter' 'python-tabulate' 'python-sphinxcontrib-svg2pdfconverter' 'python-tabulate'
'python-west' 'python-west>=0.7.2'
'git-spindle' 'gitlint' 'ninja' 'gperf' 'gcovr' 'ccache' 'git-spindle' 'gitlint' 'ninja' 'gperf' 'gcovr' 'ccache'
'doxygen' 'dfu-util' 'dtc' 'cmake>=3.8.2') 'doxygen' 'dfu-util' 'dtc' 'cmake>=3.8.2')
optdepends=('pyocd: programming and debugging ARM MCUs') optdepends=('pyocd: programming and debugging ARM MCUs')
makedepends=('patchelf') makedepends=('patchelf')
source=("https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${pkgver}/zephyr-sdk-${pkgver}-setup.run" source=("https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${pkgver}/zephyr-sdk-${pkgver}-setup.run"
"zephyrrc" "zephyrrc"
"setup-unattended.patch") "setup-unattended.patch")
options=(!strip) options=(!strip)
install=$pkgname.install install=$pkgname.install
@ -42,7 +45,8 @@ build() {
_TC_CMD="tar -C \\\$target_sdk_dir \\(-[A-Za-z0-9]\\+\\)* .\/__TC__.tar.bz2.*" _TC_CMD="tar -C \\\$target_sdk_dir \\(-[A-Za-z0-9]\\+\\)* .\/__TC__.tar.bz2.*"
_list_toolchains() { _list_toolchains() {
echo $(sed -n "s@^$(echo $_TC_CMD | sed 's/__TC__/\\(.*\\)/g')@\2@p" $1 | sort) echo $(sed -n "s@^$(echo $_TC_CMD | sed 's/__TC__/\\(.*\\)/g')@\2@p" $1 \
| grep -v cmake | sort)
} }
package () package ()
@ -107,7 +111,15 @@ package ()
######### NOTE: we are in $_installdir after this point ######### NOTE: we are in $_installdir after this point
patch ./$_setupsh $srcdir/setup-unattended.patch patch ./$_setupsh $srcdir/setup-unattended.patch
./$_setupsh -d $pkgdir/$_installdir -norc
export ZEPHYR_SDK_REGISTRY_DIR=$pkgdir/usr/lib/cmake/Zephyr-sdk
./$_setupsh -d $pkgdir/$_installdir -norc -y
# Fixup the path written to cmake file to point to final installation directory
# Ideally, upstream script would support destination dir and installation dir
rm ${ZEPHYR_SDK_REGISTRY_DIR}/*
local cmake_fname=$(echo -n /$_installdir | md5sum | cut -d' ' -f1)
echo "/$_installdir" > ${ZEPHYR_SDK_REGISTRY_DIR}/${cmake_fname}
echo ">>>" echo ">>>"
echo ">>> Ignore the environment variable values printed above, instead do this:" echo ">>> Ignore the environment variable values printed above, instead do this:"
@ -140,10 +152,11 @@ package ()
# $ cd testws # $ cd testws
# $ west update # $ west update
# $ cd zephyr # $ cd zephyr
# $ west build --pristine -b qemu_x86 samples/hellow_world # $ west build --pristine=always -b qemu_x86 samples/hello_world
# $ west -t run # $ cd build
# $ ninja run
# Expected output (qemu_x86: # Expected output for -b qemu_x86:
# #
# SeaBIOS (version rel-1.12.1-0-ga5cab58-dirty-20200214_052440-f7294c49af13-zephyr # SeaBIOS (version rel-1.12.1-0-ga5cab58-dirty-20200214_052440-f7294c49af13-zephyr
# ) # )
@ -151,7 +164,7 @@ package ()
# *** Booting Zephyr OS build v2.2.0-rc3 *** # *** Booting Zephyr OS build v2.2.0-rc3 ***
# Hello World! qemu_x86 # Hello World! qemu_x86
# #
# Expected output (qemu_cortex_m3): # Expected output for -b qemu_cortex_m3:
# #
# qemu-system-arm: warning: nic stellaris_enet.0 has no peer # qemu-system-arm: warning: nic stellaris_enet.0 has no peer
# *** Booting Zephyr OS version 2.2.0-rc3 *** # *** Booting Zephyr OS version 2.2.0-rc3 ***
@ -159,7 +172,6 @@ package ()
# More info: https://docs.zephyrproject.org/latest/getting_started/index.html # More info: https://docs.zephyrproject.org/latest/getting_started/index.html
sha256sums=('f61041a7cd7beec9c8f826e7aa1215a4c34c309c56a3dc0967b8b3401633d1b4'
sha256sums=('0f620b7bb03e951cb3c57bde6c2f2449e0fb0ae876828d832eff843d6d72f789'
'7a1257272c64bdec281283d391e3149cece065935c9e8394d6bece32d0f6fc05' '7a1257272c64bdec281283d391e3149cece065935c9e8394d6bece32d0f6fc05'
'e4ed1da3cb5a64e99f2d0f2b3b83dba44b36c778c80ef0de57bd70a708ed3d5e') 'cc57a1304ae53bf155f32d41a5b527fb207716f027e4997ccb7b14c09064c7dc')

View File

@ -1,43 +1,44 @@
--- setup.sh 2020-02-29 21:30:32.862816400 -0500 --- setup.sh 2020-07-18 10:13:04.994912357 -0400
+++ setup.sh 2020-02-29 21:36:28.300273309 -0500 +++ setup.sh 2020-07-18 10:16:38.985654960 -0400
@@ -7,7 +7,7 @@ @@ -166,15 +166,7 @@
target_sdk_dir="" return
post_install_cleanup=1 fi
confirm=0
-rc_confirm=0
+rc_confirm=""
usage () { - echo "Do you want to register the Zephyr-sdk at location: $target_sdk_dir"
cat << EOF - echo " in the CMake package registry (y/n)?"
@@ -24,6 +24,9 @@ -
-y - while read confirm; do
Automatic yes to prompts; assume "yes" as answer to all prompts. - [ "$confirm" = "Y" -o "$confirm" = "y" -o "$confirm" = "n" \
- -o "$confirm" = "N" ] && break
+ -[no]rc - echo "Invalid input \"$confirm\", please input 'y' or 'n': "
+ Whether to create/update the ~/.zerphyrc file (prompt if not given) - done
+ -
EOF + read_confirm "registering Zephyr-sdk CMake module (at $target_sdk_dir)"
} if [ "$confirm" = "y" -o "$confirm" = "Y" ]; then
if [ ! -d $ZEPHYR_SDK_REGISTRY_DIR ]; then
@@ -70,6 +73,12 @@ mkdir -p $ZEPHYR_SDK_REGISTRY_DIR
confirm="y"; --- pkg/zephyr-sdk/opt/zephyr-sdk/setup.sh.orig 2020-07-18 10:27:09.440996750 -0400
rc_confirm="y"; +++ pkg/zephyr-sdk/opt/zephyr-sdk/setup.sh 2020-07-18 10:28:11.268841053 -0400
@@ -71,7 +71,10 @@
;; ;;
+ -rc ) -y )
+ rc_confirm="y"; confirm="y";
+ ;; - rc_confirm="y";
+ -norc ) + if [ -z "$rc_confirm" ]
+ rc_confirm="n"; + then
+ ;; + rc_confirm="y"
* ) + fi
echo "Error: Invalid argument \"$1\"" ;;
usage -rc )
@@ -120,7 +129,7 @@ rc_confirm="y";
echo " export ZEPHYR_TOOLCHAIN_VARIANT=zephyr" --- pkg/zephyr-sdk/opt/zephyr-sdk/setup.sh.orig 2020-07-18 11:12:04.328724883 -0400
echo " export ZEPHYR_SDK_INSTALL_DIR=$target_sdk_dir" +++ pkg/zephyr-sdk/opt/zephyr-sdk/setup.sh 2020-07-18 11:12:40.741607822 -0400
echo @@ -158,7 +158,7 @@
- if [ "$rc_confirm" != "y" ]; then
+ if [ -z "$rc_confirm" ]; then do_cmake_package()
echo "Update/Create $HOME/.zephyrrc with environment variables setup for you (y/n)? " {
while read rc_confirm; do - ZEPHYR_SDK_REGISTRY_DIR=$HOME/.cmake/packages/Zephyr-sdk
[ "$rc_confirm" = "Y" -o "$rc_confirm" = "y" \ + : ${ZEPHYR_SDK_REGISTRY_DIR:=$HOME/.cmake/packages/Zephyr-sdk}
type md5sum
if [ $? -eq 0 ]; then