LEXUGE / oceanix

OpenCore bootloader manager with Nix
GNU General Public License v3.0
32 stars 1 forks source link

Compiling ACPI patches #3

Open JJTech0130 opened 1 year ago

JJTech0130 commented 1 year ago

I think it would be a cool feature if it could compile ACPI patches during build, just to reduce the amount of opaque, non-human-readable files in the git repo.

LEXUGE commented 1 year ago

Yes, that’s definitely within the scope of the project. However, I currently don’t have any customized ACPI code to compile. So I might not be able to test if it trielt works as intended. But I will try my best.

Feel free to ask questions on anything about the project as it is pretty much undocumented.

JJTech0130 commented 1 year ago

However, I currently don’t have any customized ACPI code to compile.

Well, I was thinking that all the ACPI patches would be compiled at build time, even off-the-shelf ones. So you could just decompile on of them to test it. I also think their sources are around somewhere?

LEXUGE commented 1 year ago

Even with the right process, decompiling and recompiling the patch may not give equivalent results. I will try work them out though

(I am usually super busy so don’t put high expectations on me, but I will get it done when time comes)

JJTech0130 commented 1 year ago

decompiling and recompiling the patch may not give equivalent results

Well, here are the original sources. Hopefully, compiling the same source file should produce an identical output. I seem to remember that some metadata about what compiled it might have been embedded? That might affect things.

You'll also probably have to nixify the iasl tool: would be good to not depend on a random blogger for the Linux build 🤣 Here's the monorepo, and the downloads page

LEXUGE commented 1 year ago

Thanks. And thankfully it’s already packaged as part of the nixpkgs

JJTech0130 commented 1 year ago

Didn't see that, was searching for iasl 🤦‍♂️ I didn't figure out that the unstable build had macOS support for a bit. Turns out you have to use it like this to get the unstable build:

nix-channel --add https://nixos.org/channels/nixpkgs-unstable unstable && nix-channel --update
# For some reason ~ does not work here?
nix-shell -I nixpkgs=$HOME/.nix-defexpr/channels/unstable/ -p acpica-tools

(as you can probably tell, I'm new to Nix)