mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-27 01:33:57 +00:00
Merge remote-tracking branch 'upstream/main' into jacob/uucode
This commit is contained in:
@@ -1,108 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# This script checks if the flatpak/zig-packages.json file is up-to-date.
|
||||
# If the `--update` flag is passed, it will update all necessary
|
||||
# files to be up to date.
|
||||
#
|
||||
# The files owned by this are:
|
||||
#
|
||||
# - flatpak/zig-packages.json
|
||||
#
|
||||
# All of these are auto-generated and should not be edited manually.
|
||||
|
||||
# Nothing in this script should fail.
|
||||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
WORK_DIR=$(mktemp -d)
|
||||
|
||||
if [[ ! "$WORK_DIR" || ! -d "$WORK_DIR" ]]; then
|
||||
echo "could not create temp dir"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
function cleanup {
|
||||
rm -rf "$WORK_DIR"
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
help() {
|
||||
echo ""
|
||||
echo "To fix, please (manually) re-run the script from the repository root,"
|
||||
echo "commit, and submit a PR with the update:"
|
||||
echo ""
|
||||
echo " ./flatpak/build-support/check-zig-cache.sh --update"
|
||||
echo " git add flatpak/zig-packages.json"
|
||||
echo " git commit -m \"flatpak: update zig-packages.json\""
|
||||
echo ""
|
||||
}
|
||||
|
||||
# Turn Nix's base64 hashes into regular hexadecimal form
|
||||
decode_hash() {
|
||||
input=$1
|
||||
input=${input#sha256-}
|
||||
echo "$input" | base64 -d | od -vAn -t x1 | tr -d ' \n'
|
||||
}
|
||||
|
||||
ROOT="$(realpath "$(dirname "$0")/../../")"
|
||||
ZIG_PACKAGES_JSON="$ROOT/flatpak/zig-packages.json"
|
||||
BUILD_ZIG_ZON_JSON="$ROOT/build.zig.zon.json"
|
||||
|
||||
if [ ! -f "${BUILD_ZIG_ZON_JSON}" ]; then
|
||||
echo -e "\nERROR: build.zig.zon2json-lock missing."
|
||||
help
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -f "${ZIG_PACKAGES_JSON}" ]; then
|
||||
OLD_HASH=$(sha512sum "${ZIG_PACKAGES_JSON}" | awk '{print $1}')
|
||||
fi
|
||||
|
||||
while read -r url sha256 dest; do
|
||||
src_type=archive
|
||||
sha256=$(decode_hash "$sha256")
|
||||
git_commit=
|
||||
if [[ "$url" =~ ^git\+* ]]; then
|
||||
src_type=git
|
||||
sha256=
|
||||
url=${url#git+}
|
||||
git_commit=${url##*#}
|
||||
url=${url%%/\?ref*}
|
||||
url=${url%%#*}
|
||||
fi
|
||||
|
||||
jq \
|
||||
-nec \
|
||||
--arg type "$src_type" \
|
||||
--arg url "$url" \
|
||||
--arg git_commit "$git_commit" \
|
||||
--arg dest "$dest" \
|
||||
--arg sha256 "$sha256" \
|
||||
'{
|
||||
type: $type,
|
||||
url: $url,
|
||||
commit: $git_commit,
|
||||
dest: $dest,
|
||||
sha256: $sha256,
|
||||
} | with_entries(select(.value != ""))'
|
||||
done < <(jq -rc 'to_entries[] | [.value.url, .value.hash, "vendor/p/\(.key)"] | @tsv' "$BUILD_ZIG_ZON_JSON") |
|
||||
jq -s '.' >"$WORK_DIR/zig-packages.json"
|
||||
|
||||
NEW_HASH=$(sha512sum "$WORK_DIR/zig-packages.json" | awk '{print $1}')
|
||||
|
||||
if [ "${OLD_HASH}" == "${NEW_HASH}" ]; then
|
||||
echo -e "\nOK: flatpak/zig-packages.json unchanged."
|
||||
exit 0
|
||||
elif [ "${1:-}" != "--update" ]; then
|
||||
echo -e "\nERROR: flatpak/zig-packages.json needs to be updated."
|
||||
echo ""
|
||||
echo " * Old hash: ${OLD_HASH}"
|
||||
echo " * New hash: ${NEW_HASH}"
|
||||
help
|
||||
exit 1
|
||||
else
|
||||
mv "$WORK_DIR/zig-packages.json" "$ZIG_PACKAGES_JSON"
|
||||
echo -e "\nOK: flatpak/zig-packages.json updated."
|
||||
exit 0
|
||||
fi
|
||||
@@ -61,9 +61,9 @@
|
||||
},
|
||||
{
|
||||
"type": "archive",
|
||||
"url": "https://github.com/mbadolato/iTerm2-Color-Schemes/archive/8b639f0c2605557bd23ba1b940842c67bbfd4ed0.tar.gz",
|
||||
"dest": "vendor/p/N-V-__8AAAlgXwSghpDmXBXZM4Rpd80WKOXVWTrcL0ucVmls",
|
||||
"sha256": "3f249617ff4800ae0364291de4546989a225e9eb76426eadf082824f387f5dad"
|
||||
"url": "https://github.com/mbadolato/iTerm2-Color-Schemes/archive/6cdbc8501d48601302e32d6b53e9e7934bf354b4.tar.gz",
|
||||
"dest": "vendor/p/N-V-__8AAAtjXwSdhZq_xYbCXo0SZMqoNoQuHFkC07sijQME",
|
||||
"sha256": "3655177013a6680f16fbb457b97727f532219bdeb87573b63a9e10090c610f27"
|
||||
},
|
||||
{
|
||||
"type": "archive",
|
||||
|
||||
Reference in New Issue
Block a user