chromium,chromedriver: 129.0.6668.91 -> 129.0.6668.100
[NixPkgs.git] / pkgs / by-name / db / dbeaver-bin / package.nix
blob9b5bf26200fb76fdbc474d46891befec991f08c0
2   lib,
3   stdenvNoCC,
4   fetchurl,
5   undmg,
6   makeWrapper,
7   openjdk17,
8   gnused,
9   autoPatchelfHook,
10   wrapGAppsHook3,
11   gtk3,
12   swt,
13   glib,
14   webkitgtk,
15   glib-networking,
18 stdenvNoCC.mkDerivation (finalAttrs: {
19   pname = "dbeaver-bin";
20   version = "24.2.1";
22   src =
23     let
24       inherit (stdenvNoCC.hostPlatform) system;
25       selectSystem = attrs: attrs.${system} or (throw "Unsupported system: ${system}");
26       suffix = selectSystem {
27         x86_64-linux = "linux.gtk.x86_64-nojdk.tar.gz";
28         aarch64-linux = "linux.gtk.aarch64-nojdk.tar.gz";
29         x86_64-darwin = "macos-x86_64.dmg";
30         aarch64-darwin = "macos-aarch64.dmg";
31       };
32       hash = selectSystem {
33         x86_64-linux = "sha256-U1KJxE1PzRRMvYw3jSYV2n6JuhzyL30le1HeY0kft1k=";
34         aarch64-linux = "sha256-AT/Xx+Hwu64sUfR1fS9nI+RTsIfdi9udF9TR9hbjnxg=";
35         x86_64-darwin = "sha256-hCIfBv6FaNoZiTvpx1UCdwBg15vq+ZsTG5upmbWXN0M=";
36         aarch64-darwin = "sha256-g0G6fqR75AoOEzlYr6MbTBL8aQ/hWQuFyw1G2w9/JlU=";
37       };
38     in
39     fetchurl {
40       url = "https://github.com/dbeaver/dbeaver/releases/download/${finalAttrs.version}/dbeaver-ce-${finalAttrs.version}-${suffix}";
41       inherit hash;
42     };
44   sourceRoot = lib.optional stdenvNoCC.hostPlatform.isDarwin "dbeaver.app";
46   nativeBuildInputs =
47     [ makeWrapper ]
48     ++ lib.optionals (!stdenvNoCC.hostPlatform.isDarwin) [
49       gnused
50       wrapGAppsHook3
51       autoPatchelfHook
52     ]
53     ++ lib.optionals stdenvNoCC.hostPlatform.isDarwin [ undmg ];
55   dontConfigure = true;
56   dontBuild = true;
58   installPhase =
59     if !stdenvNoCC.hostPlatform.isDarwin then
60       ''
61         runHook preInstall
63         mkdir -p $out/opt/dbeaver $out/bin
64         cp -r * $out/opt/dbeaver
65         makeWrapper $out/opt/dbeaver/dbeaver $out/bin/dbeaver \
66           --prefix PATH : "${openjdk17}/bin" \
67           --set JAVA_HOME "${openjdk17.home}" \
68           --prefix CLASSPATH : "$out/dbeaver/plugins/*:${swt}/jars/swt.jar" \
69           --prefix GIO_EXTRA_MODULES : "${glib-networking}/lib/gio/modules" \
70           --prefix LD_LIBRARY_PATH : "$out/lib:${
71             lib.makeLibraryPath [
72               swt
73               gtk3
74               glib
75               webkitgtk
76               glib-networking
77             ]
78           }"
80         mkdir -p $out/share/icons/hicolor/256x256/apps
81         ln -s $out/opt/dbeaver/dbeaver.png $out/share/icons/hicolor/256x256/apps/dbeaver.png
83         mkdir -p $out/share/applications
84         ln -s $out/opt/dbeaver/dbeaver-ce.desktop $out/share/applications/dbeaver.desktop
86         substituteInPlace $out/opt/dbeaver/dbeaver-ce.desktop \
87           --replace-fail "/usr/share/dbeaver-ce/dbeaver.png" "dbeaver" \
88           --replace-fail "/usr/share/dbeaver-ce/dbeaver" "$out/bin/dbeaver"
90         sed -i '/^Path=/d' $out/share/applications/dbeaver.desktop
92         runHook postInstall
93       ''
94     else
95       ''
96         runHook preInstall
98         mkdir -p $out/{Applications/dbeaver.app,bin}
99         cp -R . $out/Applications/dbeaver.app
100         makeWrapper $out/{Applications/dbeaver.app/Contents/MacOS,bin}/dbeaver \
101           --prefix PATH : "${openjdk17}/bin" \
102           --set JAVA_HOME "${openjdk17.home}"
104         runHook postInstall
105       '';
107   passthru.updateScript = ./update.sh;
109   meta = with lib; {
110     homepage = "https://dbeaver.io/";
111     description = "Universal SQL Client for developers, DBA and analysts. Supports MySQL, PostgreSQL, MariaDB, SQLite, and more";
112     longDescription = ''
113       Free multi-platform database tool for developers, SQL programmers, database
114       administrators and analysts. Supports all popular databases: MySQL,
115       PostgreSQL, MariaDB, SQLite, Oracle, DB2, SQL Server, Sybase, MS Access,
116       Teradata, Firebird, Derby, etc.
117     '';
118     sourceProvenance = with sourceTypes; [ binaryNativeCode ];
119     license = licenses.asl20;
120     platforms = platforms.linux ++ platforms.darwin;
121     maintainers = with maintainers; [
122       gepbird
123       mkg20001
124       yzx9
125     ];
126     mainProgram = "dbeaver";
127   };