IOS-2882 build nettle 4 iOS works

IOS-2882
Andreas Buff 2 years ago
parent af4e9d4728
commit c6b8d47cb3

@ -40,6 +40,18 @@
name = build_gmp_macOS;
productName = "libetpan-dependencies_macOS";
};
152E499926A9BC94009BD3CE /* build_nettle_iOS */ = {
isa = PBXAggregateTarget;
buildConfigurationList = 152E499B26A9BC94009BD3CE /* Build configuration list for PBXAggregateTarget "build_nettle_iOS" */;
buildPhases = (
152E499A26A9BC94009BD3CE /* Build */,
);
dependencies = (
152E499F26A9C62B009BD3CE /* PBXTargetDependency */,
);
name = build_nettle_iOS;
productName = "libetpan-dependencies_macOS";
};
1585EE16269DCEA600B822E1 /* build-pEpMIME-dependencies_macOS */ = {
isa = PBXAggregateTarget;
buildConfigurationList = 1585EE17269DCEA600B822E1 /* Build configuration list for PBXAggregateTarget "build-pEpMIME-dependencies_macOS" */;
@ -262,6 +274,13 @@
remoteGlobalIDString = 152E498D26A9B252009BD3CE;
remoteInfo = build_gmp_iOS;
};
152E499E26A9C62B009BD3CE /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 1585EE0B269DC6DD00B822E1 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 152E498D26A9B252009BD3CE;
remoteInfo = build_gmp_iOS;
};
1585EE35269EC8DD00B822E1 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 1585EE0B269DC6DD00B822E1 /* Project object */;
@ -434,6 +453,7 @@
1585EEFC26A0432A00B822E1 /* CLEAN_ALL_macOS */,
1585F04126A1C14C00B822E1 /* CLEAN_PEP */,
152E498D26A9B252009BD3CE /* build_gmp_iOS */,
152E499926A9BC94009BD3CE /* build_nettle_iOS */,
1585EF0526A0479800B822E1 /* build_sequoia_iOS */,
152E47C626A5B7C2009BD3CE /* CLEAN_ALL_iOS */,
);
@ -498,6 +518,25 @@
shellScript = "LIB_NAME=\"gmp\"\n\nSCRIPTS_DIR=\"${PROJECT_DIR}/..\"\nPREFIX=\"${PROJECT_DIR}/$(${SCRIPTS_DIR}/get-config-prefix.sh)\"\n\nBUILD_SCRIPT=\"${SCRIPTS_DIR}/generate_and_run_mac_dependency_build_script.sh\" \nsh \"${BUILD_SCRIPT}\" $LIB_NAME \"${PREFIX}\"\n";
showEnvVarsInLog = 0;
};
152E499A26A9BC94009BD3CE /* Build */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = Build;
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = "/bin/sh -l";
shellScript = "LIB_NAME=\"nettle\"\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;
};
1585EE28269DD87700B822E1 /* Build */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@ -772,6 +811,11 @@
target = 152E498D26A9B252009BD3CE /* build_gmp_iOS */;
targetProxy = 152E499226A9B88A009BD3CE /* PBXContainerItemProxy */;
};
152E499F26A9C62B009BD3CE /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 152E498D26A9B252009BD3CE /* build_gmp_iOS */;
targetProxy = 152E499E26A9C62B009BD3CE /* PBXContainerItemProxy */;
};
1585EE36269EC8DD00B822E1 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 1585EE27269DD87700B822E1 /* build_libiconv_macOS */;
@ -914,6 +958,24 @@
};
name = Release;
};
152E499C26A9BC94009BD3CE /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = NQLYU6MGPN;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
152E499D26A9BC94009BD3CE /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = NQLYU6MGPN;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
1585EE0F269DC6DD00B822E1 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@ -1280,6 +1342,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
152E499B26A9BC94009BD3CE /* Build configuration list for PBXAggregateTarget "build_nettle_iOS" */ = {
isa = XCConfigurationList;
buildConfigurations = (
152E499C26A9BC94009BD3CE /* Debug */,
152E499D26A9BC94009BD3CE /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
1585EE0E269DC6DD00B822E1 /* Build configuration list for PBXProject "CommonPEPDependencies" */ = {
isa = XCConfigurationList;
buildConfigurations = (

@ -3,8 +3,8 @@
LastUpgradeVersion = "1250"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
parallelizeBuildables = "NO"
buildImplicitDependencies = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"

@ -3,8 +3,8 @@
LastUpgradeVersion = "1250"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
parallelizeBuildables = "NO"
buildImplicitDependencies = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
version = "1.3">
<BuildAction
parallelizeBuildables = "NO"
buildImplicitDependencies = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "152E499926A9BC94009BD3CE"
BuildableName = "build_nettle_iOS"
BlueprintName = "build_nettle_iOS"
ReferencedContainer = "container:CommonPEPDependencies.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "152E499926A9BC94009BD3CE"
BuildableName = "build_nettle_iOS"
BlueprintName = "build_nettle_iOS"
ReferencedContainer = "container:CommonPEPDependencies.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NETTLE_VERSION</key>
<string>3.7.3</string>
<key>GMP_VERSION</key>
<string>6.2.1</string>
<key>SEQUOIA_4_iOS_VERSION</key>

@ -48,11 +48,29 @@ buildLib()
mkdir -p "${CURRENT_LIB_DIR}/include"
mkdir -p "${CURRENT_LIB_DIR}/bin"
# Set CFLAGS that fit most targets. Can be overrriden in .code file
if [[ $TARGET == *"ios"* ]]; then
export CFLAGS="-arch ${ARCH} -isysroot ${SDK_PATH} -std=c99 -miphoneos-version-min=${IOS_DEPLOYMENT_TARGET}"
else
if [[ $ARCH == "arm64" ]]; then
export CFLAGS="-arch ${ARCH} -isysroot ${SDK_PATH} -std=c99 -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET_ARM}"
elif [[ $ARCH == "x86_64" ]]; then
export CFLAGS="-arch ${ARCH} -isysroot ${SDK_PATH} -std=c99 -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET_INTEL}"
else
echo "Unhandled arch"
exit 1
fi
fi
# START: Lib Specific Code
BUILD_CODE
# END: Lib Specific Code
unset CFLAGS
unset LDFLAGS
unset CC
}
cleanup()

@ -18,7 +18,6 @@ if [ ! -d "${GMP_DIR}" ]; then
tar xvf ${GMP_NAME}.tar.bz2
fi
export CFLAGS="-arch ${ARCH} -isysroot ${SDK_PATH} -std=c99"
export LDFLAGS="-arch ${ARCH}"
export CC="$(xcrun --sdk ${SDK} -f clang) -arch ${ARCH} -isysroot ${SDK_PATH}"

@ -8,7 +8,6 @@ if [ ! -d "${ICONV_DIR}" ]; then
git clone -b "v1.16_without_lib_prefix_defines" https://gitea.pep.foundation/buff/libiconv.git
fi
pushd "${ICONV_DIR}"
export CFLAGS="-arch ${ARCH} -isysroot ${SDK_PATH} -std=c99"
export LDFLAGS="-arch ${ARCH}"
export CC="$(xcrun --sdk ${SDK} -f clang) -arch ${ARCH} -isysroot ${SDK_PATH}"

@ -0,0 +1,30 @@
NETTLE_VERSION=$(sh "${SCRIPT_DIR}"/get-pEp-version.sh "NETTLE_VERSION")
NETTLE_NAME="nettle-${NETTLE_VERSION}"
OUTPUT_DIR=${SCRIPT_DIR}/build
# Exit on errors
set -e
if [ -f "${LIB_DIR}/libnettle.a" ]; then
echo "lib exists already in ${LIB_DIR}. If you want to rebuild it, delete the existing one."
exit 0
fi
GMP_DIR="${TMP_DIR}/${NETTLE_NAME}"
if [ ! -d "${GMP_DIR}" ]; then
wget -nc https://ftp.gnu.org/gnu/nettle/${NETTLE_NAME}.tar.gz
tar xvf ${NETTLE_NAME}.tar.gz
fi
export LDFLAGS="-arch ${ARCH}"
export CC="$(xcrun --sdk ${SDK} -f clang) -arch ${ARCH} -isysroot ${SDK_PATH}"
pushd ${NETTLE_NAME}
PKG_CONFIG_ALLOW_CROSS=1 PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig CC_FOR_BUILD="$(whereis gcc)" ./configure --host=${HOST} --prefix=${CURRENT_LIB_DIR} --with-lib-path=${PREFIX}/lib --with-include-path=${PREFIX}/include --disable-assembler --disable-arm-neon --disable-documentation --verbose
make clean
make -j4
make install
popd
rm -rf *.gz
Loading…
Cancel
Save