use MacOS builtin security framework instead of homebrew - #126
Conversation
|
Thanks for the MR. I do not have a Mac to test this, though, so I'd prefer to get some feedback from other MacOS users if this fixes some of the outstanding issues on MacOS. Also, I noticed that you hard-coded "libcrypto.46.dylib" and "libssl.46.dylib" - is this a good idea / is this always the file name on all versions of MacOS and unlikely to change in the future? Or can this be made to dynamically find the proper file name? |
0190906 to
ce0ef87
Compare
re-write with better understanding of Mac security framework and dyld shared cache
6a85ac4 to
d145292
Compare
|
I thought the 'lib*.46.dylib' was just a last resort as a default to return, but it turns out that is what is needed for loading libadobe on MacOS with Homebrew openssl libs. MacOS doesn't actually have the files in its directory, but they are in its 'dyld shared cache' to be loaded. If you try to load something more generic like So this code tries the .46 version (available since 2020) and then the .35 version (available since 2015) and tests loading libadobe for each; if neither works it gives up with a message seen if running in the terminal. There's also:
How do we find someone else with a Mac to review this? Add to the Mobilread thread? |
|
Hi, I am running Calibre 8.5 on MacOS Sequoia 5.5 (x86_64) with homebrew installed. I am having the same problem, and I saw this PR, so thought I would test it on my own system. Here is my process for reproduction:
It installed cleanly! Then I registered an anonymous adobe ID and tested the import of an epub and a pdf from the adobe test library. Success again! Thanks for the plugin and the PR! |
|
Unfortunatelly the fix does not work for me. I still get: |
I also got the same error at first, but a couple of things helped me. Although it did not show up in the plugins list in the calibre settings, I found the old module in the |
|
I can confirm that this pull request works, on a x86 Mac running Sequoia 15.6.1. But as mentioned by others, the plugins folder must be properly cleaned, otherwise the old code and the new incoming plugin will step on each others toes. The old plugin cannot be cleanly removed through calibre's GUI; some GUI plugin stays, and can neither be removed nor disabled since its specially marked (In gaming terms, one could view this as a "softlock"...). Having the old plugin code still present results in all kinds of weird errors, such as the mentioned libcrypto-thingie. |
|
Thanks for confirming that this MR works, I guess then there's nothing that blocks it from getting merged anymore. The weird issue with plugin updates is unrelated to this MR. It always happens when updating from 0.0.16 to 0.1.0, I have not yet found a clean solution for that, and this is the main reason why version 0.1.0 still isn't released yet and has been stuck in beta for over a year. I will have to take another look at that eventually, but that's unrelated to the MacOS changes. |
|
Perhaps a small error message (with a link to a manual update instruction guide) when a previous install is detected might suffice. Might generate less work than trying to account for, and handle every corner case. |
|
I followed @mettavi's process (download zip at commit d145292, run Here's a summary compiled by Claude based on what I had to fix to get it installed: The problem: On modern Calibre (9.x, Python 3.14), this means the plugin's bare The fix: Run the build script with bash 4+ instead of the system bash. If you have Homebrew: After rebuilding with a modern bash, the plugin installed and loaded cleanly on Calibre 9.6.0. Suggestion for the script itself: It might be worth either adding a bash version check at the top of the script (with a clear error message), or replacing the |
|
Hi All, I've been unable to get this to install on Calibre 9.8.0 on macOS 26.5.1. It was a fresh install attempt and confirmed no references to ACSMInput and DeACSM in ~/Library/Preferences/calibre/plugins Used Homebrew Bash to run bundle_calibre_plugin and build the calibre-plugin.zip and get the "No module named 'oscrypto'" error on install to calibre. Exception log below Any thoughts? Thanks |
1e94d92 to
64df5ab
Compare
Admittedly with help from Claude and many hours trying different things, this works on my MacOS system to install and use the acsm calibre plugin with homebrew installed openssl@3 without 'brew un/link openssl@3'. Basically this just uses the system crypto libraries if they are available.
With this change to init.py, I can successfully load the plugin on MacOS Sequoia 15.4 with homebrew installed (and linked) openssl@3 and then drag in .acsm files and get the epub loaded.
Closes #106 and better addresses #109, #65 and #63.