msys2 / MINGW-packages

Package scripts for MinGW-w64 targets to build under MSYS2.
https://packages.msys2.org
BSD 3-Clause "New" or "Revised" License
2.3k stars 1.23k forks source link

Add Nix #22459

Open Ericson2314 opened 2 weeks ago

Ericson2314 commented 2 weeks ago

Package name

Nix

Brief description of package

Nix, the purely functional package manager.

Nix has a Windows port in progress, which I am involved with. It is not yet feature-complete, but it does build. We understand if packaging software that isn't yet useful is putting the cart before the horse, but we would love to better do native builds of Nix while we finish the port, and also learn a bit more about MSYS / toolchain setups in the process.

Once we're far enough to be attempting to build Nixpkgs on Windows natively with Cygwin/MSYS, we'll also need to learn a lot from you all in general. (See https://github.com/NixOS/nixpkgs/pull/354137 for the first steps on that.) So consider this a hybrid packaging requestion / general knowledge sharing and collaboration request.

(And of course, if someday you all want to ditch pacman for nix, we won't complain :))

URL for package's homepage

Repo: https://github.com/nixos/nix

Chat for Port: https://matrix.to/#/#windows:nixos.org

Provide a basic test case to validate the package's functionality.

We have unit tests for the libraries that run, and some in-progress work to run the shell-script-based integration tests.

MINGW environments where you need the package

Are you willing to submit a PR?

I think one of us porting Nix to Windows could do it but we would need hand-holding. Ideally one of you could drive the PR, and we would be highly available to answer questions.

lazka commented 2 weeks ago

Would nix (as in the tool) target the Windows APIs via C++, or is this a cygwin port? Just to be sure.. :)

Ericson2314 commented 2 weeks ago

@lazka No Cygwin! :tada: We're cross building from Linux with MinGW now, and a previous version of the port (https://github.com/nix-windows/nix/commit/windows) in fact got things building with MSVC.

The newish C++ filesystem library helps a lot, here :)

puffnfresh commented 2 weeks ago

I'll take this on, since I've got an automated build of Nix using mingw64. There are two dependencies missing:

Kreijstal commented 2 weeks ago

@lazka No Cygwin! 🎉 We're cross building from Linux with MinGW now, and a previous version of the port (nix-windows/nix@windows) in fact got things building with MSVC.

The newish C++ filesystem library helps a lot, here :)

there are many programs still depending on autotools.. it would've be certainly easier if it was cygwin based. (Would support more from source built software as it is right now) But maybe there is less dependency on it than before.. We will see.

Kreijstal commented 2 weeks ago

@lazka No Cygwin! 🎉 We're cross building from Linux with MinGW now, and a previous version of the port (nix-windows/nix@windows) in fact got things building with MSVC. The newish C++ filesystem library helps a lot, here :)

there are many programs still depending on autotools.. it would've be certainly easier if it was cygwin based. (Would support more from source built software as it is right now) But maybe there is less dependency on it than before.. We will see.

Pd: maybe with nix, I can finally get guix :)

lazka commented 2 weeks ago

We've updated libgit2 now in #20396. In theory we could backport things if needed there.

Ericson2314 commented 2 weeks ago

@lazka Yeah if you would be open to a patch, I think it is a pretty non-invasive change. https://github.com/libgit2/libgit2/compare/v1.8.4..main/#diff-069ad7b34be69df5ba08a066f481b6d5b5f473894137065f33eebfc2a7722442 shows it is not yet landed in that patch release. I'll see what I can do if @puffnfresh doesn't beat me to it :).

lazka commented 2 weeks ago

https://github.com/msys2/MINGW-packages/pull/22492

Ericson2314 commented 2 weeks ago

Wonderful! Really appreciate that @lazka :)