Merge pull request #979 from stilor/master

Make patch order overridable by individual packages
This commit is contained in:
Alexey Neyman 2018-06-06 13:46:17 -07:00 committed by GitHub
commit 21489af99a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 54 additions and 15 deletions

View File

@ -40,19 +40,16 @@ config ONLY_EXTRACT
Useful to look at the code before doing the build itself. Useful to look at the code before doing the build itself.
choice choice
prompt "Patches origin" bool "Patches origin"
bool
default PATCH_BUNDLED default PATCH_BUNDLED
config PATCH_BUNDLED config PATCH_BUNDLED
bool bool "Bundled only"
prompt "Bundled only"
help help
Only apply patches bundled with crosstool-NG. Only apply patches bundled with crosstool-NG.
config PATCH_LOCAL config PATCH_LOCAL
bool bool "Local only"
prompt "Local only (EXPERIMENTAL)"
select PATCH_USE_LOCAL select PATCH_USE_LOCAL
depends on EXPERIMENTAL depends on EXPERIMENTAL
help help
@ -61,16 +58,14 @@ config PATCH_LOCAL
copy them into your local directory if needed. copy them into your local directory if needed.
config PATCH_BUNDLED_LOCAL config PATCH_BUNDLED_LOCAL
bool bool "Bundled, then local"
prompt "Bundled, then local"
select PATCH_USE_LOCAL select PATCH_USE_LOCAL
help help
Apply the patches bundled with crosstool-NG, then apply your local Apply the patches bundled with crosstool-NG, then apply your local
patches. patches.
config PATCH_LOCAL_BUNDLED config PATCH_LOCAL_BUNDLED
bool bool "Local, then bundled"
prompt "Local, then bundled"
select PATCH_USE_LOCAL select PATCH_USE_LOCAL
depends on EXPERIMENTAL depends on EXPERIMENTAL
help help
@ -79,8 +74,7 @@ config PATCH_LOCAL_BUNDLED
to apply on top of your local patches. to apply on top of your local patches.
config PATCH_NONE config PATCH_NONE
bool bool "None"
prompt "None"
depends on EXPERIMENTAL depends on EXPERIMENTAL
help help
Don't use any patch at all. Don't use any patch at all.

View File

@ -1,3 +1,5 @@
#!// This file is not automatically generated, but we want this banner to
#!// appear in the files produced from it.
# #
# DO NOT EDIT! This file is automatically generated. # DO NOT EDIT! This file is automatically generated.
# #
@ -167,6 +169,44 @@ endif
endchoice endchoice
if EXPERIMENTAL
choice
bool "@@pkg_label@@ patches origin"
default @@fork|@@_PATCH_GLOBAL
config @@fork|@@_PATCH_GLOBAL
bool "Per global policy"
config @@fork|@@_PATCH_BUNDLED
bool "Bundled only"
config @@fork|@@_PATCH_LOCAL
bool "Local only"
select PATCH_USE_LOCAL
config @@fork|@@_PATCH_BUNDLED_LOCAL
bool "Bundled, then local"
select PATCH_USE_LOCAL
config @@fork|@@_PATCH_LOCAL_BUNDLED
bool "Local, then bundled"
select PATCH_USE_LOCAL
config @@fork|@@_PATCH_NONE
bool "None"
endchoice
endif
config @@fork|@@_PATCH_ORDER
string
default "bundled" if @@fork|@@_PATCH_BUNDLED
default "local" if @@fork|@@_PATCH_LOCAL
default "bundled,local" if @@fork|@@_PATCH_BUNDLED_LOCAL
default "local,bundled" if @@fork|@@_PATCH_LOCAL_BUNDLED
default "none" if @@fork|@@_PATCH_NONE
default "global"
#!// Below, we explicitly select all milestones to which a given version #!// Below, we explicitly select all milestones to which a given version
#!// compares greater-or-equal. We don't select just the latest applicable #!// compares greater-or-equal. We don't select just the latest applicable
#!// (and letting milestones chain-select each other, with FOO_6_or_later #!// (and letting milestones chain-select each other, with FOO_6_or_later

View File

@ -1898,7 +1898,7 @@ CT_PackageRun()
for v in basename pkg_name version pkg_dir \ for v in basename pkg_name version pkg_dir \
src_release mirrors archive_filename archive_dirname archive_formats signature_format \ src_release mirrors archive_filename archive_dirname archive_formats signature_format \
src_devel devel_vcs devel_url devel_branch devel_revision devel_subdir devel_bootstrap \ src_devel devel_vcs devel_url devel_branch devel_revision devel_subdir devel_bootstrap \
src_custom custom_location; do src_custom custom_location patch_order; do
eval "local ${v}=\${CT_${use}_${v^^}}" eval "local ${v}=\${CT_${use}_${v^^}}"
done done
@ -2056,6 +2056,11 @@ CT_DoExtractPatch()
local local_patch_dir local local_patch_dir
local overlay local overlay
# Inherit global value if requested
if [ "${patch_order}" = "global" ]; then
patch_order="${CT_PATCH_ORDER}"
fi
# If using overlay, prepare it first - we need to determine where to unpack # If using overlay, prepare it first - we need to determine where to unpack
# this component. # this component.
if [ "${CT_TARGET_USE_OVERLAY}" = "y" -a ! -d "${CT_BUILD_DIR}/overlay" ]; then if [ "${CT_TARGET_USE_OVERLAY}" = "y" -a ! -d "${CT_BUILD_DIR}/overlay" ]; then
@ -2072,7 +2077,7 @@ CT_DoExtractPatch()
# and no overlays. Otherwise, this source directory is custom-tailored for this # and no overlays. Otherwise, this source directory is custom-tailored for this
# particular configuration and cannot be reused by different configurations. # particular configuration and cannot be reused by different configurations.
if [ "${src_custom}" != "y" -a \ if [ "${src_custom}" != "y" -a \
"${CT_PATCH_ORDER}" = "bundled" -a \ "${patch_order}" = "bundled" -a \
! -d "${CT_BUILD_DIR}/overlay/${dir_name}" ]; then ! -d "${CT_BUILD_DIR}/overlay/${dir_name}" ]; then
src_dir="${CT_COMMON_SRC_DIR}" src_dir="${CT_COMMON_SRC_DIR}"
else else
@ -2121,7 +2126,7 @@ CT_DoExtractPatch()
bundled_patch_dir="${CT_LIB_DIR}/packages/${pkg_dir}" bundled_patch_dir="${CT_LIB_DIR}/packages/${pkg_dir}"
local_patch_dir="${CT_LOCAL_PATCH_DIR}/${pkg_dir}" local_patch_dir="${CT_LOCAL_PATCH_DIR}/${pkg_dir}"
case "${CT_PATCH_ORDER}" in case "${patch_order}" in
bundled) patch_dirs=("${bundled_patch_dir}");; bundled) patch_dirs=("${bundled_patch_dir}");;
local) patch_dirs=("${local_patch_dir}");; local) patch_dirs=("${local_patch_dir}");;
bundled,local) patch_dirs=("${bundled_patch_dir}" "${local_patch_dir}");; bundled,local) patch_dirs=("${bundled_patch_dir}" "${local_patch_dir}");;