[Nix-dev] Nix/Nixpkgs on Cygwin

Sander van der Burg - EWI S.vanderBurg at tudelft.nl
Thu May 29 15:21:46 CEST 2014


Yes I know this issue. It's a few years old actually.

Right now, I haven't checked the substituters things yet. First, because we don't have any prebuilt stuff on Hydra. Second, I think it should work with Perl bindings disabled, but I'm not entirely sure about that.

Regarding DLLs:

I know this is "impure", but we can still link libraries statically if we want. Or simply ignore the side effects or rebases. :P

Moreover, besides Win32 binaries Nix can also be useful for other kinds of components.

________________________________
From: Domen Kožar [domen at dev.si]
Sent: Thursday, May 29, 2014 3:15 PM
To: Sander van der Burg - EWI
Cc: nix-dev at cs.uu.nl
Subject: Re: [Nix-dev] Nix/Nixpkgs on Cygwin

Did you run into https://github.com/NixOS/nix/issues/19?


On Thu, May 29, 2014 at 3:08 PM, Sander van der Burg - EWI <S.vanderBurg at tudelft.nl<mailto:S.vanderBurg at tudelft.nl>> wrote:
Hello Nixers,

Recently I had to do couple of development tasks on *cough cough* MS Windows.

Unfortunately, Nix did not seem to work on it anymore, so I have decided revive the Cygwin support. I had to make a few subtle modifications to the Nix package manager, such as including cstdlib at several places, because a few functions were undeclared according to the compiler.

Moreover, the -std=c++0x gcc parameter caused another file not to compile because fdopen() could not be found (because it's not ANSI/ISO C). I solved it changing the gcc parameter to -std=gnu++0x

Currently, these changes live in my personal Nix fork:

https://github.com/svanderburg/nix/commit/7f685b6550d7393874fc6ef26b9a03a8ace2f90e

Moreover, I had to fix a couple of things in Nixpkgs. These changes also live in my personal fork of Nixpkgs:

https://github.com/svanderburg/nixpkgs/commit/9ec52d632302ad6267a83b563de9927f886e1817

Besides a couple of essential cygwin fixes, I also added support for x86_64-cygwin, which also seems to exist these days.

To make the Nix package manager work on Cygwin, I had to install the following Perl packages through CPAN (besides having all the relevant development packages installed):

perl -MCPAN -e 'install DBD::SQLite'
perl -MCPAN -e 'install WWW::Curl'

I compiled and installed Nix by running the following command-line instructions:

./configure --disable-perl-bindings
make BUILD_SHARED_LIBS=0
make BUILD_SHARED_LIBS=0 install

I disabled building shared libs, as they can't really be properly used with Nix on Cygwin anyway, so there is no need to investigate how to enable them.

I don't know if anyone is in favour of  getting these changes merged upstream? Our current policy is that "Cygwin is not officially supported". But if that doesn't matter, I can file a pull request so that anyone can benefit from these changes.

Moreover, any feedback is welcome!

Regards,

Sander van der Burg


_______________________________________________
nix-dev mailing list
nix-dev at lists.science.uu.nl<mailto:nix-dev at lists.science.uu.nl>
http://lists.science.uu.nl/mailman/listinfo/nix-dev


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20140529/ab8cd773/attachment-0001.html 


More information about the nix-dev mailing list