WIP: nix based build environment#417
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…upport Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Override nixpkgs mupdf derivation to version 1.27.0 with correct source hash and version string in the generated pkg-config file. Add pkg-config to nativeBuildInputs so PKG_CONFIG_PATH is populated in the dev shell. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…libmupdf-third stub Set CC/CXX/AR_arm_unknown_linux_gnueabihf so build scripts use Linaro rather than the Nix-wrapped clang for cross-compiled C crates (zstd-sys). Add libjpeg/libpng/gumbo/openjpeg/jbig2dec/bzip2/zlib to buildInputs for the native emulator target, and create a stub empty libmupdf-third.a (the Nix mupdf package bundles third-party symbols into one dylib). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The stub libmupdf-third.a is now created in mupdf's postInstall so it lives in the Nix store alongside libmupdf.dylib — reproducible for any developer, no ~/.cache writes needed. Remove nix/linaro-darwin.tar.bz2 gitignore entry: the tarball was a leftover from an abandoned local-file approach; nix/linaro.nix fetches directly from Google Drive via fetchurl. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| "aarch64-darwin" = { | ||
| url = "https://drive.usercontent.google.com/download?id=1ggMLM3VBwCYQuFTpJEC0OmyMkiDtYMju&export=download&confirm=t"; | ||
| hash = "sha256-rSP4JS/KsK8dxPwvdY7Cnb5zxbKbFYnVuKe/VIOIf/Q="; | ||
| }; |
There was a problem hiding this comment.
Are you cross compiling from MacOS to arm-unknown-linux-gnueabihf using this toolchain?
https://github.com/OGKevin/cadmus/blob/93cb8a1c5fcdd38566649798e5dfc4a5d8a79d55/devenv.nix#L41-L44
I wasn't aware that there is a way 🤔
There was a problem hiding this comment.
No, I am using the one from the Google drive link as stated in the BUILD.md
There was a problem hiding this comment.
There was a problem hiding this comment.
If you're not using it for cross-compilation, then why are you installing the toolchain on Darwin?
I used the official site to retrieve it. Just wasn't aware that there is a Darwin version that could be used for Cris-compilation, hence my question.
There was a problem hiding this comment.
I am cross compiling it, I have my patch running on both my kobos currently (ie adding latin support), I am also refining the interface to display a definition of the word directly on selecting a word (rather than having to click define, like in the original Kobo reader)!
There is a darwing version in the drive. I was saying no to using the linaro toolchain you linked.
|
Right, that’s pretty awesome.
I’m not sure Baskerville is accepting PRs. I’ll be more than happy to get a PR that enables cross compilation from Darwin using this toolchain in Cadmus.
Would be nice to see if the Darwin version can also be fetched from their official site, instead of some obscure Google Drive, though.
I’ll be able to do it myself later this month; if you haven’t or don’t want to contribute this to Cadmus.
|
The goal of this PR is to have a reproducible build environment in order to build plato for Kobo and plato emulator.
It uses the nix flakes to achieve this goal.
One nix is setup on your machine (used in a increasing number of projects); just do
nix developand you are ready to build, dist, and run the plato emulator.No more:
Was tested on MacOS only.
Happy to get more tests to see if it works well for everybody.
AI artifacts and commented code will be removed before this PR is merged.