noembryo / KoHighlights

KOHighlights is a utility for viewing KOReader's highlights and/or export them to simple text, html, csv or markdown files.
MIT License
128 stars 5 forks source link

No macOS binary in downloads #10

Closed retrography closed 3 years ago

retrography commented 3 years ago

I noticed there is no macOS binary included on the downloads page, so I created one using Platypus (https://sveinbjorn.org/platypus). Feel free to download and include it. Obviously, you are welcome to test it or have it tested first. The package is supposed to be self-contained with no need for Python or library installations (the whole Python3 venv is included). I have also included the few resource files that I have used to compile the package for future reference and reproduction purposes.

A screenshot:

Screenshot 2020-12-03 at 15 19 35
noembryo commented 3 years ago

Oh, that was very kind of you.. Thank you!

Tried to run it with an older OSX 10.8.5 virtual machine I had, but failed. What is the minimum MacOS version that I should use?

retrography commented 3 years ago

This is what I read on Platypus' website:

The latest version is Platypus 5.3, released on November 25th, 2018. Platypus and Platypus-generated applications require macOS 10.8 or later, and are 64-bit Intel binaries.

So, it is strange that it didn't work for you. Do you get any decipherable error?

And does Platypus run on your VM? Maybe you can use the same Platypus profile I have shared with you to recreate the executable bundle.

retrography commented 3 years ago

On a second thought: Is it possible that the Python binary I have included is not compatible with 10.8? You can check that by entering the bundle's directory and looking into the resources to find the venv, then running the Python binary. Sorry if I am explaining the obvious, but I am not sure how much you know about MacOS.

noembryo commented 3 years ago

Well, do explain the obvious, because I know close to nothing about macs...

I found some shortcuts for python, python3 and python3.9 inside the bin of the app, but none of then run... From the terminal I could call only Python 2.7xx (the only one installed), so that is why the compiled app doesn't run. It must be relying on the system's installed Python versions...

mac1

retrography commented 3 years ago

Actually, the alias refers to the python binary within the directory. The run.sh file that I use to launch your main.py script uses the venv python anyway.

But here is the culprit:

for OS X 10.9 and later

As reported here. The current python binaries are not compatible with macOS versions older than 10.9. We will have to find someone with a newer version of macOS to test the bundle. I will see if I can send it to a friend.

Sincerely, Platypus is not the best way to make self-contained Python-based executables, but I used it because I have a lot of issues running pyinstaller and py2app (which are the better solutions) since upgrading to macOS Big Sur.

noembryo commented 3 years ago

Actually, the alias refers to the python binary within the directory.

Well, I can't find a Python binary anywhere inside the bin directory. What you're seeing in the screenshot is the Info of the python alias, that refers to itself! I must be missing something here...

Is it possible to check the app at a system without any Python 3 installations?

retrography commented 3 years ago

Oh, now I see. You are right, there are only aliases. I just copied the python binary manually in the bundle and re-uploaded the zip file. Would you mind downloading and trying it again?

noembryo commented 3 years ago

Nope, doesn't run. It seems that its still looking for your 3.9 installation..

This is what I get when I run the Python3 executable: Mac2

retrography commented 3 years ago

It is still searching for Python DLLs. The VENV solution is what the developer of Platypus suggested for creating self-contained executables out of Python scripts. Apparently there are issues with that. Let me find another solution.

noembryo commented 3 years ago

Bummer... Thank you for your time though :o)

retrography commented 3 years ago

I couldn’t find a proper way to do it, given that Platypus doesn’t package well, py2app is outdated and pyinstaller runs into errors on Big Sur. I just discovered PyOxidizer, though, and I will give it a shot when I find some time. On Dec 4, 2020, 00:37 +0100, noEmbryo notifications@github.com, wrote:

Bummer... Thank you for your time though :o) — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

noembryo commented 3 years ago

@retrography If you succeed in the creation of a MacOS binary, notify me to upload it in the newer release.. Thank you for your time.

retrography commented 3 years ago

I have managed to build it using Nuitka, PySide and Qt4 (which is supported by Nuitka), but that Qt version is visually broken on MacOS with high dpi. On the other hands, it seems PySide2 has issues, not only with Nuitka, but also with the other Python compiler suites. So, I am stuck with a dilemma where PySide2 is not supported by exe makers, and PySide + Qt4 do not work properly on modern MacOS (or I fail to see how).

I have also tried patching KoHighlights into using PySide2/Python3/Qt5 uniquely by removing backward compatibility. It looks great on MacOS! I then minimally patched Nuitka and tricked it into doing with PySide2 what it normally does with PySide to package it. It seems to do well, except that it keeps searching for a few dependencies under the wrong directories (in system folders, etc). If you want I can upload these somewhere for you to see. But my conclusion is that unless PySide2 issues with compilers are resolved, it is very difficult to produce self-contained execs of KoHighlights for MacOS. Meanwhile, it may be possible to make an executable with a single dependency (e.g. Qt5). Worth trying? On Dec 21, 2020, 18:19 +0100, noEmbryo notifications@github.com, wrote:

@retrography If you succeed in the creation of a MacOS binary, notify me to upload it in the newer release.. Thank you for your time. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

noembryo commented 3 years ago

For the last couple of releases I've included an archive with PySide2/Python 3 source files. I have test them on Windows using Python 3.7.2 and they work OK. So you just have to find a way to fix your PyInstaller problem (which is what I use both in windows and Linux)

elain commented 1 year ago

download

Error (400) Something went wrong. Don't worry, your files are still safe and the Dropbox team has been notified. Check out our Status Page to see if there is a known incident, our Help Center and forums for help, or head back to home.

noembryo commented 1 year ago

@elain Is your message connected with the compiling of a mac OS X binary that is discussed in this issue somehow?