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.
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.
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.
Currently this repository targets the jq-1.7.1
release tag of the jq
repository on GitHub, which is the latest stable release.
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 XCFramework
s 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.
A zip archive of the XCFramework
s 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.
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.
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 |
The code in this repository is licensed under the MIT license. The zip archive of the XCFramework
s for jq
and oniguruma
are licensed under their respective licenses. A copy of the COPYING
license file is shipped with both the frameworks.