Package Details: typora 1.2.4-1

Git Clone URL: https://aur.archlinux.org/typora.git (read-only, click to copy)
Package Base: typora
Description: A minimal markdown editor and reader.
Upstream URL: https://typora.io/
Keywords: markdown
Licenses: custom:"Copyright (c) 2015 Abner Lee All Rights Reserved."
Submitter: duckbrain
Maintainer: irgendwr
Last Packager: irgendwr
Votes: 122
Popularity: 1.64
First Submitted: 2016-09-28 06:28 (UTC)
Last Updated: 2022-03-27 16:46 (UTC)

Pinned Comments

irgendwr commented on 2021-11-26 12:36 (UTC) (edited on 2022-03-25 14:57 (UTC) by irgendwr)

Typora is no longer free since it's out of beta. To continue using it you will need to purchase a license.

Update: It might be possible to use Typora for free on Linux; Some restrictions may apply. See the official FAQ: "Can I use Typora for free?" for more details.

I created another package for anyone that wants to continue using the last free beta version: typora-free

Please report issues with Typora here: https://github.com/typora/typora-issues

Latest Comments

tomacrisan commented on 2022-03-27 15:14 (UTC)

@irgendwr Thank you for your reply with the Typora github location and for posting the latest version. Fortunately, this fixed my printing issue.

irgendwr commented on 2022-03-25 14:55 (UTC) (edited on 2022-03-25 15:06 (UTC) by irgendwr)

@tomacrisan you can report Typora issues/bugs to the developer here: https://github.com/typora/typora-issues This issue looks similar: https://github.com/typora/typora-issues/issues/5033

I've just published the latest release, maybe this resolves your issue.

tomacrisan commented on 2022-03-25 13:54 (UTC)

I've never been able to print since the release of the licensed version. I have a license and have entered it. Attempting to print results in the application closing with a segmentation fault. Any suggestions on how I can debug this?

irgendwr commented on 2022-03-15 23:00 (UTC)

Hi @NicoHood, thanks for pointing out that the dependencies where outdated/incorrect.

I disagree with the other two warnings though: 1. The SETUID permission on the sandbox seems to be there on purpose (see Typora docs). 2. This is an upstream issue. I won't provide a custom license file, Typora should include that in their package.

Regarding the .tar.gz file: Sure, we could. But why? The benefit of the deb archive is that it already creates the correct folder structure. I won't change that unless there are good reasons to do so.

NicoHood commented on 2022-03-15 18:55 (UTC) (edited on 2022-03-15 18:56 (UTC) by NicoHood)

I've also added:

chmod u-s "${pkgdir}/usr/share/typora/chrome-sandbox"
chmod g-s "${pkgdir}/usr/share/typora/chrome-sandbox"

Can't we also use the .tar.gz file to package this software? https://download.typora.io/linux/Typora-linux-x64-1.1.5.tar.gz

NicoHood commented on 2022-03-15 18:43 (UTC)

I ran the latest PKGBUILD and noticed a new namcap warnings:

