nixpkgs/pkgs/by-name/db/dbgate/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

72 lines
1.8 KiB
Nix
Raw Permalink Normal View History

2024-05-13 16:12:14 +00:00
{
lib,
stdenv,
fetchurl,
undmg,
appimageTools,
}:
let
pname = "dbgate";
2024-08-08 08:55:12 +00:00
version = "5.3.4";
2024-05-13 16:12:14 +00:00
src =
fetchurl
{
aarch64-linux = {
url = "https://github.com/dbgate/dbgate/releases/download/v${version}/dbgate-${version}-linux_arm64.AppImage";
2024-08-08 08:55:12 +00:00
hash = "sha256-szG0orYBB1+DE9Vwjq0sluIaLDBlWOScKuruJR4iQKg=";
2024-05-13 16:12:14 +00:00
};
x86_64-linux = {
url = "https://github.com/dbgate/dbgate/releases/download/v${version}/dbgate-${version}-linux_x86_64.AppImage";
2024-08-08 08:55:12 +00:00
hash = "sha256-C0BJ3dydaeV8ypc8c0EDiMBhvByLAKuKTGHOozqbd+w=";
2024-05-13 16:12:14 +00:00
};
x86_64-darwin = {
url = "https://github.com/dbgate/dbgate/releases/download/v${version}/dbgate-${version}-mac_x64.dmg";
2024-08-08 08:55:12 +00:00
hash = "sha256-WwUpFFeZ9NmosHZqrHCbsz673fSbdQvwxhEvz/6JJtw=";
2024-05-13 16:12:14 +00:00
};
}
.${stdenv.system} or (throw "dbgate: ${stdenv.system} is unsupported.");
2024-06-09 14:59:56 +00:00
meta = {
2024-05-13 16:12:14 +00:00
description = "Database manager for MySQL, PostgreSQL, SQL Server, MongoDB, SQLite and others";
2024-06-09 14:59:56 +00:00
homepage = "https://dbgate.org/";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ luftmensch-luftmensch ];
changelog = "https://github.com/dbgate/dbgate/releases/tag/v${version}";
2024-05-13 16:12:14 +00:00
mainProgram = "dbgate";
platforms = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-linux"
];
2024-06-09 14:59:56 +00:00
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
2024-05-13 16:12:14 +00:00
};
in
if stdenv.hostPlatform.isDarwin then
stdenv.mkDerivation {
inherit
pname
version
src
meta
;
sourceRoot = ".";
nativeBuildInputs = [ undmg ];
installPhase = ''
runHook preInstall
mkdir -p $out/Applications
cp -r *.app $out/Applications
runHook postInstall
'';
}
else
appimageTools.wrapType2 {
inherit
pname
version
src
meta
;
}