[Nix-dev] Problem with builder #1 - nix-shell and nix-build behave differently

Daniel Hlynskyi abcz2.uprola at gmail.com
Thu May 14 07:39:09 CEST 2015


Problem: nix-build and nix-shell treat differently source root directory
When using nix-build, shell is in $sourceRoot after unpackPhase, when using
nix-shell, it is left in current directory. How can I make nix script
behave same when nix-building it and nix-shelling?

Side problem: is there shortcut for `${pkgs.python}/bin/python`?

How to reproduce:
run `nix-build default.nix`
then run `nix-shell default.nix --command "rm -rf QSci*; unpackPhase;
configurePhase"`
notice, that second one failed preConfigure step

Input: default.nix

let
     pkgs = import <nixpkgs> {};
in rec {

  qscintilla-python = pkgs.stdenv.mkDerivation rec {
    name = "qscintilla-python";

    src = pkgs.qscintilla.src;
    buildInputs = [ pkgs.python ];
    propagatedBuildInputs = [ pkgs.pyqt4 pkgs.qscintilla pkgs.qt4 ];

    preConfigure = "cd Python";
    #preConfigure = "cd $sourceRoot/Python"; #### <----- correct for
nix-shell, but wrong for nix-build
    configureScript = "${pkgs.python}/bin/python configure.py";
    configureFlags = "
          --destdir $out/lib/${pkgs.python.libPrefix}/site-packages
          --no-sip-files
          --no-qsci-api
          --pyqt PyQt4
          --qsci-incdir ${pkgs.qscintilla}/include
          --qsci-libdir ${pkgs.qscintilla}/lib
    ";
    dontAddPrefix = true;

  };
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20150514/0c51ef43/attachment.html 


More information about the nix-dev mailing list