From 639e6bc0e8bc9f62725d3a40cb8d094bc9006dc4 Mon Sep 17 00:00:00 2001 From: Boldi Koller Date: Tue, 24 Sep 2024 17:00:38 +0200 Subject: [PATCH] dbvisualizer: init at 24.2.2 --- pkgs/by-name/db/dbvisualizer/package.nix | 74 ++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 pkgs/by-name/db/dbvisualizer/package.nix diff --git a/pkgs/by-name/db/dbvisualizer/package.nix b/pkgs/by-name/db/dbvisualizer/package.nix new file mode 100644 index 0000000000000..1b6ff5fbaa02e --- /dev/null +++ b/pkgs/by-name/db/dbvisualizer/package.nix @@ -0,0 +1,74 @@ +{ + lib, + copyDesktopItems, + fetchurl, + makeDesktopItem, + makeWrapper, + openjdk17, + stdenv, +}: + +let + pname = "dbvisualizer"; +in +stdenv.mkDerivation (finalAttrs: { + inherit pname; + version = "24.2.2"; + + src = + let + underscoreVersion = builtins.replaceStrings [ "." ] [ "_" ] finalAttrs.version; + in + fetchurl { + url = "https://www.dbvis.com/product_download/dbvis-${finalAttrs.version}/media/dbvis_linux_${underscoreVersion}.tar.gz"; + hash = "sha256-/K50c7pqpKQ2/EEk2iPSTT+3IbLRF1cdo8GHzkIXiHQ="; + }; + + strictDeps = true; + + nativeBuildInputs = [ + copyDesktopItems + makeWrapper + ]; + + desktopItems = [ + (makeDesktopItem { + name = pname; + desktopName = "DB Visualizer"; + tryExec = "dbvis"; + exec = "dbvis"; + icon = "dbvisualizer"; + categories = [ "Development" ]; + terminal = false; + keywords = [ + "Database" + "SQL" + ]; + }) + ]; + + installPhase = '' + runHook preInstall + + mkdir -p $out/bin + cp -a . $out + + mkdir -p $out/share/icons/hicolor/128x128/apps + ln -s $out/resources/images/tool/dbvis-icon128x128.png \ + $out/share/icons/hicolor/128x128/apps/dbvisualizer.png + + ln -s $out/dbvis $out/bin/ + wrapProgram $out/bin/dbvis --set INSTALL4J_JAVA_HOME ${openjdk17} + + runHook postInstall + ''; + + meta = { + description = "The universal database tool"; + homepage = "https://www.dbvis.com/"; + maintainers = with lib.maintainers; [ boldikoller ]; + license = lib.licenses.unfree; + mainProgram = "dbvis"; + sourceProvenance = with lib.sourceTypes; [ binaryBytecode ]; + }; +})