nixpkgs/pkgs/applications/graphics/drawio/default.nix

95 lines
2.0 KiB
Nix

{ stdenv, lib, fetchurl, rpmextract, autoPatchelfHook, wrapGAppsHook
# Dynamic libraries
, alsaLib, atk, at-spi2-atk, at-spi2-core, cairo, dbus, cups, expat
, gdk-pixbuf, glib, gtk3, libX11, libXScrnSaver, libXcomposite, libXcursor
, libXdamage, libXext, libXfixes, libXi, libXrandr, libXrender, libXtst
, libxcb, libuuid, nspr, nss, pango
, systemd
}:
stdenv.mkDerivation rec {
pname = "drawio";
version = "11.1.1";
src = fetchurl {
url = "https://github.com/jgraph/drawio-desktop/releases/download/v${version}/draw.io-x86_64-${version}.rpm";
sha256 = "1jibkxx00rma641c3xr7720qj9slqsvhbpi7nawi6f2f91gzyc10";
};
nativeBuildInputs = [
autoPatchelfHook
rpmextract
wrapGAppsHook
];
buildInputs = [
alsaLib
atk
at-spi2-atk
at-spi2-core
cairo
cups
dbus
expat
gdk-pixbuf
glib
gtk3
libX11
libXScrnSaver
libXcomposite
libXcursor
libXdamage
libXext
libXfixes
libXi
libXrandr
libXrender
libXtst
libxcb
libuuid
nspr
nss
pango
systemd
];
runtimeDependencies = [
systemd.lib
];
dontBuild = true;
dontConfigure = true;
unpackPhase = "rpmextract ${src}";
installPhase = ''
mkdir -p $out/share
cp -r opt/draw.io $out/share/
# Application icon
mkdir -p $out/share/icons/hicolor
cp -r usr/share/icons/hicolor/0x0 $out/share/icons/hicolor/1024x1024
# XDG desktop item
cp -r usr/share/applications $out/share/applications
# Symlink wrapper
mkdir -p $out/bin
ln -s $out/share/draw.io/draw.io $out/bin/draw.io
# Update binary path
substituteInPlace $out/share/applications/draw.io.desktop \
--replace /opt/draw.io/draw.io $out/bin/draw.io
'';
meta = with stdenv.lib; {
description = "A desktop application for creating diagrams";
homepage = https://about.draw.io/;
license = licenses.asl20;
maintainers = with maintainers; [ danieldk ];
platforms = [ "x86_64-linux" ];
};
}