Skip to content

Instantly share code, notes, and snippets.

@foolnotion
Created August 13, 2020 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save foolnotion/a3e769e5a98a487f1732ad6498aabe4c to your computer and use it in GitHub Desktop.
Save foolnotion/a3e769e5a98a487f1732ad6498aabe4c to your computer and use it in GitHub Desktop.
let
pkgs = import <nixos-unstable> {};
stdenv = pkgs.gcc10Stdenv;
eigency = pkgs.python38Packages.buildPythonPackage rec {
pname = "eigency";
version = "1.77" ;
src = pkgs.python38Packages.fetchPypi {
inherit pname version;
sha256 = "13cf96e00020fd900aa5f8905036488afd27c89212bfc07b60ac5412073ea7d7";
};
doCheck = false;
# build time deps
nativeBuildInputs = with pkgs.python38Packages; [
cython
setuptools
setuptools_scm
];
## runtime deps
propagatedBuildInputs = with pkgs; [
python38Packages.numpy
eigen
];
meta = with pkgs.stdlib; {
homepage = "https://pypi.org/project/eigency";
};
};
in
pkgs.python38Packages.toPythonModule (stdenv.mkDerivation rec {
pname = "feat";
version = "0.4";
nativeBuildInputs = with pkgs; [
cmake
autoPatchelfHook
(python38.withPackages( ps: with ps; [ cython setuptools setuptools_scm ]))
];
buildInputs = with pkgs; [
eigen shogun eigency
];
enablePython = true;
CFLAGS = "-march=znver2 -O3";
src = pkgs.fetchFromGitHub {
owner = "lacava";
repo = "feat";
rev = "b778a44ae64deeb4a5d7c652ba593154f117ef6e";
sha256 = "1y16dwdy1cx7xxg5j90rzj1jyf4ccri8xrw5lsnx0krdap5a7fz7";
};
installPhase = ''
mkdir -p $out/bin
install -m755 -D feat $out/bin/feat
install -m755 -D libfeat_lib.so $out/bin/libfeat_lib.so
'';
# This is how the Python bindings should be built
# cd ../python
# python setup.py install --home=$out
meta = with stdenv.lib; {
description = "A feature engineering automation tool for learning data representations";
homepage = "https://github.com/lacava/feat";
license = stdenv.lib.licenses.gpl3;
platforms = stdenv.lib.platforms.linux;
};
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment