-
-
Save NicoHood/3a86fb28b6535789bbca3c330703d8dd to your computer and use it in GitHub Desktop.
Typora PKGBUILD
This file contains 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: Jonathan Duck <duckbrain30@gmail.com> | |
# Contributor: NicoHood <archlinux {cat} nicohood {dog} de> | |
pkgname=typora | |
pkgver=0.9.72 | |
pkgrel=2 | |
pkgdesc="A minimal Markdown reading & writing app." | |
arch=('x86_64') | |
license=('custom: "Copyright (c) 2015 Abner Lee All Rights Reserved."') | |
url="https://typora.io/" | |
depends=('electron') | |
optdepends=('noto-fonts-emoji: emoji support') | |
source=("${pkgname}-${pkgver}.tar.gz::https://typora.io/linux/Typora-linux-x64.tar.gz" | |
"typora.desktop" | |
"typora.js") | |
sha512sums=('fab80da19e33e8dc69f05c5e083c6691b041efd0a27d76eebaaa3688d2b52da1dc2bba47265df198e38334cd1ab8c7d47e0e98e252a8bd2cd1db6f601f2c3bc6' | |
'a130972eb5f240c21362da7401c125fea82e9a545d14c74cc67a727f85f272163af40ec3999a91e1d9d1a88223d0091254991db07962927778ad4c11431164ec' | |
'976917931c1739c8b463d1b3f0ba53cf7291e258b2018fd67fe2bf6509aabda0d97fa073e127dc96492a41f1c49d7d47898f25be14aa422490c4ee60771642d9') | |
package() { | |
cd "${srcdir}" | |
# Do not copy the bundled electron version to reduce package size and | |
# use the most up to date electron version. | |
mkdir -p "${pkgdir}/opt/typora" | |
cp -a "Typora-linux-x64/resources/app/." "${pkgdir}/opt/typora" | |
install -Dm644 "typora.desktop" "${pkgdir}/usr/share/applications/typora.desktop" | |
for size in 16 32 128 256 512; do | |
install -Dm644 "${pkgdir}/opt/typora/asserts/icon/icon_${size}x${size}.png" \ | |
"${pkgdir}/usr/share/icons/hicolor/${size}x${size}/apps/typora.png" | |
done | |
# Symlink typora binary which is located in /opt | |
mkdir -p "${pkgdir}/usr/bin/" | |
ln -sf /opt/typora/typora.js "${pkgdir}/usr/bin/typora" | |
install -Dm755 "typora.js" "${pkgdir}/opt/typora/typora.js" | |
# Install license | |
install -Dm 644 "Typora-linux-x64/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" | |
} |
This file contains 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
[Desktop Entry] | |
Name=Typora | |
Comment=A minimal Markdown reading & writing app. | |
GenericName=Markdown Editor | |
Exec=typora %U | |
Icon=typora | |
Type=Application | |
StartupNotify=true | |
Categories=Office;WordProcessor; | |
MimeType=text/markdown;text/x-markdown; |
This file contains 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
#!/usr/bin/electron | |
const { join } = require('path'); | |
const { app } = require('electron'); | |
const APP_DIR = '/opt/typora/'; | |
const conf = require(APP_DIR + 'package.json'); | |
app.setName(conf.name); | |
app.setPath('userData', join(app.getPath('appData'), conf.name)); | |
app.getVersion = () => conf.version; | |
process.argv.shift(); | |
require(APP_DIR + conf.main); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment