Recipe files
Configurations/60-otok.conf 2421 bytes · raw
## SPDX-License-Identifier: Apache-2.0
## An extension of OpenSSL's Configurations, after the settings of its targets in 10-main.conf and 15-ios.conf
## (Copyright The OpenSSL Project Authors), under OpenSSL's license, the Apache License 2.0.
## Configure targets of the otok recipe: one per OS and architecture of the Apple slices. otok's
## toolchain brings the compiler and its flags (CC, CFLAGS with -target and -isysroot), so these targets
## carry no compiler, SDK or deployment version, unlike the -xcrun targets of 15-ios.conf.
my %targets = (
"otok-apple" => {
template => 1,
inherit_from => [ "darwin-common" ],
disable => [ "shared", "async" ],
},
# as darwin64-arm64; ios64-xcrun adds RC4_CHAR, a speed choice for RC4. Where the architectures of
# one platform differ in bn_ops (watchOS: arm64_32 beside arm64), otok keeps configuration.h per
# architecture.
"otok-apple-arm64" => {
template => 1,
inherit_from => [ "otok-apple" ],
lib_cppflags => add("-DL_ENDIAN"),
bn_ops => "SIXTY_FOUR_BIT_LONG",
asm_arch => 'aarch64',
perlasm_scheme => "ios64",
},
"otok-apple-x86_64" => {
template => 1,
inherit_from => [ "otok-apple" ],
lib_cppflags => add("-DL_ENDIAN"),
bn_ops => "SIXTY_FOUR_BIT_LONG",
asm_arch => 'x86_64',
perlasm_scheme => "macosx",
},
# Apple Watch: 32-bit pointers on a 64-bit CPU, no assembler
"otok-apple-arm64_32" => {
template => 1,
inherit_from => [ "otok-apple" ],
lib_cppflags => add("-DL_ENDIAN"),
bn_ops => "BN_LLONG RC4_CHAR",
},
);
# sys_id tells OpenSSL the OS; macOS and Mac Catalyst keep darwin-common's MACOSX
my @systems = ([ "macos", undef, [] ], [ "ios", "iOS", [] ], [ "tvos", "tvOS", [ "engine" ] ],
[ "watchos", "watchOS", [ "engine" ] ], [ "xros", "visionOS", [] ]);
foreach my $system (@systems) {
my ($os, $sys_id, $disable) = @$system;
foreach my $arch ("arm64", "x86_64", "arm64_32") {
$targets{"otok-$os-$arch"} = {
inherit_from => [ "otok-apple-$arch" ],
(defined $sys_id ? (sys_id => $sys_id) : ()),
(@$disable ? (disable => add(@$disable)) : ()),
};
}
}
%targets;
PrivacyInfo.xcprivacy 627 bytes · raw
<?xml version="1.0" encoding="UTF-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>NSPrivacyTracking</key>
<false/>
<key>NSPrivacyTrackingDomains</key>
<array/>
<key>NSPrivacyCollectedDataTypes</key>
<array/>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>C617.1</string>
<string>0A2A.1</string>
</array>
</dict>
</array>
</dict>
</plist>
build.lua 1929 bytes · raw
-- Configure with a target of Configurations/60-otok.conf and the slice's toolchain, then the
-- libraries and the development files only.
function build(slice, options, deps)
local t = slice.toolchain
otok.copy(slice.recipe .. "/Configurations/60-otok.conf", slice.source .. "/Configurations/60-otok.conf")
local configure = { slice.toolchains.perl, slice.source .. "/Configure", "otok-" .. slice.vars.openssl_os .. "-" .. slice.arch, "no-shared",
"no-tests", "--prefix=" .. slice.prefix, "--openssldir=/etc/ssl", "--libdir=lib",
"CC=" .. t.cc, "CFLAGS=" .. table.concat(t.cflags, " ") .. " -Wall", "AR=" .. t.ar, "RANLIB=" .. t.ranlib }
if options["no-deprecated"] then table.insert(configure, "no-deprecated") end
otok.run(configure, { cwd = slice.build })
if slice.vars.no_fork then
local makefile = otok.read(slice.build .. "/Makefile")
makefile = makefile:gsub("apps/lib/libapps%-lib%-http_server%.o \\\n", ""):gsub("apps/lib/libapps%-lib%-http_server%.o ", "")
otok.write(slice.build .. "/Makefile", makefile)
end
otok.make{ "build_libs", cwd = slice.build }
otok.make{ "install_dev", cwd = slice.build }
-- the headers Swift and Objective-C use; the others come along through their includes
local module = { "module COpenSSL {" }
for _, h in ipairs{ "ssl", "err", "evp", "rand", "sha", "hmac", "kdf", "x509v3", "pem", "pkcs12", "core_names", "provider" } do
table.insert(module, ' header "../openssl/' .. h .. '.h"')
end
table.insert(module, " export *\n}\n")
otok.write(slice.prefix .. "/module.modulemap", table.concat(module, "\n"))
return {
libraries = {
ssl = slice.prefix .. "/lib/libssl.a",
crypto = slice.prefix .. "/lib/libcrypto.a",
},
headers = slice.prefix .. "/include",
module_map = slice.prefix .. "/module.modulemap",
}
end
recipe.toml 1651 bytes · raw
# The otok recipe of OpenSSL (https://github.com/apotocki/otok): libssl and libcrypto for every
# Apple platform, from the release tag.
[recipe]
api = 1
library = "openssl"
name = "openssl"
version = "3.6.5"
revision = 1
license = "Apache-2.0"
license-files = ["LICENSE.txt"]
homepage = "https://www.openssl.org"
description = "OpenSSL (libssl, libcrypto), built from source."
keywords = ["tls", "crypto"]
[source]
git = "https://github.com/openssl/openssl"
commit = "c8bd5a57108599ac650bbae77fcabe3109dab2e8"
tag = "openssl-3.6.5"
[platforms]
supported = ["ios", "iossim", "macosx", "catalyst", "tvos", "tvossim", "watchos", "watchossim", "xros", "xrossim"]
build-on = ["macos/xcode"]
[vars]
# the OS part of the Configure targets of Configurations/60-otok.conf
openssl_os = { macosx = "macos", catalyst = "macos", ios = "ios", iossim = "ios", tvos = "tvos", tvossim = "tvos", watchos = "watchos", watchossim = "watchos", xros = "xros", xrossim = "xros" }
# fork() is unavailable: libapps, which build_libs builds too, leaves out its HTTP server
no_fork = { tvos = true, tvossim = true, watchos = true, watchossim = true, default = false }
[options.no-deprecated]
type = "bool"
default = false
doc = "Configure with no-deprecated: removes the deprecated APIs."
[[product]]
name = "OpenSSL"
libraries = ["ssl", "crypto"]
headers = "crypto"
defines = [{ define = "OPENSSL_NO_DEPRECATED", when = { option = "no-deprecated" } }]
apple = { module = "COpenSSL", privacy-manifest = "PrivacyInfo.xcprivacy" }
[toolchains]
make = { version = ">= 3.81", default-recipe = "apotocki/make" }
perl = { version = ">= 5.30", default-recipe = "apotocki/perl" }