Otok public index

apotocki/openssl

apotocki/openssl 4.1.0 (r1, linux)

Library
openssl
Variant
linux, target linux
Channel
stable
Published
2026-11-14
Recipe source
https://github.com/otok-dev/recipes
1ea16409510454b8ee22a4a83ff304e3e03808c4 in recipes/openssl/4.1/linux/
Recipe SHA-256
7e29a3960b5c08a6abd7f5e471a47a9dfef9a1a38ec31c680bd6f06cd4848f52

Recipe files changed

Inputs

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

Platforms

linux

Options

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

Toolchains

Recipe files

build.lua 1578 bytes · raw
-- Configure with OpenSSL's own target for the architecture and the slice's compiler and flags, then the libraries and the
-- development files only. The directory OpenSSL looks for certificates in is /etc/ssl, where the distributions keep theirs.
function build(slice, options, deps)
    local t = slice.toolchain
    local shared = slice.linkage == "dynamic"
    local target = slice.arch == "x86_64" and "linux-x86_64" or "linux-aarch64"
    local configure = { slice.toolchains.perl, slice.source .. "/Configure", target, shared and "shared" or "no-shared",
        "no-tests", "--prefix=" .. slice.prefix, "--openssldir=/etc/ssl", "--libdir=lib",
        "CC=" .. t.cc, "CFLAGS=" .. table.concat(t.cflags, " "), "AR=" .. t.ar, "RANLIB=" .. t.ranlib }
    -- libssl finds libcrypto beside itself; $$ is make's $, and the quotes keep the shell from expanding it
    if shared and t.rpath ~= "" then
        table.insert(configure, "LDFLAGS=-Wl,-rpath,'" .. (t.rpath:gsub("%$", "$$")) .. "'")
    end
    if options["no-deprecated"] then table.insert(configure, "no-deprecated") end
    otok.run(configure, { cwd = slice.build })
    otok.make{ "build_libs", cwd = slice.build }
    local install = { "install_dev", cwd = slice.build }
    if shared then table.insert(install, 2, "install_runtime_libs") end
    otok.make(install)

    local p = slice.prefix
    local ext = shared and ".so" or ".a"
    return {
        libraries = { ssl = otok.glob("lib/libssl" .. ext, p)[1], crypto = otok.glob("lib/libcrypto" .. ext, p)[1] },
        headers = p .. "/include",
    }
end
recipe.toml 1284 bytes · raw
# The otok recipe of OpenSSL (https://github.com/apotocki/otok): libssl and libcrypto for Linux, from the release
# tag, with OpenSSL's own Configure targets (linux-x86_64, linux-aarch64) and the slice's compiler; static or dynamic.
[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", "dynamic"]

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

[platforms]
supported = ["linux"]
build-on = ["linux/gcc", "linux/clang"]

[options.no-deprecated]
type = "bool"
default = false
doc = "Configure with no-deprecated: removes the deprecated APIs."

[[product]]
name = "OpenSSL"
libraries = ["ssl", "crypto"]
headers = "crypto"
# what a static libcrypto calls (Configure's ex_libs of the linux targets)
link = { libraries = ["dl", "pthread"] }
defines = [{ define = "OPENSSL_NO_DEPRECATED", when = { option = "no-deprecated" } }]

[toolchains]
make = { version = ">= 3.81", default-recipe = "apotocki/make" }
perl = { version = ">= 5.30", default-recipe = "apotocki/perl" }