Skip to content

WIP: nix based build environment#417

Open
rvlander wants to merge 14 commits intobaskerville:masterfrom
rvlander:sane-build-environment
Open

WIP: nix based build environment#417
rvlander wants to merge 14 commits intobaskerville:masterfrom
rvlander:sane-build-environment

Conversation

@rvlander
Copy link
Copy Markdown

@rvlander rvlander commented Apr 26, 2026

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 develop and you are ready to build, dist, and run the plato emulator.

No more:

  • manually install required package
  • manually downloading/extracting/pathing linaro toolchain

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.

rvlander and others added 14 commits April 19, 2026 18:46
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>
@rvlander rvlander changed the title Sane build environment WIP: nix based build environment Apr 26, 2026
Comment thread nix/linaro.nix
"aarch64-darwin" = {
url = "https://drive.usercontent.google.com/download?id=1ggMLM3VBwCYQuFTpJEC0OmyMkiDtYMju&export=download&confirm=t";
hash = "sha256-rSP4JS/KsK8dxPwvdY7Cnb5zxbKbFYnVuKe/VIOIf/Q=";
};
Copy link
Copy Markdown

@OGKevin OGKevin Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 🤔

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I am using the one from the Google drive link as stated in the BUILD.md

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

@rvlander rvlander May 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@OGKevin
Copy link
Copy Markdown

OGKevin commented May 4, 2026 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants