Blob Blame History Raw
#!/bin/bash -xe

CMSIS_VERSION=9fe411cef1cef5de58e5957b89760759de44e393
CMSIS_SVD_VERSION=b6f0a65ac37760f52d6ade23dd3205424d6c91fa

# The license for this tarball is complicated, but the headers are under a
# simple BSD license, so we only package them.
wget https://github.com/ARM-software/CMSIS/archive/${CMSIS_VERSION}/cmsis-${CMSIS_VERSION}.tar.gz
tar xf cmsis-${CMSIS_VERSION}.tar.gz
tar cJf cmsis-${CMSIS_VERSION}-clean.tar.xz \
    CMSIS-${CMSIS_VERSION}/README.md \
    CMSIS-${CMSIS_VERSION}/CMSIS/Include/
rm -r CMSIS-${CMSIS_VERSION}/

# This is basically a "collection of random stuff" from various vendors, under
# various licenses. Some licenses are non-free and some are actively hostile,
# but we only need a rather small portion under a good license.
wget https://github.com/posborne/cmsis-svd/archive/${CMSIS_SVD_VERSION}/cmsis_svd-${CMSIS_SVD_VERSION}.tar.gz
tar xf cmsis_svd-${CMSIS_SVD_VERSION}.tar.gz
tar cJf cmsis_svd-${CMSIS_SVD_VERSION}-clean.tar.xz \
    cmsis-svd-${CMSIS_SVD_VERSION}/data/Atmel/ \
    # This has a weird license, so we cannot include it.
    # cmsis-svd-${CMSIS_SVD_VERSION}/data/STMicro/
rm -r cmsis_svd-${CMSIS_SVD_VERSION}/