Checking typora-1.1.5-1-x86_64.pkg.tar.zst
typora E: ELF file ('usr/share/typora/Typora') outside of a valid path.
typora E: ELF file ('usr/share/typora/chrome-sandbox') outside of a valid path.
typora E: ELF file ('usr/share/typora/libEGL.so') outside of a valid path.
typora E: ELF file ('usr/share/typora/libGLESv2.so') outside of a valid path.
typora E: ELF file ('usr/share/typora/libffmpeg.so') outside of a valid path.
typora E: ELF file ('usr/share/typora/libvk_swiftshader.so') outside of a valid path.
typora E: ELF file ('usr/share/typora/libvulkan.so.1') outside of a valid path.
typora E: ELF file ('usr/share/typora/resources/app.asar.unpacked/main.node') outside of a valid path.
typora E: ELF file ('usr/share/typora/resources/node_modules/spellchecker/build/Release/spellchecker.node') outside of a valid path.
typora E: ELF file ('usr/share/typora/resources/node_modules/spellchecker/node_modules/cld/build/Release/cld.node') outside of a valid path.
typora E: ELF file ('usr/share/typora/resources/node_modules/vscode-ripgrep/bin/rg') outside of a valid path.
typora E: ELF file ('usr/share/typora/swiftshader/libEGL.so') outside of a valid path.
typora E: ELF file ('usr/share/typora/swiftshader/libGLESv2.so') outside of a valid path.
typora W: ELF file ('usr/share/typora/resources/app.asar.unpacked/main.node') lacks FULL RELRO, check LDFLAGS.
typora W: ELF file ('usr/share/typora/resources/node_modules/spellchecker/build/Release/spellchecker.node') lacks FULL RELRO, check LDFLAGS.
typora W: ELF file ('usr/share/typora/resources/node_modules/spellchecker/node_modules/cld/build/Release/cld.node') lacks FULL RELRO, check LDFLAGS.
typora W: ELF file ('usr/share/typora/resources/node_modules/vscode-ripgrep/bin/rg') lacks FULL RELRO, check LDFLAGS.
typora W: ELF file ('usr/share/typora/resources/app.asar.unpacked/main.node') lacks PIE.
typora W: ELF file ('usr/share/typora/resources/node_modules/spellchecker/build/Release/spellchecker.node') lacks PIE.
typora W: ELF file ('usr/share/typora/resources/node_modules/spellchecker/node_modules/cld/build/Release/cld.node') lacks PIE.
typora W: ELF file ('usr/share/typora/resources/node_modules/vscode-ripgrep/bin/rg') lacks PIE.
typora E: Missing custom license directory (usr/share/licenses/typora)
typora W: File (usr/share/typora/chrome-sandbox) is setuid or setgid.
typora W: Referenced library 'libsmime3.so' is an uninstalled dependency
typora W: Referenced library 'libnspr4.so' is an uninstalled dependency
typora W: Referenced library 'libnss3.so' is an uninstalled dependency
typora W: Referenced library 'libasound.so.2' is an uninstalled dependency
typora W: Referenced library 'libffmpeg.so' is an uninstalled dependency
typora W: Referenced library 'libnssutil3.so' is an uninstalled dependency
typora W: Unused shared library '/usr/lib/libdl.so.2' by file ('usr/share/typora/Typora')
typora W: Unused shared library '/usr/lib/libpthread.so.0' by file ('usr/share/typora/Typora')
typora W: Unused shared library '/usr/lib/libpthread.so.0' by file ('usr/share/typora/chrome-sandbox')
typora W: Unused shared library '/usr/lib/libdl.so.2' by file ('usr/share/typora/libEGL.so')
typora W: Unused shared library '/usr/lib/libpthread.so.0' by file ('usr/share/typora/libEGL.so')
typora W: Unused shared library '/usr/lib/libdl.so.2' by file ('usr/share/typora/libGLESv2.so')
typora W: Unused shared library '/usr/lib/libpthread.so.0' by file ('usr/share/typora/libGLESv2.so')
typora W: Unused shared library '/usr/lib/libpthread.so.0' by file ('usr/share/typora/libffmpeg.so')
typora W: Unused shared library '/usr/lib/libdl.so.2' by file ('usr/share/typora/libvk_swiftshader.so')
typora W: Unused shared library '/usr/lib/libpthread.so.0' by file ('usr/share/typora/libvk_swiftshader.so')
typora W: Unused shared library '/usr/lib/libdl.so.2' by file ('usr/share/typora/libvulkan.so.1')
typora W: Unused shared library '/usr/lib/libpthread.so.0' by file ('usr/share/typora/libvulkan.so.1')
typora W: Unused shared library '/usr/lib/libpthread.so.0' by file ('usr/share/typora/resources/app.asar.unpacked/main.node')
typora W: Unused shared library '/usr/lib/libpthread.so.0' by file ('usr/share/typora/resources/node_modules/spellchecker/build/Release/spellchecker.node')
typora W: Unused shared library '/usr/lib/libpthread.so.0' by file ('usr/share/typora/resources/node_modules/spellchecker/node_modules/cld/build/Release/cld.node')
typora W: Unused shared library '/usr/lib/libdl.so.2' by file ('usr/share/typora/swiftshader/libEGL.so')
typora W: Unused shared library '/usr/lib/libpthread.so.0' by file ('usr/share/typora/swiftshader/libEGL.so')
typora W: Unused shared library '/usr/lib/libdl.so.2' by file ('usr/share/typora/swiftshader/libGLESv2.so')
typora W: Unused shared library '/usr/lib/libpthread.so.0' by file ('usr/share/typora/swiftshader/libGLESv2.so')
typora W: Dependency included and not needed ('libxss')

I could solve most of the dependency issues by adding: 'nss' 'alsa-lib' 'nspr' 'poppler'

The following two warnings should be adressed as well: typora E: Missing custom license directory (usr/share/licenses/typora) typora W: File (usr/share/typora/chrome-sandbox) is setuid or setgid.

kgbook commented on 2021-12-07 13:41 (UTC)

PING typora.io 100% packet loss from China Mainland. What a pity!

irgendwr commented on 2021-11-26 12:36 (UTC) (edited on 2022-03-25 14:57 (UTC) by irgendwr)

Typora is no longer free since it's out of beta. To continue using it you will need to purchase a license.

Update: It might be possible to use Typora for free on Linux; Some restrictions may apply. See the official FAQ: "Can I use Typora for free?" for more details.

I created another package for anyone that wants to continue using the last free beta version: typora-free

Please report issues with Typora here: https://github.com/typora/typora-issues

irgendwr commented on 2021-09-20 13:58 (UTC)

Thanks @xsmile, I've now removed the option to build with the systems electron package since, even after fixing the build script, typora detects these changes and refuses to launch. Besides, it never really was stable since electron updates could break typora at any time.

xsmile commented on 2021-09-20 06:35 (UTC)

I get an packaging error while trying to use system Electron:

==> Starting package()...
mv: cannot stat 'tmp/resources/app': No such file or directory

