dbgate: 6.2.0 -> 6.3.3 (#400498)

This commit is contained in:
Pol Dellaiera
2025-04-28 05:26:24 +00:00
committed by GitHub
2 changed files with 41 additions and 9 deletions
+19 -9
View File
@@ -1,34 +1,38 @@
{
lib,
stdenv,
appimageTools,
fetchurl,
_7zz,
appimageTools,
}:
let
pname = "dbgate";
version = "6.2.0";
version = "6.3.3";
src =
fetchurl
{
aarch64-linux = {
url = "https://github.com/dbgate/dbgate/releases/download/v${version}/dbgate-${version}-linux_arm64.AppImage";
hash = "sha256-ZhF8ZxfJSNWg4AGj84oSs3/lJLiijSZDGXdnyuFLV7Q=";
hash = "sha256-H4ACPBLmZ78JOCxgx/ZuP8yawh8XK9EN+CZh12uLf8g=";
};
x86_64-linux = {
url = "https://github.com/dbgate/dbgate/releases/download/v${version}/dbgate-${version}-linux_x86_64.AppImage";
hash = "sha256-d6+24Bn12v32fwRGK0GHkkDbNzknMIBbpNDygmIT9/E=";
hash = "sha256-lsQ3/O2Jr4VQ7pusiUYgUPiXu5WHEzLiUf+vmKC0tEo=";
};
x86_64-darwin = {
url = "https://github.com/dbgate/dbgate/releases/download/v${version}/dbgate-${version}-mac_x64.dmg";
hash = "sha256-6gwjI0nlhzh0rLevdFRkcPPUrlxrwwIDSnD4mENtHc8=";
hash = "sha256-1mO/wlvV+zaB7gLJcl8WfD9SnHdio8eXXHboyYBsWzU=";
};
aarch64-darwin = {
url = "https://github.com/dbgate/dbgate/releases/download/v${version}/dbgate-${version}-mac_universal.dmg";
hash = "sha256-cSFtA/rjkE6lxxs1DR6yvP6WR9a4gjzsdUo8/oyz4/I=";
hash = "sha256-EFKjPJZ2sghPFNYO/A3Ow2GTFyuTcB85VAuQZFn6Q3U=";
};
}
.${stdenv.system} or (throw "dbgate: ${stdenv.system} is unsupported.");
.${stdenv.hostPlatform.system} or (throw "dbgate: ${stdenv.hostPlatform.system} is unsupported.");
passthru.updateScript = ./update.sh;
meta = {
description = "Database manager for MySQL, PostgreSQL, SQL Server, MongoDB, SQLite and others";
homepage = "https://dbgate.org/";
@@ -51,6 +55,7 @@ if stdenv.hostPlatform.isDarwin then
pname
version
src
passthru
meta
;
@@ -62,8 +67,10 @@ if stdenv.hostPlatform.isDarwin then
installPhase = ''
runHook preInstall
mkdir -p $out/Applications
cp -r *.app $out/Applications
runHook postInstall
'';
}
@@ -76,11 +83,14 @@ else
pname
version
src
passthru
meta
;
extraInstallCommands = ''
install -m 444 -D ${appimageContents}/${pname}.desktop -t $out/share/applications
substituteInPlace $out/share/applications/${pname}.desktop --replace-warn "Exec=AppRun --no-sandbox" "Exec=$out/bin/${pname}"
install -Dm644 ${appimageContents}/dbgate.desktop -t $out/share/applications
substituteInPlace $out/share/applications/dbgate.desktop \
--replace-warn "Exec=AppRun --no-sandbox" "Exec=dbgate"
cp -r ${appimageContents}/usr/share/icons $out/share
'';
}
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bash nix-update common-updater-scripts nix
set -euo pipefail
currentVersion=$(nix-instantiate --eval -E "with import ./. {}; dbgate.version or (lib.getVersion dbgate)" | tr -d '"')
nix-update dbgate
latestVersion=$(nix-instantiate --eval -E "with import ./. {}; dbgate.version or (lib.getVersion dbgate)" | tr -d '"')
if [[ "$currentVersion" == "$latestVersion" ]]; then
echo "package is up-to-date: $currentVersion"
exit 0
fi
for system in \
x86_64-linux \
aarch64-linux \
x86_64-darwin \
aarch64-darwin; do
hash=$(nix hash convert --to sri --hash-algo sha256 $(nix-prefetch-url $(nix-instantiate --eval -E "with import ./. {}; dbgate.src.url" --system "$system" | tr -d '"')))
update-source-version dbgate $latestVersion $hash --system=$system --ignore-same-version
done