irods.scm 12 KB

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