···59 # - Releases: ../modules/${pname}/releases/releases.nix
60 # - Package: ../modules/${pname}/releases/package.nix
6100062 # All releases across all platforms
63 # See ../modules/${pname}/releases/releases.nix
64- allReleases = evaluatedModules.config.${pname}.releases;
6566 # Compute versioned attribute name to be used in this package set
67 # Patch version changes should not break the build, so we only use major and minor
···72 # isSupported :: Package -> Bool
73 isSupported =
74 package:
75- strings.versionAtLeast cudaVersion package.minCudaVersion
076 && strings.versionAtLeast package.maxCudaVersion cudaVersion;
7778 # Get all of the packages for our given platform.
79 redistArch = flags.getRedistArch hostPlatform.system;
800081 # All the supported packages we can build for our platform.
82- # supportedPackages :: List (AttrSet Packages)
83- supportedPackages = builtins.filter isSupported (allReleases.${redistArch} or []);
8485- # newestToOldestSupportedPackage :: List (AttrSet Packages)
86- newestToOldestSupportedPackage = lists.reverseList supportedPackages;
87-88- nameOfNewest = computeName (builtins.head newestToOldestSupportedPackage);
8990 # A function which takes the `final` overlay and the `package` being built and returns
91 # a function to be consumed via `overrideAttrs`.
···120 attrsets.nameValuePair name fixedDrv;
121122 # versionedDerivations :: AttrSet Derivation
123- versionedDerivations = builtins.listToAttrs (lists.map buildPackage newestToOldestSupportedPackage);
124125- defaultDerivation = attrsets.optionalAttrs (versionedDerivations != {}) {
126- ${pname} = versionedDerivations.${nameOfNewest};
127- };
128 in
129 versionedDerivations // defaultDerivation;
130in
···59 # - Releases: ../modules/${pname}/releases/releases.nix
60 # - Package: ../modules/${pname}/releases/package.nix
6162+ # FIXME: do this at the module system level
63+ propagatePlatforms = lib.mapAttrs (platform: subset: map (r: r // { inherit platform; }) subset);
64+65 # All releases across all platforms
66 # See ../modules/${pname}/releases/releases.nix
67+ releaseSets = propagatePlatforms evaluatedModules.config.${pname}.releases;
6869 # Compute versioned attribute name to be used in this package set
70 # Patch version changes should not break the build, so we only use major and minor
···75 # isSupported :: Package -> Bool
76 isSupported =
77 package:
78+ !(strings.hasPrefix "unsupported" package.platform)
79+ && strings.versionAtLeast cudaVersion package.minCudaVersion
80 && strings.versionAtLeast package.maxCudaVersion cudaVersion;
8182 # Get all of the packages for our given platform.
83 redistArch = flags.getRedistArch hostPlatform.system;
8485+ allReleases = builtins.concatMap (xs: xs) (builtins.attrValues releaseSets);
86+87 # All the supported packages we can build for our platform.
88+ # perSystemReleases :: List Package
89+ perSystemReleases = releaseSets.${redistArch} or [ ];
9091+ preferable =
92+ p1: p2: (isSupported p2 -> isSupported p1) && (strings.versionAtLeast p1.version p2.version);
93+ newest = builtins.head (builtins.sort preferable allReleases);
09495 # A function which takes the `final` overlay and the `package` being built and returns
96 # a function to be consumed via `overrideAttrs`.
···125 attrsets.nameValuePair name fixedDrv;
126127 # versionedDerivations :: AttrSet Derivation
128+ versionedDerivations = builtins.listToAttrs (lists.map buildPackage perSystemReleases);
129130+ defaultDerivation = { ${pname} = (buildPackage newest).value; };
00131 in
132 versionedDerivations // defaultDerivation;
133in
+11-10
pkgs/development/cuda-modules/tensorrt/fixup.nix
···16 strings
17 versions
18 ;
000000019in
20finalAttrs: prevAttrs: {
21 # Useful for inspecting why something went wrong.
···58 # We need to look inside the extracted output to get the files we need.
59 sourceRoot = "TensorRT-${finalAttrs.version}";
6061- buildInputs = prevAttrs.buildInputs ++ [finalAttrs.passthru.cudnn.lib];
6263 preInstall =
64- let
65- targetArch =
66- if hostPlatform.isx86_64 then
67- "x86_64-linux-gnu"
68- else if hostPlatform.isAarch64 then
69- "aarch64-linux-gnu"
70- else
71- throw "Unsupported architecture";
72- in
73 (prevAttrs.preInstall or "")
74 + ''
75 # Replace symlinks to bin and lib with the actual directories from targets.
···107 };
108109 meta = prevAttrs.meta // {
000110 homepage = "https://developer.nvidia.com/tensorrt";
111 maintainers = prevAttrs.meta.maintainers ++ [maintainers.aidalgol];
112 };
···16 strings
17 versions
18 ;
19+ targetArch =
20+ if hostPlatform.isx86_64 then
21+ "x86_64-linux-gnu"
22+ else if hostPlatform.isAarch64 then
23+ "aarch64-linux-gnu"
24+ else
25+ "unsupported";
26in
27finalAttrs: prevAttrs: {
28 # Useful for inspecting why something went wrong.
···65 # We need to look inside the extracted output to get the files we need.
66 sourceRoot = "TensorRT-${finalAttrs.version}";
6768+ buildInputs = prevAttrs.buildInputs ++ [ finalAttrs.passthru.cudnn.lib ];
6970 preInstall =
00000000071 (prevAttrs.preInstall or "")
72 + ''
73 # Replace symlinks to bin and lib with the actual directories from targets.
···105 };
106107 meta = prevAttrs.meta // {
108+ badPlatforms =
109+ prevAttrs.meta.badPlatforms or [ ]
110+ ++ lib.optionals (targetArch == "unsupported") [ hostPlatform.system ];
111 homepage = "https://developer.nvidia.com/tensorrt";
112 maintainers = prevAttrs.meta.maintainers ++ [maintainers.aidalgol];
113 };