From 20f19261e4bfdd239b192c3f9beb722970dc67a0 Mon Sep 17 00:00:00 2001 From: Sharlatan Hellseher Date: Wed, 28 Aug 2024 23:17:57 +0100 Subject: [PATCH] gnu: python-pyarrow: Fix build. Resolve regression introduced in c2d172fc74dcb34a34f26e51d7a01fffa1442ea7 as seen in CI . * gnu/packages/databases.scm (python-pyarrow) [arguments]: <#:phases>: Add 'set-version phase. In 'set-pyarrow-build-options phase sort environment variables alphabetically, add PYARROW_CMAKE_OPTIONS, PYARROW_PARALLEL, PYARROW_WITH_HDFS. Change-Id: I85bb78e49fa207d19080e15db09d9764c7f84c25 --- gnu/packages/databases.scm | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm index 9d1b9643c437784a7b41e18806bb4257598f12d4..40002f788a2676e5d455d5676028821c27d10eba 100644 --- a/gnu/packages/databases.scm +++ b/gnu/packages/databases.scm @@ -5034,18 +5034,44 @@ algorithm implementations.") (build-system python-build-system) (arguments (list - #:tests? #f ; XXX There are no tests in the "python" directory + ;; XXX: Test data is distributed sepratly in + ;; 39MiB and requires + ;; additional steps to be implemented, see + ;; . + #:tests? #f #:phases #~(modify-phases %standard-phases (delete 'build) ; XXX the build is performed again during the install phase (add-after 'unpack 'enter-source-directory (lambda _ (chdir "python"))) + (add-after 'enter-source-directory 'set-version + (lambda _ + ;; XXX: This python-setuptools-scm option is available in v8+: + ;; TypeError: Configuration.__init__() got an unexpected + ;; keyword argument 'version_file' + (substitute* "pyproject.toml" + (("version_file = .*") "")) + + ;; Version file generation ad-hoc, remove when a newer version + ;; of python-setuptools-scm is packed. + (with-output-to-file "pyarrow/_generated_version.py" + (let* ((version #$(package-version this-package) ) + (version-tuple (string-join (string-split version #\.) ", "))) + (lambda () + (format #t + "__version__ = version = '~a' +__version_tuple__ = version_tuple = (~a)~%" version version-tuple)))))) (add-before 'install 'set-pyarrow-build-options (lambda _ (setenv "PYARROW_BUNDLE_ARROW_CPP_HEADERS" "0") + (setenv "PYARROW_CMAKE_OPTIONS" + (string-append "-DCMAKE_INSTALL_RPATH=" #$output)) + (setenv "PYARROW_PARALLEL" + (number->string (parallel-job-count))) + (setenv "PYARROW_WITH_DATASET" "1") + (setenv "PYARROW_WITH_HDFS" "1") (setenv "PYARROW_WITH_ORC" "1") - (setenv "PYARROW_WITH_PARQUET" "1") - (setenv "PYARROW_WITH_DATASET" "1")))))) + (setenv "PYARROW_WITH_PARQUET" "1")))))) (propagated-inputs (list (list apache-arrow "lib") (list apache-arrow "include")