depot/pkgs/development/tools/build-managers/gradle/patching.sh
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

29 lines
441 B
Bash

extractVersion() {
local jar version
local prefix="$1"
shift
local candidates="$@"
jar="$(basename -a $candidates | sort | head -n1)"
version="${jar#$prefix-}"
echo "${version%.jar}"
}
autoPatchelfInJar() {
local file="$1" rpath="$2"
local work
work="$(mktemp -dt patching.XXXXXXXXXX)"
pushd "$work"
jar xf "$file"
rm "$file"
autoPatchelf -- .
jar cf "$file" .
popd
}