2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv, lib, fetchurl, rpmextract, autoPatchelfHook, wrapGAppsHook
|
|
|
|
|
|
|
|
# Dynamic libraries
|
2021-06-28 23:13:55 +00:00
|
|
|
, alsa-lib, atk, at-spi2-atk, at-spi2-core, cairo, dbus, cups, expat
|
2020-04-24 23:36:52 +00:00
|
|
|
, gdk-pixbuf, glib, gtk3, libX11, libXScrnSaver, libXcomposite, libXcursor
|
|
|
|
, libXdamage, libXext, libXfixes, libXi, libXrandr, libXrender, libXtst
|
2021-04-26 19:14:03 +00:00
|
|
|
, libxcb, libuuid, libxshmfence, nspr, nss, pango, mesa
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
, systemd
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "drawio";
|
2021-12-25 05:07:40 +00:00
|
|
|
version = "16.0.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-04-05 15:23:46 +00:00
|
|
|
url = "https://github.com/jgraph/drawio-desktop/releases/download/v${version}/drawio-x86_64-${version}.rpm";
|
2021-12-25 05:07:40 +00:00
|
|
|
sha256 = "980af60ea53fd0c255cfa3faa9407b146658074ea411bc491f53a047352b5b66";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
autoPatchelfHook
|
|
|
|
rpmextract
|
|
|
|
wrapGAppsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2021-06-28 23:13:55 +00:00
|
|
|
alsa-lib
|
2020-04-24 23:36:52 +00:00
|
|
|
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
|
2021-04-05 15:23:46 +00:00
|
|
|
libxshmfence
|
2020-04-24 23:36:52 +00:00
|
|
|
libXtst
|
|
|
|
libxcb
|
|
|
|
libuuid
|
2021-04-26 19:14:03 +00:00
|
|
|
mesa # for libgbm
|
2020-04-24 23:36:52 +00:00
|
|
|
nspr
|
|
|
|
nss
|
|
|
|
pango
|
|
|
|
systemd
|
|
|
|
];
|
|
|
|
|
|
|
|
runtimeDependencies = [
|
2020-09-25 04:45:31 +00:00
|
|
|
(lib.getLib systemd)
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
dontConfigure = true;
|
|
|
|
|
|
|
|
unpackPhase = "rpmextract ${src}";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/share
|
2021-04-05 15:23:46 +00:00
|
|
|
cp -r opt/drawio $out/share/
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# 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-04-05 15:23:46 +00:00
|
|
|
ln -s $out/share/drawio/drawio $out/bin/drawio
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Update binary path
|
|
|
|
substituteInPlace $out/share/applications/drawio.desktop \
|
2021-04-05 15:23:46 +00:00
|
|
|
--replace /opt/drawio/drawio $out/bin/drawio
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A desktop application for creating diagrams";
|
|
|
|
homepage = "https://about.draw.io/";
|
|
|
|
license = licenses.asl20;
|
2020-08-20 17:08:02 +00:00
|
|
|
changelog = "https://github.com/jgraph/drawio-desktop/releases/tag/v${version}";
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with maintainers; [ darkonion0 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|