I’m packaging cgal-bindings for NixOS, which depends on a number of C and C++ libraries. When I attempt to call the package, it outputs the following:
Executing setuptoolsBuildPhase
You are missing boost-thread
You are missing the gmp library
You are missing the mpfr library
You are missing the CGAL library
This is my package definition:
{ lib, stdenv
, fetchPypi
, python
, buildPythonPackage
, buildPythonApplication
, setuptoolsBuildHook
, boost
, swig
, eigen
, tbb
, cgal_5
#cgal dependencies
, gmp
, mpfr
}:
buildPythonPackage rec {
pname = "cgal-bindings";
version = "1.2";
src = fetchPypi {
inherit pname version;
sha256 = "1b5aj83b1fv5h8dc2qg2s0c959njnpr884i30hni370la0s30l0x";
};
nativeBuildInputs = [ setuptoolsBuildHook ];
buildInputs = [ boost swig eigen tbb gmp mpfr cgal_5];
meta = with lib; {
description = "CGAL bindings using SWIG";
homepage = "http://cgal.org";
license = with licenses; [ gpl3Plus lgpl3Plus];
platforms = platforms.all;
#maintainers = [ maintainers.raskin ];
};
}
And it’s called through the following nix-shell script
{ pkgs ? import <nixpkgs> {} }:
let
my-python-package = ps: ps.callPackage ./cgal-python {};
python-with-my-packages = pkgs.python3.withPackages(ps: with ps; [
(my-python-package ps)
]);
in
(pkgs.buildFHSUserEnv {
name = "test-fhs-env";
targetPkgs = with pkgs; pkgs: [
python-with-my-packages
];
}).env
The setup.py
associated with the PyPI package finds libraries, with distutils.compiler.find_library_file
which seems like the standard way of doing it. Furthermore, if I create an FHS env with the dependencies and attempt to install cgal-bindings
through pip, like so:
nix-shell ./test-fhs.nix
python -m venv .vev
source .venv/bin/activate
pip install cgal-bindings
Then the errors about missing libraries are limited to just:
You are missing the CGAL library
(This likely has to do with the fact that CGAL is a header only library, which is a problem I’ll have to address later)
Installing the dependencies with targetPkgs
in an FHS env allows them to be found by the package, but installing them via. buildInputs
does not seem to have this effect, which is a little perplexing.
What do I have to do in order to get the package to find these libraries? Why isn’t that the default Behaviour?