Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calibre fix darwin build #373940

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft

Conversation

pitkling
Copy link
Member

@pitkling pitkling commented Jan 15, 2025

This is another attempt at getting calibre to work on Darwin, following in the footsteps of draft PR #324666 (by @eliandoran), which itself is based on PR #280559 (by @midchildan). It consists of multiple package updates of calibre's dependencies for Darwin (some from the previous PRs, some added by myself, one from yet another PR that is still in progress) plus an adapted main commit from the previous PRs to fix calibre itself on Darwin.

I would appreciate if @eliandoran and/or @midchildan and the calibre maintainer (@pSub) could take a look. Since the other PRs were somewhat dated and had merge conflicts, I thought it would be best to open a new one. But if you would rather continue one of the old PRs, feel free to do so (and pick from this draft PR whatever you feel suitable).

Specifically, the different commits do the following:

  • commits 1 – 4: Update of onnxruntime that enables compilation on darwin, cherry picked from PR onnxruntime: 1.18.1 -> 1.20.1; eigen: 3.4.0 -> 3.4.0-unstable-2022-05-19 #364362. Will be dropped once that PR is merged and reaches master.
  • commits 5 – 9: package updates of calibre's dependencies to make them darwin compatible
    • commit 5: Extend sox target platform from linux to unix, cherry picked from draft PR calibre: fix darwin build #324666.
    • commit 6: Update of speechd to enable compilation on darwin.
    • commit 7: Update of mbrola to enable compilation on darwin.
    • commits 8 – 9: Fixed packaging issue in macfsevents + jaconv that caused a failure because of a file collision when both were added to a python environment.
  • commit 10: main commit fixing calibre, adapted from PR calibre: fix darwin build #324666
    • main differences:
      • use new apple-sdk
      • keep pyqt6-webengine (with the additional packaged updates, this seems to work now)
      • remove some more of calibre's tests (see comments in package.nix)

I haven't pinged the maintainers of the updated calibre dependencies yet, since I first wanted to hear back from the original PRs' committers. The updates seem al rather minor, but if someone things (some of) these should be their own PRs, I am happy to extract them.

Current State on Darwin

So far I only tested the main calibre binary on Darwin, which seems to work fine except for some issue seemingly with the wrapper. In particular, starting calibre on Darwin with a my existing calibre library in place creates a new ebook .calibre-wrapped with the contents of the calibre run script (created by calibre during installation). Also, opening one of the existing books for viewing in the GUI via double clicking opens that book successfully, but seemingly also tries to open the .calibre-wrapped book which naturally throws an error.

I have not yet investigated those problems, but will update this description once I did.

For completeness sake: Note that there are also two PRs that aim to bring calibre to Darwin by packaging the prebuilt binaries, see PR #352851 and PR #371442.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@ofborg ofborg bot added the 6.topic: darwin Running or building packages on Darwin label Jan 15, 2025
mweinelt and others added 10 commits January 19, 2025 12:56
Fast forward to a version required by onnxruntime.

(cherry picked until PR NixOS#364362 is merged)
(cherry picked until PR NixOS#364362 is merged)
The upgrade to `0.12.0-rc4` enables building `speechd-minimal` on Darwin.
To include fixes (specifically numediart/MBROLA@d0119cc and numediart/MBROLA@19f31eb) that enable compilation on Darwin.
`data_files` installs into Python's installation prefix (not into the directory of the python module), potentially causing collisions if other packages do the same (with such general files).
`data_files` installs into Python's installation prefix (not into the directory of the python module), potentially causing collisions if other packages do the same (with such general files).
based on a commit of  @midchildan from draft PR NixOS#324666
@pitkling pitkling force-pushed the calibre-fix-darwin-build branch from 92defa9 to 935ea6d Compare January 19, 2025 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: cuda Parallel computing platform and API 6.topic: darwin Running or building packages on Darwin 6.topic: python 10.rebuild-darwin: 5001+ 10.rebuild-linux: 5001+
Projects
Status: New
Development

Successfully merging this pull request may close these issues.

4 participants