xsmile commented on 2021-09-20 06:31 (UTC)

@irgendwr Thanks! Hopefully this will get more attention on their issue tracker.

irgendwr commented on 2021-09-20 00:18 (UTC)

@xsmile I fixed the file permissions by adding chmod -R go-w "$pkgdir/usr/share/typora/resources/node_modules" to the build script.

Ideally this should be fixed upstream in the original .deb package though. I opened an issue here: https://github.com/typora/typora-issues/issues/4669

xsmile commented on 2021-09-15 13:50 (UTC)

One year has passed and several files in /usr/share/typora/resources/app/node_modules/ are still writable by anyone. I notified upstream back then but they ignored it.

Please fix these permissions. Thanks!

duckbrain commented on 2021-09-02 23:44 (UTC)

@irgendwr I'm glad it's been getting plenty of use. Thanks for picking up the mantle.

Feel free to unpin my maintainer comment. I don't have permission anymore. :)

GAZ082 commented on 2021-09-02 13:05 (UTC)

All hail the new maintainer!

irgendwr commented on 2021-09-01 22:48 (UTC)

Thanks for creating and maintaining this package @duckbrain! Five years is a long time, I appreciate your effort. I adopted the package since I'm still using it and I'm willing to maintain it.

duckbrain commented on 2021-09-01 20:34 (UTC)

I'm not able to maintain this package anymore. I haven't been actively using it for years and I don't have the time/energy to maintain it anymore.

I've updated to 0.11.8. For the most part, the Makefile in the repository will cover updates. If someone would like to take it over, I'm still perfectly happy to answer questions.

grawlinson commented on 2021-08-26 19:26 (UTC)

Since this package uses precompiled binaries, it should be called typora-bin.

irgendwr commented on 2021-08-26 18:25 (UTC)

This is the new URL: https://typora.io/linux/typora_0.11.7_amd64.deb

nursoda commented on 2021-08-26 18:07 (UTC) (edited on 2021-08-26 18:08 (UTC) by nursoda)

Just for info:

I've published it because at least it doesn't 404 like the 0.11.5.

  -> Loading typora_0.11.6_amd64.deb ...
curl: (22) The requested URL returned error: 404

duckbrain commented on 2021-08-26 14:49 (UTC)

@CRISPYrice Upstream regularly removes previous packages. I can't really get a rhyme or reason to it. You can curl https://www.typora.io/linux/Packages | grep Version to see the versions currently available.

Building 0.11.6 leaves a broken menu bar. (It shows, but with many fewer items.) Not sure if that's an upstream issue or a packaging issue. I've published it because at least it doesn't 404 like the 0.11.5. I wouldn't recommend updating for now if you already have an older version installed.

crispyrice commented on 2021-08-26 14:00 (UTC)

https://typora.io/linux/typora_0.11.4_amd64.deb 404s, does anyone know where the new location is? I can't seem to find any versions that are at that address

xoan commented on 2021-04-30 08:29 (UTC)

I get an error when building with env ELECTRON=electron:

==> Starting package()...
mv: cannot stat 'tmp/resources/app': No such file or directory

egasato commented on 2020-08-29 13:28 (UTC)

I tried to install typora and got the 404 error your pinned comment warns about. I randomly tried different URLs bumping the version number and both https://typora.io/linux/typora_0.9.93_amd64.deb and https://typora.io/linux/typora_0.9.94_amd64.deb work.

I am not sure whether 0.9.94 is the latest version or not, because downloading the binary file from the homepage provides a version file that contains only the string 9.9.2 and the official changelog file says the latest version is 0.9.9.35, but the URL https://typora.io/linux/typora_0.9.9.35_amd64.deb returns a 404 error as well.

yochananmarqos commented on 2020-08-27 18:56 (UTC) (edited on 2021-04-28 17:31 (UTC) by yochananmarqos)

See Package etiquette:

When creating a package description for a package, do not include the package name in a self-referencing way.

This should not be installed to /usr/share/, see Electron package guidelines: Directory structure

RANP0 commented on 2020-07-16 08:46 (UTC) (edited on 2020-07-16 08:47 (UTC) by RANP0)

the 0.9.92 version might has a problem that can't automatically save image to local folders.(My image location is set as "./assets")

if you right click a picture (from Internet) and then click "copy to assets",you get a warning on the top "复制图片至目标目录失败。 Failed to copy image .ENOENT: no such file or directory, stat 'http://xxx.jpg'"


and I think 0.9.89 has another bug that a new picture with a same name will overwrite the old one.

xsmile commented on 2020-06-28 18:20 (UTC)

Multiple files in /usr/share/typora/resources/app/node_modules are writable by everyone, please fix this.

ascii78 commented on 2020-05-23 13:00 (UTC)

I've just added 0.9.87 + hashes to my pkgbuild, unfortunately it seems to download a corrupted .deb. Can anyone confirm ?

irgendwr commented on 2020-05-08 15:48 (UTC)

@duk3m0n this is not how you install from AUR... Either use "yay" (very convenient wrapper) or read the wiki for the manual approach: https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_packages

