summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Lisin2019-10-29 23:13:04 +0100
committerMatthias Lisin2019-10-29 23:13:04 +0100
commitf26024a32f137c2b63bff92bc04061906fcab9af (patch)
tree9e52f14d228d6b00abdf4ae2d24422f9e2b538f2
parentd0b6c8c075372dfd35d11359e71eb81cb2ae29a7 (diff)
downloadaur-f26024a32f137c2b63bff92bc04061906fcab9af.tar.gz
upgpkg: rocketchat-desktop 2.16.0-3
- Patch "node-spellchecker" to fix build with Electron 7 - makedepends: Pin nodejs version to 12 - makedepends: Replace python2 with python
-rw-r--r--.SRCINFO13
-rw-r--r--PKGBUILD25
-rw-r--r--patch-node-spellchecker.patch89
3 files changed, 114 insertions, 13 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 5189ac76860a..ecfdd1b406a6 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,29 +1,32 @@
pkgbase = rocketchat-desktop
pkgdesc = Rocket.Chat Native Cross-Platform Desktop Application via Electron.
pkgver = 2.16.0
- pkgrel = 2
+ pkgrel = 3
url = https://github.com/RocketChat/Rocket.Chat.Electron
arch = i686
arch = x86_64
license = MIT
makedepends = gulp
- makedepends = nodejs
+ makedepends = nodejs>=12
+ makedepends = nodejs<13
makedepends = node-gyp
- makedepends = python2
+ makedepends = python
makedepends = yarn
depends = electron
optdepends = hunspell-en_US: spell checking
conflicts = rocketchat-client-bin
source = rocketchat-desktop-2.16.0.tar.gz::https://github.com/RocketChat/Rocket.Chat.Electron/archive/2.16.0.tar.gz
source = rocketchat-desktop
+ source = rocketchat-desktop.desktop
source = fix-build.patch
source = fix-spellchecking.patch
- source = rocketchat-desktop.desktop
+ source = patch-node-spellchecker.patch
sha512sums = c6111ad391d9b62003d503274a60b32d0af3b79f58ee2caf35381d88cf861079f361f79977c3487b5eed999b8a4c45e5e0f79ebd0e0ad2168fd3c929de070f09
sha512sums = 1f0f7197012421ff42d2936f73e697e35eef8c57fb9fed59ee022f9d170d6496407f89e426526fba8451fe304b3a8de1724d1cd14bd85d781bbf6aa9ca078d7d
+ sha512sums = d87664b9bdf30eac3011393d094962e0d568a94b5eaf4c8e5f17529442dcba905cea7341527066102a97a07a981acd6ce045b8737eb78a7d81a2a2d05023fe26
sha512sums = f614b29f3fb330e870edd51a3f1b9ca05c72c2c937a5a4d23797947751d55f8ac8db217f8edbe277e721c1a07f5bc84fd0be7a4903a7d991f7a9eb9625f34ce9
sha512sums = 030f7088dcff15cfe6f7f16814f800d92a833f2ac53eb373554587b64979f77081013c93dd7559b8198aa8aa2bf871e422c6c86d579936c7378670dac52944e8
- sha512sums = d87664b9bdf30eac3011393d094962e0d568a94b5eaf4c8e5f17529442dcba905cea7341527066102a97a07a981acd6ce045b8737eb78a7d81a2a2d05023fe26
+ sha512sums = b0fd7d0835bb4a15d7a2e4313a9b5e8b98143bf0c93b47e4430b2c5237a410ac1946016ee9441dd379b8c1a1b5db1ee99a13c384b539785b6604e27442c5fa09
pkgname = rocketchat-desktop
diff --git a/PKGBUILD b/PKGBUILD
index b1c58a358640..92b00450bfad 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,25 +3,27 @@
pkgname=rocketchat-desktop
pkgver=2.16.0
_srcname="Rocket.Chat.Electron-$pkgver"
-pkgrel=2
+pkgrel=3
pkgdesc='Rocket.Chat Native Cross-Platform Desktop Application via Electron.'
arch=('i686' 'x86_64')
url="https://github.com/RocketChat/Rocket.Chat.Electron"
license=('MIT')
depends=('electron')
-makedepends=('gulp' 'nodejs' 'node-gyp' 'python2' 'yarn')
+makedepends=('gulp' 'nodejs>=12' 'nodejs<13' 'node-gyp' 'python' 'yarn')
optdepends=('hunspell-en_US: spell checking')
conflicts=('rocketchat-client-bin')
source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz"
rocketchat-desktop
+ rocketchat-desktop.desktop
fix-build.patch
fix-spellchecking.patch
- rocketchat-desktop.desktop)
+ patch-node-spellchecker.patch)
sha512sums=('c6111ad391d9b62003d503274a60b32d0af3b79f58ee2caf35381d88cf861079f361f79977c3487b5eed999b8a4c45e5e0f79ebd0e0ad2168fd3c929de070f09'
'1f0f7197012421ff42d2936f73e697e35eef8c57fb9fed59ee022f9d170d6496407f89e426526fba8451fe304b3a8de1724d1cd14bd85d781bbf6aa9ca078d7d'
+ 'd87664b9bdf30eac3011393d094962e0d568a94b5eaf4c8e5f17529442dcba905cea7341527066102a97a07a981acd6ce045b8737eb78a7d81a2a2d05023fe26'
'f614b29f3fb330e870edd51a3f1b9ca05c72c2c937a5a4d23797947751d55f8ac8db217f8edbe277e721c1a07f5bc84fd0be7a4903a7d991f7a9eb9625f34ce9'
'030f7088dcff15cfe6f7f16814f800d92a833f2ac53eb373554587b64979f77081013c93dd7559b8198aa8aa2bf871e422c6c86d579936c7378670dac52944e8'
- 'd87664b9bdf30eac3011393d094962e0d568a94b5eaf4c8e5f17529442dcba905cea7341527066102a97a07a981acd6ce045b8737eb78a7d81a2a2d05023fe26')
+ 'b0fd7d0835bb4a15d7a2e4313a9b5e8b98143bf0c93b47e4430b2c5237a410ac1946016ee9441dd379b8c1a1b5db1ee99a13c384b539785b6604e27442c5fa09')
if [[ $CARCH == "i686" ]]; then
_releasename="release:linux-ia32"
_distname="linux-ia32-unpacked"
@@ -31,15 +33,22 @@ else
fi
prepare() {
- for patch in *.patch; do
- patch -p1 -d "$_srcname" < "$patch"
+ for patch in fix-{build,spellchecking}.patch; do
+ patch -N -p1 -d "$_srcname" -i "$srcdir/$patch"
done
+
+ cd "$_srcname"
+ yarn upgrade "electron@$(sed '/^v/ d' /usr/lib/electron/version)" --non-interactive --cache-folder "$srcdir/yarn-cache"
+
+ # Patching node-spellchecker to work with Electron 7
+ # https://github.com/atom/node-spellchecker/issues/127
+ # https://github.com/atom/node-spellchecker/pull/128
+ patch -N -p1 -d node_modules/spellchecker -i "$srcdir/patch-node-spellchecker.patch"
}
build() {
cd "$_srcname"
- yarn upgrade "electron@$(sed 's/^v//' </usr/lib/electron/version)" --non-interactive --cache-folder "$srcdir/yarn-cache"
- NODE_ENV=production yarn gulp build "$_releasename"
+ NODE_ENV=production yarn --cache-folder="$srcdir/yarn-cache" gulp build "$_releasename"
}
package() {
diff --git a/patch-node-spellchecker.patch b/patch-node-spellchecker.patch
new file mode 100644
index 000000000000..101a894ab7de
--- /dev/null
+++ b/patch-node-spellchecker.patch
@@ -0,0 +1,89 @@
+commit 613ff91dd2d9a5ee0e86be8a3682beecc4e94887
+Author: Hal Gentz <zegentzy@protonmail.com>
+Date: Thu Oct 24 06:17:40 2019 -0600
+
+ Fix for v8 in node 12.
+
+ Signed-off-by: Hal Gentz <zegentzy@protonmail.com>
+---
+ src/main.cc | 22 ++++++++++++++++------
+ src/worker.cc | 12 +++++++++---
+ 2 files changed, 25 insertions(+), 9 deletions(-)
+
+diff --git a/src/main.cc b/src/main.cc
+index 0318ac5..b834148 100644
+--- a/src/main.cc
++++ b/src/main.cc
+@@ -134,9 +134,15 @@ class Spellchecker : public Nan::ObjectWrap {
+ uint32_t start = iter->start, end = iter->end;
+
+ Local<Object> misspelled_range = Nan::New<Object>();
+- misspelled_range->Set(Nan::New("start").ToLocalChecked(), Nan::New<Integer>(start));
+- misspelled_range->Set(Nan::New("end").ToLocalChecked(), Nan::New<Integer>(end));
+- result->Set(index, misspelled_range);
++ {
++ Isolate* isolate = misspelled_range->GetIsolate();
++ Local<Context> context = isolate->GetCurrentContext();
++ misspelled_range->Set(context, Nan::New("start").ToLocalChecked(), Nan::New<Integer>(start)).Check();
++ misspelled_range->Set(context, Nan::New("end").ToLocalChecked(), Nan::New<Integer>(end)).Check();
++ }
++ Isolate* isolate = result->GetIsolate();
++ Local<Context> context = isolate->GetCurrentContext();
++ result->Set(context, index, misspelled_range).Check();
+ }
+ }
+
+@@ -220,7 +226,9 @@ class Spellchecker : public Nan::ObjectWrap {
+ Local<Array> result = Nan::New<Array>(dictionaries.size());
+ for (size_t i = 0; i < dictionaries.size(); ++i) {
+ const std::string& dict = dictionaries[i];
+- result->Set(i, Nan::New(dict.data(), dict.size()).ToLocalChecked());
++ Isolate* isolate = result->GetIsolate();
++ Local<Context> context = isolate->GetCurrentContext();
++ result->Set(context, i, Nan::New(dict.data(), dict.size()).ToLocalChecked()).Check();
+ }
+
+ info.GetReturnValue().Set(result);
+@@ -246,7 +254,9 @@ class Spellchecker : public Nan::ObjectWrap {
+ const std::string& word = corrections[i];
+
+ Nan::MaybeLocal<String> val = Nan::New<String>(word.data(), word.size());
+- result->Set(i, val.ToLocalChecked());
++ Isolate* isolate = result->GetIsolate();
++ Local<Context> context = isolate->GetCurrentContext();
++ result->Set(context, i, val.ToLocalChecked()).Check();
+ }
+
+ info.GetReturnValue().Set(result);
+@@ -286,7 +296,7 @@ class Spellchecker : public Nan::ObjectWrap {
+
+ Isolate* isolate = exports->GetIsolate();
+ Local<Context> context = isolate->GetCurrentContext();
+- exports->Set(Nan::New("Spellchecker").ToLocalChecked(), tpl->GetFunction(context).ToLocalChecked());
++ exports->Set(context, Nan::New("Spellchecker").ToLocalChecked(), tpl->GetFunction(context).ToLocalChecked()).Check();
+ }
+ };
+
+diff --git a/src/worker.cc b/src/worker.cc
+index fbae5ec..0314e91 100644
+--- a/src/worker.cc
++++ b/src/worker.cc
+@@ -35,9 +35,15 @@ void CheckSpellingWorker::HandleOKCallback() {
+ uint32_t start = iter->start, end = iter->end;
+
+ Local<Object> misspelled_range = Nan::New<Object>();
+- misspelled_range->Set(Nan::New("start").ToLocalChecked(), Nan::New<Integer>(start));
+- misspelled_range->Set(Nan::New("end").ToLocalChecked(), Nan::New<Integer>(end));
+- result->Set(index, misspelled_range);
++ {
++ Isolate* isolate = misspelled_range->GetIsolate();
++ Local<Context> context = isolate->GetCurrentContext();
++ misspelled_range->Set(context, Nan::New("start").ToLocalChecked(), Nan::New<Integer>(start)).Check();
++ misspelled_range->Set(context, Nan::New("end").ToLocalChecked(), Nan::New<Integer>(end)).Check();
++ }
++ Isolate* isolate = result->GetIsolate();
++ Local<Context> context = isolate->GetCurrentContext();
++ result->Set(context, index, misspelled_range).Check();
+ }
+
+ Local<Value> argv[] = { Nan::Null(), result };