summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaleb Maclennan2020-04-23 18:17:01 +0300
committerCaleb Maclennan2020-04-23 18:17:01 +0300
commitc36aefc94b8eb483b03cc23ec8a66924a9c13d34 (patch)
tree24a243c7abdad0aa2c1e17ce86edf3df6a60219a
parent1aa59c35bfc6a5d6d7efc4042aa057937cfe720a (diff)
downloadaur-c36aefc94b8eb483b03cc23ec8a66924a9c13d34.tar.gz
upgpkg: marktext 0.16.1-5
Properly rebuild all modules against system Electron version
-rw-r--r--.SRCINFO7
-rw-r--r--PKGBUILD36
-rwxr-xr-xmarktext.sh2
3 files changed, 31 insertions, 14 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 07a4575df13..0f9ce08d7d7 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,13 +1,16 @@
pkgbase = marktext
pkgdesc = A simple and elegant open-source markdown editor that focused on speed and usability
pkgver = 0.16.1
- pkgrel = 4
+ pkgrel = 5
url = https://marktext.app
arch = x86_64
license = MIT
+ makedepends = jq
makedepends = nodejs-lts-erbium
makedepends = node-gyp
+ makedepends = moreutils
makedepends = yarn
+ makedepends = yq
depends = electron
depends = libxkbfile
depends = libsecret
@@ -15,7 +18,7 @@ pkgbase = marktext
source = marktext-0.16.1.tar.gz::https://github.com/marktext/marktext/archive/v0.16.1.tar.gz
source = marktext.sh
sha256sums = a00aa0caf26ab6e24e6cd5fef2a2a03e2ef46d0bf185c6971d9f00207223633e
- sha256sums = 5716d0879a683d390caf8c90a9b373cc536256821d80498d0f983a1ac0f364ab
+ sha256sums = c5af6eabe525af458df2ccfac6098092746dd0ae23225c131100bb6e37170f86
pkgname = marktext
diff --git a/PKGBUILD b/PKGBUILD
index 9ea2ddcfbd0..d4e2fd72302 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -6,7 +6,7 @@
pkgname=marktext
pkgver=0.16.1
-pkgrel=4
+pkgrel=5
pkgdesc='A simple and elegant open-source markdown editor that focused on speed and usability'
arch=('x86_64')
url='https://marktext.app'
@@ -15,34 +15,48 @@ depends=('electron'
'libxkbfile'
'libsecret'
'ripgrep')
-makedepends=('nodejs-lts-erbium'
+makedepends=('jq'
+ 'nodejs-lts-erbium'
'node-gyp'
- 'yarn')
+ 'moreutils'
+ 'yarn'
+ 'yq')
source=("$pkgname-$pkgver.tar.gz::https://github.com/marktext/marktext/archive/v${pkgver}.tar.gz"
"$pkgname.sh")
sha256sums=('a00aa0caf26ab6e24e6cd5fef2a2a03e2ef46d0bf185c6971d9f00207223633e'
- '5716d0879a683d390caf8c90a9b373cc536256821d80498d0f983a1ac0f364ab')
+ 'c5af6eabe525af458df2ccfac6098092746dd0ae23225c131100bb6e37170f86')
+
+_electronDist=$(dirname $(realpath $(which electron)))
+_electronVersion=$(electron --version | sed -e 's/^v//')
prepare() {
cd "$pkgname-$pkgver"
+ jq 'del(.devDependencies["electron"], .scripts["preinstall", "postinstall"])' \
+ package.json | sponge package.json
+ yq -y ". + {\"electronDist\": \"$_electronDist\", \"electronVersion\": \"$_electronVersion\"}" \
+ electron-builder.yml | sponge electron-builder.yml
mkdir -p "$srcdir/node_modules"
- yarn --cache-folder "$srcdir/node_modules" install --frozen-lockfile --ignore-scripts
+ yarn --cache-folder "$srcdir/node_modules" install --frozen-lockfile
+ yarn --cache-folder "$srcdir/node_modules" add -D -E --no-lockfile --ignore-scripts electron@$_electronVersion
}
build() {
cd "$pkgname-$pkgver"
- yarn --cache-folder "$srcdir/node_modules" run rebuild
- yarn --cache-folder "$srcdir/node_modules" run build:bin
+ yarn --cache-folder "$srcdir/node_modules" run electron-rebuild
+ node .electron-vue/build.js
+ yarn --cache-folder "$srcdir/node_modules" run \
+ electron-builder --linux --x64 --dir dist
}
package() {
cd "$pkgname-$pkgver"
install -Dm755 "../$pkgname.sh" "$pkgdir/usr/bin/$pkgname"
- install -Dm644 -t "$pkgdir/usr/lib/$pkgname/resources/" build/linux-unpacked/resources/app.asar
- cp -a build/linux-unpacked/resources/{app.asar.unpacked,hunspell_dictionaries} "$pkgdir/usr/lib/$pkgname/resources/"
- local _rg_path='usr/lib/marktext/resources/app.asar.unpacked/node_modules/vscode-ripgrep/bin/'
+ local _dist=build/linux-unpacked/resources
+ install -Dm644 -t "$pkgdir/usr/lib/$pkgname/" "$_dist/app.asar"
+ cp -a "$_dist"/{app.asar.unpacked,hunspell_dictionaries} "$pkgdir/usr/lib/$pkgname/"
+ local _rg_path="$pkgdir/usr/lib/marktext/app.asar.unpacked/node_modules/vscode-ripgrep/bin/"
mkdir -p $_rg_path
- ln -sf /usr/bin/rg "$pkgdir/$_rg_path/rg"
+ ln -sf /usr/bin/rg "$_rg_path"
install -Dm755 -t "${pkgdir}/usr/share/applications/" resources/linux/marktext.desktop
install -Dm755 -t "${pkgdir}/usr/share/metainfo/" resources/linux/marktext.appdata.xml
install -Dm644 resources/icons/icon.png "${pkgdir}/usr/share/pixmaps/marktext.png"
diff --git a/marktext.sh b/marktext.sh
index 6dbb7a3deed..8bfc08fdf0e 100755
--- a/marktext.sh
+++ b/marktext.sh
@@ -1,3 +1,3 @@
#!/usr/bin/env sh
-exec electron /usr/lib/marktext/resources/app.asar "$@"
+exec electron /usr/lib/marktext/app.asar "$@"