bdewey/static-libgit2
Exposes a static XCFramework of libgit2 as a Swift package
Usage in an Application
If you are writing an iOS or Mac app that needs access to libgit2, you can simply add this package to your project via Swift Package Manager. The libgit2 C Language APIs are provided through the Clibgit2 module, so you can access them with import Clibgit2. For example, the following SwiftUI view will show the libgit2 version:
import Clibgit2
import SwiftUI
struct ContentView: View {
var body: some View {
Text(LIBGIT2_VERSION)
.padding()
}
}Usage in another package
If you want to use static-libgit2 in another package (say, to expose some cool Swift bindings to the C API), include the following in your Package.swift:
dependencies: [
.package(url: "https://github.com/bdewey/static-libgit2", from: "0.1.0"),
],What's Included
static-libgit2 includes the following libraries:
| Library | Version | | ------- | ------- | | libgit2 | 1.3.0 | | openssl | 3.0.0 | | libssh2 | 1.10.0 |
This build recipe and the original version of the build script comes from the insightful project https://github.com/light-tech/LibGit2-On-iOS.
Build it yourself
You don't need to depend on this package's pre-built libraries. You can build your own version of the framework.
# You need the tool `wget`
brew install wget
git clone https://github.com/bdewey/static-libgit2
cd static-libgit2
./build-libgit2-framework.shPackage Metadata
Repository: bdewey/static-libgit2
Stars: 25
Forks: 16
Open issues: 3
Default branch: main
Primary language: c
README: README.md