From b3df77d150d9cf26549c695bd1f4f1b8b2323d26 Mon Sep 17 00:00:00 2001 From: lucasew Date: Fri, 3 Jan 2025 12:18:37 -0300 Subject: [PATCH] catboost: tweak, fix build Signed-off-by: lucasew --- pkgs/by-name/ca/catboost/package.nix | 42 +++++++++++++++------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/pkgs/by-name/ca/catboost/package.nix b/pkgs/by-name/ca/catboost/package.nix index 1d0ef404a667b..93c229d29f1ed 100644 --- a/pkgs/by-name/ca/catboost/package.nix +++ b/pkgs/by-name/ca/catboost/package.nix @@ -12,13 +12,14 @@ ragel, yasm, zlib, + gitUpdater, cudaSupport ? config.cudaSupport, cudaPackages ? { }, llvmPackages_12, pythonSupport ? false, }: let - inherit (llvmPackages) stdenv; + stdenv = if cudaSupport then cudaPackages.backendStdenv else llvmPackages.stdenv; in stdenv.mkDerivation (finalAttrs: { @@ -28,7 +29,7 @@ stdenv.mkDerivation (finalAttrs: { src = fetchFromGitHub { owner = "catboost"; repo = "catboost"; - rev = "refs/tags/v${finalAttrs.version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-I3geFdVQ1Pm61eRXi+ueaxel3QRb8EJV9f4zV2Q7kk4="; }; @@ -68,12 +69,9 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optionals stdenv.hostPlatform.isDarwin [ cctools ] - ++ lib.optionals cudaSupport ( - with cudaPackages; - [ - cuda_nvcc - ] - ); + ++ lib.optionals cudaSupport [ + cudaPackages.cuda_nvcc + ]; buildInputs = [ @@ -83,14 +81,11 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ] - ++ lib.optionals cudaSupport ( - with cudaPackages; - [ - cuda_cudart - cuda_cccl - libcublas - ] - ); + ++ lib.optionals cudaSupport [ + cudaPackages.cuda_cudart + cudaPackages.cuda_cccl + cudaPackages.libcublas + ]; env = { PROGRAM_VERSION = finalAttrs.version; @@ -101,6 +96,11 @@ stdenv.mkDerivation (finalAttrs: { CUDAHOSTCXX = lib.optionalString cudaSupport "${llvmPackages_12.stdenv.cc}/bin/cc"; NIX_CFLAGS_LINK = lib.optionalString stdenv.hostPlatform.isLinux "-fuse-ld=lld"; NIX_LDFLAGS = "-lc -lm"; + NIX_CFLAGS_COMPILE = toString ( + lib.optionals stdenv.cc.isClang [ + "-Wno-error=missing-template-arg-list-after-template-kw" + ] + ); }; cmakeFlags = [ @@ -123,7 +123,9 @@ stdenv.mkDerivation (finalAttrs: { runHook postInstall ''; - meta = with lib; { + passthru.updateScript = gitUpdater { rev-prefix = "v"; }; + + meta = { description = "High-performance library for gradient boosting on decision trees"; longDescription = '' A fast, scalable, high performance Gradient Boosting on Decision Trees @@ -131,10 +133,10 @@ stdenv.mkDerivation (finalAttrs: { learning tasks for Python, R, Java, C++. Supports computation on CPU and GPU. ''; changelog = "https://github.com/catboost/catboost/releases/tag/v${finalAttrs.version}"; - license = licenses.asl20; - platforms = platforms.unix; + license = lib.licenses.asl20; + platforms = lib.platforms.unix; homepage = "https://catboost.ai"; - maintainers = with maintainers; [ + maintainers = with lib.maintainers; [ PlushBeaver natsukium ];