Contents

bdewey/static-libgit2

This repository makes it easier to include the C library Libgit2 into an iOS or Mac application. It does not try to provide any sort of nice, Swifty wrapper over the libgit2 APIs.

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.sh

Package Metadata

Repository: bdewey/static-libgit2

Default branch: main

README: README.md