1- { stdenv
2- , lib
3- , fetchgit
4- , cmake
5- , llvmPackages
6- , enablePython ? false
7- , python ? null
1+ {
2+ stdenv ,
3+ lib ,
4+ fetchFromGitHub ,
5+ cmake ,
6+ python3 ,
7+ llvmPackages ,
8+ enablePython ? false ,
9+ python ? python3 ,
810} :
911
10- let pyEnv = python . withPackages ( p : with p ; [ numpy scipy ] ) ;
12+ let
13+ pyEnv = python . withPackages (
14+ p : with p ; [
15+ numpy
16+ scipy
17+ distutils
18+ ]
19+ ) ;
1120
12- in stdenv . mkDerivation rec {
21+ in
22+ stdenv . mkDerivation ( finalAttrs : {
1323 pname = "taco" ;
1424 version = "unstable-2022-08-02" ;
1525
16- src = fetchgit {
17- url = "https://github.com/tensor-compiler/${ pname } .git" ;
26+ src = fetchFromGitHub {
27+ owner = "tensor-compiler" ;
28+ repo = "taco" ;
1829 rev = "2b8ece4c230a5f0f0a74bc6f48e28edfb6c1c95e" ;
1930 fetchSubmodules = true ;
2031 hash = "sha256-PnBocyRLiLALuVS3Gkt/yJeslCMKyK4zdsBI8BFaTSg=" ;
2132 } ;
2233
34+ src-new-pybind11 = python . pkgs . pybind11 . src ;
35+
36+ postPatch = ''
37+ rm -rf python_bindings/pybind11/*
38+ cp -r ${ finalAttrs . src-new-pybind11 } /* python_bindings/pybind11
39+ find python_bindings/pybind11 -exec chmod +w {} \;
40+ '' ;
41+
2342 # Remove test cases from cmake build as they violate modern C++ expectations
2443 patches = [ ./taco.patch ] ;
2544
@@ -31,7 +50,7 @@ in stdenv.mkDerivation rec {
3150
3251 cmakeFlags = [
3352 "-DOPENMP=ON"
34- ] ++ lib . optional enablePython "-DPYTHON=ON" ;
53+ ] ++ lib . optional enablePython "-DPYTHON=ON" ;
3554
3655 postInstall = lib . strings . optionalString enablePython ''
3756 mkdir -p $out/${ python . sitePackages }
@@ -45,11 +64,11 @@ in stdenv.mkDerivation rec {
4564 # However, the python module works flawlessly.
4665 dontFixup = enablePython ;
4766
48- meta = with lib ; {
67+ meta = {
4968 description = "Computes sparse tensor expressions on CPUs and GPUs" ;
5069 mainProgram = "taco" ;
51- license = licenses . mit ;
70+ license = lib . licenses . mit ;
5271 homepage = "https://github.com/tensor-compiler/taco" ;
53- maintainers = [ maintainers . sheepforce ] ;
72+ maintainers = [ lib . maintainers . sheepforce ] ;
5473 } ;
55- }
74+ } )
0 commit comments