diff options
author | Caleb Maclennan | 2020-04-23 18:17:01 +0300 |
---|---|---|
committer | Caleb Maclennan | 2020-04-23 18:17:01 +0300 |
commit | c36aefc94b8eb483b03cc23ec8a66924a9c13d34 (patch) | |
tree | 24a243c7abdad0aa2c1e17ce86edf3df6a60219a /PKGBUILD | |
parent | 1aa59c35bfc6a5d6d7efc4042aa057937cfe720a (diff) | |
download | aur-c36aefc94b8eb483b03cc23ec8a66924a9c13d34.tar.gz |
upgpkg: marktext 0.16.1-5
Properly rebuild all modules against system Electron version
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 36 |
1 files changed, 25 insertions, 11 deletions
@@ -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" |