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
49 Keil.STM32F2xx_DFP.pdsc
50 Keil.STM32F4xx_DFP.pdsc
51 Keil.STM32F7xx_DFP.pdsc
52 Keil.B-L475E-IOT01A_BSP.pdsc
53 Infineon.XMC4000_DFP.pdsc
54 NXP.LPCXpresso55S69_BSP.pdsc
55 NXP.EVK-MIMXRT1064_BSP.pdsc
58 # Optional: restrict fallback modes for changelog generation
61 # - full Tag annotations, release descriptions, or commit messages (in order)
62 # - release Tag annotations, or release descriptions (in order)
63 # - tag Tag annotations only
64 PACK_CHANGELOG_MODE="tag"
66 # custom preprocessing steps
67 function preprocess() {
71 # custom post-processing steps
72 # function postprocess() {
75 ############ DO NOT EDIT BELOW ###########
77 function install_lib() {
78 local URL="https://github.com/Open-CMSIS-Pack/gen-pack/archive/refs/tags/v$1.tar.gz"
79 echo "Downloading gen-pack lib to '$2'"
81 curl -L "${URL}" -s | tar -xzf - --strip-components 1 -C "$2" || exit 1
85 if [[ -d ${GEN_PACK_LIB} ]]; then
86 . "${GEN_PACK_LIB}/gen-pack"
89 local GLOBAL_LIB="/usr/local/share/gen-pack/${REQUIRED_GEN_PACK_LIB}"
90 local USER_LIB="${HOME}/.local/share/gen-pack/${REQUIRED_GEN_PACK_LIB}"
91 if [[ ! -d "${GLOBAL_LIB}" && ! -d "${USER_LIB}" ]]; then
92 echo "Required gen_pack lib not found!" >&2
93 install_lib "${REQUIRED_GEN_PACK_LIB}" "${USER_LIB}"
96 if [[ -d "${GLOBAL_LIB}" ]]; then
97 . "${GLOBAL_LIB}/gen-pack"
98 elif [[ -d "${USER_LIB}" ]]; then
99 . "${USER_LIB}/gen-pack"
101 echo "Required gen-pack lib is not installed!" >&2
107 gen_pack "${DEFAULT_ARGS[@]}" "$@"