Browse Source

Merge branch 'Release_2.1'

master
Andreas Buff 3 months ago
parent
commit
00f440cb08
3 changed files with 7 additions and 129 deletions
  1. +0
    -54
      build-sequoia-iOS.sh
  2. +0
    -61
      build-sequoia-macOS.sh
  3. +7
    -14
      buildcode/sequoia.code

+ 0
- 54
build-sequoia-iOS.sh View File

@ -1,54 +0,0 @@
# Builds fat lib for iOS (ARM64 & x86_64).
# Pass PREFIX as argument. If not passed, "local/" is used as deafult.
set -e
SCRIPT_DIR=$(dirname "$0")
PREFIX=$1
VERSION=$(sh "${SCRIPT_DIR}/get-pEp-version.sh" "SEQUOIA_4_iOS_VERSION")
# Get Absolute Paths & Setup
# Get Absolute Paths & Setup
SCRIPT_DIR=$(dirname "$0")
pushd "${SCRIPT_DIR}"
SCRIPT_DIR=$(pwd)
popd
if [ "${PREFIX}" = "" ]; then
PREFIX="${SCRIPT_DIR}/local"
fi
mkdir -p "${PREFIX}"
pushd "${PREFIX}"
PREFIX=$(pwd)
popd
# Go, Build
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
TMP_DIR="${SCRIPT_DIR}/tmp"
mkdir -p "${TMP_DIR}"
pushd "${TMP_DIR}"
SEQUOIA_4_IOS_DIR="${TMP_DIR}/sequoia4ios"
if [ ! -d "${SEQUOIA_4_IOS_DIR}" ]; then
git clone -b "${VERSION}" http://pep-security.lu/gitlab/iOS/sequoia4ios.git
fi
pushd ${SEQUOIA_4_IOS_DIR}
sh build.sh
popd
# Copy artefacts ...
mkdir -p "${PREFIX}/lib"
cp "${SEQUOIA_4_IOS_DIR}/build/lib/libgmp.a" "${PREFIX}/lib/"
cp "${SEQUOIA_4_IOS_DIR}/build/lib/libhogweed.a" "${PREFIX}/lib/"
cp "${SEQUOIA_4_IOS_DIR}/build/lib/libnettle.a" "${PREFIX}/lib/"
cp "${SEQUOIA_4_IOS_DIR}/build/lib/libsequoia_openpgp_ffi.a" "${PREFIX}/lib/"
# ... and headers
mkdir -p "${PREFIX}/include"
cp -R "${SEQUOIA_4_IOS_DIR}/build/include/nettle" "${PREFIX}/include/"
cp -R "${SEQUOIA_4_IOS_DIR}/build/include/sequoia" "${PREFIX}/include/"
cp "${SEQUOIA_4_IOS_DIR}/build/include/gmp.h" "${PREFIX}/include/"
popd

+ 0
- 61
build-sequoia-macOS.sh View File

@ -1,61 +0,0 @@
# Builds fat lib for macOS (ARM64 & x86_64).
# Pass PREFIX as argument. If not passed, "local/" is used as deafult.
set -e
SCRIPT_DIR=$(dirname "$0")
PREFIX=$1
VERSION=$(sh "${SCRIPT_DIR}/get-pEp-version.sh" "SEQUOIA_4_MAC_OS_VERSION")
# Get Absolute Paths & Setup
# Get Absolute Paths & Setup
SCRIPT_DIR=$(dirname "$0")
pushd "${SCRIPT_DIR}"
SCRIPT_DIR=$(pwd)
popd
if [ "${PREFIX}" = "" ]; then
PREFIX="${SCRIPT_DIR}/local"
fi
mkdir -p "${PREFIX}"
pushd "${PREFIX}"
PREFIX=$(pwd)
popd
# Go, Build
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
TMP_DIR="${SCRIPT_DIR}/tmp"
mkdir -p "${TMP_DIR}"
pushd "${TMP_DIR}"
SEQUOIA_4_MACOS_DIR="${TMP_DIR}/sequoia4macos"
if [ ! -d "${SEQUOIA_4_MACOS_DIR}" ]; then
git clone -b "${VERSION}" http://pep-security.lu/gitlab/macos/sequoia4macos.git
fi
pushd ${SEQUOIA_4_MACOS_DIR}
sh build.sh
popd
# Copy artefacts ...
mkdir -p "${PREFIX}/lib"
cp "${SEQUOIA_4_MACOS_DIR}/build/lib/libgmp.a" "${PREFIX}/lib/"
cp "${SEQUOIA_4_MACOS_DIR}/build/lib/libhogweed.a" "${PREFIX}/lib/"
cp "${SEQUOIA_4_MACOS_DIR}/build/lib/libnettle.a" "${PREFIX}/lib/"
cp "${SEQUOIA_4_MACOS_DIR}/build/lib/libsequoia_ffi.a" "${PREFIX}/lib/"
cp "${SEQUOIA_4_MACOS_DIR}/build/lib/libsequoia_openpgp_ffi.a" "${PREFIX}/lib/"
# ... and headers
mkdir -p "${PREFIX}/include"
cp -R "${SEQUOIA_4_MACOS_DIR}/build/include/nettle" "${PREFIX}/include/"
cp -R "${SEQUOIA_4_MACOS_DIR}/build/include/sequoia" "${PREFIX}/include/"
cp "${SEQUOIA_4_MACOS_DIR}/build/include/gmp.h" "${PREFIX}/include/"
popd
# Cleanup
rm -rf "${TMP_DIR}/x86_64"
rm -rf "${TMP_DIR}/arm64"
export MACOSX_DEPLOYMENT_TARGET=10.10

+ 7
- 14
buildcode/sequoia.code View File

@ -13,6 +13,7 @@ fi
NETTLE_BINDINGS="${SCRIPT_DIR}/buildcode/sequoia_resources/nettle-bindings.rs"
build_ios()
{
#TODO: change according to build_macos. Nightly and pregenerated bindings might not be required any more
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 ${PREFIX}/lib" rustup run nightly cargo build --target ${TARGET} -p sequoia-openpgp-ffi --release -Z build-std=core,alloc,std
@ -22,25 +23,17 @@ build_ios()
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
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
cp "${SEQUOIA_DIR}/target/${HOST}/release"/*.a "${CURRENT_LIB_DIR}/lib"
}
pushd ${SEQUOIA_DIR}
rm -rf rust-toolchain
if [[ $TARGET == *"ios"* ]]; then
build_ios
else


Loading…
Cancel
Save