From 1d1f1cdb907fa512a614e2cd99a436e3d4f31ee5 Mon Sep 17 00:00:00 2001 From: Naxdy Date: Fri, 17 May 2024 08:19:57 +0200 Subject: [PATCH] dbeaver-bin: add `.desktop` file --- pkgs/by-name/db/dbeaver-bin/package.nix | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/db/dbeaver-bin/package.nix b/pkgs/by-name/db/dbeaver-bin/package.nix index 47a90db11e2b..4af2d9153a99 100644 --- a/pkgs/by-name/db/dbeaver-bin/package.nix +++ b/pkgs/by-name/db/dbeaver-bin/package.nix @@ -3,13 +3,17 @@ , fetchurl , makeWrapper , openjdk17 +, gnused }: stdenvNoCC.mkDerivation (finalAttrs: { pname = "dbeaver-bin"; version = "24.0.4"; - nativeBuildInputs = [ makeWrapper ]; + nativeBuildInputs = [ + makeWrapper + gnused + ]; src = let @@ -39,6 +43,19 @@ stdenvNoCC.mkDerivation (finalAttrs: { makeWrapper $out/opt/dbeaver/dbeaver $out/bin/dbeaver \ --prefix PATH : "${openjdk17}/bin" \ --set JAVA_HOME "${openjdk17.home}" + + 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 + + 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" + + sed -i '/^Path=/d' $out/share/applications/dbeaver.desktop + runHook postInstall '';