diff options
author | Maciej Krüger <mkg20001@gmail.com> | 2024-05-24 16:20:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-24 16:20:44 +0200 |
commit | 7f8fba8e137b4aa81628a5bd3208701987f2a74e (patch) | |
tree | 36d318ccab85248e0ad6112f21708d764c64d3c3 /pkgs/by-name/db | |
parent | 5e872e63fe9021adda07a1a655b51422623352c4 (diff) | |
parent | 237485a9dbef337fc08f9a3297bb2d1b58342749 (diff) |
Merge pull request #314262 from gepbird/dbeaver-fix-aarch64-and-update-script
dbeaver-bin: fix aarch64 build, add update script
Diffstat (limited to 'pkgs/by-name/db')
-rw-r--r-- | pkgs/by-name/db/dbeaver-bin/package.nix | 4 | ||||
-rwxr-xr-x | pkgs/by-name/db/dbeaver-bin/update.sh | 25 |
2 files changed, 28 insertions, 1 deletions
diff --git a/pkgs/by-name/db/dbeaver-bin/package.nix b/pkgs/by-name/db/dbeaver-bin/package.nix index ddf67faca43c3..c4998ec7ce903 100644 --- a/pkgs/by-name/db/dbeaver-bin/package.nix +++ b/pkgs/by-name/db/dbeaver-bin/package.nix @@ -27,7 +27,7 @@ stdenvNoCC.mkDerivation (finalAttrs: { }; hash = selectSystem { x86_64-linux = "sha256-q6VIr55hXn47kZrE2i6McEOfp2FBOvwB0CcUnRHFMZs="; - aarch64-linux = "sha256-CQg2+p1P+Bg1uFM1PMTWtweS0TNElXTP7tI7D5WxixM="; + aarch64-linux = "sha256-Xn3X1C31UALBAsZIGyMWdp0HNhJEm5N+7Go7nMs8W64="; }; in fetchurl { @@ -61,6 +61,8 @@ stdenvNoCC.mkDerivation (finalAttrs: { runHook postInstall ''; + passthru.updateScript = ./update.sh; + meta = with lib; { homepage = "https://dbeaver.io/"; description = "Universal SQL Client for developers, DBA and analysts. Supports MySQL, PostgreSQL, MariaDB, SQLite, and more"; diff --git a/pkgs/by-name/db/dbeaver-bin/update.sh b/pkgs/by-name/db/dbeaver-bin/update.sh new file mode 100755 index 0000000000000..ad09144f9a4b0 --- /dev/null +++ b/pkgs/by-name/db/dbeaver-bin/update.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env nix-shell +#!nix-shell -I nixpkgs=./. -i bash -p curl jq + +latestVersion=$(curl "https://api.github.com/repos/dbeaver/dbeaver/tags" | jq -r '.[0].name') +currentVersion=$(nix-instantiate --eval -E "with import ./. {}; dbeaver-bin.version" | tr -d '"') + +echo "latest version: $latestVersion" +echo "current version: $currentVersion" + +if [[ "$latestVersion" == "$currentVersion" ]]; then + echo "package is up-to-date" + exit 0 +fi + +for i in \ + "x86_64-linux linux.gtk.x86_64-nojdk.tar.gz" \ + "aarch64-linux linux.gtk.aarch64-nojdk.tar.gz" +do + set -- $i + prefetch=$(nix-prefetch-url "https://github.com/dbeaver/dbeaver/releases/download/$latestVersion/dbeaver-ce-$latestVersion-$2") + hash=$(nix-hash --type sha256 --to-sri $prefetch) + + update-source-version dbeaver-bin 0 "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" --system=$1 + update-source-version dbeaver-bin $latestVersion $hash --system=$1 +done |