Created
May 30, 2026 02:37
-
-
Save sukanka/eac3b15945e61ba5e169a460e8eebfc6 to your computer and use it in GitHub Desktop.
PKGBUILD for marktext
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Maintainer: Caleb Maclennan <caleb@alerque.com> | |
| # Contributor: Gabriel Saillard (GitSquared) <gabriel@saillard.dev> | |
| # Contributor: David Birks <david@tellus.space> | |
| # Contributor: Simon Doppler (dopsi) <dop.simon@gmail.com> | |
| # Contributor: dpeukert | |
| pkgname=marktext | |
| pkgver=0.19.0 | |
| pkgrel=1 | |
| pkgdesc='A simple and elegant open-source markdown editor that focused on speed and usability' | |
| arch=(x86_64) | |
| url=https://www.marktext.cc | |
| _url="https://github.com/$pkgname/$pkgname" | |
| license=(MIT) | |
| _electron=electron42 | |
| depends=("$_electron" | |
| libxkbfile | |
| libsecret | |
| openssl | |
| ripgrep) | |
| makedepends=(jq | |
| pnpm | |
| node-gyp | |
| moreutils | |
| git | |
| ) | |
| _archive="$pkgname-$pkgver" | |
| source=("$_url/archive/v$pkgver/$_archive.tar.gz" | |
| "$pkgname.sh" | |
| # "$pkgname-arg-handling.patch" | |
| ) | |
| sha256sums=('11cbf280f28dcf71b993717ca4205e5fe54138af76943749e5da4d0ec20504d3' | |
| '8f37f164a642a536b75f54b49e7c7a7c1e4d355a91dd8ece4cab6a95b42d369e') | |
| prepare() { | |
| cd "$_archive" | |
| local electronDist="/usr/lib/${_electron}" | |
| local electronVersion="$(<$electronDist/version)" | |
| jq ".devDependencies.electron = \"$electronVersion\"" package.json | | |
| jq ".build.electronDist = \"$electronDist\"" | | |
| jq ".build.electronVersion = \"$electronVersion\"" | | |
| sponge package.json | |
| sed -i "s/@ELECTRON@/$_electron/" "${srcdir}/$pkgname.sh" | |
| sed -i '/AppImage/d;/snap/d' electron-builder.yml | |
| sed -i 's/rpm/dir/g' electron-builder.yml | |
| } | |
| build() { | |
| cd "$_archive" | |
| export HOME=${srcdir} | |
| export ELECTRON_SKIP_BINARY_DOWNLOAD=1 | |
| export TMPDIR=${srcdir} | |
| export NODE_ENV=production | |
| pnpm install | |
| pnpm run build:linux | |
| } | |
| package() { | |
| cd "$_archive" | |
| install -Dm0755 "${srcdir}/$pkgname.sh" "$pkgdir/usr/bin/$pkgname" | |
| local _dist=dist/linux-unpacked/resources | |
| install -d "$pkgdir/usr/lib/$pkgname/" | |
| cp -ar "$_dist"/* "$pkgdir/usr/lib/$pkgname/" | |
| local _rg_path="$pkgdir/usr/lib/$pkgname/app.asar.unpacked/node_modules/@vscode/ripgrep-linux-x64/bin/" | |
| mkdir -p $_rg_path | |
| ln -sf /usr/bin/rg "$_rg_path" | |
| install -Dm0755 -t "$pkgdir/usr/share/applications/" "build/linux/$pkgname.desktop" | |
| install -Dm0755 -t "$pkgdir/usr/share/metainfo/" "build/linux/$pkgname.appdata.xml" | |
| install -Dm0644 build/icons/icon.png "$pkgdir/usr/share/pixmaps/$pkgname.png" | |
| install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE | |
| install -Dm0644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md | |
| cp -a docs "$pkgdir/usr/share/doc/$pkgname/" | |
| cp -ar static "$pkgdir/usr/lib/$pkgname/" | |
| pushd "build/icons" | |
| for res in {16,24,32,48,64,128,256,512}; do | |
| install -Dm644 ${res}x${res}/marktext.png -t $pkgdir/usr/share/icons/hicolor/${res}x${res}/ | |
| done | |
| popd | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
patches needed for it to find the proper path for translations