File tree Expand file tree Collapse file tree 5 files changed +3214
-36
lines changed
Expand file tree Collapse file tree 5 files changed +3214
-36
lines changed Original file line number Diff line number Diff line change 1+ {
2+ callPackage
3+ , stdenv
4+
5+ , defaultCrateOverrides
6+ , nix-gitignore
7+
8+ , darwin
9+ , python3Packages
10+ , pkgconfig
11+
12+ , releaseBuild ? true
13+ } :
14+
15+ let
16+ rustNightly = callPackage ./nix/rust-nightly.nix { } ;
17+ in ( ( callPackage ./nix/finalfusion-python.nix { } ) . finalfusion_python { } ) . override {
18+ release = releaseBuild ;
19+ rust = rustNightly ;
20+
21+ crateOverrides = defaultCrateOverrides // {
22+ finalfusion-python = attr : rec {
23+ pname = "finalfusion-python" ;
24+ name = "${ pname } -${ attr . version } " ;
25+
26+ src = nix-gitignore . gitignoreSource [ ".git/" "*.nix" "/nix" ] ./. ;
27+
28+ buildInputs = stdenv . lib . optional stdenv . isDarwin darwin . Security ;
29+
30+ installCheckInputs = [ python3Packages . pytest ] ;
31+
32+ propagatedBuildInputs = [ python3Packages . numpy ] ;
33+
34+ doInstallCheck = true ;
35+
36+ installPhase = let
37+ sitePackages = python3Packages . python . sitePackages ;
38+ sharedLibrary = stdenv . hostPlatform . extensions . sharedLibrary ;
39+ in ''
40+ mkdir -p "$out/${ sitePackages } "
41+ cp target/lib/libfinalfusion-*${ sharedLibrary } \
42+ "$out/${ sitePackages } /finalfusion.so"
43+ export PYTHONPATH="$out/${ sitePackages } :$PYTHONPATH"
44+ '' ;
45+
46+ installCheckPhase = ''
47+ cargo fmt --all -- --check
48+ pytest
49+ '' ;
50+
51+ meta = with stdenv . lib ; {
52+ description = "Python module for finalfusion embeddings" ;
53+ license = licenses . asl20 ;
54+ platforms = platforms . all ;
55+ } ;
56+ } ;
57+
58+ pyo3 = attr : {
59+ buildInputs = [ python3Packages . python ] ;
60+ } ;
61+ } ;
62+ }
You can’t perform that action at this time.
0 commit comments