duk3m0n commented on 2020-05-08 15:44 (UTC)

Excuse me, I can't install or search typora in aur, the output of "sudo pacman -S typora" is "error: target not found: typora"

duckbrain commented on 2020-04-24 15:37 (UTC)

@Samhamsam, I just tried building a package and it worked for me.

The same day you posted your comment, the package direcotry gave a 504 status code on my monitoring. It has since resolved itself, so I suspect that was your issue.

Samhamsam commented on 2020-04-21 23:13 (UTC)

Hi, i get "ERROR: One or more files did not pass the validity check!" when trying to install.

@duckbrain

hatred commented on 2020-01-02 11:54 (UTC)

0.9.83 is out

duckbrain commented on 2019-12-02 23:54 (UTC)

@tschertel Thanks for helping. If you clone the repo, make update will check the newest version and build it for you.

@irgendwr Thanks, did it.

tschertel commented on 2019-12-02 21:36 (UTC) (edited on 2019-12-02 21:37 (UTC) by tschertel)

Solve this is easier than you think:

Just git clone the repo and edit PKGBUILD file to the right version and run make. Then update the programm.

git clone https://aur.archlinux.org/typora.git

(edit PKGBUILD to 81)

make

pacman -U typora-0.9.81-1-x86_64.pkg.tar.xz

irgendwr commented on 2019-12-02 20:42 (UTC)

@duckbrain Please update pkgver=0.9.80 to pkgver=0.9.81 as soon as possible (0.9.80 is no longer available which breaks the installation) and change source=("<https://typora.io/./linux/>$filename") to source=("<https://typora.io/linux/>$filename").

michaldybczak commented on 2019-12-02 19:55 (UTC)

Couldn't install.

curl: (22) The requested URL returned error: 404 ==> ERROR: Download error https://typora.io/./linux/typora_0.9.80_amd64.deb Aborting...

polve commented on 2019-12-02 15:31 (UTC)

@Tio

As you already noticed, at the time of me writing this, the following doesn't work:

curl -O https://typora.io/./linux/typora_0.9.80_amd64.deb

But this seem to be working fine:

curl -LO https://typora.io/./linux/typora_0.9.80_amd64.deb

However, I do not know how to make it work with the PKGBUILD.

timhs commented on 2019-12-01 20:42 (UTC) (edited on 2019-12-01 20:44 (UTC) by timhs)

in PKGBUILD I changed it to

pkgver=0.9.81

and I changed the sha512:

sha512sums=('4c2db673277431643b4ea006ff62780c2769f35ff6bdc2ae0fb52147001a97b410fa012e05743385004541d5aa064a8bdb229b1ed9263fd022076d74838139d1')

Now I have the Beta Version. I think the 0.9.80.deb is missing

Tio commented on 2019-12-01 17:55 (UTC)

Error:

Building typora...
==> Making package: typora 0.9.80-1 (dom 01 dic 2019 18:38:20 CET)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Downloading typora_0.9.80_amd64.deb...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404 
==> ERROR: Failure while downloading https://typora.io/./linux/typora_0.9.80_amd64.deb
    Aborting...

GAZ082 commented on 2019-12-01 13:48 (UTC)

  1. The .deb file source is wrong. There is not file there.
  2. Why do you use a .deb package? Use the tar.gz.

max-k commented on 2019-12-01 12:59 (UTC)

Hi,

Could you upgrade this package to 0.9.81-1 ?

Also, I think you can remove useless ./ in URL.

And, maybe sha512 is a bit too much for a checksum, sha256 is probably sufficient.

Thank you very much.

solatis commented on 2019-12-01 11:17 (UTC) (edited on 2019-12-01 11:19 (UTC) by solatis)

Currently broken:

:: Parsing SRCINFO (1/1): typora ==> Making package: typora 0.9.80-1 (Sun 01 Dec 2019 12:18:10 PM CET) ==> Retrieving sources... -> Downloading typora_0.9.80_amd64.deb... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 curl: (22) The requested URL returned error: 404 ==> ERROR: Failure while downloading <https://typora.io/./linux/typora_0.9.80_amd64.deb> Aborting... Error downloading sources: typora

tschertel commented on 2019-12-01 10:15 (UTC)

Why download a deb file if we have Typora-linux-x64.tar.gz binary there? Just asking. No need to change everything.

springzfx commented on 2019-12-01 00:55 (UTC)

I tried ELECTRON=electron. There is a not-match version warning with first start, just dismiss that, and everything works seamlessly as before.

tschertel commented on 2019-10-23 20:37 (UTC)

Is gconf really needed??

duckbrain commented on 2019-10-13 00:51 (UTC) (edited on 2020-08-30 00:33 (UTC) by duckbrain)

If you get the error ERROR: One or more files did not pass the validity check! or curl: (22) The requested URL returned error: 404, it might be that upstream has changed/removed a released package. They have a habit of doing that from time to time. Leave me a comment and I'll update the sum (or version).

