summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorkitsunyan2017-12-11 23:37:13 +0300
committerkitsunyan2017-12-11 23:37:13 +0300
commitb41338be01578481c7fbf5adfa4774e8dfe846af (patch)
treea8b7e7b32858babdfed2f7312d6b2da7e8c7bcb5 /PKGBUILD
downloadaur-b41338be01578481c7fbf5adfa4774e8dfe846af.tar.gz
Initial commit
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD63
1 files changed, 63 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..6e41cd2686f
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,63 @@
+# Maintainer: kitsunyan <kitsunyan@inbox.ru>
+
+pkgname=drawio-desktop
+pkgver=7.8.4
+pkgrel=1
+pkgdesc='Diagram drawing application built on web technology'
+arch=('x86_64')
+url='https://github.com/jgraph/drawio'
+license=('Apache')
+depends=(electron gconf libnotify)
+conflicts=(drawio-desktop-bin)
+source=("https://github.com/jgraph/drawio/archive/v$pkgver.tar.gz")
+sha256sums=('ec1275a4e3eaa3f83413ef429ce56f73521e31983ffa2867cfebe8177eab002c')
+
+prepare() {
+ cd "$srcdir/drawio-$pkgver"
+
+ # disable logger and updater
+ sed -e "/require('electron-log')/d" \
+ -e '/^autoUpdater.* = .*$/d' \
+ -e "s/require('electron-updater').autoUpdater/{on: () => {}, checkForUpdates: () => {}}/" \
+ -i 'war/electron.js'
+}
+
+package() {
+ cd "$srcdir/drawio-$pkgver"
+
+ mkdir -p "$pkgdir/usr/share/webapps"
+ cp -rp 'war' "$pkgdir/usr/share/webapps/draw.io"
+ rm -rf "$pkgdir/usr/share/webapps/draw.io/META-INF"
+ rm -rf "$pkgdir/usr/share/webapps/draw.io/WEB-INF"
+
+ # create run script
+ mkdir -p "$pkgdir/usr/bin"
+ printf '%s\n' \
+ '#!/bin/sh' \
+ 'exec electron /usr/share/webapps/draw.io "$@"' \
+ > "$pkgdir/usr/bin/draw.io"
+ chmod a+x "$pkgdir/usr/bin/draw.io"
+
+ # create desktop file
+ mkdir -p "$pkgdir/usr/share/applications"
+ printf '%s\n' \
+ '[Desktop Entry]' \
+ 'Name=draw.io' \
+ 'Comment=draw.io desktop' \
+ 'Exec="/usr/bin/draw.io" %U' \
+ 'Terminal=false' \
+ 'Type=Application' \
+ 'Icon=draw.io' \
+ 'Categories=Graphics;' \
+ > "$pkgdir/usr/share/applications/draw.io.desktop"
+
+ # create icons
+ find 'war/images' -regex '.*/drawlogo[0-9]+\.png' |
+ grep -o '[0-9]\+' |
+ while read size; do
+ install -Dm644 "war/images/drawlogo$size.png" \
+ "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/draw.io.png"
+ done
+
+ install -Dm644 'LICENSE' "$pkgdir/usr/share/licenses/drawio-desktop/LICENSE"
+}