path: root/PKGBUILD
diff options
authorCaleb Maclennan2020-04-01 15:49:07 +0300
committerCaleb Maclennan2020-04-01 20:11:38 +0300
commitd570a442fa854e203b56a0eaa4076bd597a118df (patch)
treea7590477470813aa4670ad41be4801bb2dd1768a /PKGBUILD
parent9816e149c30bdf7ab052c2843de9552a4c1b4375 (diff)
Overhaul in line with Arch packaging guidelines
* NEVER ADD or REMOVE files in *_install() hooks! * Use system Electron. This is an early adaptation of this and could use a lot of optimization. It currently builds stuff it doesn't use, bundles quite a few things that could be stripped out, and generally makes a nuisance of itself, but at least it uses the system default electron. Besides being 2 major versions plus lots of patches ahead and staying secure as Arch Linux updates the system, it also shaves 50+ MB off the package size and 166+ MB off the installed size. * Add missing libsecret dependency. * Use current upstream URL. * Remove makedeps that are part of base-devel. * Don't duplicate a mess of provides/conflicts, the -bin and -git packages take tare of this the other direction and pacman maps it even between each other. * Drop obsolete mime/desktop updates, these are handled by hooks. * Use system yarn for build rather than dynamically fetching it at build time. * Python 2 is not a dependency, node-gyp is which now uses Python 3. Depend directly on the thing we need to build. * Don't provide() a duplicate of the package name. * Don't let build stuff happen in prepare(). * Install LICENSE and documentation files.
Diffstat (limited to 'PKGBUILD')
1 files changed, 32 insertions, 19 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 23d3be6c3d8..11b1b417eb6 100644
@@ -1,37 +1,50 @@
+# Maintainer: Gabriel Saillard (GitSquared) <>
+# Maintainer: Caleb Maclennan <>
# Contributor: David Birks <>
# Contributor: Simon Doppler (dopsi) <>
# Contributor: dpeukert
-# Contributor: Gabriel Saillard (GitSquared) <>
pkgdesc='A simple and elegant open-source markdown editor that focused on speed and usability'
-conflicts=('marktext-bin' 'marktext-git')
-makedepends=('nodejs' 'npm' 'python2' 'tar')
+ 'libxkbfile'
+ 'libsecret')
+ 'moreutils'
+ 'nodejs'
+ 'node-gyp'
+ 'yarn')
+ "$")
+ '5716d0879a683d390caf8c90a9b373cc536256821d80498d0f983a1ac0f364ab')
prepare() {
- cd "${pkgname}-${pkgver}"
- npx yarn --frozen-lockfile
+ cd "$pkgname-$pkgver"
+ yarn --cache-folder "$srcdir" install --frozen-lockfile --ignore-scripts
build() {
- cd "${pkgname}-${pkgver}"
- node .electron-vue/build.js && npx electron-builder build --dir --linux pacman
+ cd "$pkgname-$pkgver"
+ yarn --cache-folder "$srcdir" run build:bin
package() {
- tar xf ${pkgname}-${pkgver}/build/marktext-*.pacman -C "${pkgdir}"
- rm -f "${pkgdir}/.INSTALL" "${pkgdir}/.MTREE" "${pkgdir}/.PKGINFO"
- chmod 755 "${pkgdir}/opt/Mark Text/marktext"
+ cd "$pkgname-$pkgver"
+ install -Dm755 "../$" "$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/"
+ 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"
+ install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE
+ install -Dm644 -t "$pkgdir/usr/share/doc/$pkgname/"
+ cp -a docs "$pkgdir/usr/share/doc/$pkgname/"
+ pushd "resources/icons"
+ find -name maktext.png -exec install -Dm644 {} "$pkgdir/usr/share/icons/hicolor/{}" \;