Otok public index

apotocki/libssh2

libssh2, a client-side C library implementing the SSH2 protocol.

Library
libssh2
Newest
1.11.1 (r1, apple)
Targets
apple
License
BSD-3-Clause
Homepage
https://libssh2.org
Keywords
ssh, sftp

Use it

In otok.toml:

[deps.libssh2]
recipe = "apotocki/libssh2"
version = "~> 1.11.1"

Versions

VersionTargetChannelPublishedStatus
1.11.1 (r1, apple) apple stable 2026-11-07

1.11.1 (r1, apple)

Platforms

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

Dependencies

LibraryVersionRecipeDetails
openssl >= 3.0 apotocki/openssl

Toolchains

Recipe files

build.lua 761 bytes · raw
-- The CMake project, the library only, with the OpenSSL of deps.openssl given explicitly (its static
-- libraries, so FindOpenSSL looks nowhere else) and zlib from the SDK.
function build(slice, options, deps)
    local ssl = deps.openssl
    otok.cmake{
        defines = {
            BUILD_STATIC_LIBS = true, BUILD_EXAMPLES = false, BUILD_TESTING = false, ENABLE_ZLIB_COMPRESSION = true,
            CRYPTO_BACKEND = "OpenSSL", OPENSSL_ROOT_DIR = ssl.prefix, OPENSSL_USE_STATIC_LIBS = true,
            OPENSSL_INCLUDE_DIR = ssl.include, OPENSSL_SSL_LIBRARY = ssl.libraries.ssl, OPENSSL_CRYPTO_LIBRARY = ssl.libraries.crypto,
        },
    }
    return { libraries = { ssh2 = slice.prefix .. "/lib/libssh2.a" }, headers = slice.prefix .. "/include" }
end
recipe.toml 1182 bytes · raw
# The otok recipe of libssh2 (https://github.com/apotocki/otok): the SSH2 client library for every
# Apple platform, from the release archive, with OpenSSL as its crypto backend and the system zlib.
[recipe]
api = 1
library = "libssh2"
name = "libssh2"
version = "1.11.1"
revision = 1
license = "BSD-3-Clause"
license-files = ["COPYING"]
homepage = "https://libssh2.org"
description = "libssh2, a client-side C library implementing the SSH2 protocol."
keywords = ["ssh", "sftp"]

[source]
# the release archive: the git tag says "1.11.1_DEV" in libssh2.h
url = "https://libssh2.org/download/libssh2-1.11.1.tar.gz"
sha256 = "d9ec76cbe34db98eec3539fe2c899d26b0c837cb3eb466a56b0f109cabf658f7"

[platforms]
supported = ["ios", "iossim", "macosx", "catalyst", "tvos", "tvossim", "watchos", "watchossim", "xros", "xrossim"]
build-on = ["macos/xcode"]

[deps.openssl]
version = ">= 3.0"
default-recipe = "apotocki/openssl"

[toolchains]
cmake = { version = ">= 3.20", default-recipe = "apotocki/cmake" }
ninja = { version = ">= 1.10", default-recipe = "apotocki/ninja" }

[[product]]
name = "LibSSH2"
libraries = ["ssh2"]
link = { libraries = ["z"] }
apple = { privacy-manifest = "none" }