···
cudaSupport ? config.cudaSupport or false,
···
pname = "paddlepaddle" + lib.optionalString cudaSupport "-gpu";
28
+
version = if cudaSupport then "2.6.2" else "3.0.0";
pyShortVersion = "cp${builtins.replaceStrings [ "." ] [ "" ] python.pythonVersion}";
cpuOrGpu = if cudaSupport then "gpu" else "cpu";
allHashAndPlatform = import ./binary-hashes.nix;
35
-
allHashAndPlatform."${stdenv.system}"."${cpuOrGpu}"."${pyShortVersion}"
36
-
or (throw "${pname} has no binary-hashes.nix entry for '${stdenv.system}.${cpuOrGpu}.${pyShortVersion}' attribute");
37
-
platform = allHashAndPlatform."${stdenv.system}".platform;
34
+
allHashAndPlatform."${stdenv.hostPlatform.system}"."${cpuOrGpu}"."${pyShortVersion}"
35
+
or (throw "${pname} has no binary-hashes.nix entry for '${stdenv.hostPlatform.system}.${cpuOrGpu}.${pyShortVersion}' attribute");
36
+
platform = allHashAndPlatform."${stdenv.hostPlatform.system}".platform;
···
···
59
-
disabled = pythonOlder "3.9" || pythonAtLeast "3.11";
61
-
libraryPath = lib.makeLibraryPath (
62
-
# TODO: remove openssl_1_1 and zlib, maybe by building paddlepaddle from
63
-
# source as suggested in the following comment:
64
-
# https://github.com/NixOS/nixpkgs/pull/243583#issuecomment-1641450848
69
-
++ lib.optionals cudaSupport (
70
-
with cudaPackages_11;
79
-
postFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
80
-
function fixRunPath {
81
-
p=$(patchelf --print-rpath $1)
82
-
patchelf --set-rpath "$p:$libraryPath" $1
83
-
${lib.optionalString cudaSupport ''
87
-
fixRunPath $out/${python.sitePackages}/paddle/fluid/libpaddle.so
60
+
(pythonOlder "3.11" || pythonAtLeast "3.13")
62
+
(pythonOlder "3.12" || pythonAtLeast "3.14");
nativeBuildInputs = [ addDriverRunpath ];
92
-
propagatedBuildInputs = [
···
pythonImportsCheck = [ "paddle" ];
···
110
-
description = "PArallel Distributed Deep LEarning: Machine Learning Framework from Industrial Practice (『飞桨』核心框架,深度学习&机器学习高性能单机、分布式训练和跨平台部署";
83
+
postFixup = lib.optionalString stdenv.hostPlatform.isLinux (
85
+
libraryPath = lib.makeLibraryPath (
88
+
(lib.getLib stdenv.cc.cc)
90
+
++ lib.optionals cudaSupport (
91
+
with cudaPackages_11;
101
+
function fixRunPath {
102
+
p=$(patchelf --print-rpath $1)
103
+
patchelf --set-rpath "$p:${libraryPath}" $1
104
+
${lib.optionalString cudaSupport ''
105
+
addDriverRunpath $1
108
+
fixRunPath $out/${python.sitePackages}/paddle/base/libpaddle.so
109
+
fixRunPath $out/${python.sitePackages}/paddle/libs/lib*.so
114
+
description = "Machine Learning Framework from Industrial Practice";
homepage = "https://github.com/PaddlePaddle/Paddle";
112
-
license = licenses.asl20;
113
-
maintainers = with maintainers; [ happysalada ];
116
+
license = lib.licenses.asl20;
117
+
maintainers = with lib.maintainers; [ happysalada ];
116
-
++ optionals (!cudaSupport) [
120
+
++ lib.optionals (!cudaSupport) [