You can also try cloning the repo and running make update, which attempts to parse the newest version out of the debian repository index and update the PKGBUILD for you.

duckbrain commented on 2019-10-13 00:50 (UTC) (edited on 2019-10-13 00:52 (UTC) by duckbrain)

New: The PKGBUILD will build with system electron if you set env ELECTRON=electron while building. Please try this out and provide feedback.

Edit: Thanks NicoHood for the PKGBUILD contributions.

georgeat8 commented on 2019-10-10 08:22 (UTC)

Seems that there is a validity check problem.

"ERROR: One or more files did not pass the validity check!"

rocka commented on 2019-09-11 09:24 (UTC)

Typora 0.9.77 uses electron 5.0.4, so I think gconf can be removed from dependencies safely.

And unfortunately electron2 won't work in this case.

Tip: to find out what electron version Typora is using, activate developer tools by pressing Shift + F12 in the main window, switch to 'Console' tab, then type process.versions.electron in the console and press enter.

NicoHood commented on 2019-09-08 12:24 (UTC)

I suggest adding pandoc as optional dependency, as pandoc can be used for custom exports to other formats such as open office etc. https://support.typora.io/Install-and-Use-Pandoc/

duckbrain commented on 2019-08-02 15:46 (UTC)

@NicoHood

I don't see any benefit to moving to the tarball. We've already had problems in the past with upstream breaking the package. https://aur.archlinux.org/packages/typora/?O=20&PP=10#comment-624914 They've gotten better, but the tarball will break the package after every release. It looks like someone else wanted to do that too. https://aur.archlinux.org/packages/typora-latest/

We've also tried using system electron before. https://aur.archlinux.org/packages/typora/?O=0&PP=10#comment-669181 I see now that there is now an electron2 package that might work, but it will take some experimentation.

The gconf dependency is based off of what is documented in the Debian package. It may no longer be accurate, but it did depend on it at one time and still shows in the latest debian package. https://aur.archlinux.org/packages/typora/?O=30&PP=10#comment-565571 I'll have to look into the dependencies. I'm not sure about the gtk3 and nss dependencies. https://www.archlinux.org/packages/community/x86_64/electron2/ lists the dependencies for electron2. That might be the best way to go.

NicoHood commented on 2019-07-30 22:01 (UTC)

I've updated my PKGBUILD again. It now used the archlinux electron. The package size got reduced by 160mb from ~200mb to ~39mb now.

NicoHood commented on 2019-07-29 16:12 (UTC)

I want to suggest a PKGBUILD change: https://gist.github.com/NicoHood/3a86fb28b6535789bbca3c330703d8dd

I've used the tarball instead of the debian package, because that is more neutral. The downside is, that it is not versioned, but maybe we can arrange better links with upstream in the future.

Also I've added the gtk3 and nss dependency and removed the not required gconf dependency. Correct me if I am wrong. I've also made sure license files etc are in the correct place.

Can you please tell me why you used the 2 chmods?

duckbrain commented on 2019-04-13 15:07 (UTC)

@alf That path gets updated with the latest version without warning. That would make it so every time there was an update, this AUR package would fail to build until the AUR package gets updated with the new checksum.

alf commented on 2019-04-11 09:32 (UTC) (edited on 2019-04-11 15:43 (UTC) by alf)

why don't we use https://typora.io/linux/Typora-linux-x64.tar.gz instead of https://typora.io/linux/typora_0.9.68_amd64.deb?

here is my setup

PKGBUILD https://hastebin.com/werizitowo

asar.js.patch https://hastebin.com/biwefifejo

typora.sh https://hastebin.com/xebacucubu

typora.desktop https://hastebin.com/ucezayizip

JohnRobson commented on 2019-03-11 22:55 (UTC)

@duckbrain thank you very much! you are right, this is the latest version.

duckbrain commented on 2019-03-09 17:24 (UTC)

@JohnRobson 0.9.9.65? Where are you seeing that? It's already at 0.9.65? 0.9.9.65 doesn't make any sense. Also, you don't need to post a comment when you flag it as out of date. I get an email for each.

irgendwr commented on 2018-11-03 20:05 (UTC)

@duckbrain wow, that was really quick and solved it. Thanks!

duckbrain commented on 2018-11-03 19:55 (UTC) (edited on 2018-11-03 19:55 (UTC) by duckbrain)

@irgendwr Yeah, it's causing more problems than it solves. I reverted back to the binary release.

irgendwr commented on 2018-11-03 19:25 (UTC)

@duckbrain >I prefer having the electron dependency, unless it causes a problem.

Using the electron dependency is currently causing a problem since typora is bundled with and depends on electron 3.x while the electron dependency here is on 2.x. See https://github.com/typora/typora-issues/issues/1932 and https://github.com/typora/typora-issues/issues/1912

Can you at least temporarily use the bundled electron until 3.x is available to fix the issues?

rocka commented on 2018-10-03 13:51 (UTC) (edited on 2018-10-07 07:47 (UTC) by rocka)

