beekeeper-studio: 5.0.9 -> 5.1.5

This commit is contained in:
emaryn 2025-03-27 01:09:18 +08:00
parent 5325034183
commit 5e00f68544

View File

@ -1,54 +1,127 @@
{
appimageTools,
fetchurl,
lib,
makeWrapper,
stdenv,
fetchurl,
dpkg,
autoPatchelfHook,
makeWrapper,
glibc,
gcc,
glib,
gtk3,
pango,
cairo,
dbus,
at-spi2-atk,
cups,
libdrm,
gdk-pixbuf,
nss,
nspr,
xorg,
alsa-lib,
expat,
libxkbcommon,
libgbm,
vulkan-loader,
systemd,
libGL,
writeShellScript,
nix-update,
}:
let
stdenv.mkDerivation (finalAttrs: {
pname = "beekeeper-studio";
version = "5.0.9";
version = "5.1.5";
plat =
{
aarch64-linux = "-arm64";
x86_64-linux = "";
}
.${stdenv.hostPlatform.system};
src =
let
selectSystem = attrs: attrs.${stdenv.hostPlatform.system};
arch = selectSystem {
x86_64-linux = "amd64";
aarch64-linux = "arm64";
};
in
fetchurl {
url = "https://github.com/beekeeper-studio/beekeeper-studio/releases/download/v${finalAttrs.version}/beekeeper-studio_${finalAttrs.version}_${arch}.deb";
hash = selectSystem {
x86_64-linux = "sha256-ClKD5OnNhEBo1O3E3rXOGu9X8vVGZAOrfXQFppuEnbU=";
aarch64-linux = "sha256-64ID+psuwfiVTfBayILeotJ3en21Hsv8FMQj+IQjjyE=";
};
};
hash =
{
aarch64-linux = "sha256-Ky7nowci7PNp9IAbmnr1W8+sN8A9f2BakBRUQHx14HY=";
x86_64-linux = "sha256-DAxY2b6WAl9llgDr5SNlvp8ZnwQuVKVrC4T++1FyiZE=";
}
.${stdenv.hostPlatform.system};
nativeBuildInputs = [
dpkg
autoPatchelfHook
makeWrapper
];
src = fetchurl {
url = "https://github.com/beekeeper-studio/beekeeper-studio/releases/download/v${version}/Beekeeper-Studio-${version}${plat}.AppImage";
inherit hash;
};
buildInputs = [
(lib.getLib stdenv.cc.cc)
xorg.libX11
xorg.libXcomposite
xorg.libXdamage
xorg.libXext
xorg.libXfixes
xorg.libXrandr
xorg.libxcb
libxkbcommon
glibc
gcc
libGL
glib
gtk3
pango
cairo
dbus
at-spi2-atk
cups
libdrm
gdk-pixbuf
nss
nspr
alsa-lib
expat
libgbm
vulkan-loader
];
appimageContents = appimageTools.extractType2 { inherit pname version src; };
in
appimageTools.wrapType2 {
inherit pname version src;
runtimeDependencies = map lib.getLib [
systemd
];
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
extraInstallCommands = ''
wrapProgram $out/bin/${pname} \
cp -r usr $out
substituteInPlace $out/share/applications/beekeeper-studio.desktop \
--replace-fail '"/opt/Beekeeper Studio/beekeeper-studio"' "beekeeper-studio"
mkdir -p $out/opt $out/bin
cp -r opt/"Beekeeper Studio" $out/opt/beekeeper-studio
makeWrapper $out/opt/beekeeper-studio/beekeeper-studio-bin $out/bin/beekeeper-studio \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}"
install -Dm444 ${appimageContents}/${pname}.desktop -t $out/share/applications/
install -Dm444 ${appimageContents}/${pname}.png -t $out/share/pixmaps/
substituteInPlace $out/share/applications/${pname}.desktop \
--replace-fail 'Exec=AppRun --no-sandbox' 'Exec=${pname}'
runHook postInstall
'';
preFixup = ''
patchelf --add-needed libGL.so.1 \
--add-rpath ${
lib.makeLibraryPath [
libGL
]
} $out/opt/beekeeper-studio/beekeeper-studio-bin
'';
passthru.updateScript = writeShellScript "beekeeper-studio-update-script" ''
${lib.getExe nix-update} beekeeper-studio --system x86_64-linux
${lib.getExe nix-update} beekeeper-studio --system aarch64-linux --version "skip"
'';
meta = {
description = "Modern and easy to use SQL client for MySQL, Postgres, SQLite, SQL Server, and more. Linux, MacOS, and Windows";
description = "Modern and easy to use SQL client for MySQL, Postgres, SQLite, SQL Server, and more";
homepage = "https://www.beekeeperstudio.io";
changelog = "https://github.com/beekeeper-studio/beekeeper-studio/releases/tag/v${version}";
changelog = "https://github.com/beekeeper-studio/beekeeper-studio/releases/tag/v${finalAttrs.version}";
license = lib.licenses.gpl3Only;
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
mainProgram = "beekeeper-studio";
@ -60,5 +133,6 @@ appimageTools.wrapType2 {
"aarch64-linux"
"x86_64-linux"
];
knownVulnerabilities = [ "Electron version 31 is EOL" ];
};
}
})