From 9e956c8f02ba7b354eb80e82490ca78ea851fc26 Mon Sep 17 00:00:00 2001 From: Samar Sunkaria Date: Fri, 7 Jun 2024 14:23:08 +0200 Subject: [PATCH] Target jq-1.7.1 Added support for visionOS builds as well. --- .gitignore | 1 + .gitmodules | 2 +- README.md | 13 ++++++++----- build.sh | 28 +++++++++++++++++++++++----- jq | 2 +- 5 files changed, 34 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index b654d88..77c1e20 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .DS_Store +.vscode Products/ diff --git a/.gitmodules b/.gitmodules index c05e5a0..1bbd1b1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "jq"] path = jq - url = https://github.com/stedolan/jq.git + url = https://github.com/jqlang/jq.git diff --git a/README.md b/README.md index 57b19dd..8436e5c 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,11 @@ Build [jq](https://stedolan.github.io/jq/) for various Apple platforms. This rep ## Requirements -Xcode 12 or higher is required to generate a build for all the platforms supported by the `build.sh` script. In addition to that, all the system dependencies for building `jq` are also required. You'll need to have `automake`, and `autoconf` installed on your Mac (other dependencies are part of Xcode's command line tools). +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 you have all of the required dependencies and that command line tools are selected for the desired version of Xcode. +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](https://brew.sh): @@ -22,7 +22,7 @@ To select Xcode command line tools: sudo xcode-select -s /path/to/Xcode.app ``` -Now, you can build by running the `build.sh` file. +Now, you can build by executing `build.sh`: ``` ./build.sh @@ -34,7 +34,7 @@ All the build artifacts are available under the `Products` directory once the sc ## jq -Currently this repository targets the [`jq-1.6` release tag](https://github.com/stedolan/jq/tree/jq-1.6) of the [`jq` repository on GitHub](https://github.com/stedolan/jq), which is the latest stable release. +Currently this repository targets the [`jq-1.7.1` release tag](https://github.com/stedolan/jq/tree/jq-1.7.1) of the [`jq` repository on GitHub](https://github.com/jqlang/jq), which is the latest stable release. ## Generated XCFramework @@ -58,7 +58,7 @@ shasum -a 1 path/to/framework.xcframework.zip The `build.sh` file supports the following targets: -| | Platform | Deployment Target | Architecture | Varient | +| | Platform | Deployment Target | Architecture | Variant | |---|----------|-------------------|--------------|-------------| | 📱 | iOS | 9.0 | armv7 | iPhone/iPad | | 📱 | iOS | 9.0 | armv7s | iPhone/iPad | @@ -77,6 +77,9 @@ The `build.sh` file supports the following targets: | 📺 | 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 diff --git a/build.sh b/build.sh index 88e8c0b..5549fcd 100755 --- a/build.sh +++ b/build.sh @@ -4,7 +4,8 @@ set -e trap 'echo "Build did not finish successfully."' ERR -BASEDIR=${PWD} +REPOROOT=$(git rev-parse --show-toplevel) +BASEDIR=${REPOROOT} # Checking requirements @@ -149,8 +150,8 @@ build "arm64" "iphoneos" "arm64-apple-ios9.0" build "i386" "iphonesimulator" "i386-apple-ios9.0-simulator" build "x86_64" "iphonesimulator" "x86_64-apple-ios9.0-simulator" build "arm64" "iphonesimulator" "arm64-apple-ios9.0-simulator" -build "x86_64" "macosx" "x86_64-apple-ios13.0-macabi" -build "arm64" "macosx" "arm64-apple-ios13.0-macabi" +build "x86_64" "macosx" "x86_64-apple-ios14.0-macabi" +build "arm64" "macosx" "arm64-apple-ios14.0-macabi" # macOS build "x86_64" "macosx" "x86_64-apple-macos10.10" build "arm64" "macosx" "arm64-apple-macos11.0" @@ -163,26 +164,43 @@ build "arm64" "watchsimulator" "arm64-apple-watchos2.0-simulator" build "arm64" "appletvos" "arm64-apple-tvos9.0" build "x86_64" "appletvsimulator" "x86_64-apple-tvos9.0-simulator" build "arm64" "appletvsimulator" "arm64-apple-tvos9.0-simulator" +#visionOS +build "arm64" "xros" "arm64-apple-xros1.0" +build "x86_64" "xrsimulator" "x86_64-apple-xros1.0-simulator" +build "arm64" "xrsimulator" "arm64-apple-xros1.0-simulator" # Generating universal binaries for targets representing equivalent library definitions echo "Generating required universal binaries" lipo_targets "ios" "armv7-apple-ios9.0" "armv7s-apple-ios9.0" "arm64-apple-ios9.0" lipo_targets "ios-simulator" "i386-apple-ios9.0-simulator" "x86_64-apple-ios9.0-simulator" "arm64-apple-ios9.0-simulator" -lipo_targets "ios-macabi" "x86_64-apple-ios13.0-macabi" "arm64-apple-ios13.0-macabi" +lipo_targets "ios-macabi" "x86_64-apple-ios14.0-macabi" "arm64-apple-ios14.0-macabi" lipo_targets "macos" "x86_64-apple-macos10.10" "arm64-apple-macos11.0" lipo_targets "watchos" "armv7k-apple-watchos2.0" "arm64_32-apple-watchos5.0" lipo_targets "watchos-simulator" "x86_64-apple-watchos2.0-simulator" "arm64-apple-watchos2.0-simulator" lipo_targets "tvos" "arm64-apple-tvos9.0" lipo_targets "tvos-simulator" "x86_64-apple-tvos9.0-simulator" "arm64-apple-tvos9.0-simulator" +lipo_targets "xros" "arm64-apple-xros1.0" +lipo_targets "xrsimulator" "x86_64-apple-xros1.0-simulator" "arm64-apple-xros1.0-simulator" # Generating xcframeworks echo "Generating XCFrameworks" cd ${BASEDIR} + +JQ_FRAMEWORK_DIR="${BASEDIR}/Products/frameworks/Cjq.xcframework" +ONIG_FRAMEWORK_DIR="${BASEDIR}/Products/frameworks/Coniguruma.xcframework" + +for framework_path in $JQ_FRAMEWORK_DIR $ONIG_FRAMEWORK_DIR; do + if [ -d "${framework_path}" ]; then + echo "Removing exisitng framework at path ${framework_path}" + rm -rf ${framework_path} + fi +done + XCFRAMEWORK_CMD_JQ="xcodebuild -create-xcframework -output ${BASEDIR}/Products/frameworks/Cjq.xcframework" XCFRAMEWORK_CMD_ONIG="xcodebuild -create-xcframework -output ${BASEDIR}/Products/frameworks/Coniguruma.xcframework" -for target in ios ios-simulator ios-macabi macos watchos watchos-simulator tvos tvos-simulator; do +for target in ios ios-simulator ios-macabi macos watchos watchos-simulator tvos tvos-simulator xros xrsimulator; do XCFRAMEWORK_CMD_JQ+=" -library ${BASEDIR}/Products/libs/${target}/jq/libjq.a -headers ${BASEDIR}/Products/libs/${target}/jq/include" XCFRAMEWORK_CMD_ONIG+=" -library ${BASEDIR}/Products/libs/${target}/oniguruma/libonig.a -headers ${BASEDIR}/Products/libs/${target}/oniguruma/include" done diff --git a/jq b/jq index 2e01ff1..71c2ab5 160000 --- a/jq +++ b/jq @@ -1 +1 @@ -Subproject commit 2e01ff1fb69609540b2bdc4e62a60499f2b2fb8e +Subproject commit 71c2ab509a8628dbbad4bc7b3f98a64aa90d3297