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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

105 lines
2.3 KiB
Nix
Raw Normal View History

{ stdenv, lib, fetchurl, rpmextract, autoPatchelfHook, wrapGAppsHook
# Dynamic libraries
, alsa-lib, atk, at-spi2-atk, at-spi2-core, cairo, dbus, cups, expat
2019-05-22 11:03:39 +00:00
, gdk-pixbuf, glib, gtk3, libX11, libXScrnSaver, libXcomposite, libXcursor
, libXdamage, libXext, libXfixes, libXi, libXrandr, libXrender, libXtst
2021-04-09 08:41:26 +00:00
, libxcb, libuuid, libxshmfence, nspr, nss, pango, mesa
, systemd
}:
stdenv.mkDerivation rec {
pname = "drawio";
2023-02-07 00:58:41 +00:00
version = "20.8.16";
src = fetchurl {
2021-03-31 18:58:15 +00:00
url = "https://github.com/jgraph/drawio-desktop/releases/download/v${version}/drawio-x86_64-${version}.rpm";
2023-02-07 00:58:41 +00:00
sha256 = "sha256-FBnyogqf5BHLRInjJzC2dENnAwFcWMHDvJ+F0I3ffVg=";
};
nativeBuildInputs = [
autoPatchelfHook
rpmextract
wrapGAppsHook
];
buildInputs = [
alsa-lib
atk
at-spi2-atk
at-spi2-core
cairo
cups
dbus
expat
2019-05-22 11:03:39 +00:00
gdk-pixbuf
glib
gtk3
libX11
libXScrnSaver
libXcomposite
libXcursor
libXdamage
libXext
libXfixes
libXi
libXrandr
libXrender
2021-03-31 18:58:15 +00:00
libxshmfence
libXtst
libxcb
libuuid
2021-04-09 08:41:26 +00:00
mesa # for libgbm
nspr
nss
pango
systemd
];
runtimeDependencies = [
(lib.getLib systemd)
];
dontBuild = true;
dontConfigure = true;
unpackPhase = "rpmextract ${src}";
installPhase = ''
mkdir -p $out/share
2021-03-31 18:58:15 +00:00
cp -r opt/drawio $out/share/
# Application icon
mkdir -p $out/share/icons/hicolor
cp -r usr/share/icons/hicolor/* $out/share/icons/hicolor/
# XDG desktop item
cp -r usr/share/applications $out/share/applications
# Symlink wrapper
mkdir -p $out/bin
2021-03-31 18:58:15 +00:00
ln -s $out/share/drawio/drawio $out/bin/drawio
# Update binary path
substituteInPlace $out/share/applications/drawio.desktop \
2021-03-31 18:58:15 +00:00
--replace /opt/drawio/drawio $out/bin/drawio
'';
2022-01-22 16:58:41 +00:00
doInstallCheckPhase = true;
installCheckPhase = ''
$out/bin/drawio --help > /dev/null
'';
meta = with lib; {
description = "A desktop application for creating diagrams";
2020-03-29 02:18:40 +00:00
homepage = "https://about.draw.io/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.asl20;
2020-07-25 06:25:19 +00:00
changelog = "https://github.com/jgraph/drawio-desktop/releases/tag/v${version}";
2021-11-11 14:00:01 +00:00
maintainers = with maintainers; [ darkonion0 ];
platforms = [ "x86_64-linux" ];
};
}