diff options
-rw-r--r-- | .SRCINFO | 48 | ||||
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | 0001-scripts-template_dir-don-t-let-y-override-no-rc.patch | 28 | ||||
-rw-r--r-- | 0002-scripts-template_dir-don-t-prompt-for-cmake-when-y-s.patch | 33 | ||||
-rw-r--r-- | 0003-scripts-template_dir-re-use-common-prompting-code.patch | 108 | ||||
-rw-r--r-- | 0004-scripts-template_dir-no-cmake-flag-for-CMake-module-.patch | 92 | ||||
-rw-r--r-- | PKGBUILD | 105 |
7 files changed, 34 insertions, 381 deletions
@@ -1,55 +1,31 @@ pkgbase = zephyr-sdk pkgdesc = SDK for Zephyr real-time operating system - pkgver = 0.12.4 + pkgver = 0.16.5 pkgrel = 1 url = https://www.zephyrproject.org/ install = zephyr-sdk.install arch = x86_64 license = Apache makedepends = patchelf - 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>=0.24 - depends = python-pyserial - depends = python-pykwalify - depends = python-pillow - depends = python-anytree - depends = python-intelhex - depends = python-packaging - depends = python-progress - depends = python-pyserial - depends = python-cbor - depends = python-psutil - depends = python-pytest - 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>=0.7.2 - depends = git-spindle - depends = gitlint + makedepends = wget + depends = cmake depends = ninja depends = gperf - depends = gcovr depends = ccache - depends = doxygen depends = dfu-util depends = dtc - depends = cmake>=3.8.2 + depends = python-pip + depends = python-pyelftools + depends = python-setuptools + depends = python-wheel + depends = tk + depends = xz optdepends = pyocd: programming and debugging ARM MCUs + optdepends = python-west: Zephyr RTOS Project meta-tool options = !strip - source = https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.12.4/zephyr-sdk-0.12.4-x86_64-linux-setup.run + source = https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.5/zephyr-sdk-0.16.5_linux-x86_64.tar.xz source = zephyrrc - sha256sums = 5382df7c47b63b4a259004270f27211d20de1a612c25fde5c97af6864383879c + sha256sums = eb4495e2e04387c822f8482be116a8f4ab3d1d2bfc1c1aeb53ca67937acf0009 sha256sums = 7a1257272c64bdec281283d391e3149cece065935c9e8394d6bece32d0f6fc05 pkgname = zephyr-sdk - diff --git a/.gitignore b/.gitignore index d3b5b20461e3..eb915334b69d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ pkg/ src/ +*.tar.gz *.pkg.tar.xz *.pkg.tar.zst *.run diff --git a/0001-scripts-template_dir-don-t-let-y-override-no-rc.patch b/0001-scripts-template_dir-don-t-let-y-override-no-rc.patch deleted file mode 100644 index aed4ac006242..000000000000 --- a/0001-scripts-template_dir-don-t-let-y-override-no-rc.patch +++ /dev/null @@ -1,28 +0,0 @@ -From b8d47d156f3e89237a80b349eb2ec48160046b05 Mon Sep 17 00:00:00 2001 -From: Alexei Colin <ac@alexeicolin.com> -Date: Sat, 18 Jul 2020 12:06:52 -0400 -Subject: [PATCH 1/4] scripts/template_dir: don't let -y override -[no]rc - -Overlooked in 6dd3e26c271bbf139f6d30523bc55fc7673b52f5 ---- - scripts/template_dir | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/scripts/template_dir b/scripts/template_dir -index 1ae2794..ab3394c 100644 ---- a/scripts/template_dir -+++ b/scripts/template_dir -@@ -66,7 +66,9 @@ while [ "$1" != "" ]; do - ;; - -y ) - confirm="y"; -- rc_confirm="y"; -+ if [ -z "$rc_confirm" ]; then -+ rc_confirm="y" -+ fi - ;; - -rc ) - rc_confirm="y"; --- -2.27.0 - diff --git a/0002-scripts-template_dir-don-t-prompt-for-cmake-when-y-s.patch b/0002-scripts-template_dir-don-t-prompt-for-cmake-when-y-s.patch deleted file mode 100644 index a7afbb9acb60..000000000000 --- a/0002-scripts-template_dir-don-t-prompt-for-cmake-when-y-s.patch +++ /dev/null @@ -1,33 +0,0 @@ -From e2e27bb5c5c044203c6085279a99514416799c51 Mon Sep 17 00:00:00 2001 -From: Alexei Colin <ac@alexeicolin.com> -Date: Sat, 18 Jul 2020 12:04:52 -0400 -Subject: [PATCH 2/4] scripts/template_dir: don't prompt for cmake when -y set - ---- - scripts/template_dir | 10 +--------- - 1 file changed, 1 insertion(+), 9 deletions(-) - -diff --git a/scripts/template_dir b/scripts/template_dir -index ab3394c..b03d4b5 100644 ---- a/scripts/template_dir -+++ b/scripts/template_dir -@@ -163,15 +163,7 @@ do_cmake_package() - return - fi - -- 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 with path $target_sdk_dir " - if [ "$confirm" = "y" -o "$confirm" = "Y" ]; then - if [ ! -d $ZEPHYR_SDK_REGISTRY_DIR ]; then - mkdir -p $ZEPHYR_SDK_REGISTRY_DIR --- -2.27.0 - diff --git a/0003-scripts-template_dir-re-use-common-prompting-code.patch b/0003-scripts-template_dir-re-use-common-prompting-code.patch deleted file mode 100644 index 7b9cdef2b55a..000000000000 --- a/0003-scripts-template_dir-re-use-common-prompting-code.patch +++ /dev/null @@ -1,108 +0,0 @@ -From 03933375277558f939a12990cae3ee372511d87e Mon Sep 17 00:00:00 2001 -From: Alexei Colin <ac@alexeicolin.com> -Date: Sat, 18 Jul 2020 12:14:07 -0400 -Subject: [PATCH 3/4] scripts/template_dir: re-use common prompting code - ---- - scripts/template_dir | 56 ++++++++++++++++++++++++-------------------- - 1 file changed, 31 insertions(+), 25 deletions(-) - -diff --git a/scripts/template_dir b/scripts/template_dir -index b03d4b5..0a0d69e 100644 ---- a/scripts/template_dir -+++ b/scripts/template_dir -@@ -131,15 +131,10 @@ do_zephyrrc() - echo " export ZEPHYR_SDK_INSTALL_DIR=$target_sdk_dir" - echo - 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" \ -- -o "$rc_confirm" = "n" \ -- -o "$rc_confirm" = "N" ] && break -- echo "Invalid input \"$rc_confirm\", please input 'y' or 'n': " -- done -+ prompt "creating/updating $HOME/.zephyrrc with environment variables setup for you " -+ rc_confirm=$answer - fi -- if [ "$rc_confirm" = "y" -o "$rc_confirm" = "Y" ]; then -+ if [ "$rc_confirm" = "y" ]; then - if [ -f $HOME/.zephyrrc ]; then - sed -i "s#ZEPHYR_SDK_INSTALL_DIR=.*#ZEPHYR_SDK_INSTALL_DIR=${target_sdk_dir}#" $HOME/.zephyrrc - sed -i "s#ZEPHYR_TOOLCHAIN_VARIANT=.*#ZEPHYR_TOOLCHAIN_VARIANT=zephyr#" $HOME/.zephyrrc -@@ -163,8 +158,8 @@ do_cmake_package() - return - fi - -- read_confirm "registering Zephyr-sdk CMake module with path $target_sdk_dir " -- if [ "$confirm" = "y" -o "$confirm" = "Y" ]; then -+ query "registering Zephyr-sdk CMake module with path $target_sdk_dir " -+ if [ "$answer" = "y" ]; then - if [ ! -d $ZEPHYR_SDK_REGISTRY_DIR ]; then - mkdir -p $ZEPHYR_SDK_REGISTRY_DIR - fi -@@ -176,17 +171,28 @@ do_cmake_package() - - # Read the input "y" - # $1 is optional, but allows the caller to provide additional text. --read_confirm () { -- if [ "$confirm" != "y" ]; then -- echo "Do you want to continue $1(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 -- else -- echo -- fi -+prompt () { -+ echo "Do you want to continue $1(y/n)? " -+ while read answer; do -+ if [ "$answer" = "Y" -o "$answer" = "y" ]; then -+ answer="y" -+ break -+ elif [ "$answer" = "N" -o "$answer" = "n" ]; then -+ answer="n" -+ break -+ else -+ echo "Invalid input \"$answer\", please input 'y' or 'n': " -+ fi -+ done -+} -+# Like prompt, but only if prompts were not pre-answered by -y argument -+query () { -+ if [ "$confirm" != "y" ]; then -+ prompt "$1" -+ else -+ answer="y" -+ echo -+ fi - } - - verify_os -@@ -261,8 +267,8 @@ if [ "$sdk_dirname" != "/opt" \ - echo Note: The version number \'-$SDK_VERSION\' can be omitted. - echo - -- read_confirm "installing to ${target_sdk_dir} " -- if [ "$confirm" = "n" -o "$confirm" = "N" ]; then -+ query "installing to ${target_sdk_dir} " -+ if [ "$answer" = "n" ]; then - # Abort the installation - echo "SDK installation aborted!" - exit 1 -@@ -282,8 +288,8 @@ if [ -d $target_sdk_dir ]; then - # wipe the directory first - if [ -d $target_sdk_dir/sysroots ]; then - echo "The directory $target_sdk_dir/sysroots will be removed! " -- read_confirm -- if [ "$confirm" = "y" -o "$confirm" = "Y" ]; then -+ query -+ if [ "$answer" = "y" ]; then - rm -rf $target_sdk_dir/sysroots/ - rm -rf $target_sdk_dir/info-zephyr-sdk*/ - rm -fr $target_sdk_dir/sdk_version --- -2.27.0 - diff --git a/0004-scripts-template_dir-no-cmake-flag-for-CMake-module-.patch b/0004-scripts-template_dir-no-cmake-flag-for-CMake-module-.patch deleted file mode 100644 index f87f4b18d436..000000000000 --- a/0004-scripts-template_dir-no-cmake-flag-for-CMake-module-.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 706b10cddfd781e3c7f1006a64ad23e09601e77c Mon Sep 17 00:00:00 2001 -From: Alexei Colin <ac@alexeicolin.com> -Date: Sat, 18 Jul 2020 12:18:20 -0400 -Subject: [PATCH 4/4] scripts/template_dir: -[no]cmake flag for CMake module - installation - -There are two issues with CMake module installation that are -problematic for distro packages: -1. the cmake module is installed under $HOME and this path is not overridable -2. the path to SDK recorded in the cmake file is the same as the -target directory, which might be prefixed by the staging path of the -package build (e.g. ~/mypackages/zerphyr-sdk/destdir/opt/zerphyr-sdk), -not the final installation directory in the system (/opt/zephyr-sdk). - -1 is fixable by making the variable overridable from the environment: - : ${ZEPHYR_SDK_REGISTRY_DIR:=$HOME/.cmake/packages/Zephyr-sdk} -(but this may be a bashism). But, 1 is not useful unless 2 is also -addressed. - -2 might be fixable by introducing a prefix argument -p (default "") in -addition to the target_dir (-d), and composing the destination directory -for copying files as $prefix/$target_dir while using only $target_dir -wherever installation paths are written, such as in the CMake module. - -Until 1 or 2 are addressed, add -[no]cmake arg so that the package -scripts can install the CMake module themselves. ---- - scripts/template_dir | 20 ++++++++++++++++++-- - 1 file changed, 18 insertions(+), 2 deletions(-) - -diff --git a/scripts/template_dir b/scripts/template_dir -index 0a0d69e..fccf6f0 100644 ---- a/scripts/template_dir -+++ b/scripts/template_dir -@@ -3,6 +3,7 @@ target_sdk_dir="" - post_install_cleanup=1 - confirm=0 - rc_confirm="" -+cmake_confirm="" - - usage () { - cat << EOF -@@ -22,6 +23,9 @@ Options: - -[no]rc - Whether to create/update the ~/.zerphyrc file (prompt if not given) - -+ -[no]cmake -+ Whether to install Zephyr-sdk CMake module (prompt if not given) -+ - EOF - } - -@@ -69,6 +73,9 @@ while [ "$1" != "" ]; do - if [ -z "$rc_confirm" ]; then - rc_confirm="y" - fi -+ if [ -z "$cmake_confirm" ]; then -+ cmake_confirm="y" -+ fi - ;; - -rc ) - rc_confirm="y"; -@@ -76,6 +83,12 @@ while [ "$1" != "" ]; do - -norc ) - rc_confirm="n"; - ;; -+ -cmake ) -+ cmake_confirm="y" -+ ;; -+ -nocmake ) -+ cmake_confirm="n" -+ ;; - * ) - echo "Error: Invalid argument \"$1\"" - usage -@@ -158,8 +171,11 @@ do_cmake_package() - return - fi - -- query "registering Zephyr-sdk CMake module with path $target_sdk_dir " -- if [ "$answer" = "y" ]; then -+ if [ -z "$cmake_confirm" ]; then -+ prompt "registering Zephyr-sdk CMake module with path $target_sdk_dir " -+ cmake_confirm=$answer -+ fi -+ if [ "$cmake_confirm" = "y" ]; then - if [ ! -d $ZEPHYR_SDK_REGISTRY_DIR ]; then - mkdir -p $ZEPHYR_SDK_REGISTRY_DIR - fi --- -2.27.0 - @@ -1,36 +1,25 @@ # Maintainer: Alexei Colin <ac@alexeicolin.com> pkgname=zephyr-sdk -pkgver=0.12.4 +pkgver=0.16.5 pkgrel=1 pkgdesc="SDK for Zephyr real-time operating system" arch=('x86_64') url="https://www.zephyrproject.org/" 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 (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' - 'python-progress' 'python-pyserial' 'python-cbor' 'python-psutil' - 'python-pytest' 'python-colorama' - 'python-coverage' 'gcovr' - 'python-sphinx>=1.7.5' 'python-sphinx_rtd_theme' - 'python-sphinxcontrib-svg2pdfconverter' 'python-tabulate' - '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') -makedepends=('patchelf') -_installer=zephyr-sdk-${pkgver}-x86_64-linux-setup.run -source=("https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${pkgver}/${_installer}" +depends=('cmake' 'ninja' 'gperf' 'ccache' 'dfu-util' 'dtc' + 'python-pip' 'python-pyelftools' 'python-setuptools' 'python-wheel' + 'tk' 'xz') +optdepends=('pyocd: programming and debugging ARM MCUs' + 'python-west: Zephyr RTOS Project meta-tool') +makedepends=('patchelf' 'wget') +source=("https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${pkgver}/zephyr-sdk-${pkgver}_linux-x86_64.tar.xz" "zephyrrc" ) +sha256sums=('eb4495e2e04387c822f8482be116a8f4ab3d1d2bfc1c1aeb53ca67937acf0009' + '7a1257272c64bdec281283d391e3149cece065935c9e8394d6bece32d0f6fc05') + options=(!strip) install=$pkgname.install @@ -42,64 +31,20 @@ build() { cd "$srcdir" } -# Matches per-toolchain commands in $_installdir/setup.sh -_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 \ - | grep -v cmake | sort) -} - package () { cd "$srcdir" - mkdir -p $pkgdir/$_installdir - echo ">>> Running installer...." - sh ${_installer} --target $pkgdir/$_installdir --nochown --noexec --keep -- -d $pkgdir/$_installdir + mkdir -p $pkgdir/opt + echo ">>> Unpacking...." + cp -a $srcdir/zephyr-sdk-$pkgver $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/$_setupsh - - # Install hosttools always, but let the toolchains be selectable below: - ALL_TOOLCHAINS=($(_list_toolchains $pkgdir/$_installdir/$_setupsh)) - echo ">>> To select a subset of toolchains set TOOLCHAINS in environment, like so:" - echo ">>> TOOLCHAINS='arm.x86_64 arm64.x86_64' makepkg" - echo ">>> Available toolchains: ${ALL_TOOLCHAINS[*]}" - - # Validate selected toolchains - if [ ! -z "$TOOLCHAINS" ] - then - TOOLCHAINS=(${TOOLCHAINS}) # convert to array - - for tc in "${TOOLCHAINS[@]}" - do - if ! echo "${ALL_TOOLCHAINS[@]}" | grep -q -w "$tc" - then - echo ">>> ERROR: unknown toolchain: $tc" - exit 1 - fi - done - else - TOOLCHAINS=("${ALL_TOOLCHAINS[@]}") - fi - echo ">>> Selected toolchains: ${TOOLCHAINS[*]}" - - for tc in ${ALL_TOOLCHAINS[@]} - do - if ! echo "${TOOLCHAINS[@]}" | grep -q -w "$tc" - then - DISABLED_TOOLCHAINS+=("$tc") - fi - done - - for tc in ${DISABLED_TOOLCHAINS[@]} - do - sed -i "/$(echo $_TC_CMD | sed s/__TC__/${tc}/g)/,+3d" $pkgdir/$_installdir/$_setupsh - done - - echo ">>> Installing toolchains: $(_list_toolchains $pkgdir/$_installdir/$_setupsh)" + sed -i 's#\(\./zephyr-sdk-\${HOSTTYPE}-hosttools-standalone-[0-9.]\+sh\)#\1 -R -S#' $pkgdir/$_installdir/$_setupsh + + # Disables sanboxing on systems where libseccomp is available + sed -i 's/xargs -n100 file/xargs -n100 file -S/' $pkgdir/$_installdir/zephyr-sdk-x86_64-hosttools-standalone-*.sh install -Dm644 zephyrrc $pkgdir/usr/share/zephyr-sdk/zephyrrc @@ -107,7 +52,7 @@ package () ######### NOTE: we are in $_installdir after this point - ./$_setupsh -d $pkgdir/$_installdir -norc -nocmake -y + ./$_setupsh -h -t all # Manually install the CMake module, because upstream paths are no good: # file installed into $HOME and path is the package build path. Upstream @@ -118,18 +63,13 @@ package () mkdir -p "$_cmake_module_path" echo "/$_installdir" > "$_cmake_module_path/${_cmake_fname}" - echo ">>>" - echo ">>> Ignore the environment variable values printed above, instead do this:" - echo ">>> cp /usr/share/zephyr-sdk/zephyrrc ~/.zephyrrc" - echo ">>>" - # Strip package build path from prefix path sed -i "s@\(relocate_sdk.py\s\+\)${pkgdir}/${_installdir} ${pkgdir}/${_installdir}@\1 /${_installdir} /${_installdir}@g" relocate_sdk.sh ./relocate_sdk.sh rm zephyr-sdk-*-hosttools-standalone-*.sh - rm "${ALL_TOOLCHAINS[@]/%/.tar.bz2}" - rm -f mips.tar.bz2 # workaround: mips is part of archive but not in setup.sh + rm relocate_sdk.{py,sh} + rm setup.sh } # Manual test procedure: get Zephyr Kernel, build an example, and run in Qemu: @@ -159,6 +99,3 @@ package () # Hello World! qemu_cortex_a53 # More info: https://docs.zephyrproject.org/latest/getting_started/index.html - -sha256sums=('5382df7c47b63b4a259004270f27211d20de1a612c25fde5c97af6864383879c' - '7a1257272c64bdec281283d391e3149cece065935c9e8394d6bece32d0f6fc05') |