Bug 258224 - deskutils/calibre: usbms relies on deleted HAL port
Summary: deskutils/calibre: usbms relies on deleted HAL port
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Guido Falsi
URL: https://github.com/kovidgoyal/calibre...
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-02 16:32 UTC by Dwayne MacKinnon
Modified: 2025-04-14 03:04 UTC (History)
0 users

See Also:
madpilot: maintainer-feedback+


Attachments
device mount patch v2 (12.05 KB, patch)
2025-03-18 14:26 UTC, Guido Falsi
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dwayne MacKinnon 2021-09-02 16:32:52 UTC
On FreeBSD, calibre relied on HAL for the mounting of ereaders that use USB mass storage (usbms). HAL was deleted from the ports system back in February 2021, and it appears that it was never a formal requirement of the port (probably relied on it being pulled in from the Desktop.)

I'm looking into replacing the HAL code with BSDisks/Udisks2, but I haven't been a programmer in a long, long time. I thought I'd file a bug report to see if someone with more current skills can help.

On an installed calibre the files in question are /usr/local/lib/calibre/calibre/devices/usbms/device.py and hal.py in the same directory.
Comment 1 Guido Falsi freebsd_committer freebsd_triage 2021-09-02 18:18:12 UTC
Hi,

Thanks for the report.

I'm actually aware of this, and was planning to do the same you propose (use libudisks and bsdisks), but I've been unable to make it work. Unluckily at present I can dedicate little time to this.

Also add that I don't have good knowledge of python.

If you want to try to create a patch even imperfect and post here I'll be happy to try to help.
Comment 2 Guido Falsi freebsd_committer freebsd_triage 2021-09-02 18:29:38 UTC
To be more specific I had problems finding how to access bsdisk and libudidsks from python to get the information I need to actually mount the devices.
Comment 3 Guido Falsi freebsd_committer freebsd_triage 2025-03-18 14:26:32 UTC
Created attachment 258762 [details]
device mount patch v2

Hi!

I've made some progress on this and created a patch that should work, and maybe acceptable to upstream.

I've attached here a patch against the port so it can be tested.

The patch against upstream is available at [1] as a draft pull request. I plan to promote it once I'm sure it works fine.


If anyone could test it and report back that would be appreciated.


[1] https://github.com/kovidgoyal/calibre/pull/2694
Comment 4 commit-hook freebsd_committer freebsd_triage 2025-03-21 18:29:07 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ea5a07ded849c996ed435fb8932bdda1690acd75

commit ea5a07ded849c996ed435fb8932bdda1690acd75
Author:     Guido Falsi <madpilot@FreeBSD.org>
AuthorDate: 2025-03-21 18:27:51 +0000
Commit:     Guido Falsi <madpilot@FreeBSD.org>
CommitDate: 2025-03-21 18:27:51 +0000

    deskutils/calibre: Update to 8.0.1, add UDisks2 device mounting

    I submitted the DBus/UDisks2 device mounting code upstream here:

    https://github.com/kovidgoyal/calibre/pull/2694

    PR:     258224

 deskutils/calibre/Makefile                         |   8 +-
 deskutils/calibre/distinfo                         |  14 +-
 .../files/patch-UDisks2-Device-Mounting (new)      | 288 +++++++++++++++++++++
 deskutils/calibre/files/user-agent-data.json       | 154 +++++------
 deskutils/calibre/pkg-plist                        |  10 +-
 5 files changed, 385 insertions(+), 89 deletions(-)
Comment 5 Guido Falsi freebsd_committer freebsd_triage 2025-03-21 18:30:26 UTC
Device mounting code committed to port with latest update.
Comment 6 Dwayne MacKinnon 2025-04-14 03:04:02 UTC
Hi, I just wanted to say thank you for all the work. It's really, *really* nice to not need to boot into my OpenSuSE partition to use Calibre with my Kobo anymore.