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
pkgdesc = SDK for Zephyr real-time operating system
pkgver = 0.11.2
pkgver = 0.11.4
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-breathe>=4.9.1
depends = python-docutils>=0.14
depends = python-pyaml>=5.1
depends = python-ply>=3.10
depends = python-pip
depends = python-setuptools
depends = python-wheel
depends = python-pyelftools
depends = python-pyelftools>=0.24
depends = python-pyserial
depends = python-pykwalify
depends = python-pillow
depends = python-anytree
depends = python-intelhex
depends = python-packaging
depends = pyocd
depends = python-progress
depends = python-pyserial
depends = python-cbor
depends = python-psutil
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-sphinxcontrib-svg2pdfconverter
depends = python-tabulate
depends = python-west
depends = python-west>=0.7.2
depends = git-spindle
depends = gitlint
depends = ninja
@ -41,12 +47,12 @@ pkgbase = zephyr-sdk
depends = cmake>=3.8.2
optdepends = pyocd: programming and debugging ARM MCUs
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 = setup-unattended.patch
sha256sums = 0f620b7bb03e951cb3c57bde6c2f2449e0fb0ae876828d832eff843d6d72f789
sha256sums = f61041a7cd7beec9c8f826e7aa1215a4c34c309c56a3dc0967b8b3401633d1b4
sha256sums = 7a1257272c64bdec281283d391e3149cece065935c9e8394d6bece32d0f6fc05
sha256sums = e4ed1da3cb5a64e99f2d0f2b3b83dba44b36c778c80ef0de57bd70a708ed3d5e
sha256sums = cc57a1304ae53bf155f32d41a5b527fb207716f027e4997ccb7b14c09064c7dc
pkgname = zephyr-sdk

View File

@ -1,7 +1,7 @@
# Maintainer: Alexei Colin <ac@alexeicolin.com>
pkgname=zephyr-sdk
pkgver=0.11.2
pkgver=0.11.4
pkgrel=1
pkgdesc="SDK for Zephyr real-time operating system"
arch=('x86_64')
@ -11,15 +11,18 @@ license=('Apache')
# 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
# zephyr/scripts/requirements.txt in Zephyr distribution)
# missing: junit2html
depends=('python-breathe' 'python-sphinx' 'python-docutils' 'python-pyaml'
'python-ply' 'python-pip' 'python-setuptools' 'python-wheel'
'python-pyelftools' 'python-pyserial' 'python-pykwalify'
# Missing (not packaged for Arch): junit2html, canopen, sphinx-tabs
depends=('python-breathe>=4.9.1' 'python-docutils>=0.14'
'python-pyaml>=5.1'
'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'
'pyocd' 'python-pyserial'
'python-pytest' 'python-sphinx_rtd_theme'
'python-progress' 'python-pyserial' 'python-cbor' 'python-psutil'
'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-west'
'python-west>=0.7.2'
'git-spindle' 'gitlint' 'ninja' 'gperf' 'gcovr' 'ccache'
'doxygen' 'dfu-util' 'dtc' 'cmake>=3.8.2')
optdepends=('pyocd: programming and debugging ARM MCUs')
@ -42,7 +45,8 @@ build() {
_TC_CMD="tar -C \\\$target_sdk_dir \\(-[A-Za-z0-9]\\+\\)* .\/__TC__.tar.bz2.*"
_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 ()
@ -107,7 +111,15 @@ package ()
######### NOTE: we are in $_installdir after this point
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 ">>> Ignore the environment variable values printed above, instead do this:"
@ -140,10 +152,11 @@ package ()
# $ cd testws
# $ west update
# $ cd zephyr
# $ west build --pristine -b qemu_x86 samples/hellow_world
# $ west -t run
# $ west build --pristine=always -b qemu_x86 samples/hello_world
# $ 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
# )
@ -151,7 +164,7 @@ package ()
# *** Booting Zephyr OS build v2.2.0-rc3 ***
# 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
# *** Booting Zephyr OS version 2.2.0-rc3 ***
@ -159,7 +172,6 @@ package ()
# More info: https://docs.zephyrproject.org/latest/getting_started/index.html
sha256sums=('0f620b7bb03e951cb3c57bde6c2f2449e0fb0ae876828d832eff843d6d72f789'
sha256sums=('f61041a7cd7beec9c8f826e7aa1215a4c34c309c56a3dc0967b8b3401633d1b4'
'7a1257272c64bdec281283d391e3149cece065935c9e8394d6bece32d0f6fc05'
'e4ed1da3cb5a64e99f2d0f2b3b83dba44b36c778c80ef0de57bd70a708ed3d5e')
'cc57a1304ae53bf155f32d41a5b527fb207716f027e4997ccb7b14c09064c7dc')

View File

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