Nixpkgs: lxml header files location problem

Created on 28 Dec 2015  路  4Comments  路  Source: NixOS/nixpkgs

nixos: 16.03pre73316.93d8671

when I install lxml with

nix-env -iA nixos.libxml2

the header files are in ../include/libxml2/libxml/*h. Most apps require headers and this additional subdirectory makes some problems.

I solved that by adding that path to C_INCLUDE_PATH, but probably better solution would be to remove this one level of directory, what do you think?

(my particular use case is to install lxml with virtualenv/pip)

Most helpful comment

@BernardNotarianni

My default.nix for build lxml and grab:

with import <nixpkgs> {}; {
  pyEnv = stdenv.mkDerivation {
    name = "py_libxml2_grab";
    buildInputs = [ stdenv libxml2 libxslt curl ];
    C_INCLUDE_PATH="${libxml2}/include/libxml2:${libxslt}/include/libxslt:${curl}/include/curl";
  };
}

Just use nix-shell . and then pip install lxml grab

All 4 comments

It's better to use pkgconfig. So either install it or do nix-shell -p libxml2 before using virtualenv

@domenkozar thank you for help. Looks like lxml is already using pkgconfig but I had no it installed.

  1. Still weird why there is one more directory level in the path
  2. Why do you think that nix-shell -p libxml2 could be helpful here, how it's different than nix-env -iA nixos.libxml2?

Hello @spinus

I have the same issue. Could you please describe how you solved it?

@BernardNotarianni

My default.nix for build lxml and grab:

with import <nixpkgs> {}; {
  pyEnv = stdenv.mkDerivation {
    name = "py_libxml2_grab";
    buildInputs = [ stdenv libxml2 libxslt curl ];
    C_INCLUDE_PATH="${libxml2}/include/libxml2:${libxslt}/include/libxslt:${curl}/include/curl";
  };
}

Just use nix-shell . and then pip install lxml grab

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lverns picture lverns  路  3Comments

ghost picture ghost  路  3Comments

ayyess picture ayyess  路  3Comments

matthiasbeyer picture matthiasbeyer  路  3Comments

copumpkin picture copumpkin  路  3Comments