summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD36
1 files changed, 25 insertions, 11 deletions
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"