Merge pull request #276945 from Mic92/ferdium

ferdium: 6.6.0 -> 6.7.0
This commit is contained in:
André Silva 2024-01-03 13:11:47 +00:00 committed by GitHub
commit ef73683e6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 35 deletions

View file

@ -6,13 +6,13 @@ let
aarch64-linux = "arm64"; aarch64-linux = "arm64";
}."${stdenv.hostPlatform.system}" or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); }."${stdenv.hostPlatform.system}" or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
hash = { hash = {
amd64-linux_hash = "sha256-ZCyAz+XVp2NJVUuMWyv5ubjMaoYBsjPAye/1vO2jv/w="; amd64-linux_hash = "sha256-X1wGrxwENEXKhJkY8cg0iFVJTnJzWDs/4jsluq01sZM=";
arm64-linux_hash = "sha256-prdVwEn6eynzjLQ+aw2CS4PJ/JgG4QFKs9WDbzjV5oo="; arm64-linux_hash = "sha256-7qjM2H88rc+oGT8u4z5DzKMxu03yRDrXVJ9joK58vwM=";
}."${arch}-linux_hash"; }."${arch}-linux_hash";
in mkFranzDerivation rec { in mkFranzDerivation rec {
pname = "ferdium"; pname = "ferdium";
name = "Ferdium"; name = "Ferdium";
version = "6.6.0"; version = "6.7.0";
src = fetchurl { src = fetchurl {
url = "https://github.com/ferdium/ferdium-app/releases/download/v${version}/Ferdium-linux-${version}-${arch}.deb"; url = "https://github.com/ferdium/ferdium-app/releases/download/v${version}/Ferdium-linux-${version}-${arch}.deb";
inherit hash; inherit hash;

View file

@ -1,40 +1,12 @@
#!/usr/bin/env nix-shell #!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl gnused nix-prefetch jq #!nix-shell -i bash -p git bash curl jq nix-update
set -e set -xe
dirname="$(dirname "$0")" dirname="$(dirname "$0")"
updateHash()
{
version=$1
arch=$2
hashKey="${arch}-linux_hash"
url="https://github.com/ferdium/ferdium-app/releases/download/v$version/Ferdium-linux-$version-$arch.deb"
hash=$(nix-prefetch-url --type sha256 $url)
sriHash="$(nix hash to-sri --type sha256 $hash)"
sed -i "s|$hashKey = \"[a-zA-Z0-9\/+-=]*\";|$hashKey = \"$sriHash\";|g" "$dirname/default.nix"
}
updateVersion()
{
sed -i "s/version = \"[0-9.]*\";/version = \"$1\";/g" "$dirname/default.nix"
}
currentVersion=$(cd $dirname && nix eval --raw -f ../../../../.. ferdium.version)
latestTag=$(curl https://api.github.com/repos/ferdium/ferdium-app/releases/latest | jq -r ".tag_name") latestTag=$(curl https://api.github.com/repos/ferdium/ferdium-app/releases/latest | jq -r ".tag_name")
latestVersion="$(expr $latestTag : 'v\(.*\)')" latestVersion="$(expr $latestTag : 'v\(.*\)')"
if [[ "$currentVersion" == "$latestVersion" ]]; then nix-update --version "$latestVersion" --system aarch64-linux --override-filename "$dirname/default.nix" ferdium
echo "Ferdium is up-to-date: ${currentVersion}" nix-update --version skip --system x86_64-linux --override-filename "$dirname/default.nix" ferdium
exit 0
fi
updateVersion $latestVersion
updateHash $latestVersion amd64
updateHash $latestVersion arm64