Good to know that changes, but I found 2 new questions:

  1. app configuration path has been changed to ~/.config/Electron, not ~/.config/Typora, because electron did not start with a package.json file. We can use electron's app.setPath() to override it;

  2. the app version in 'Help -> About' displays version of electron, not Typora. We can also override it with the version name from package.json file.

Here was the changed typora.js:

#!/usr/bin/electron

const { join } = require('path');
const { app } = require('electron');
const APP_DIR = '/usr/share/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);

duckbrain commented on 2018-10-03 03:45 (UTC)

@rocka, I used your idea, but without patching the Typora code. My entrypoint is a JavaScript file with electron in the hash-bang, that just immediately removes the extra arg and runs the normal code. It seems to work.

Let me know if there are any other issues with the new system electron package.

rocka commented on 2018-09-26 13:03 (UTC) (edited on 2018-09-27 03:51 (UTC) by rocka)

Finally I figured out how to keep the featrue "On Launch - Restore last closed files and folders" functionality with system electron. Just patch the .js files.

When typora is launched with bundled electron, it's process.argv equals to ["/usr/share/typora/Typora", "/path/to/file"]. But if it was launched with system electron, it changes to ["/usr/lib/electron/electron", "/path/to/typora", "/path/to/file"], so it would just restore typora folder every times.

Let me show the PKGBUILD and patch:

pkgname=typora
pkgver=0.9.58
pkgrel=1
pkgdesc="Typora will give you a seamless experience as both a reader and a writer."
arch=('x86_64')
license=('custom:"Copyright (c) 2015 Abner Lee All Rights Reserved."')
url="https://typora.io/"
depends=('gconf' 'libxss' 'electron')
makedepends=('asar')
optdepends=('noto-fonts-emoji: Or some other emoji font to see emojis')
provides=('typora')
conflicts=('typora')
source=(
    'typora.sh'
    'atom.js.diff'
    "https://typora.io/./linux/${pkgname}_${pkgver}_amd64.deb"
)
md5sums=(
    'ba1aa3c5c401723a06cb941fe8b7c23a'
    'a103aa5e384d9fc4b54a7aae4e10d4e5'
    '23e55a05ead4115b415c77c1709aa9e6'
)

package() {
    _src="$srcdir/$pkgname"
    mkdir -p "$_src"
    bsdtar -xf data.tar.xz -C "$_src/"

    sed -i '/Change Log/d' "$_src/usr/share/applications/typora.desktop"

    asar e "$_src/usr/share/typora/resources/app/atom.asar" "$_src/usr/share/typora/resources/app/atom"
    patch "$_src/usr/share/typora/resources/app/atom/atom.js" "$srcdir/atom.js.diff"
    asar p "$_src/usr/share/typora/resources/app/atom" "$_src/usr/share/typora/resources/app/atom.asar"
    rm -r "$_src/usr/share/typora/resources/app/atom"

    install -Dm644 "$_src/usr/share/applications/typora.desktop" "$pkgdir/usr/share/applications/typora.desktop"
    install -Dm644 "$_src/usr/share/doc/typora/copyright" "$pkgdir/usr/share/doc/typora/copyright"
    install -Dm755 "$srcdir/typora.sh" "$pkgdir/usr/bin/typora"

    cp -r "$_src/usr/share/icons" "$pkgdir/usr/share/icons"
    cp -r "$_src/usr/share/typora/resources/app" "$pkgdir/usr/share/typora"
}

typora.sh

#!/usr/bin/bash
exec /usr/bin/electron /usr/share/typora $@

atom.js.diff

