Sameesunkaria / JQ-Darwin

Build jq for various Apple platforms πŸ™Œ! Pre-built XCFrameworks are available as release assets 🧰.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JQ for Darwin

Build jq for various Apple platforms. This repository hosts scripts to conveniently build jq for all of the numerous supported Apple Platforms and generate XCFrameworks for the jq library. The compressed frameworks are hosted as release assets.

Requirements

Xcode 15 or newer is required to build for all the platforms declared in the build.sh script. Aditionally, Autotools is required for building jq and oniguruma. Other dependencies are part of Xcode's command line tools.

Building

Before building, make sure that all required dependencies are installed and the command line tools for your desired version of Xcode have been selected.

To install automake, and autoconf using Homebrew:

brew install automake autoconf

To select Xcode command line tools:

sudo xcode-select -s /path/to/Xcode.app

Now, you can build by executing build.sh:

./build.sh

The build script will compile static libraries and executables for jq and oniguruma (a dependency of jq) for all the supported targets. The generated static libraries are then used to create a single XCFramework for jq and oniguruma.

All the build artifacts are available under the Products directory once the script finishes building.

jq

Currently this repository targets the jq-1.7.1 release tag of the jq repository on GitHub, which is the latest stable release.

Generated XCFramework

The build.sh script generates an XCFramework for jq and the associated version of oniguruma. To allow interoperability with Swift, these frameworks expose Cjq and Coniguruma clang modules for the respective static library. Both the XCFrameworks are required for using the jq library. To use an XCFramework, you can link the framework in your Xcode project, or add it as a binary target to your Swift Package manifest.

XCFramework Releases

A zip archive of the XCFrameworks for jq and the associated version of oniguruma are available for download as part of the release assets. The release info should contain the SHA-1 hashes of both the zip archives and the version of Xcode and other build tools used to generate the framework.

Verifying Authenticity of Builds

Since the frameworks are being distributed as compiled binaries, it becomes crucial to verify the authenticity of the builds. The authenticity of the builds can be verified by checking out the release tag for the particular release and running the build.sh script. When the script finishes running, it prints out the SHA-1 hashes of the zip archives of the newly built XCFrameworks. This hash must match the hash of the respective zip archives on the release page, and hash of the downloaded zip archive obtained by running:

shasum -a 1 path/to/framework.xcframework.zip

NOTE: To generate an identical build for verifying the authenticity make sure that same versions of the Xcode and other build tools are used. Please follow the instructions provided in the README for the particular release that you want to verify. The instructions may vary between releases.

Supported Targets

The build.sh file supports the following targets:

Platform Deployment Target Architecture Variant
πŸ“± iOS 9.0 armv7 iPhone/iPad
πŸ“± iOS 9.0 armv7s iPhone/iPad
πŸ“± iOS 9.0 arm64 iPhone/iPad
πŸ“± iOS 9.0 i386 Simulator
πŸ“± iOS 9.0 x86_64 Simulator
πŸ“± iOS 9.0 arm64 Simulator
πŸ“± iOS 13.0 x86_64 Catalyst
πŸ“± iOS 13.0 arm64 Catalyst
πŸ–₯ macOS 10.10 x86_64 Mac
πŸ–₯ macOS 11.0 arm64 Mac
⌚️ watchOS 2.0 armv7k Watch
⌚️ watchOS 5.0 arm64_32 Watch
⌚️ watchOS 2.0 x86_64 Simulator
⌚️ watchOS 2.0 arm64 Simulator
πŸ“Ί tvOS 9.0 arm64 TV
πŸ“Ί tvOS 9.0 x86_64 Simulator
πŸ“Ί tvOS 9.0 arm64 Simulator
πŸ•ΆοΈ visionOS 1.0 arm64 Vision Pro
πŸ•ΆοΈ visionOS 1.0 x86_64 Simulator
πŸ•ΆοΈ visionOS 1.0 arm64 Simulator

License

The code in this repository is licensed under the MIT license. The zip archive of the XCFrameworks for jq and oniguruma are licensed under their respective licenses. A copy of the COPYING license file is shipped with both the frameworks.

About

Build jq for various Apple platforms πŸ™Œ! Pre-built XCFrameworks are available as release assets 🧰.

License:MIT License


Languages

Language:Shell 83.7%Language:Swift 16.3%