[Nix-dev] mxe on NixOS

Andrew Kelley superjoe30 at gmail.com
Tue Aug 18 07:51:27 CEST 2015


On Mon, Aug 17, 2015 at 10:13 PM, James Cook <james.cook at utoronto.ca> wrote:

> No, I'm not using mxe at all, and I've only tried running autogen.sh.
>
> Unless someone chimes in and points out why building glib outside
> nix-shell isn't working, a couple of ideas if you haven't already
> tried them:
>
> * Try starting with the glib derivation: add autoconf, automake and
> libtool to pkgs/development/libraries/glib/default.nix and use
> nix-shell -A glib.
>

I forked nixpkgs and then did this modification:

diff --git a/pkgs/development/libraries/glib/default.nix
b/pkgs/development/libraries/glib/default.nix
index fb9c361..ad2eba4 100644
--- a/pkgs/development/libraries/glib/default.nix
+++ b/pkgs/development/libraries/glib/default.nix
@@ -1,5 +1,6 @@
 { stdenv, fetchurl, pkgconfig, gettext, perl, python
 , libiconv, libintlOrEmpty, zlib, libffi, pcre, libelf
+, autoconf, automake, libtool

 # this is just for tests (not in closure of any regular package)
 , coreutils, dbus_daemon, libxml2, tzdata, desktop_file_utils,
shared_mime_info, doCheck ? false
@@ -55,7 +56,7 @@ stdenv.mkDerivation rec {

   setupHook = ./setup-hook.sh;

-  buildInputs = [ libelf ]
+  buildInputs = [ libelf autoconf automake libtool ]
     ++ optionals doCheck [ tzdata libxml2 desktop_file_utils
shared_mime_info ];

   nativeBuildInputs = [ pkgconfig gettext perl python ];


Then I tried `NIX_PATH=nixpkgs=/home/andy/dev/nixpkgs nix-shell -A glib`
but it did not need to recompile glib. Not sure what's going on with that.

Then I tried `nix-build -A glib` which as I understand uses the current
directory (which was /home/andy/dev/nixpkgs) and that did trigger a build
of glib, which succeeded.


>
> * With that method, can you build vanilla, non-mxe glib?
> (https://github.com/GNOME/glib) If not, we must be doing something
> different...
>

Do you mean building it from source using ./autogen.sh as you did earlier?

I tried that just now and it worked fine. I used this for nix-shell:

with import <nixpkgs> {}; {
  glibEnv = stdenv.mkDerivation {
    name = "glib";
    buildInputs = [
      gnome.gtk_doc
      autoconf
      automake
      gnumake
      bison
      cmake
      flex
      gettext
      gperf
      intltool
      libtool
      pkgconfig
      openssl
      ruby
      scons
      unzip
      python
      wget
      zlib
      libffi
    ];
  };
}

The extra packages are packages that are in the mxe nix-shell environment;
I thought I'd try to keep the environments close to see what would happen.


>
> * If you can successfully build ordinary glib that way, but can't
> build mxe glib, it might be time to take it back to the mxe people.
>

OK so it sounds like maybe this is an mxe issue after all?


>
> James
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20150817/05499f7e/attachment.html 


More information about the nix-dev mailing list