[Nix-dev] mxe on NixOS

James Cook james.cook at utoronto.ca
Mon Jul 27 18:19:34 CEST 2015


>> You are trying to build something outside of a nix build environment.
>> Instead of calling make ecc. like you do on every other distro, in Nix
>> things are very different. You should write a .nix file describing how the
>> package should build and build it. It will be easier.
>>
>> Also 99% of the times errors like that are not an upstream issue but your
>> own issue on nixos.

I find I'm usually able to build things on NixOS just by manually
running configure, make &c. as long as I install all the dependencies
with nix-env. Sometimes I have to pass some flag to a package's
configure script to tell it where to find C headers or something like
that.

Of course under many circumstances it's nicer to have nix build things for you.

> Thanks for the reply.
>
> I think I did not succeed in explaining what MXE is and how it works. It
> would not make sense to create a nix expression for mxe; one does not build
> mxe like a normal application. Instead, one uses mxe to build for Windows.
> So compiling software with mxe is more like running a normal application at
> runtime rather than building a package.

Luca's suggestion may still be workable: if I understand right, you
could write a nix expression for each Windows library you want. You
would probably want to set the source to be mxe's source, and override
the build stage so it runs "make glib" or whatever. Personally, I'm
guessing you'd run into the same problem, but it could be worth a try.

(Of course, you might not want to use mxe that way, but it could still
be useful for figuring out what the problem is.)

James


More information about the nix-dev mailing list