From 815143af0f676f4d4dd97d8655244a99f4b174c6 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Thu, 7 Dec 2023 05:49:22 +0100 Subject: [PATCH] treewide: use lib.splitVersion --- pkgs/applications/office/wpsoffice/default.nix | 4 ++-- pkgs/development/compilers/openjdk/openjfx/17.nix | 4 ++-- pkgs/development/python-modules/torch/default.nix | 2 +- pkgs/games/armagetronad/default.nix | 2 +- pkgs/os-specific/linux/nvidia-x11/default.nix | 2 +- pkgs/tools/admin/colmena/default.nix | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/applications/office/wpsoffice/default.nix b/pkgs/applications/office/wpsoffice/default.nix index 87c0183e7e3d..d336b9cd5ba5 100644 --- a/pkgs/applications/office/wpsoffice/default.nix +++ b/pkgs/applications/office/wpsoffice/default.nix @@ -24,10 +24,10 @@ stdenv.mkDerivation rec { version = "11.1.0.11711"; src = if useChineseVersion then fetchurl { - url = "https://wps-linux-personal.wpscdn.cn/wps/download/ep/Linux2019/${lib.last (lib.splitString "." version)}/wps-office_${version}_amd64.deb"; + url = "https://wps-linux-personal.wpscdn.cn/wps/download/ep/Linux2019/${lib.last (lib.splitVersion version)}/wps-office_${version}_amd64.deb"; hash = "sha256-JHSTZZnOZoTpj8zF4C5PmjTkftEdxbeaqweY3ITiJto="; } else fetchurl { - url = "https://wdl1.pcfg.cache.wpscdn.com/wpsdl/wpsoffice/download/linux/${lib.last (lib.splitString "." version)}/wps-office_${version}.XA_amd64.deb"; + url = "https://wdl1.pcfg.cache.wpscdn.com/wpsdl/wpsoffice/download/linux/${lib.last (lib.splitVersion version)}/wps-office_${version}.XA_amd64.deb"; hash = "sha256-2apkSE/8Wm6/OQ4x5n1PE1emhovqOgD0NVTY5QZZTYA="; }; diff --git a/pkgs/development/compilers/openjdk/openjfx/17.nix b/pkgs/development/compilers/openjdk/openjfx/17.nix index 65d6697c6ef7..b91bde152554 100644 --- a/pkgs/development/compilers/openjdk/openjfx/17.nix +++ b/pkgs/development/compilers/openjdk/openjfx/17.nix @@ -14,8 +14,8 @@ let java = openjdk17_headless; }); - dashed-icu-version = lib.concatStringsSep "-" (lib.splitString "." (lib.getVersion icu71)); - underscored-icu-version = lib.concatStringsSep "_" (lib.splitString "." (lib.getVersion icu71)); + dashed-icu-version = lib.concatStringsSep "-" (lib.splitVersion (lib.getVersion icu71)); + underscored-icu-version = lib.concatStringsSep "_" (lib.splitVersion (lib.getVersion icu71)); icu-data = fetchurl { url = "https://github.com/unicode-org/icu/releases/download/release-${dashed-icu-version}/icu4c-${underscored-icu-version}-data-bin-l.zip"; hash = "sha256-pVWIy0BkICsthA5mxhR9SJQHleMNnaEcGl/AaLi5qZM="; diff --git a/pkgs/development/python-modules/torch/default.nix b/pkgs/development/python-modules/torch/default.nix index b648e2d7bf36..986b57c8548e 100644 --- a/pkgs/development/python-modules/torch/default.nix +++ b/pkgs/development/python-modules/torch/default.nix @@ -180,7 +180,7 @@ in buildPythonPackage rec { # Strangely, this is never set in cmake substituteInPlace cmake/public/LoadHIP.cmake \ --replace "set(ROCM_PATH \$ENV{ROCM_PATH})" \ - "set(ROCM_PATH \$ENV{ROCM_PATH})''\nset(ROCM_VERSION ${lib.concatStrings (lib.intersperse "0" (lib.splitString "." rocmPackages.clr.version))})" + "set(ROCM_PATH \$ENV{ROCM_PATH})''\nset(ROCM_VERSION ${lib.concatStrings (lib.intersperse "0" (lib.splitVersion rocmPackages.clr.version))})" '' # Detection of NCCL version doesn't work particularly well when using the static binary. + lib.optionalString cudaSupport '' diff --git a/pkgs/games/armagetronad/default.nix b/pkgs/games/armagetronad/default.nix index 275b878d2619..fb0117f3e93e 100644 --- a/pkgs/games/armagetronad/default.nix +++ b/pkgs/games/armagetronad/default.nix @@ -82,7 +82,7 @@ let let # Split the version into the major and minor parts versionParts = lib.splitString "-" version; - splitVersion = lib.splitString "." (builtins.elemAt versionParts 0); + splitVersion = lib.splitVersion (builtins.elemAt versionParts 0); majorVersion = builtins.concatStringsSep "." (lib.lists.take 2 splitVersion); minorVersionPart = parts: sep: expectedSize: diff --git a/pkgs/os-specific/linux/nvidia-x11/default.nix b/pkgs/os-specific/linux/nvidia-x11/default.nix index d9caae7f457f..90e726b080a4 100644 --- a/pkgs/os-specific/linux/nvidia-x11/default.nix +++ b/pkgs/os-specific/linux/nvidia-x11/default.nix @@ -66,7 +66,7 @@ rec { openSha256 = "sha256-K14Av5fCda1J9o5pkQBhmwW34d2hgqrF3J99FWPsNjM="; settingsSha256 = "sha256-jCRfeB1w6/dA27gaz6t5/Qo7On0zbAPIi74LYLel34s="; persistencedSha256 = "sha256-WviDU6B50YG8dO64CGvU3xK8WFUX8nvvVYm/fuGyroM="; - url = "https://developer.nvidia.com/downloads/vulkan-beta-${lib.concatStrings (lib.splitString "." version)}-linux"; + url = "https://developer.nvidia.com/downloads/vulkan-beta-${lib.concatStrings (lib.splitVersion version)}-linux"; }; # data center driver compatible with current default cudaPackages diff --git a/pkgs/tools/admin/colmena/default.nix b/pkgs/tools/admin/colmena/default.nix index ceb544753b21..6cb763c88d1e 100644 --- a/pkgs/tools/admin/colmena/default.nix +++ b/pkgs/tools/admin/colmena/default.nix @@ -32,7 +32,7 @@ rustPlatform.buildRustPackage rec { passthru = { # We guarantee CLI and Nix API stability for the same minor version - apiVersion = builtins.concatStringsSep "." (lib.take 2 (lib.splitString "." version)); + apiVersion = builtins.concatStringsSep "." (lib.take 2 (lib.splitVersion version)); tests.version = testers.testVersion { package = colmena; }; };