Leseratte10 / acsm-calibre-plugin

Calibre plugin for ACSM->EPUB and ACSM->PDF conversion.
https://www.mobileread.com/forums/showthread.php?t=341975
GNU General Public License v3.0
695 stars 24 forks source link

Exception when installing plugin in Flatpak Calibre #67

Open fkrull opened 1 year ago

fkrull commented 1 year ago

Bug description

When trying to import the plugin, Calibre installed via Flatpak shows the following exception:

Traceback (most recent call last):
  File "calibre/customize/ui.py", line 710, in initialize_plugin
  File "calibre_plugins.deacsm.__init__", line 226, in initialize
    from libadobe import createDeviceKeyFile, update_account_path, sendHTTPRequest
  File "/home/mara/Downloads/DeACSM_0.0.16.zip/libadobe.py", line 59, in <module>
    from oscrypto import keys
  File "/home/mara/.var/app/com.calibre_ebook.calibre/config/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/keys.py", line 5, in <module>
    from ._asymmetric import parse_certificate, parse_private, parse_public
  File "/home/mara/.var/app/com.calibre_ebook.calibre/config/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_asymmetric.py", line 27, in <module>
    from .kdf import pbkdf1, pbkdf2, pkcs12_kdf
  File "/home/mara/.var/app/com.calibre_ebook.calibre/config/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/kdf.py", line 9, in <module>
    from .util import rand_bytes
  File "/home/mara/.var/app/com.calibre_ebook.calibre/config/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/util.py", line 14, in <module>
    from ._openssl.util import rand_bytes
  File "/home/mara/.var/app/com.calibre_ebook.calibre/config/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_openssl/util.py", line 6, in <module>
    from ._libcrypto import libcrypto, libcrypto_version_info, handle_openssl_error
  File "/home/mara/.var/app/com.calibre_ebook.calibre/config/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_openssl/_libcrypto.py", line 24, in <module>
    from ._libcrypto_ctypes import (
  File "/home/mara/.var/app/com.calibre_ebook.calibre/config/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_openssl/_libcrypto_ctypes.py", line 47, in <module>
    raise LibraryNotFoundError('Error detecting the version of libcrypto')
oscrypto.errors.LibraryNotFoundError: Error detecting the version of libcrypto

This appears due to a bug in oscrypto with libssl version numbers that contain multiple digits (the runtime used by the Calibre Flatpak currently has OpenSSL 3.0.10). This was fixed in oscrypto (https://github.com/wbond/oscrypto/commit/d5f3437ed24257895ae1edd9e503cfb352e635a8) but not yet included in a release (https://github.com/wbond/oscrypto/issues/78).

Would it be possible to make a new release of DeACSM with a fixed bundled version of oscrypto?

Operating system

Linux

Which version of Calibre are you running?

6.26

Which version of the ACSM Input plugin are you running?

v0.0.16

Import type

No response

Further information

No response

LaHaine commented 1 year ago

I can confirm that DeACSM doesn't work with flatpak calibre, that's why I have reported this: https://github.com/flathub/com.calibre_ebook.calibre/issues/189

I can confirm that this workaround worked:

  1. Download DeACSM v0.0.16
  2. git clone https://github.com/wbond/oscrypto
  3. zip -r oscypto.zip oscrypto
  4. unzip DeACSM
  5. replace oscrypto.zip
  6. zip it up again

Then I could install the plugin in flatpak calibre.

Leseratte10 commented 1 year ago

This has nothing to do with Flatpak vs. non Flatpak. This is a bug in oscrypto that causes it to fail with OpenSSL 3.0.10 and newer. I'll try to add another patch for that later.

thilakm-git commented 1 year ago

Experiencing the same here.

edent commented 5 days ago

FWIW, the latest version worked find with my Flatpak install of Calibre.

LaHaine commented 3 days ago

FWIW, the latest version worked find with my Flatpak install of Calibre.

There wasn't a new release of the plug-in since this bug was opened.

Leseratte10 commented 3 days ago

Correct, 0.1.0 is still not released since there's still issues with migrating from 0.0.16 to 0.1.0. It can be downloaded from github and then be manually installed, though.

edent commented 3 days ago

Yes, I'm using the .16 one from GitHub.