AOSC-Archive / autobuild3

AOSC OS package maintenance toolkit (version 3)
https://aosc.io
GNU General Public License v2.0
24 stars 17 forks source link

`<build_type>_AFTER` declared as an array in defines #130

Closed cthbleachbit closed 2 years ago

cthbleachbit commented 2 years ago

Currentlys AB3 couldn't handle parameter passing to cmake / autotools / meson for options that contain literal space characters due to <build_type>_AFTER being a single string. As a result bash cannot possibly distinguish a literal space apart from inter-field separators that splits the string into char**. AOSC maintainers usually resort to writing custom build scripts whenever these cases arises... which isn't great for consistency.

This PR adds support to use bash array for values of CMAKE_AFTER, AUTOTOOLS_AFTER and MESON_AFTER. Any options that should contain literal spaces can be specified as following:

CMAKE_AFTER=(
    "-DOPTION_NAME=This is a literal sentence"
    "-DQUOTED_OPTION=QuotedValue"
    -DUNQUOTED_OPTION=Value
)

Existing <build_type>_AFTER as a huge string is still supported.