2022-11-21 17:40:18 +00:00
|
|
|
{ pkgs
|
|
|
|
, lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, autoPatchelfHook
|
|
|
|
, dpkg
|
2023-10-09 19:29:22 +00:00
|
|
|
, wrapGAppsHook
|
2022-11-21 17:40:18 +00:00
|
|
|
, ...
|
|
|
|
}:
|
|
|
|
with lib;
|
2023-10-09 19:29:22 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2022-11-21 17:40:18 +00:00
|
|
|
pname = "figma-linux";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "0.11.2";
|
2022-11-21 17:40:18 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-10-09 19:29:22 +00:00
|
|
|
url = "https://github.com/Figma-Linux/figma-linux/releases/download/v${finalAttrs.version}/figma-linux_${finalAttrs.version}_linux_amd64.deb";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-WKL5RabTUD8xIOUoISyn26NXYrNImKZdjXnTYkXpfkE=";
|
2022-11-21 17:40:18 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
nativeBuildInputs = [ autoPatchelfHook dpkg wrapGAppsHook ];
|
2022-11-21 17:40:18 +00:00
|
|
|
|
|
|
|
buildInputs = with pkgs;[
|
|
|
|
alsa-lib
|
|
|
|
at-spi2-atk
|
|
|
|
cairo
|
|
|
|
cups.lib
|
|
|
|
dbus.lib
|
|
|
|
expat
|
|
|
|
gdk-pixbuf
|
|
|
|
glib
|
|
|
|
gtk3
|
|
|
|
libdrm
|
|
|
|
libxkbcommon
|
|
|
|
mesa
|
|
|
|
nspr
|
|
|
|
nss
|
|
|
|
pango
|
|
|
|
] ++ (with pkgs.xorg; [
|
|
|
|
libX11
|
|
|
|
libXcomposite
|
|
|
|
libXdamage
|
|
|
|
libXext
|
|
|
|
libXfixes
|
|
|
|
libXrandr
|
|
|
|
libxcb
|
|
|
|
libxshmfence
|
|
|
|
]);
|
|
|
|
|
|
|
|
runtimeDependencies = with pkgs; [ eudev ];
|
|
|
|
|
|
|
|
unpackCmd = "dpkg -x $src .";
|
|
|
|
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/lib && cp -r opt/figma-linux/* $_
|
|
|
|
mkdir -p $out/bin && ln -s $out/lib/figma-linux $_/figma-linux
|
|
|
|
|
|
|
|
cp -r usr/* $out
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
substituteInPlace $out/share/applications/figma-linux.desktop \
|
2023-10-09 19:29:22 +00:00
|
|
|
--replace "Exec=/opt/figma-linux/figma-linux" "Exec=$out/bin/${finalAttrs.pname}"
|
2022-11-21 17:40:18 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2024-01-02 11:29:13 +00:00
|
|
|
description = "Unofficial Electron-based Figma desktop app for Linux";
|
2022-11-21 17:40:18 +00:00
|
|
|
homepage = "https://github.com/Figma-Linux/figma-linux";
|
|
|
|
platforms = [ "x86_64-linux" ];
|
2024-01-02 11:29:13 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2023-10-09 19:29:22 +00:00
|
|
|
maintainers = with maintainers; [ ercao kashw2 ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "figma-linux";
|
2022-11-21 17:40:18 +00:00
|
|
|
};
|
2023-10-09 19:29:22 +00:00
|
|
|
})
|