diff options
| -rw-r--r-- | guix-science/packages/python.scm | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/guix-science/packages/python.scm b/guix-science/packages/python.scm index ddc6efc..d17ee6b 100644 --- a/guix-science/packages/python.scm +++ b/guix-science/packages/python.scm | |||
| @@ -932,6 +932,22 @@ NumPy @code{dtype} extensions used in machine learning libraries, including: | |||
| 932 | "@?(bazel_tools|embedded_jdk|local_.*)(\\.marker)?") | 932 | "@?(bazel_tools|embedded_jdk|local_.*)(\\.marker)?") |
| 933 | (find-files "external" | 933 | (find-files "external" |
| 934 | "^\\.(git|svn|hg)$"))) | 934 | "^\\.(git|svn|hg)$"))) |
| 935 | |||
| 936 | ;; Do not keep a copy of the JDK. The JDK files are not | ||
| 937 | ;; source code and they may change as the JDK package (or | ||
| 938 | ;; any of its inputs) changes. | ||
| 939 | |||
| 940 | ;; These are all symlinks from the "jdk" output of the | ||
| 941 | ;; openjdk package, except for BUILD.bazel and WORKSPACE. | ||
| 942 | (for-each delete-file | ||
| 943 | (find-files "external/local_jdk" | ||
| 944 | (lambda (file-name stat) | ||
| 945 | (eq? (stat:type stat) 'symlink)))) | ||
| 946 | ;; The BUILD file contains a store reference to the JDK. | ||
| 947 | (substitute* "external/local_jdk/BUILD.bazel" | ||
| 948 | (("java_home = .*,") | ||
| 949 | "java_home = \"@GUIX_JAVA_HOME@\",")) | ||
| 950 | |||
| 935 | ;; Erase markers | 951 | ;; Erase markers |
| 936 | (for-each (lambda (file) | 952 | (for-each (lambda (file) |
| 937 | (truncate-file file 0)) | 953 | (truncate-file file 0)) |
| @@ -1045,7 +1061,7 @@ NumPy @code{dtype} extensions used in machine learning libraries, including: | |||
| 1045 | #$static-protobuf | 1061 | #$static-protobuf |
| 1046 | "/include")) | 1062 | "/include")) |
| 1047 | #:hash | 1063 | #:hash |
| 1048 | "0jzk6d5s27s2rbzrrg8cmghkfyl99wgx3rfakhj0nshx1kra3c49"))) | 1064 | "0k5h3yfr646m3jn80k2ls42p4xaj3hb4cvngmi0dppr7diab5awm"))) |
| 1049 | 1065 | ||
| 1050 | ;; Rewrite dangling links to current build directory | 1066 | ;; Rewrite dangling links to current build directory |
| 1051 | (for-each (lambda (file) | 1067 | (for-each (lambda (file) |
| @@ -1061,6 +1077,8 @@ NumPy @code{dtype} extensions used in machine learning libraries, including: | |||
| 1061 | (string-contains (readlink file-name) | 1077 | (string-contains (readlink file-name) |
| 1062 | "GUIX_BUILD_TOP"))) | 1078 | "GUIX_BUILD_TOP"))) |
| 1063 | #:stat lstat)) | 1079 | #:stat lstat)) |
| 1080 | (substitute* (string-append bazel-out "/external/local_jdk/BUILD.bazel") | ||
| 1081 | (("@GUIX_JAVA_HOME@") #$(this-package-native-input "openjdk"))) | ||
| 1064 | (setenv "HOME" (getenv "NIX_BUILD_TOP")) | 1082 | (setenv "HOME" (getenv "NIX_BUILD_TOP")) |
| 1065 | 1083 | ||
| 1066 | (invoke "python" "build/build.py" "--configure_only") | 1084 | (invoke "python" "build/build.py" "--configure_only") |
| @@ -1225,10 +1243,12 @@ build --local_cpu_resources=HOST_CPUS*.75 | |||
| 1225 | python-protobuf-for-tensorflow-2 | 1243 | python-protobuf-for-tensorflow-2 |
| 1226 | python-scipy)) | 1244 | python-scipy)) |
| 1227 | (native-inputs | 1245 | (native-inputs |
| 1228 | (list python-pypa-build python-setuptools python-wheel | 1246 | (list bazel-6 |
| 1229 | bazel-6 | 1247 | `(,openjdk11 "jdk") ;for bazel |
| 1230 | which | 1248 | python-pypa-build |
| 1231 | `(,openjdk11 "jdk"))) ;for bazel | 1249 | python-setuptools |
| 1250 | python-wheel | ||
| 1251 | which)) | ||
| 1232 | (home-page "https://github.com/google/jax") | 1252 | (home-page "https://github.com/google/jax") |
| 1233 | (synopsis "Differentiate, compile, and transform Numpy code.") | 1253 | (synopsis "Differentiate, compile, and transform Numpy code.") |
| 1234 | (description "JAX is Autograd and XLA, brought together for | 1254 | (description "JAX is Autograd and XLA, brought together for |
| @@ -1446,7 +1466,7 @@ mechanism for serializing structured data.") | |||
| 1446 | #$(this-package-input "python-wrapper") | 1466 | #$(this-package-input "python-wrapper") |
| 1447 | "/bin/python")) | 1467 | "/bin/python")) |
| 1448 | #:hash | 1468 | #:hash |
| 1449 | "1fm0qjsbks8xz84bzv3ivyc8ba52vj5rz31n5w87glvsxijzq6jf"))) | 1469 | "0ahsbf510465iyxiih7r0hmhmpi4c2kw1z7bk1x311vmnfl54irr"))) |
| 1450 | 1470 | ||
| 1451 | ;; Rewrite dangling links to current build directory | 1471 | ;; Rewrite dangling links to current build directory |
| 1452 | (for-each (lambda (file) | 1472 | (for-each (lambda (file) |
| @@ -1462,6 +1482,8 @@ mechanism for serializing structured data.") | |||
| 1462 | (string-contains (readlink file-name) | 1482 | (string-contains (readlink file-name) |
| 1463 | "GUIX_BUILD_TOP"))) | 1483 | "GUIX_BUILD_TOP"))) |
| 1464 | #:stat lstat)) | 1484 | #:stat lstat)) |
| 1485 | (substitute* (string-append bazel-out "/external/local_jdk/BUILD.bazel") | ||
| 1486 | (("@GUIX_JAVA_HOME@") #$(this-package-native-input "openjdk"))) | ||
| 1465 | (setenv "HOME" (getenv "NIX_BUILD_TOP")) | 1487 | (setenv "HOME" (getenv "NIX_BUILD_TOP")) |
| 1466 | 1488 | ||
| 1467 | ;; Bazel aborts when a source file includes a header | 1489 | ;; Bazel aborts when a source file includes a header |
| @@ -1792,7 +1814,7 @@ subclassing API with an imperative style for advanced research.") | |||
| 1792 | #:bazel-arguments | 1814 | #:bazel-arguments |
| 1793 | '(list) | 1815 | '(list) |
| 1794 | #:hash | 1816 | #:hash |
| 1795 | "104m99n0ah9nxa296m3ryrfyqm40ay8ck4nsggfdmci935jigvwa"))) | 1817 | "104m99n0ah9nxa296m300rfyqm40ay8ck4nsggfdmci935jigvwa"))) |
| 1796 | 1818 | ||
| 1797 | ;; Rewrite dangling links to current build directory | 1819 | ;; Rewrite dangling links to current build directory |
| 1798 | (for-each (lambda (file) | 1820 | (for-each (lambda (file) |
| @@ -1808,6 +1830,8 @@ subclassing API with an imperative style for advanced research.") | |||
| 1808 | (string-contains (readlink file-name) | 1830 | (string-contains (readlink file-name) |
| 1809 | "GUIX_BUILD_TOP"))) | 1831 | "GUIX_BUILD_TOP"))) |
| 1810 | #:stat lstat)) | 1832 | #:stat lstat)) |
| 1833 | (substitute* (string-append bazel-out "/external/local_jdk/BUILD.bazel") | ||
| 1834 | (("@GUIX_JAVA_HOME@") #$(this-package-native-input "openjdk"))) | ||
| 1811 | (setenv "HOME" (getenv "NIX_BUILD_TOP")))) | 1835 | (setenv "HOME" (getenv "NIX_BUILD_TOP")))) |
| 1812 | (replace 'build | 1836 | (replace 'build |
| 1813 | (lambda _ | 1837 | (lambda _ |
