2021-02-16 17:04:54 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2021-03-20 04:20:00 +00:00
|
|
|
, copyDesktopItems
|
2021-02-16 17:04:54 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, makeDesktopItem
|
|
|
|
, makeWrapper
|
|
|
|
, fontconfig
|
|
|
|
, freetype
|
|
|
|
, glib
|
|
|
|
, gtk3
|
|
|
|
, jdk
|
|
|
|
, libX11
|
|
|
|
, libXrender
|
|
|
|
, libXtst
|
|
|
|
, zlib
|
|
|
|
, maven
|
2021-12-06 16:07:01 +00:00
|
|
|
, webkitgtk
|
|
|
|
, glib-networking
|
2022-03-30 09:31:56 +00:00
|
|
|
, javaPackages
|
2021-02-16 17:04:54 +00:00
|
|
|
}:
|
2021-03-20 04:20:00 +00:00
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
(javaPackages.mavenfod.override {
|
|
|
|
inherit maven; # use overridden maven version (see dbeaver's entry in all-packages.nix)
|
|
|
|
}) rec {
|
2021-05-20 23:08:51 +00:00
|
|
|
pname = "dbeaver";
|
2022-10-21 18:38:19 +00:00
|
|
|
version = "22.2.2"; # When updating also update mvnSha256
|
2021-02-16 17:04:54 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dbeaver";
|
|
|
|
repo = "dbeaver";
|
|
|
|
rev = version;
|
2022-10-21 18:38:19 +00:00
|
|
|
sha256 = "sha256-TUdtrhQ1JzqZx+QNauNA1P/+WDSSeOGIgGX3SdS0JTI=";
|
2021-02-16 17:04:54 +00:00
|
|
|
};
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
mvnSha256 = "uu7UNRIuAx2GOh4+YxxoGRcV5QO8C72q32e0ynJdgFo=";
|
2022-03-30 09:31:56 +00:00
|
|
|
mvnParameters = "-P desktop,all-platforms";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-20 04:20:00 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
copyDesktopItems
|
|
|
|
makeWrapper
|
|
|
|
maven
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
2021-02-16 17:04:54 +00:00
|
|
|
fontconfig
|
|
|
|
freetype
|
|
|
|
glib
|
|
|
|
gtk3
|
|
|
|
jdk
|
|
|
|
libX11
|
|
|
|
libXrender
|
|
|
|
libXtst
|
|
|
|
zlib
|
2021-12-06 16:07:01 +00:00
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
webkitgtk
|
|
|
|
glib-networking
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-03-20 04:20:00 +00:00
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
|
|
|
name = "dbeaver";
|
|
|
|
exec = "dbeaver";
|
|
|
|
icon = "dbeaver";
|
|
|
|
desktopName = "dbeaver";
|
|
|
|
comment = "SQL Integrated Development Environment";
|
|
|
|
genericName = "SQL Integrated Development Environment";
|
2022-03-05 16:20:37 +00:00
|
|
|
categories = [ "Development" ];
|
2021-03-20 04:20:00 +00:00
|
|
|
})
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-02-16 17:04:54 +00:00
|
|
|
installPhase =
|
|
|
|
let
|
2021-03-20 04:20:00 +00:00
|
|
|
productTargetPath = "product/community/target/products/org.jkiss.dbeaver.core.product";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
platformMap = {
|
2022-05-18 14:49:53 +00:00
|
|
|
aarch64-darwin = "aarch64";
|
2021-03-09 03:18:52 +00:00
|
|
|
aarch64-linux = "aarch64";
|
|
|
|
x86_64-darwin = "x86_64";
|
|
|
|
x86_64-linux = "x86_64";
|
|
|
|
};
|
|
|
|
|
|
|
|
systemPlatform = platformMap.${stdenv.hostPlatform.system} or (throw "dbeaver not supported on ${stdenv.hostPlatform.system}");
|
2021-02-16 17:04:54 +00:00
|
|
|
in
|
|
|
|
if stdenv.isDarwin then ''
|
2021-03-09 03:18:52 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2021-02-16 17:04:54 +00:00
|
|
|
mkdir -p $out/Applications $out/bin
|
2021-03-09 03:18:52 +00:00
|
|
|
cp -r ${productTargetPath}/macosx/cocoa/${systemPlatform}/DBeaver.app $out/Applications
|
2021-01-05 17:05:55 +00:00
|
|
|
|
2021-02-16 17:04:54 +00:00
|
|
|
sed -i "/^-vm/d; /bin\/java/d" $out/Applications/DBeaver.app/Contents/Eclipse/dbeaver.ini
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-16 17:04:54 +00:00
|
|
|
ln -s $out/Applications/DBeaver.app/Contents/MacOS/dbeaver $out/bin/dbeaver
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-16 17:04:54 +00:00
|
|
|
wrapProgram $out/Applications/DBeaver.app/Contents/MacOS/dbeaver \
|
|
|
|
--prefix JAVA_HOME : ${jdk.home} \
|
|
|
|
--prefix PATH : ${jdk}/bin
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2021-02-16 17:04:54 +00:00
|
|
|
'' else ''
|
2021-03-09 03:18:52 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2021-02-16 17:04:54 +00:00
|
|
|
mkdir -p $out/
|
2021-03-09 03:18:52 +00:00
|
|
|
cp -r ${productTargetPath}/linux/gtk/${systemPlatform}/dbeaver $out/dbeaver
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-16 17:04:54 +00:00
|
|
|
# Patch binaries.
|
|
|
|
interpreter=$(cat $NIX_CC/nix-support/dynamic-linker)
|
|
|
|
patchelf --set-interpreter $interpreter $out/dbeaver/dbeaver
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-16 17:04:54 +00:00
|
|
|
makeWrapper $out/dbeaver/dbeaver $out/bin/dbeaver \
|
|
|
|
--prefix PATH : ${jdk}/bin \
|
2021-12-06 16:07:01 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath ([ glib gtk3 libXtst webkitgtk glib-networking ])} \
|
|
|
|
--prefix GIO_EXTRA_MODULES : "${glib-networking}/lib/gio/modules" \
|
2021-02-16 17:04:54 +00:00
|
|
|
--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
|
|
|
|
|
|
|
|
mkdir -p $out/share/pixmaps
|
|
|
|
ln -s $out/dbeaver/icon.xpm $out/share/pixmaps/dbeaver.xpm
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2021-02-16 17:04:54 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
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.
|
|
|
|
'';
|
2022-06-26 10:26:21 +00:00
|
|
|
sourceProvenance = with sourceTypes; [
|
|
|
|
fromSource
|
|
|
|
binaryBytecode # dependencies from maven
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
2022-05-18 14:49:53 +00:00
|
|
|
platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
|
2021-08-18 13:19:15 +00:00
|
|
|
maintainers = with maintainers; [ jojosch mkg20001 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|