From a4d529d36f43caddcf3aab3cb42dd36a91cbb5b0 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Mon, 8 Jan 2018 18:22:32 -0500 Subject: [PATCH] dbeaver: inits at 4.3.2 --- pkgs/applications/misc/dbeaver/default.nix | 70 ++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 72 insertions(+) create mode 100644 pkgs/applications/misc/dbeaver/default.nix diff --git a/pkgs/applications/misc/dbeaver/default.nix b/pkgs/applications/misc/dbeaver/default.nix new file mode 100644 index 000000000000..cb0e08613719 --- /dev/null +++ b/pkgs/applications/misc/dbeaver/default.nix @@ -0,0 +1,70 @@ +{ stdenv, fetchurl, makeDesktopItem, makeWrapper +, fontconfig, freetype, glib, gtk2 +, jdk, libX11, libXrender, libXtst, zlib }: + +# The build process is almost like eclipse's. +# See `pkgs/applications/editors/eclipse/*.nix` + +stdenv.mkDerivation rec { + name = "dbeaver-ce-${version}"; + version = "4.3.2"; + + desktopItem = makeDesktopItem { + name = "dbeaver"; + exec = "dbeaver"; + icon = "dbeaver"; + desktopName = "dbeaver"; + comment = "SQL Integrated Development Environment"; + genericName = "SQL Integrated Development Environment"; + categories = "Application;Development;"; + }; + + buildInputs = [ + fontconfig freetype glib gtk2 + jdk libX11 libXrender libXtst zlib + ]; + + nativeBuildInputs = [ + makeWrapper + ]; + + src = fetchurl { + url = "https://dbeaver.jkiss.org/files/${version}/dbeaver-ce-${version}-linux.gtk.x86_64.tar.gz"; + sha256 = "0spiwx5dxchpl2qq10rinj9db723w2hf7inqmg4m7fjaj75bpl3s"; + }; + + installPhase = '' + mkdir -p $out/ + cp -r . $out/dbeaver + + # Patch binaries. + interpreter=$(cat $NIX_CC/nix-support/dynamic-linker) + patchelf --set-interpreter $interpreter $out/dbeaver/dbeaver + + makeWrapper $out/dbeaver/dbeaver $out/bin/dbeaver \ + --prefix PATH : ${jdk}/bin \ + --prefix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath ([ glib gtk2 libXtst ])} \ + --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" + + # Create desktop item. + mkdir -p $out/share/applications + cp ${desktopItem}/share/applications/* $out/share/applications + + mkdir -p $out/share/pixmaps + ln -s $out/dbeaver/icon.xpm $out/share/pixmaps/dbeaver.xpm + ''; + + meta = with stdenv.lib; { + homepage = https://dbeaver.jkiss.org; + 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. + ''; + license = licenses.asl20; + platforms = [ "x86_64-linux" ]; + maintainers = [ maintainers.samueldr ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c77658244dfc..00410adbf36e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1721,6 +1721,8 @@ with pkgs; davfs2 = callPackage ../tools/filesystems/davfs2 { }; + dbeaver = callPackage ../applications/misc/dbeaver { }; + dbench = callPackage ../development/tools/misc/dbench { }; dclxvi = callPackage ../development/libraries/dclxvi { };