Browse Source

IOS-2882 sequoia 4 iOS working

IOS-2882
Andreas Buff 2 months ago
parent
commit
94850fb75a
5 changed files with 163 additions and 7 deletions
  1. +1
    -1
      CommonPEPDependencies/CommonPEPDependencies.xcodeproj/project.pbxproj
  2. +2
    -4
      _config/pEp_versions.plist
  3. +2
    -2
      build-ios_dependency.template
  4. +50
    -0
      buildcode/sequoia.code
  5. +108
    -0
      buildcode/sequoia_resources/nettle-bindings.rs

+ 1
- 1
CommonPEPDependencies/CommonPEPDependencies.xcodeproj/project.pbxproj View File

@ -859,7 +859,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = "/bin/sh -l";
shellScript = "# Note: `-l`(login shell) needed to find `wget`\nSCRIPTS_DIR=\"${PROJECT_DIR}/..\"\nPREFIX=\"${PROJECT_DIR}/$(${SCRIPTS_DIR}/get-config-prefix.sh)\"\nBUILD_SCRIPT=\"${SCRIPTS_DIR}/build-sequoia-iOS.sh\" \nsh \"${BUILD_SCRIPT}\" \"${PREFIX}\"\n";
shellScript = "LIB_NAME=\"sequoia\"\n\nSCRIPTS_DIR=\"${PROJECT_DIR}/..\"\nPREFIX=\"${PROJECT_DIR}/$(${SCRIPTS_DIR}/get-config-prefix.sh)\"\n\nBUILD_SCRIPT=\"${SCRIPTS_DIR}/generate_and_run_ios_dependency_build_script.sh\" \nsh \"${BUILD_SCRIPT}\" $LIB_NAME \"${PREFIX}\"\n";
showEnvVarsInLog = 0;
};
1585F04626A1C14C00B822E1 /* Build */ = {


+ 2
- 4
_config/pEp_versions.plist View File

@ -6,10 +6,8 @@
<string>3.7.3</string>
<key>GMP_VERSION</key>
<string>6.2.1</string>
<key>SEQUOIA_4_iOS_VERSION</key>
<string>v2.1.6</string>
<key>SEQUOIA_4_MAC_OS_VERSION</key>
<string>v2.1.6</string>
<key>SEQUOIA_VERSION</key>
<string>openpgp/v1.3.0</string>
<key>PEP_ENGINE_VERSION</key>
<string>Release_2.1.47</string>
<key>LIB_PEP_ADAPTER_VERSION</key>


+ 2
- 2
build-ios_dependency.template View File

@ -1,4 +1,4 @@
# Builds fat lib for macOS (ARM64 & x86_64).
# Builds fat lib for iOS (ARM64 & x86_64).
# Pass PREFIX as argument. If not passed, "local/" is used as deafult.
# Exit on errors
@ -60,7 +60,7 @@ buildLib()
echo "Unhandled arch"
exit 1
fi
fi
fi
# START: Lib Specific Code


+ 50
- 0
buildcode/sequoia.code View File

@ -0,0 +1,50 @@
if [ -f "${PREFIX}/lib/libsequoia_openpgp_ffi.a" ]; then
echo "lib exists already in ${LIB_DIR}. If you want to rebuild it, delete the existing one."
exit 0
fi
VERSION=$(sh "${SCRIPT_DIR}/get-pEp-version.sh" "SEQUOIA_VERSION")
SEQUOIA_DIR="${TMP_DIR}/sequoia"
if [ ! -d "${SEQUOIA_DIR}" ]; then
git clone -b ${VERSION} --depth 1 https://gitlab.com/sequoia-pgp/sequoia.git
fi
NETTLE_BINDINGS="${SCRIPT_DIR}/buildcode/sequoia_resources/nettle-bindings.rs"
build_ios()
{
cargo update
rustup run nightly cargo update
NETTLE_PREGENERATED_BINDINGS="${NETTLE_BINDINGS}" PKG_CONFIG_ALLOW_CROSS=1 RUST_BACKTRACE=1 PKG_CONFIG_PATH=$OUTPUT_DIR/${ARCH}/lib/pkgconfig RUSTFLAGS="-L ${CURRENT_LIB_DIR}/lib" rustup run nightly cargo build --target ${TARGET} -p sequoia-openpgp-ffi --release -Z build-std=core,alloc,std
}
build_macos()
{
if [ ${ARCH} == "arm64" ]; then
rustup run nightly cargo update
SDKROOT=$(xcrun -sdk ${SDK} --show-sdk-path) \
# JSONAdapter needlessly requires libsequoia_ffi.a
NETTLE_PREGENERATED_BINDINGS="${SCRIPT_DIR}/nettle-bindings.rs" PKG_CONFIG_ALLOW_CROSS=1 RUST_BACKTRACE=full PKG_CONFIG_PATH=${CURRENT_LIB_DIR}/lib/pkgconfig RUSTFLAGS="-L ${PREFIX}/lib" rustup run nightly cargo build --target ${HOST} --release -Z build-std=core,alloc,std
elif [ ${ARCH} == "x86_64" ]; then
cargo update
SDKROOT=$(xcrun -sdk ${SDK} --show-sdk-path) \
# JSONAdapter needlessly requires libsequoia_ffi.a
PKG_CONFIG_ALLOW_CROSS=1 RUST_BACKTRACE=full PKG_CONFIG_PATH=${CURRENT_LIB_DIR}/lib/pkgconfig RUSTFLAGS="-L ${PREFIX}/lib" cargo build --target ${HOST} --release
else
echo "Unhandled ARCH"
exit 1
fi
}
pushd ${SEQUOIA_DIR}
if [[ $TARGET == *"ios"* ]]; then
build_ios
else
build_macos
fi
popd
# copy artefacts
cp "${SEQUOIA_DIR}/target/${TARGET}/release"/*.a "${CURRENT_LIB_DIR}/lib"
cp -R "${SEQUOIA_DIR}/openpgp-ffi/include"/* "${CURRENT_LIB_DIR}/include/"

+ 108
- 0
buildcode/sequoia_resources/nettle-bindings.rs
File diff suppressed because it is too large
View File


Loading…
Cancel
Save