Skip to content

Swift package that wraps the libssh2 library and exposes its API to macOS and iOS applications.

License

Notifications You must be signed in to change notification settings

mfcollins3/libssh2-apple

Repository files navigation

libssh2 Swift Package

Overview

This repository implements a Swift package that builds, includes, and wraps the libssh2 library. I created this package because I have other frameworks that depend on libssh2 and I wanted to break out the libssh2 implementation in case anyone else had a need to use libssh2. Over time, I plan to build a Swift API for some of the libssh2 features to use them in applications.

The libssh2 library that this package wraps was built on top of OpenSSL. For the OpenSSL package, please see my openssl-apple repository.

This Swift package supports the following platforms:

  • macOS (Apple Silicone and Intel)
  • iOS (64-bit only)
  • iOS Simulator (Apple Silicone and Intel)
  • macOS Catalyst (Apple Silicone and Intel)

⚠️ Please note that in order to use this Swift package, you must also agree to the license terms for libssh2 and OpenSSL. Please review the OpenSSL license and the libssh2 license for more information.

Building libssh2

⚠️ Building libssh2 from scratch requires you to have installed and built OpenSSL from my openssl-apple repository. openssl-apple and libssh2-apple must be siblings in the same parent directory as the build program in libssh2-apple uses a relative file path to find the openssl-apple repository.

If you need to build the libssh2 libraries for use with other libraries that might depend on libssh2, I have provided the build.sh script to automate the process. This program will build libssh2 for all supported platforms and will produce an XCFramework containing the libraries and header files for all supported platforms.

This repository includes the source code for libssh2 as a Git submodule. To begin, you need to clone the repository and load the submodules:

git clone https://github.com/mfcollins3/libssh2-apple.git
cd libssh2-apple
git submodule init
git submodule update

After cloning the repository and loading the libssh2 source code, you can run the build.sh program without any arguments to build the libssh2 library and produce the XCFramework.

About

Swift package that wraps the libssh2 library and exposes its API to macOS and iOS applications.

Resources

License

Stars

Watchers

Forks

Packages

No packages published