--- atom.js 2018-09-26 20:48:45.760765096 +0800
+++ atom.1.js   2018-09-26 20:46:57.989992178 +0800
@@ -60,6 +60,9 @@

 function getFilePath(argv, workingDirectory) {
     var path;
+    if (argv[0].endsWith('electron')) {
+        argv.shift();
+    }
     if (argv.length > 1) {
         path = argv[argv.length - 1];
     }

arch440 commented on 2018-08-24 08:07 (UTC)

That makes sense, I was suggesting it because I noticed a regression/change when keeping the electron dependency: the preference "On Launch - Restore last closed files and folders" is not working anymore, and it always opens in the system Typora folder /usr/share/typora/. This was working before.

duckbrain commented on 2018-08-21 23:20 (UTC)

I prefer having the electron dependency, unless it causes a problem. It makes the package much smaller (44038772 to 8509788 bytes) and prevents having these types of issues in the future.

arch440 commented on 2018-08-17 09:10 (UTC)

Today glibc was updated to 2.28-4, so I guess we can remove the electron dependency now?

duckbrain commented on 2018-08-13 17:20 (UTC)

Sorry, I made the fix @rocka suggested, but I forgot to push it (to the correct remote). I can't get into my machine with the key right now, (NetworkManager keeps stopping sshd) but I'll push it when I can.

In the meantime. If you replace /usr/bin/typora with @rocka's script, it should work.

@Peven, good to know that this is a glibc issue. I'm liking the removing the packaged electron to trim down package size anyway.

Peven commented on 2018-08-13 16:05 (UTC) (edited on 2018-08-13 16:06 (UTC) by Peven)

The segmentation fault (core dumped) typora can be solved by upgrading glibc to 2.28-4 in testing Repo

rocka commented on 2018-08-13 08:26 (UTC) (edited on 2018-08-13 13:21 (UTC) by rocka)

@duckbrain That was a mistake, sorry for that ... Maybe we should write typora.sh as below:

#!/usr/bin/bash
exec /usr/bin/electron /usr/share/typora/resources/app $@

the directory /usr/share/typora/resources/app should be where typora's package.json located, that's depends on where we installed it ...

bilabila commented on 2018-08-11 14:03 (UTC)

a way to open with local electron

cd /usr/share/typora/resources/app
electron .

cabbage commented on 2018-08-11 03:24 (UTC) (edited on 2018-08-11 03:27 (UTC) by cabbage)

I also have the segmentation fault after the lastest Syu update. But everyone, please DO NOT downgrade your glibc. It's really really a bad idea to mess with glibc, your whole system could break down. Just wait for fixes from upstream.

duckbrain commented on 2018-08-08 06:03 (UTC)

@rocka, Thanks! That keeps it from being dependent on the system glib and libxss, and makes the package a lot smaller. I can probably remove those as direct dependencies.

Why does your typora.sh cd /usr/share/typora? That breaks opening relative files with it.

The only concern I have is it breaking expecting a different version of node/electron. If anything breaks, I might have to revert it with a new pkgrel.

rocka commented on 2018-08-07 17:09 (UTC) (edited on 2018-08-07 17:14 (UTC) by rocka)

How about package this with system electron? I've modified the PKGBUILD and It seems to work fine.

PKGBUILD:

pkgname=typora
pkgver=0.9.53
pkgrel=2
pkgdesc="Typora will give you a seamless experience as both a reader and a writer."
arch=('x86_64')
license=('custom:"Copyright (c) 2015 Abner Lee All Rights Reserved."')
url="https://typora.io/"
depends=('gconf' 'libxss' 'electron')
optdepends=('noto-fonts-emoji: Or some other emoji font to see emojis')
source=(
    'typora.sh'
    "https://typora.io/./linux/${pkgname}_${pkgver}_amd64.deb"
)
md5sums=(
    '5851ce5475b7526ae0277e739a5ce6f9'
    '7bf938aa11cc6b8d3dca442e673b057b'
)

package() {
    _src="$srcdir/$pkgname"
    mkdir "$_src"
    bsdtar -xf data.tar.xz -C "$_src/"
    sed -i '/Change Log/d' "$_src/usr/share/applications/typora.desktop"
    install -Dm644 "$_src/usr/share/applications/typora.desktop" "$pkgdir/usr/share/applications/typora.desktop"
    install -Dm644 "$_src/usr/share/doc/typora/copyright" "$pkgdir/usr/share/doc/typora/copyright"
    install -Dm755 "$srcdir/typora.sh" "$pkgdir/usr/bin/typora"

    cp -r "$_src/usr/share/icons" "$pkgdir/usr/share/icons"
    cp -r "$_src/usr/share/typora/resources/app" "$pkgdir/usr/share/typora"
}

typora.sh:

#!/usr/bin/bash

cd /usr/share/typora
exec electron /usr/share/typora $@

duckbrain commented on 2018-08-07 14:13 (UTC) (edited on 2018-08-07 14:14 (UTC) by duckbrain)

It worked for me this morning, then I installed updates and it broke. Try downgrading glibc. That fixed it for me.

There hasn't been a package update for a while, so there haven't been any changes there.

sudo pacman -U /var/cache/pacman/pkg/glibc-2.27-3-x86_64.pkg.tar.xz

iosmanthus commented on 2018-08-07 09:56 (UTC)

It seems that typora doesn't work in ArchLinux now? It crashes when I launch it in terminal or DE. Here are the error message:

[1]    24885 segmentation fault (core dumped)  typora

lonaowna commented on 2018-04-05 20:13 (UTC)

License isn't right: cat /usr/share/doc/typora/copyright: Copyright (c) 2015 Abner Lee All Rights Reserved.

schmunk commented on 2018-03-16 10:50 (UTC)

I just noticed that several emojis in my markdown files were missing until I installed noto-fonts-emoji - might be an optional recommendation for typora

duckbrain commented on 2017-12-14 17:59 (UTC)

There was an 0.9.40. There was also a 0.9.39, but by the time I went to build a package it was already removed.

This seems to be happening after every release. The release happens, then there are one or more re-releases soon after, where the previous new releases are removed. As of writing, the repository has 0.9.33, 0.9.38, and 0.9.41. Maybe I need to wait a day or two before updating the AUR for the dust to settle.

@Timmy1e, changing to an unversioned URL is only going to make it worse, because the MD5sums will be wrong every time they update that path.

ludenticus commented on 2017-12-14 14:25 (UTC) (edited on 2017-12-14 14:29 (UTC) by ludenticus)

In PKGBUILD, change version to 0.9.41 and md5sum to '567fa10ef0bfb15cc6481f537ac7cc7c'

Timmy1e commented on 2017-12-14 14:20 (UTC) (edited on 2017-12-14 14:24 (UTC) by Timmy1e)

The URL seems to be wrong, the new URL is <https://typora.io/linux/Typora-linux-x64.tar.gz>

==> Making package: typora 0.9.40-1 (Thu Dec 14 15:00:36 CET 2017)
==> Retrieving sources...
curl: (22) The requested URL returned error: 404 Not Found
==> ERROR: Failure while downloading 
https://typora.io/./linux/typora_0.9.40_amd64.deb

artfors commented on 2017-12-14 14:16 (UTC)

There is no 0.9.40 package. There is a 0.9.41

MrMuffin commented on 2017-08-10 22:26 (UTC)

@duckbrain I just updated Typora successfully. The app works perfectly :D

duckbrain commented on 2017-08-10 19:27 (UTC)

@MrMuffin You're right. The package was removed from https://www.typora.io/linux/Packages and there was a new release. At least this time upstream didn't just change the package without a new version number. I just pushed an update that at least builds a package. I haven't tested it running.

MrMuffin commented on 2017-08-10 16:16 (UTC)

Hi, I am getting this error: curl: (22) The requested URL returned error: 404 Not Found ==> ERROR: Failure while downloading https://typora.io/./linux/typora_0.9.30_amd64.deb Aborting... ==> ERROR: Makepkg was unable to build typora.

urldog commented on 2017-06-14 14:21 (UTC)

I was wondering why the linux package is a few dozen versions behind. Then I realized it's tracking the deb, instead of git. Typora is not open source. Oh well.

duckbrain commented on 2017-04-25 14:00 (UTC)

I did. My nightly diff of the Debian package index shows that they changed the package without incrementing the version. Thanks for catching that. I updated the release number to reflect that.

tareqmahmud9 commented on 2017-04-24 21:38 (UTC) (edited on 2017-04-24 21:39 (UTC) by tareqmahmud9)

@duckbrain ==> Validating source files with md5sums... typora_0.9.29_amd64.deb ... FAILED ==> ERROR: One or more files did not pass the validity check! Please Update Package Sums... Thanks :)

