diff options
author | Russell Keith-Magee <russell@keith-magee.com> | 2024-06-30 00:34:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-30 00:34:35 (GMT) |
commit | 48cd104b0cf05dad8958efa9cb9666c029ef9201 (patch) | |
tree | b8ae90a1286cfa1529ad575588c6c701a56fbc68 /Makefile.pre.in | |
parent | 6b280a84988ca221b5bdc1077a914e873790cce5 (diff) | |
download | cpython-48cd104b0cf05dad8958efa9cb9666c029ef9201.zip cpython-48cd104b0cf05dad8958efa9cb9666c029ef9201.tar.gz cpython-48cd104b0cf05dad8958efa9cb9666c029ef9201.tar.bz2 |
gh-120522: Add a `--with-app-store-compliance` configure option to patch out problematic code (#120984)
* Add --app-store-compliance configuration option.
* Added blurb.
* Correct tab-vs-spaces formatting issue.
* Correct source file name in docs.
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
* Correct source code reference in Mac docs
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
* Only apply the patch forward, and ensure the working directory is correct.
* Make patching reslient to multiple builds.
* Documentation fixes found during review
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
* Documentation and configure.ac syntax improvements
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* Regenerate configure script.
* Silence the patch echo output.
---------
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Diffstat (limited to 'Makefile.pre.in')
-rw-r--r-- | Makefile.pre.in | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/Makefile.pre.in b/Makefile.pre.in index 41904a2..1d106f3 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -178,6 +178,9 @@ EXPORTSFROM= @EXPORTSFROM@ EXE= @EXEEXT@ BUILDEXE= @BUILDEXEEXT@ +# Name of the patch file to apply for app store compliance +APP_STORE_COMPLIANCE_PATCH=@APP_STORE_COMPLIANCE_PATCH@ + # Short name and location for Mac OS X Python framework UNIVERSALSDK=@UNIVERSALSDK@ PYTHONFRAMEWORK= @PYTHONFRAMEWORK@ @@ -691,7 +694,7 @@ list-targets: @grep -E '^[A-Za-z][-A-Za-z0-9]+:' Makefile | awk -F : '{print $$1}' .PHONY: build_all -build_all: check-clean-src $(BUILDPYTHON) platform sharedmods \ +build_all: check-clean-src @APP_STORE_COMPLIANCE_PATCH_TARGET@ $(BUILDPYTHON) platform sharedmods \ gdbhooks Programs/_testembed scripts checksharedmods rundsymutil .PHONY: build_wasm @@ -927,6 +930,18 @@ SRC_GDB_HOOKS=$(srcdir)/Tools/gdb/libpython.py $(BUILDPYTHON)-gdb.py: $(SRC_GDB_HOOKS) $(INSTALL_DATA) $(SRC_GDB_HOOKS) $(BUILDPYTHON)-gdb.py +# Compliance with app stores (such as iOS and macOS) sometimes requires making +# modifications to the Python standard library. If enabled, apply the patch of +# known modifications to the source tree before building. The patch will be +# applied in a dry-run mode (validating, but not applying the patch) on builds +# that *have* a compliance patch, but where compliance has not been enabled. +build/app-store-compliant: + patch @APP_STORE_COMPLIANCE_PATCH_FLAGS@ --forward --strip=1 --directory="$(srcdir)" --input "$(APP_STORE_COMPLIANCE_PATCH)" + @if test "@APP_STORE_COMPLIANCE_PATCH_FLAGS@" == ""; then \ + mkdir -p build ; \ + echo "$(APP_STORE_COMPLIANCE_PATCH)" > build/app-store-compliant ; \ + fi + # This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary # minimal framework (not including the Lib directory and such) in the current # directory. |