mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-132006: Add support for handling XCPrivacy manifests (#139163)
Adds a PrivacyInfo.xcprivacy file when packaging `_hashlib` and `_ssl` modules for iOS (based on the original OpenSSL sources); and adds handling to the build script to allow any app to add `xcprivacy` handling for a binary module.
This commit is contained in:
parent
3779f2b95e
commit
195d13c85e
4 changed files with 55 additions and 2 deletions
|
|
@ -67,6 +67,9 @@ install_dylib () {
|
|||
|
||||
# The name of the extension file
|
||||
EXT=$(basename "$FULL_EXT")
|
||||
# The name and location of the module
|
||||
MODULE_PATH=$(dirname "$FULL_EXT")
|
||||
MODULE_NAME=$(echo $EXT | cut -d "." -f 1)
|
||||
# The location of the extension file, relative to the bundle
|
||||
RELATIVE_EXT=${FULL_EXT#$CODESIGNING_FOLDER_PATH/}
|
||||
# The path to the extension file, relative to the install base
|
||||
|
|
@ -94,6 +97,16 @@ install_dylib () {
|
|||
# Create a back reference to the .so file location in the framework
|
||||
echo "${RELATIVE_EXT%.so}.fwork" > "$CODESIGNING_FOLDER_PATH/$FRAMEWORK_FOLDER/$FULL_MODULE_NAME.origin"
|
||||
|
||||
# If the framework provides an xcprivacy file, install it.
|
||||
if [ -e "$MODULE_PATH/$MODULE_NAME.xcprivacy" ]; then
|
||||
echo "Installing XCPrivacy file for $FRAMEWORK_FOLDER/$FULL_MODULE_NAME"
|
||||
XCPRIVACY_FILE="$CODESIGNING_FOLDER_PATH/$FRAMEWORK_FOLDER/PrivacyInfo.xcprivacy"
|
||||
if [ -e "$XCPRIVACY_FILE" ]; then
|
||||
rm -rf "$XCPRIVACY_FILE"
|
||||
fi
|
||||
mv "$MODULE_PATH/$MODULE_NAME.xcprivacy" "$XCPRIVACY_FILE"
|
||||
fi
|
||||
|
||||
echo "Signing framework as $EXPANDED_CODE_SIGN_IDENTITY_NAME ($EXPANDED_CODE_SIGN_IDENTITY)..."
|
||||
/usr/bin/codesign --force --sign "$EXPANDED_CODE_SIGN_IDENTITY" ${OTHER_CODE_SIGN_FLAGS:-} -o runtime --timestamp=none --preserve-metadata=identifier,entitlements,flags --generate-entitlement-der "$CODESIGNING_FOLDER_PATH/$FRAMEWORK_FOLDER"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue