Otok public index

apotocki/openssl

apotocki/openssl 4.1.0 (r1, apple)

Library
openssl
Variant
apple, target apple
Channel
stable
Published
2026-11-07
Recipe source
https://github.com/otok-dev/recipes
32756a87cf5bd189ca4c9825159bf0713ea8cf5e in recipes/openssl/4.1/apple/
Recipe SHA-256
cce36805dbfaaf73b725fbdc26ae04334a288eb45162b660b0d7f8a7cb98f6d5
Previous
4.0.3 (r1, apple)

Changes since 4.0.3 (r1, apple)

Key4.0.3 (r1, apple)4.1.0 (r1, apple)
linkageabsent["static"]
source.commit"af1775b60dfa141a4ad762585052cabeb9f37e9e""2f4e3a5fec05394068cfa7379890ab552483a8a6"
source.tag"openssl-4.0.3""openssl-4.1.0"

The upstream changes between the two sources

Recipe files changed

  • Configurations/60-otok.conf changed
  • recipe.toml changed

2 files are the same as in 4.0.3 (r1, apple).

Inputs

source.commit2f4e3a5fec05394068cfa7379890ab552483a8a6
source.githttps://github.com/openssl/openssl
source.tagopenssl-4.1.0

Platforms

ios, iossim, macosx, catalyst, tvos, tvossim, watchos, watchossim, xros, xrossim

Options

OptionTypeDefaultDescription
no-deprecated bool false Configure with no-deprecated: removes the deprecated APIs.

Toolchains

Recipe files

Configurations/60-otok.conf 4786 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, and one per
## architecture of the Windows target. otok's toolchain brings the compiler and its flags (CC, CFLAGS with
## -target and -isysroot, or --target for clang-cl), so these targets carry no compiler, SDK or deployment
## version, unlike the -xcrun targets of 15-ios.conf.

my %targets = (
    # Windows, cross-built with clang-cl: the settings of the VC- targets, with the Unix makefile template
    # and GNU make instead of nmake. platform/Windows/otok.pm keeps the MSVC names of the libraries
    # (libcrypto.lib, libcrypto-<version>-x64.dll); clang-cl links the DLLs, passing lld-link's options
    # behind /clang:-Wl, and llvm-ar fills COFF archives. The names of these targets are not VC-: the
    # version resources of the DLLs, which want rc's options, stay out.
    "otok-windows" => {
        template         => 1,
        inherit_from     => [ "VC-noCE-common" ],
        build_file       => "Makefile",
        build_scheme     => [ "unified", "unix" ],
        perl_platform    => 'Windows::otok',
        # otok's flags choose the optimization and the runtime (/MD, /MDd), also in static libraries
        cflags           => "/GF /Gy",
        lib_cflags       => "",
        dso_cflags       => "",
        bin_cflags       => "",
        bin_lflags       => "",
        LDFLAGS          => "",
        ARFLAGS          => "--format=coff rc",
        RANLIB           => "",
        shared_target    => "windows-shared",
        shared_ldflag    => "/LD",
        shared_impflag   => "/clang:-Wl,/implib:",
        shared_defflag   => "/clang:-Wl,/def:",
    },
    # The Windows target keeps one include/ for its architectures, so both write the same configuration.h:
    # no sys_id (VC-WIN64A's OPENSSL_SYS_WIN64A, which no source tests) and no RC4_CHAR (a speed choice for
    # RC4 that VC-CLANG-WIN64-CLANGASM-ARM makes).
    "otok-windows-x86_64" => {
        inherit_from     => [ "otok-windows" ],
        bn_ops           => "SIXTY_FOUR_BIT",
        asm_arch         => 'x86_64',
        # GNU syntax with Win64's calling convention and unwind tables, which clang-cl assembles
        perlasm_scheme   => "mingw64",
        multilib         => "-x64",
    },
    # as VC-CLANG-WIN64-CLANGASM-ARM
    "otok-windows-arm64" => {
        inherit_from     => [ "otok-windows" ],
        defines          => add("_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE", "OPENSSL_SYS_WIN_CORE"),
        bn_ops           => "SIXTY_FOUR_BIT",
        asm_arch         => 'aarch64',
        perlasm_scheme   => "win64",
        multilib         => "-arm64",
    },

    "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 1672 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 = "4.1.0"
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"]
linkage = ["static"]

[source]
git = "https://github.com/openssl/openssl"
commit = "2f4e3a5fec05394068cfa7379890ab552483a8a6"
tag = "openssl-4.1.0"

[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" }