Merge pull request #272614 from pbsds/use-splitversion

treewide: use lib.splitVersion
This commit is contained in:
Weijia Wang 2023-12-07 13:39:43 +01:00 committed by GitHub
commit 3561c828d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 8 deletions

View file

@ -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=";
};

View file

@ -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=";

View file

@ -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 ''

View file

@ -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:

View file

@ -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

View file

@ -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; };
};