archrelease: copy trunk to community-any
[arch-community.git] / emscripten / trunk / get-compatible-versions.sh
blobae621b7debca9e4964e93f378a4316d035229f7e
1 #!/usr/bin/env bash
3 # Get compatible versions of binaryen and llvm
5 # How to use:
6 # Change pkgver in PKGBUILD to desired version and then run ./get-compatible-versions.sh.
7 # This will fetch, print and substitute into the PKGBUILD the compatible binaryen and llvm versions.
9 pkgver=$(makepkg --printsrcinfo | sed -rn 's/.*pkgver = (.*)/\1/gp')
10 tag_hash=$(curl -Ls https://github.com/emscripten-core/emsdk/raw/main/emscripten-releases-tags.json | jq ".releases[\"$pkgver\"]" | sed s/\"//g)
11 deps_file=$(curl -Ls "https://chromium.googlesource.com/emscripten-releases/+/$tag_hash/DEPS?format=TEXT" | base64 -d)
12 binaryen_revision=$(echo "$deps_file" | sed -rn "s/.*'binaryen_revision': '(.*)',/\\1/gp")
13 llvm_project_revision=$(echo "$deps_file" | sed -rn "s/.*'llvm_project_revision': '(.*)',/\\1/gp")
14 sed -i "s/_binaryen_revision=.*/_binaryen_revision=$binaryen_revision/g" PKGBUILD
15 sed -i "s/_llvm_project_revision=.*/_llvm_project_revision=$llvm_project_revision/g" PKGBUILD