gnu: xorg-server: Update to 21.1.2 [security fixes].
[jackhill/guix/guix.git] / gnu / packages / irods.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2021 Ricardo Wurmus <rekado@elephly.net>
3 ;;;
4 ;;; This file is part of GNU Guix.
5 ;;;
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
10 ;;;
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19 (define-module (gnu packages irods)
20 #:use-module ((guix licenses) #:prefix license:)
21 #:use-module (guix packages)
22 #:use-module (guix download)
23 #:use-module (guix git-download)
24 #:use-module (guix build-system cmake)
25 #:use-module (guix utils)
26 #:use-module (gnu packages)
27 #:use-module (gnu packages backup)
28 #:use-module (gnu packages base)
29 #:use-module (gnu packages boost)
30 #:use-module (gnu packages check)
31 #:use-module (gnu packages compression)
32 #:use-module (gnu packages cpp)
33 #:use-module (gnu packages databases)
34 #:use-module (gnu packages gcc)
35 #:use-module (gnu packages kerberos)
36 #:use-module (gnu packages linux)
37 #:use-module (gnu packages llvm)
38 #:use-module (gnu packages logging)
39 #:use-module (gnu packages man)
40 #:use-module (gnu packages networking)
41 #:use-module (gnu packages pretty-print)
42 #:use-module (gnu packages python)
43 #:use-module (gnu packages serialization)
44 #:use-module (gnu packages tls)
45 #:use-module (srfi srfi-1))
46
47 (define-public irods
48 (package
49 (name "irods")
50 (version "4.2.8")
51 (source (origin
52 (method url-fetch)
53 (uri (string-append "https://github.com/irods/irods/releases/download/"
54 version "/irods-" version ".tar.gz"))
55 (sha256
56 (base32
57 "0ny54c3r0j692rvbr4iibg7xgd2i7g9x8yyrw04j889bywix14rc"))))
58 (build-system cmake-build-system)
59 (arguments
60 `(#:configure-flags
61 (list
62 "-DCMAKE_BUILD_TYPE=Release"
63 (string-append "-DCMAKE_MODULE_LINKER_FLAGS=-Wl,-rpath="
64 (assoc-ref %outputs "out") "/lib")
65 (string-append "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath="
66 (assoc-ref %outputs "out") "/lib")
67 (string-append "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath="
68 (assoc-ref %outputs "out") "/lib")
69
70 ;; Configuration aborts if no generator format is set
71 "-DCPACK_GENERATOR=TGZ"
72
73 ;; Configuration attempts to guess the distribution with Python.
74 "-DIRODS_LINUX_DISTRIBUTION_NAME=guix"
75 "-DIRODS_LINUX_DISTRIBUTION_VERSION_MAJOR=1"
76
77 (string-append "-DIRODS_EXTERNALS_FULLPATH_CLANG="
78 (assoc-ref %build-inputs "clang"))
79 (string-append "-DIRODS_EXTERNALS_FULLPATH_CLANG_RUNTIME="
80 (assoc-ref %build-inputs "clang-runtime"))
81 (string-append "-DIRODS_EXTERNALS_FULLPATH_CPPZMQ="
82 (assoc-ref %build-inputs "cppzmq"))
83 (string-append "-DIRODS_EXTERNALS_FULLPATH_ARCHIVE="
84 (assoc-ref %build-inputs "libarchive"))
85 (string-append "-DIRODS_EXTERNALS_FULLPATH_AVRO="
86 (assoc-ref %build-inputs "avro-cpp"))
87 (string-append "-DIRODS_EXTERNALS_FULLPATH_BOOST="
88 (assoc-ref %build-inputs "boost"))
89 (string-append "-DIRODS_EXTERNALS_FULLPATH_ZMQ="
90 (assoc-ref %build-inputs "zeromq"))
91 (string-append "-DIRODS_EXTERNALS_FULLPATH_JSON="
92 (assoc-ref %build-inputs "json"))
93 (string-append "-DIRODS_EXTERNALS_FULLPATH_CATCH2="
94 (assoc-ref %build-inputs "catch2"))
95 (string-append "-DIRODS_EXTERNALS_FULLPATH_NANODBC="
96 (assoc-ref %build-inputs "nanodbc"))
97 (string-append "-DIRODS_EXTERNALS_FULLPATH_FMT="
98 (assoc-ref %build-inputs "fmt")))
99
100 #:phases
101 (modify-phases %standard-phases
102 (add-after 'unpack 'unset-Werror
103 (lambda _
104 ;; -Werror kills the build due to a comparison REQUIRE(errs.size() == err->len);
105 ;; in unit_tests/src/test_irods_lifetime_manager.cpp
106 (substitute* "CMakeLists.txt"
107 (("-Werror") ""))))
108 (add-after 'unpack 'remove-FHS-and-prefix-assumptions
109 (lambda* (#:key inputs #:allow-other-keys)
110 (substitute* '("CMakeLists.txt"
111 "cmake/server.cmake"
112 "cmake/development_library.cmake"
113 "cmake/runtime_library.cmake")
114 (("usr/") ""))
115 (substitute* "lib/core/src/irods_default_paths.cpp"
116 (("path.append\\(\"usr\"\\)") "path")
117 (("path.remove_filename\\(\\).remove_filename\\(\\).remove_filename\\(\\)")
118 "path.remove_filename().remove_filename()"))
119 (substitute* "scripts/irods/paths.py"
120 (("'usr', 'lib', 'irods'") "'lib', 'irods'"))
121 (substitute* "scripts/irods/pypyodbc.py"
122 (("\"/usr/lib/libodbc.so\"")
123 (search-input-file inputs "/lib/libodbc.so")))))
124 (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
125 (lambda* (#:key inputs #:allow-other-keys)
126 (let ((gcc (assoc-ref inputs "gcc")))
127 (setenv "CPLUS_INCLUDE_PATH"
128 (string-join
129 (cons* (search-input-directory inputs "/include/c++/v1")
130 (search-input-directory inputs "/include/catch2")
131 (search-input-directory inputs "/include/nlohmann")
132 ;; Hide GCC's C++ headers so that they do not interfere with
133 ;; the Clang headers.
134 (delete (string-append gcc "/include/c++")
135 (string-split (getenv "CPLUS_INCLUDE_PATH")
136 #\:)))
137 ":"))
138 (format #true
139 "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
140 (getenv "CPLUS_INCLUDE_PATH"))))))))
141 (inputs
142 `(("avro-cpp" ,avro-cpp-1.9-for-irods)
143 ("boost" ,boost-for-irods)
144 ("cppzmq" ,cppzmq)
145 ("fmt" ,fmt-for-irods)
146 ("json" ,json-modern-cxx)
147 ("libarchive" ,libarchive)
148 ("libcxxabi" ,libcxxabi-6) ; we need this for linking with -lc++abi
149 ("linux-pam" ,linux-pam)
150 ("mit-krb5" ,mit-krb5)
151 ("nanodbc" ,nanodbc-for-irods)
152 ("openssl" ,openssl)
153 ("python" ,python-wrapper)
154 ("unixodbc" ,unixodbc)
155 ("zeromq" ,zeromq)))
156 (native-inputs
157 `(("catch2" ,catch-framework2)
158 ("clang" ,clang-toolchain-6)
159 ("clang-runtime" ,clang-runtime-6)
160 ("libcxx+libcxxabi" ,libcxx+libcxxabi-6)))
161 (home-page "https://irods.org")
162 (synopsis "Data management software")
163 (description "The Integrated Rule-Oriented Data System (iRODS) is data
164 management software. iRODS virtualizes data storage resources, so users can
165 take control of their data, regardless of where and on what device the data is
166 stored.")
167 (license license:bsd-3)))
168
169 (define-public irods-client-icommands
170 (package
171 (name "irods-client-icommands")
172 (version "4.2.8")
173 (source (origin
174 (method git-fetch)
175 (uri (git-reference
176 (url "https://github.com/irods/irods_client_icommands")
177 (commit version)))
178 (file-name (git-file-name name version))
179 (sha256
180 (base32
181 "069n647p5ypf44gim8z26mwayg5lzgk7r9qyyqd8f9n7h0p4jxpn"))))
182 (build-system cmake-build-system)
183 (arguments
184 `(#:tests? #false ; not clear how to run tests
185 #:configure-flags
186 (list
187 "-DCMAKE_BUILD_TYPE=Release"
188
189 ;; Configuration attempts to guess the distribution with Python.
190 "-DIRODS_LINUX_DISTRIBUTION_NAME=guix"
191 "-DIRODS_LINUX_DISTRIBUTION_VERSION_MAJOR=1"
192
193 (string-append "-DIRODS_DIR="
194 (assoc-ref %build-inputs "irods")
195 "/lib/irods/cmake")
196 (string-append "-DIRODS_EXTERNALS_FULLPATH_CLANG="
197 (assoc-ref %build-inputs "clang"))
198 (string-append "-DIRODS_EXTERNALS_FULLPATH_CLANG_RUNTIME="
199 (assoc-ref %build-inputs "clang-runtime"))
200 (string-append "-DIRODS_EXTERNALS_FULLPATH_CPPZMQ="
201 (assoc-ref %build-inputs "cppzmq"))
202 (string-append "-DIRODS_EXTERNALS_FULLPATH_ARCHIVE="
203 (assoc-ref %build-inputs "libarchive"))
204 (string-append "-DIRODS_EXTERNALS_FULLPATH_AVRO="
205 (assoc-ref %build-inputs "avro-cpp"))
206 (string-append "-DIRODS_EXTERNALS_FULLPATH_BOOST="
207 (assoc-ref %build-inputs "boost"))
208 (string-append "-DIRODS_EXTERNALS_FULLPATH_ZMQ="
209 (assoc-ref %build-inputs "zeromq"))
210 (string-append "-DIRODS_EXTERNALS_FULLPATH_JSON="
211 (assoc-ref %build-inputs "json"))
212 (string-append "-DIRODS_EXTERNALS_FULLPATH_FMT="
213 (assoc-ref %build-inputs "fmt")))
214
215 #:phases
216 (modify-phases %standard-phases
217 (add-after 'unpack 'unset-Werror ;
218 (lambda _ ;
219 ;; -Werror kills the build due to a deprecation warning
220 (substitute* "CMakeLists.txt" ;
221 (("-Werror") ""))))
222 (add-after 'unpack 'remove-/usr-prefix
223 (lambda _
224 (substitute* "CMakeLists.txt"
225 (("usr/") ""))))
226 (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
227 (lambda* (#:key inputs #:allow-other-keys)
228 (let ((gcc (assoc-ref inputs "gcc")))
229 (setenv "CPLUS_INCLUDE_PATH"
230 (string-join
231 (cons* (search-input-directory inputs
232 "include/c++/v1")
233 (search-input-directory inputs
234 "include/nlohmann")
235 ;; Hide GCC's C++ headers so that they do not interfere with
236 ;; the Clang headers.
237 (delete (string-append gcc "/include/c++")
238 (string-split (getenv "CPLUS_INCLUDE_PATH")
239 #\:)))
240 ":"))
241 (format #true
242 "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
243 (getenv "CPLUS_INCLUDE_PATH"))))))))
244 (inputs
245 `(("avro-cpp" ,avro-cpp-1.9-for-irods)
246 ("boost" ,boost-for-irods)
247 ("cppzmq" ,cppzmq)
248 ("fmt" ,fmt-for-irods)
249 ("irods" ,irods)
250 ("json" ,json-modern-cxx)
251 ("libarchive" ,libarchive)
252 ("libcxxabi" ,libcxxabi-6) ; we need this for linking with -lc++abi
253 ("mit-krb5" ,mit-krb5)
254 ("openssl" ,openssl)
255 ("zeromq" ,zeromq)))
256 (native-inputs
257 `(("clang" ,clang-toolchain-6)
258 ("clang-runtime" ,clang-runtime-6)
259 ("libcxx+libcxxabi" ,libcxx+libcxxabi-6)
260 ("help2man" ,help2man)
261 ("which" ,which)))
262 (home-page "https://irods.org")
263 (synopsis "Data management software")
264 (description "The Integrated Rule-Oriented Data System (iRODS) is data
265 management software. iRODS virtualizes data storage resources, so users can
266 take control of their data, regardless of where and on what device the data is
267 stored.")
268 (license license:bsd-3)))