2024-06-20 14:57:18 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenvNoCC,
|
|
|
|
fetchurl,
|
|
|
|
undmg,
|
|
|
|
makeWrapper,
|
|
|
|
openjdk17,
|
|
|
|
gnused,
|
|
|
|
autoPatchelfHook,
|
|
|
|
wrapGAppsHook3,
|
2024-09-19 14:19:46 +00:00
|
|
|
gtk3,
|
|
|
|
swt,
|
|
|
|
glib,
|
|
|
|
webkitgtk,
|
|
|
|
glib-networking,
|
2024-06-05 15:53:02 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenvNoCC.mkDerivation (finalAttrs: {
|
|
|
|
pname = "dbeaver-bin";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "24.2.0";
|
2024-06-05 15:53:02 +00:00
|
|
|
|
|
|
|
src =
|
|
|
|
let
|
|
|
|
inherit (stdenvNoCC.hostPlatform) system;
|
|
|
|
selectSystem = attrs: attrs.${system} or (throw "Unsupported system: ${system}");
|
|
|
|
suffix = selectSystem {
|
|
|
|
x86_64-linux = "linux.gtk.x86_64-nojdk.tar.gz";
|
|
|
|
aarch64-linux = "linux.gtk.aarch64-nojdk.tar.gz";
|
2024-06-20 14:57:18 +00:00
|
|
|
x86_64-darwin = "macos-x86_64.dmg";
|
|
|
|
aarch64-darwin = "macos-aarch64.dmg";
|
2024-06-05 15:53:02 +00:00
|
|
|
};
|
|
|
|
hash = selectSystem {
|
2024-09-19 14:19:46 +00:00
|
|
|
x86_64-linux = "sha256-N4r2immlH6B6rWluFX9abU5gnavPFY1ZoNtKpzCxwh4=";
|
|
|
|
aarch64-linux = "sha256-oRU+0iMLno1xIVI3NzeJfDrz5CuPlccICM/zpxRvV40=";
|
|
|
|
x86_64-darwin = "sha256-oUUof1HYeULP3qPr9mB69ZU83VuI4hJ09w03fjc+1Y4=";
|
|
|
|
aarch64-darwin = "sha256-JZfj0dgaqEndzyLgBwFrFebWxz7O/53qA9aTeOEWvLE=";
|
2024-06-05 15:53:02 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
fetchurl {
|
|
|
|
url = "https://github.com/dbeaver/dbeaver/releases/download/${finalAttrs.version}/dbeaver-ce-${finalAttrs.version}-${suffix}";
|
|
|
|
inherit hash;
|
|
|
|
};
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
sourceRoot = lib.optional stdenvNoCC.isDarwin "dbeaver.app";
|
|
|
|
|
|
|
|
nativeBuildInputs =
|
|
|
|
[ makeWrapper ]
|
|
|
|
++ lib.optionals (!stdenvNoCC.isDarwin) [
|
|
|
|
gnused
|
|
|
|
wrapGAppsHook3
|
|
|
|
autoPatchelfHook
|
|
|
|
]
|
|
|
|
++ lib.optionals stdenvNoCC.isDarwin [ undmg ];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
installPhase =
|
|
|
|
if !stdenvNoCC.isDarwin then
|
|
|
|
''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/opt/dbeaver $out/bin
|
|
|
|
cp -r * $out/opt/dbeaver
|
|
|
|
makeWrapper $out/opt/dbeaver/dbeaver $out/bin/dbeaver \
|
|
|
|
--prefix PATH : "${openjdk17}/bin" \
|
2024-09-19 14:19:46 +00:00
|
|
|
--set JAVA_HOME "${openjdk17.home}" \
|
|
|
|
--prefix CLASSPATH : "$out/dbeaver/plugins/*:${swt}/jars/swt.jar" \
|
|
|
|
--prefix GIO_EXTRA_MODULES : "${glib-networking}/lib/gio/modules" \
|
|
|
|
--prefix LD_LIBRARY_PATH : "$out/lib:${
|
|
|
|
lib.makeLibraryPath [
|
|
|
|
swt
|
|
|
|
gtk3
|
|
|
|
glib
|
|
|
|
webkitgtk
|
|
|
|
glib-networking
|
|
|
|
]
|
|
|
|
}"
|
2024-06-20 14:57:18 +00:00
|
|
|
|
|
|
|
mkdir -p $out/share/icons/hicolor/256x256/apps
|
|
|
|
ln -s $out/opt/dbeaver/dbeaver.png $out/share/icons/hicolor/256x256/apps/dbeaver.png
|
|
|
|
|
|
|
|
mkdir -p $out/share/applications
|
|
|
|
ln -s $out/opt/dbeaver/dbeaver-ce.desktop $out/share/applications/dbeaver.desktop
|
2024-06-05 15:53:02 +00:00
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
substituteInPlace $out/opt/dbeaver/dbeaver-ce.desktop \
|
|
|
|
--replace-fail "/usr/share/dbeaver-ce/dbeaver.png" "dbeaver" \
|
|
|
|
--replace-fail "/usr/share/dbeaver-ce/dbeaver" "$out/bin/dbeaver"
|
2024-06-05 15:53:02 +00:00
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
sed -i '/^Path=/d' $out/share/applications/dbeaver.desktop
|
2024-06-05 15:53:02 +00:00
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
runHook postInstall
|
|
|
|
''
|
|
|
|
else
|
|
|
|
''
|
|
|
|
runHook preInstall
|
2024-06-05 15:53:02 +00:00
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
mkdir -p $out/{Applications/dbeaver.app,bin}
|
|
|
|
cp -R . $out/Applications/dbeaver.app
|
|
|
|
makeWrapper $out/{Applications/dbeaver.app/Contents/MacOS,bin}/dbeaver \
|
|
|
|
--prefix PATH : "${openjdk17}/bin" \
|
|
|
|
--set JAVA_HOME "${openjdk17.home}"
|
2024-06-05 15:53:02 +00:00
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
2024-06-05 15:53:02 +00:00
|
|
|
|
|
|
|
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";
|
|
|
|
longDescription = ''
|
|
|
|
Free multi-platform database tool for developers, SQL programmers, database
|
|
|
|
administrators and analysts. Supports all popular databases: MySQL,
|
|
|
|
PostgreSQL, MariaDB, SQLite, Oracle, DB2, SQL Server, Sybase, MS Access,
|
|
|
|
Teradata, Firebird, Derby, etc.
|
|
|
|
'';
|
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
|
|
|
license = licenses.asl20;
|
2024-06-20 14:57:18 +00:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
|
|
|
maintainers = with maintainers; [
|
|
|
|
gepbird
|
|
|
|
mkg20001
|
|
|
|
yzx9
|
|
|
|
];
|
2024-06-05 15:53:02 +00:00
|
|
|
mainProgram = "dbeaver";
|
|
|
|
};
|
|
|
|
})
|