duckbrain commented on 2017-01-25 00:40 (UTC)

Thanks @XuanYuan. I added the dependency.

XuanYuan commented on 2017-01-24 04:00 (UTC)

Seems that it depends `libxss` as well.

duckbrain commented on 2016-10-10 14:51 (UTC)

@coffeemakr Thanks, I added the dependency and fixed the permission setting.

coffeemakr commented on 2016-10-10 06:53 (UTC)

typora depends on gconf: $ typora typora: error while loading shared libraries: libgconf-2.so.4: cannot open shared object file: No such file or directory after installing gconf it worked. The permission "fix" is quite ugly because it also sets all files as executable. I changed it to the following command: find "$pkgdir" -type d -exec chmod 755 {} \;

reflectionalist commented on 2016-10-07 04:50 (UTC)

Thanks for packaging this, so far the best Markdown editor.

j1simon commented on 2016-10-01 07:34 (UTC)

In the package there is information about licence: /usr/share/doc/typora/copyright

duckbrain commented on 2016-10-01 04:33 (UTC)

This has been updated to your version. The /usr/share/lintian/ directory is no longer packaged. I removed the license line because I can't seem to find one on the website. The source code is not available on Github, just supporting material and issue tracking.

j1simon commented on 2016-09-28 16:24 (UTC)

I think you should change the PKGBUILD: - It isn't necessary to put empty variables - license=('custom:"Copyright (c) 2014 GitHub Inc."') - There shouldn't be 'build' section. This package hasn't build step. - '/usr/share/lintian/' is unnecessary on Arch. - It's better use 'bsdtar' to extract deb contents. This is my version of PKGBUILD: pkgname=typora pkgver=0.9.19 pkgrel=2 pkgdesc="Typora will give you a seamless experience as both a reader and a writer." arch=('x86_64') filename="${pkgname}_${pkgver}_amd64.deb" url="https://typora.io/" license=('custom:"Copyright (c) 2014 GitHub Inc."') source=("https://typora.io/./linux/$filename") md5sums=('30b9881f6d698a5442dff96002d9d812') package() { bsdtar -xf data.tar.xz -C "$pkgdir/" rm -rf "${pkgdir}"/usr/share/lintian/ chmod -R 755 "$pkgdir" }

duckbrain commented on 2016-09-28 15:32 (UTC)

Forgot to update .SRCINFO. I'll need to set up a pre-commit hook for that.

j1simon commented on 2016-09-28 15:27 (UTC)

I think it lacks to update the version. yaourt doesn't detect changes and it doesn't upgrade.

duckbrain commented on 2016-09-28 13:48 (UTC)

@j1simon Thanks. That should be fixed.

j1simon commented on 2016-09-28 09:21 (UTC)

Please fix the permissions before pack: chmod -R 755