You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
common-dependency-build-hel.../build-sequoia-iOS.sh

55 lines
1.5 KiB
Bash

#!/bin/bash
# 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 ...
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
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