Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 stdenv,
4 fetchurl,
5 dpkg,
6 autoPatchelfHook,
7 makeWrapper,
8 glibc,
9 gcc,
10 glib,
11 gtk3,
12 pango,
13 cairo,
14 dbus,
15 at-spi2-atk,
16 cups,
17 libdrm,
18 gdk-pixbuf,
19 nss,
20 nspr,
21 xorg,
22 alsa-lib,
23 expat,
24 libxkbcommon,
25 libgbm,
26 vulkan-loader,
27 systemd,
28 libGL,
29 krb5,
30}:
31
32stdenv.mkDerivation (finalAttrs: {
33 pname = "beekeeper-studio";
34 version = "5.2.12";
35
36 src =
37 let
38 selectSystem = attrs: attrs.${stdenv.hostPlatform.system};
39 arch = selectSystem {
40 x86_64-linux = "amd64";
41 aarch64-linux = "arm64";
42 };
43 in
44 fetchurl {
45 url = "https://github.com/beekeeper-studio/beekeeper-studio/releases/download/v${finalAttrs.version}/beekeeper-studio_${finalAttrs.version}_${arch}.deb";
46 hash = selectSystem {
47 x86_64-linux = "sha256-hpzvu4SyVLXhQ5wbh5hyx+8tM19SxkKZvlMVhzhDCW4=";
48 aarch64-linux = "sha256-s567NOTzTItfOdsABIzYoF8iYSpwDsDzbnLZhUSfT8o=";
49 };
50 };
51
52 nativeBuildInputs = [
53 dpkg
54 autoPatchelfHook
55 makeWrapper
56 ];
57
58 buildInputs = [
59 (lib.getLib stdenv.cc.cc)
60 xorg.libX11
61 xorg.libXcomposite
62 xorg.libXdamage
63 xorg.libXext
64 xorg.libXfixes
65 xorg.libXrandr
66 xorg.libxcb
67 libxkbcommon
68 glibc
69 gcc
70 libGL
71 glib
72 gtk3
73 pango
74 cairo
75 dbus
76 at-spi2-atk
77 cups
78 libdrm
79 gdk-pixbuf
80 nss
81 nspr
82 alsa-lib
83 expat
84 libgbm
85 vulkan-loader
86 krb5
87 ];
88
89 runtimeDependencies = map lib.getLib [ systemd ];
90
91 installPhase = ''
92 runHook preInstall
93
94 cp -r usr $out
95 substituteInPlace $out/share/applications/beekeeper-studio.desktop \
96 --replace-fail '"/opt/Beekeeper Studio/beekeeper-studio"' "beekeeper-studio"
97 mkdir -p $out/opt $out/bin
98 cp -r opt/"Beekeeper Studio" $out/opt/beekeeper-studio
99 makeWrapper $out/opt/beekeeper-studio/beekeeper-studio-bin $out/bin/beekeeper-studio \
100 --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}"
101
102 runHook postInstall
103 '';
104
105 preFixup = ''
106 patchelf --add-needed libGL.so.1 \
107 --add-needed libEGL.so.1 \
108 --add-rpath ${
109 lib.makeLibraryPath [
110 libGL
111 ]
112 } $out/opt/beekeeper-studio/beekeeper-studio-bin
113 '';
114
115 passthru.updateScript = ./update.sh;
116
117 meta = {
118 description = "Modern and easy to use SQL client for MySQL, Postgres, SQLite, SQL Server, and more";
119 homepage = "https://www.beekeeperstudio.io";
120 changelog = "https://github.com/beekeeper-studio/beekeeper-studio/releases/tag/v${finalAttrs.version}";
121 license = lib.licenses.gpl3Only;
122 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
123 mainProgram = "beekeeper-studio";
124 maintainers = with lib.maintainers; [
125 milogert
126 alexnortung
127 ];
128 platforms = [
129 "aarch64-linux"
130 "x86_64-linux"
131 ];
132 knownVulnerabilities = [ "Electron version 31 is EOL" ];
133 };
134})