mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-29 00:53:57 +00:00
ced21f5e1a
The `buildPython*` function computes name from `pname` and `version`. This change removes `name` attribute from all expressions in `pkgs/development/python-modules`. While at it, some other minor changes were made as well, such as replacing `fetchurl` calls with `fetchPypi`.
33 lines
717 B
Nix
33 lines
717 B
Nix
{ stdenv
|
|
, buildPythonPackage
|
|
, nose
|
|
, scipy
|
|
, xgboost
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "xgboost";
|
|
inherit (xgboost) version src meta;
|
|
|
|
propagatedBuildInputs = [ scipy ];
|
|
checkInputs = [ nose ];
|
|
|
|
postPatch = let
|
|
libname = "libxgboost.${stdenv.hostPlatform.extensions.sharedLibrary}";
|
|
|
|
in ''
|
|
cd python-package
|
|
|
|
sed "s/CURRENT_DIR = os.path.dirname(__file__)/CURRENT_DIR = os.path.abspath(os.path.dirname(__file__))/g" -i setup.py
|
|
sed "/^LIB_PATH.*/a LIB_PATH = [os.path.relpath(LIB_PATH[0], CURRENT_DIR)]" -i setup.py
|
|
cat <<EOF >xgboost/libpath.py
|
|
def find_lib_path():
|
|
return ["${xgboost}/lib/${libname}"]
|
|
EOF
|
|
'';
|
|
|
|
postInstall = ''
|
|
rm -rf $out/xgboost
|
|
'';
|
|
}
|