From da8eea70a5bc61bb4b979e3e242bfefe4ad2174b Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Mon, 25 Nov 2024 17:22:01 +0800 Subject: [PATCH 1/2] taco: nixfmt --- pkgs/by-name/ta/taco/package.nix | 34 ++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/pkgs/by-name/ta/taco/package.nix b/pkgs/by-name/ta/taco/package.nix index a2f2f933214c..f78e535e80ec 100644 --- a/pkgs/by-name/ta/taco/package.nix +++ b/pkgs/by-name/ta/taco/package.nix @@ -1,15 +1,23 @@ -{ stdenv -, lib -, fetchgit -, cmake -, llvmPackages -, enablePython ? false -, python ? null +{ + stdenv, + lib, + fetchgit, + cmake, + llvmPackages, + enablePython ? false, + python ? null, }: -let pyEnv = python.withPackages (p: with p; [ numpy scipy ]); +let + pyEnv = python.withPackages ( + p: with p; [ + numpy + scipy + ] + ); -in stdenv.mkDerivation rec { +in +stdenv.mkDerivation rec { pname = "taco"; version = "unstable-2022-08-02"; @@ -31,7 +39,7 @@ in stdenv.mkDerivation rec { cmakeFlags = [ "-DOPENMP=ON" - ] ++ lib.optional enablePython "-DPYTHON=ON" ; + ] ++ lib.optional enablePython "-DPYTHON=ON"; postInstall = lib.strings.optionalString enablePython '' mkdir -p $out/${python.sitePackages} @@ -45,11 +53,11 @@ in stdenv.mkDerivation rec { # However, the python module works flawlessly. dontFixup = enablePython; - meta = with lib; { + meta = { description = "Computes sparse tensor expressions on CPUs and GPUs"; mainProgram = "taco"; - license = licenses.mit; + license = lib.licenses.mit; homepage = "https://github.com/tensor-compiler/taco"; - maintainers = [ maintainers.sheepforce ]; + maintainers = [ lib.maintainers.sheepforce ]; }; } From 31efc3ee347f57ff5363581dedb933d0020faf6d Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Mon, 25 Nov 2024 17:25:36 +0800 Subject: [PATCH 2/2] python312Packages.taco: fix build --- pkgs/by-name/ta/taco/package.nix | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/ta/taco/package.nix b/pkgs/by-name/ta/taco/package.nix index f78e535e80ec..e80d2b7e3b1b 100644 --- a/pkgs/by-name/ta/taco/package.nix +++ b/pkgs/by-name/ta/taco/package.nix @@ -1,11 +1,12 @@ { stdenv, lib, - fetchgit, + fetchFromGitHub, cmake, + python3, llvmPackages, enablePython ? false, - python ? null, + python ? python3, }: let @@ -13,21 +14,31 @@ let p: with p; [ numpy scipy + distutils ] ); in -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "taco"; version = "unstable-2022-08-02"; - src = fetchgit { - url = "https://github.com/tensor-compiler/${pname}.git"; + src = fetchFromGitHub { + owner = "tensor-compiler"; + repo = "taco"; rev = "2b8ece4c230a5f0f0a74bc6f48e28edfb6c1c95e"; fetchSubmodules = true; hash = "sha256-PnBocyRLiLALuVS3Gkt/yJeslCMKyK4zdsBI8BFaTSg="; }; + src-new-pybind11 = python.pkgs.pybind11.src; + + postPatch = '' + rm -rf python_bindings/pybind11/* + cp -r ${finalAttrs.src-new-pybind11}/* python_bindings/pybind11 + find python_bindings/pybind11 -exec chmod +w {} \; + ''; + # Remove test cases from cmake build as they violate modern C++ expectations patches = [ ./taco.patch ]; @@ -60,4 +71,4 @@ stdenv.mkDerivation rec { homepage = "https://github.com/tensor-compiler/taco"; maintainers = [ lib.maintainers.sheepforce ]; }; -} +})