-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
koreader: init at 2022.05.1 (built from source) #178557
Conversation
Force-push is to resolve the merge conflict caused by 466c2e3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heroic, I should say.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really have to vendor all of these? I'm sure koreader builds fine with any version of most of these dependencies. Using a vendored version has the disadvantage of longer build times and untimely security updates.
That is my next project! However, I think that the default If we diverge from the versions used by upstream, any quirks or bugs that arise from our version-bumps will create "support blowback" for upstream... people will complain to them about weird bugs that they can't reproduce without realizing that it's really our fault for bumping the version of something (say, My plan is to add a parameter So koreader = callPackage ../applications/misc/koreader/src.nix { unVendor = []; }
koreader-unvendored = callPackage ../applications/misc/koreader/src.nix { } We should not mislead people into thinking that
Yes, and the shorter build times are the main attraction for me, since I'm about to start hacking on koreader... soon my ebook reader will finally have a "totally ignore the touchscreen" mode like all of my dead-tree books do! |
:blushes: |
Our default should be secure. Does koreader have tests that we could use to make sure our versions work well? |
The main reason we "vendor" e.g. zstd is because the primary target is embedded systems. It should be perfectly fine to use djvulibre, freetype2, fribidi, giflib, glib (or perhaps rather sdcv; that's just a dependency), harfbuzz, libffi, libiconv, libjpeg-turbo, libpng, libunibreak, possibly luajit (if sufficiently recent), luasec/luasocket (if sufficiently recent), minizip, NOT MuPDF, sdcv, sqlite, zlib, and zstd from the system, probably a few more. NB The *zmq stuff is mesozoic era and incompatible with recent versions. But yes, if you run the tests you should get a reasonably decent indication. Doing so would require some time investment in koreader-base. For example by introducing some kind of |
Squashed. |
This expression (`koreader/default.nix`) builds koreader from source. The previous koreader expression has been renamed `koreader-bin` as suggested by @AndersonTorres, and has been moved to koreader/bin.nix. Co-authored-by: Anderson Torres <[email protected]>
This is stretching the word "embedded"... these aren't microcontrollers running an RTOS. All the popular ebook devices (Kindles and Kobos) are full-fledged
Thanks for clarifying. Does this statement apply to ereader builds as well? Because those are the ones that really matter. Being able to Also, curious, what is different about MuPDF? Koreader seems to backport a huge amount of material to mupdf-1.13.0; did something awful happen in the following release?
It is not clear that getting the tests to run inside the nix sandbox is feasible. They expect network access, only partly in order to download more lua packages that aren't used during the build. It's extremely tedious to work on them inside the sandbox because the tests run after the entire build has finished, and the build takes a long time, and AFAICT nix doesn't have good support for restarting partially-completed sandboxed builds. Modularizing the build into separate derivations would need to come first.
This is slightly funny since I don't run NixOS and am frequently told that my workstation isn't a "desktop" because it omits certain software ;) But I guess all terminology is loaded in some way. |
If To some extent that even applies to OpenWrt (I guess you wouldn't like its homepage), but there saying it's a full-fledged Linux is a lot more accurate because it's actually trying to be fairly generic, normal, and proper. It's not largely broken outside of the very few specific use cases that matter to the manufacturer. Use whichever word you like, but you have to approach it as if it were an embedded system, hic sunt dracones. If you approach it as if it were a regular Linux system since it looks like one you'll burn your hand. All that being said, if it doesn't blow up within the first few minutes it's probably sufficiently usable. Just don't count on some weird segfault not being the fault of the system's alleged glibc or some hilariously broken kernel module. ;-) (Kindle actually has a fairly decent kernel compared to most of these embedded devices, but to compensate for that they have an extremely untrustworthy FUSE mount.)
Yes, it changed everything about the API so that it'd be easier to maintain going forward. Porting that over constitutes an effort no one has found or made the time for.
But does the concept make sense to you? ;-) |
@Frenzie, thank you for patiently explaining so many things to me in this thread. You've been very generous with your time. I've been thinking a lot about this PR. I still think that nixpkgs' amazing support for cross-compilation would make koreader's build process much simpler and more maintainable. I do a lot of cross-compilation and it's very hard to go back. However I'm no longer think it's a good idea to build the ereader/device builds of koreader from an expression kept in the nixpkgs repo. With very few exceptions, nixpkgs doesn't keep old versions of things around for very long. That policy simply doesn't work for things like koreader that have to deal with manufacturer-supplied kernels and userspaces. I'm starting to think that the
There's a similar situation with another piece of software which I am very fond of, coreboot. Curiously, coreboot's version-pinned toolchain is in nixpkgs, but coreboot itself isn't.
Yes, absolutely. Chromium and firefox both vendor enormous quantities of libraries (probably more than koreader does) but only use them if the linker can't find a corresponding system library. For situations where automatic detection is inappropriate I belive the manual option is |
Reviewers: it will be easier to read this PR if you look at each commit individually, rather than smashed together the way the "Files Changed" tab shows them.
The first three commits are trivial; they are included because without them CI will fail. The fourth commit renames the existing
koreader
expression tokoreader-bin
without any changes to it. The fifth commit marks thesourceProvenance
ofkoreader-bin
.The sixth commit is where all the interesting stuff is.
Two utility functions,
mapAttrsToConcatStringSep
andbuildLuaRock
, near the top of the file are likely to be useful outside of this particular package. They have comments suggesting they might be moved elsewhere. I prefer to do that in separate PRs following this one.Ancestral WIP-draft was #178320
Description of changes
This expression (
koreader/src.nix
) builds koreader from source.The previous koreader expression has been renamed
koreader-bin
as suggested by @AndersonTorres, and has been moved to koreader/bin.nix.Things done
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)