4 # This bash script generates a CMSIS-Driver Software Pack
9 # Set version of gen pack library
10 REQUIRED_GEN_PACK_LIB="0.6.1"
12 # Set default command line arguments
15 # Pack warehouse directory - destination
18 # Temporary pack build directory
21 # Specify directory names to be added to pack base directory
32 # Specify file names to be added to pack base directory
38 # Specify file names to be deleted from pack build directory
41 # Specify patches to be applied
44 # Specify addition argument to packchk
47 # Specify additional dependencies for packchk
51 Keil.STM32F2xx_DFP.pdsc
52 Keil.STM32F4xx_DFP.pdsc
53 Keil.STM32F7xx_DFP.pdsc
54 Keil.B-L475E-IOT01A_BSP.pdsc
55 Infineon.XMC4000_DFP.pdsc
56 NXP.LPCXpresso55S69_BSP.pdsc
57 NXP.EVK-MIMXRT1064_BSP.pdsc
60 # Optional: restrict fallback modes for changelog generation
63 # - full Tag annotations, release descriptions, or commit messages (in order)
64 # - release Tag annotations, or release descriptions (in order)
65 # - tag Tag annotations only
66 PACK_CHANGELOG_MODE="tag"
68 # custom preprocessing steps
69 function preprocess() {
73 # custom post-processing steps
74 # function postprocess() {
77 ############ DO NOT EDIT BELOW ###########
79 function install_lib() {
80 local URL="https://github.com/Open-CMSIS-Pack/gen-pack/archive/refs/tags/v$1.tar.gz"
81 echo "Downloading gen-pack lib to '$2'"
83 curl -L "${URL}" -s | tar -xzf - --strip-components 1 -C "$2" || exit 1
87 if [[ -d ${GEN_PACK_LIB} ]]; then
88 . "${GEN_PACK_LIB}/gen-pack"
91 local GLOBAL_LIB="/usr/local/share/gen-pack/${REQUIRED_GEN_PACK_LIB}"
92 local USER_LIB="${HOME}/.local/share/gen-pack/${REQUIRED_GEN_PACK_LIB}"
93 if [[ ! -d "${GLOBAL_LIB}" && ! -d "${USER_LIB}" ]]; then
94 echo "Required gen_pack lib not found!" >&2
95 install_lib "${REQUIRED_GEN_PACK_LIB}" "${USER_LIB}"
98 if [[ -d "${GLOBAL_LIB}" ]]; then
99 . "${GLOBAL_LIB}/gen-pack"
100 elif [[ -d "${USER_LIB}" ]]; then
101 . "${USER_LIB}/gen-pack"
103 echo "Required gen-pack lib is not installed!" >&2
109 gen_pack "${DEFAULT_ARGS[@]}" "$@"