projects/guix·blob java-team · refs

205 lines · 7.8 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2023, 2024 Greg Hogan <[email protected]>
3;;; Copyright © 2023, 2025, 2026 Ricardo Wurmus <[email protected]>
4;;; Copyright © 2024 Felix Gruber <[email protected]>
5;;; Copyright © 2024 Nicolas Graves <[email protected]>
6;;; Copyright © 2024, 2025 Ekaitz Zarraga <[email protected]>
7;;; Copyright © 2024-2026 Sharlatan Hellseher <[email protected]>
8;;;
9;;; This file is part of GNU Guix.
10;;;
11;;; GNU Guix is free software; you can redistribute it and/or modify it
12;;; under the terms of the GNU General Public License as published by
13;;; the Free Software Foundation; either version 3 of the License, or (at
14;;; your option) any later version.
15;;;
16;;; GNU Guix is distributed in the hope that it will be useful, but
17;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;;; GNU General Public License for more details.
20;;;
21;;; You should have received a copy of the GNU General Public License
22;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24(define-module (gnu packages duckdb)
25 #:use-module ((guix licenses) #:prefix license:)
26 #:use-module (guix build-system cmake)
27 #:use-module (guix build-system pyproject)
28 #:use-module (guix build-system r)
29 #:use-module (guix download)
30 #:use-module (guix gexp)
31 #:use-module (guix git-download)
32 #:use-module (guix packages)
33 #:use-module (guix utils)
34 #:use-module (gnu packages)
35 #:use-module (gnu packages base)
36 #:use-module (gnu packages check) ;python-pytest
37 #:use-module (gnu packages cran)
38 #:use-module (gnu packages databases)
39 #:use-module (gnu packages build-tools)
40 #:use-module (gnu packages python-build)
41 #:use-module (gnu packages python-science)
42 #:use-module (gnu packages python-xyz)
43 #:use-module (gnu packages statistics)
44 #:use-module (gnu packages time))
45
46;;; Commentary:
47;;;
48;;; This module contains DuckDB - an analytical in-process SQL database
49;;; management system (https://www.duckdb.org/) and it's binding in different
50;;; programming languages with other related to DuckDB packages.
51;;;
52;;; Code:
53
54(define %duckdb-version "1.5.3")
55
56(define-public duckdb
57 (package
58 (name "duckdb")
59 (version %duckdb-version)
60 (source
61 (origin
62 (method git-fetch)
63 (uri (git-reference
64 (url "https://github.com/duckdb/duckdb")
65 (commit (string-append "v" version))))
66 (file-name (git-file-name name version))
67 (sha256
68 (base32 "0020lv9dxcrng34f0c6ibp20pxll7pyjg0p3080qgw6jf5hsvfck"))))
69 (build-system cmake-build-system)
70 (arguments
71 (list
72 ;; TODO: Find out how to run tests, see: <.github/workflows>.
73 #:tests? #f
74 #:configure-flags
75 #~(list "-DBUILD_EXTENSIONS=autocomplete;icu;json;parquet;tpch;"
76 ;; There is no git checkout from which to read the version tag.
77 (string-append "-DOVERRIDE_GIT_DESCRIBE="
78 "v" #$version "-0-g0123456789"))))
79 (home-page "https://duckdb.org")
80 (synopsis "In-process SQL OLAP database management system")
81 (description
82 "CLI and C/C++ source libraries for DuckDB, a relational (table-oriented)
83 @acronym{DBMS, Database Management System} that supports @acronym{SQL,
84Structured Query Language}, contains a columnar-vectorized query execution
85engine, and provides transactional @acronym{ACID, Atomicity Consistency
86Isolation and Durability} guarantees via bulk-optimized @acronym{MVCC,
87Multi-Version Concurrency Control}. Data can be stored in persistent,
88single-file databases with support for secondary indexes.")
89 (license license:expat)))
90
91(define-public python-duckdb
92 (package
93 (name "python-duckdb")
94 (version %duckdb-version)
95 (source
96 (origin
97 (method git-fetch)
98 (uri (git-reference
99 (url "https://github.com/duckdb/duckdb-python")
100 (commit (string-append "v" version))))
101 (file-name (git-file-name name version))
102 (sha256
103 (base32 "1d0zbg86kfpknx50zjmz9j6hcycfy8pwb2h2w5rxw741iihdyj5g"))))
104 (build-system pyproject-build-system)
105 (arguments
106 (list
107 ;; Overwrite duckdb_packaging.build_backend.
108 #:build-backend "scikit_build_core.build"
109 ;; tests: 3269 passed, 42 skipped, 2 deselected, 9 xfailed
110 #:test-flags
111 ;; Network access is required.
112 #~(list "--ignore=tests/slow/test_h2oai_arrow.py"
113 ;; Flaky test.
114 (string-append "--deselect=tests/fast/api/"
115 "test_query_progress.py::TestQueryProgress"
116 "::test_query_progress"))
117 #:phases
118 #~(modify-phases %standard-phases
119 (add-before 'build 'link-duckdb-source
120 (lambda _
121 (rmdir "external/duckdb")
122 (symlink #+(package-source (this-package-native-input "duckdb"))
123 "external/duckdb")))
124 (add-before 'build 'pre-build
125 (lambda _
126 (setenv "DUCKDB_BUILD_UNITY" "1")
127 (setenv "CMAKE_DEFINE_DUCKDB_EXTENSION_AUTOLOAD_DEFAULT" "0")
128 (setenv "CMAKE_DEFINE_DUCKDB_EXTENSION_AUTOINSTALL_DEFAULT" "0")))
129 (add-before 'check 'set-HOME
130 (lambda _ (setenv "HOME" "/tmp"))))))
131 (native-inputs
132 (list duckdb
133 ninja
134 python-pytest
135 python-pytz
136 python-scikit-build-core
137 python-setuptools-scm
138 tzdata-for-tests))
139 (propagated-inputs
140 (list python-adbc-driver-manager
141 python-fsspec
142 python-ipython
143 python-numpy
144 python-pandas
145 python-psutil
146 python-pyarrow))
147 (home-page "https://www.duckdb.org")
148 (synopsis "DuckDB embedded database")
149 (description "DuckDB is an in-process SQL OLAP database management
150system.")
151 (license license:expat)))
152
153(define-public r-duckdb
154 (package
155 (name "r-duckdb")
156 (version "1.5.2")
157 (source
158 (origin
159 (method url-fetch)
160 (uri (cran-uri "duckdb" version))
161 (sha256
162 (base32 "1dldlfwvc33czvlxfmwaj4p9y6sjjj5iqy98yda47a8kclrqmyam"))
163 ;; This package bundles the duckdb sources and builds a custom variant
164 ;; of duckdb. I'd be happy to link it with our duckdb library instead,
165 ;; but it does not seem possible to do that.
166 #;
167 (snippet
168 '(delete-file "src/duckdb.tar.xz"))))
169 (properties
170 '((upstream-name . "duckdb")
171 (updater-extra-native-inputs . ("tzdata-for-tests"))
172 ;; We don't seem to need this and I don't want to package it now.
173 (updater-ignored-native-inputs . ("r-dblog"))))
174 (build-system r-build-system)
175 (arguments (list #:tests? #false)) ;tests can time out on the build farm
176 (propagated-inputs (list r-dbi))
177 (native-inputs (list r-adbcdrivermanager
178 r-arrow
179 r-bit64
180 r-callr
181 r-clock
182 r-dbitest
183 r-dbplyr
184 r-dplyr
185 r-remotes
186 r-rlang
187 r-sf
188 r-testthat
189 r-tibble
190 r-vctrs
191 r-withr
192 r-wk
193 tzdata-for-tests))
194 (home-page "https://r.duckdb.org/")
195 (synopsis "DBI package for the DuckDB database management system")
196 (description
197 "The DuckDB project is an embedded analytical data management system with
198support for the Structured Query Language (SQL). This package includes all of
199DuckDB and an R Database Interface (DBI) connector.")
200 (license license:expat)))
201
202;;;
203;;; Avoid adding new packages to the end of this file. To reduce the chances
204;;; of a merge conflict, place them above in alphabetic order.
205;;;