Add irods.

  • Done
  • quality assurance status badge
Details
3 participants
  • Ludovic Courtès
  • Maxime Devos
  • Ricardo Wurmus
Owner
unassigned
Submitted by
Ricardo Wurmus
Severity
normal
R
R
Ricardo Wurmus wrote on 23 Apr 2021 16:20
(address . guix-patches@gnu.org)
878s59qe0b.fsf@elephly.net
Hi Guix,

this set of patches adds irods and irods-client-icommands. What
makes this patch set a little annoying is the fact that irods
insists on being built with clang 6; this means that we need
variants of existing GCC-built packages just so that they can be
linked with the irods libraries.

For the most part this is not too bad because we need specific
versions of certain libraries anyway. But for snappy-with-clang6
and avro-cpp it’s pretty bad. You’ll see that I’m using an inline
package definition for a variant of avro-cpp that is built with
clang; that package variant needs snappy, so I had to introduce
snappy-with-clang6.

Before we can actually merge this we would have to move this
avro-cpp variant to its own top-level package definition, because
it turns out that irods-client-icommands also needs it.

If you have an idea how to build irods with GCC, I’d be very
happy. (It takes quite some time to build irods, so be prepared
for long iteration cycles…)

--
Ricardo
R
R
Ricardo Wurmus wrote on 23 Apr 2021 16:31
[PATCH 1/6] gnu: Add boost-for-irods.
(address . 47972@debbugs.gnu.org)(name . Ricardo Wurmus)(address . rekado@elephly.net)
20210423143201.12831-1-rekado@elephly.net
* gnu/packages/boost.scm (boost-for-irods): New variable.
---
gnu/packages/boost.scm | 94 +++++++++++++++++++++++++++++++++++++++++-
1 file changed, 93 insertions(+), 1 deletion(-)

Toggle diff (121 lines)
diff --git a/gnu/packages/boost.scm b/gnu/packages/boost.scm
index a59bb01f3d..0ab62a4d90 100644
--- a/gnu/packages/boost.scm
+++ b/gnu/packages/boost.scm
@@ -7,7 +7,7 @@
;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
-;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2018, 2019, 2021 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2018 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
@@ -43,6 +43,7 @@
#:use-module (gnu packages compression)
#:use-module (gnu packages hurd)
#:use-module (gnu packages icu4c)
+ #:use-module (gnu packages llvm)
#:use-module (gnu packages perl)
#:use-module (gnu packages python)
#:use-module (gnu packages shells)
@@ -201,6 +202,97 @@ across a broad spectrum of applications.")
(license (license:x11-style "https://www.boost.org/LICENSE_1_0.txt"
"Some components have other similar licences."))))
+;; Sadly, this is needed for irods. It won't link with 1.69 or later.
+(define-public boost-for-irods
+ (package
+ (name "boost-for-irods")
+ (version "1.68.0")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "mirror://sourceforge/boost/boost/" version "/boost_"
+ (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version)
+ ".tar.bz2"))
+ (sha256
+ (base32
+ "1dyqsr9yb01y0nnjdq9b8q5s2kvhxbayk34832k5cpzn7jy30qbz"))))
+ (build-system gnu-build-system)
+ (inputs
+ `(("icu4c" ,icu4c)
+ ("zlib" ,zlib)))
+ (native-inputs
+ `(("clang" ,clang-6)
+ ("libcxx" ,libcxx+libcxxabi-6)
+ ("libcxxabi" ,libcxxabi-6)
+ ("perl" ,perl)
+ ("tcsh" ,tcsh)))
+ (arguments
+ `(#:tests? #f
+ #:make-flags
+ (list "threading=multi" "link=shared"
+ "cxxflags=-stdlib=libc++"
+ "--without-python"
+
+ ;; Set the RUNPATH to $libdir so that the libs find each other.
+ (string-append "linkflags=-stdlib=libc++ -Wl,-rpath="
+ (assoc-ref %outputs "out") "/lib"))
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'bootstrap)
+ (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((gcc (assoc-ref inputs "gcc")))
+ (setenv "CPLUS_INCLUDE_PATH"
+ (string-join
+ (cons (string-append (assoc-ref inputs "libcxx")
+ "/include/c++/v1")
+ ;; Hide GCC's C++ headers so that they do not interfere with
+ ;; the Clang headers.
+ (delete (string-append gcc "/include/c++")
+ (string-split (getenv "CPLUS_INCLUDE_PATH")
+ #\:)))
+ ":"))
+ (format #true
+ "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
+ (getenv "CPLUS_INCLUDE_PATH")))))
+ (replace 'configure
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((icu (assoc-ref inputs "icu4c"))
+ (zlib (assoc-ref inputs "zlib"))
+ (out (assoc-ref outputs "out")))
+ (substitute* '("libs/config/configure"
+ "libs/spirit/classic/phoenix/test/runtest.sh"
+ "tools/build/src/engine/execunix.c"
+ "tools/build/src/engine/Jambase"
+ "tools/build/src/engine/jambase.c")
+ (("/bin/sh") (which "sh")))
+
+ (setenv "SHELL" (which "sh"))
+ (setenv "CONFIG_SHELL" (which "sh"))
+
+ (invoke "./bootstrap.sh"
+ (string-append "--prefix=" out)
+ ;; Auto-detection looks for ICU only in traditional
+ ;; install locations.
+ (string-append "--with-icu=" icu)
+ "--with-toolset=clang"))))
+ (replace 'build
+ (lambda* (#:key inputs make-flags #:allow-other-keys)
+ (let ((zlib (assoc-ref inputs "zlib")))
+ (apply invoke "./b2"
+ (format #f "-j~a" (parallel-job-count))
+ make-flags))))
+ (replace 'install
+ (lambda* (#:key make-flags #:allow-other-keys)
+ (apply invoke "./b2" "install" make-flags))))))
+ (home-page "https://www.boost.org")
+ (synopsis "Peer-reviewed portable C++ source libraries")
+ (description
+ "A collection of libraries intended to be widely useful, and usable
+across a broad spectrum of applications.")
+ (license (license:x11-style "https://www.boost.org/LICENSE_1_0.txt"
+ "Some components have other similar licences."))))
+
(define-public boost-with-python2
(package/inherit boost
(name "boost-python2")
--
2.31.1
R
R
Ricardo Wurmus wrote on 23 Apr 2021 16:31
[PATCH 2/6] gnu: Add snappy-with-clang6.
(address . 47972@debbugs.gnu.org)(name . Ricardo Wurmus)(address . rekado@elephly.net)
20210423143201.12831-2-rekado@elephly.net
* gnu/packages/compression.scm (snappy-with-clang6): New variable.
---
gnu/packages/compression.scm | 37 +++++++++++++++++++++++++++++++++++-
1 file changed, 36 insertions(+), 1 deletion(-)

Toggle diff (64 lines)
diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
index 37a7d230fe..2b1dfcfab1 100644
--- a/gnu/packages/compression.scm
+++ b/gnu/packages/compression.scm
@@ -4,7 +4,7 @@
;;; Copyright © 2014, 2015, 2018 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2015 Taylan Ulrich Bay?rl?/Kammer <taylanbayirli@gmail.com>
;;; Copyright © 2015, 2016 Eric Bavier <bavier@member.fsf.org>
-;;; Copyright © 2015, 2016, 2017, 2018, 2020 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2015, 2016, 2017, 2018, 2020, 2021 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2015, 2017, 2018 Leo Famulari <leo@famulari.name>
;;; Copyright © 2015 Jeff Mickey <j@codemac.net>
;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
@@ -76,6 +76,7 @@
#:use-module (gnu packages gnome)
#:use-module (gnu packages gnupg)
#:use-module (gnu packages gtk)
+ #:use-module (gnu packages llvm)
#:use-module (gnu packages man)
#:use-module (gnu packages maths)
#:use-module (gnu packages perl)
@@ -1132,6 +1133,40 @@ for most inputs, but the resulting compressed files are anywhere from 20% to
100% bigger.")
(license license:asl2.0)))
+;; We need this for irods.
+(define-public snappy-with-clang6
+ (package
+ (inherit snappy)
+ (name "snappy-with-clang")
+ (arguments
+ `(#:configure-flags
+ '("-DBUILD_SHARED_LIBS=ON"
+ "-DCMAKE_CXX_COMPILER=clang++"
+ "-DCMAKE_CXX_FLAGS=-stdlib=libc++"
+ "-DCMAKE_EXE_LINKER_FLAGS=-lc++abi")
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((gcc (assoc-ref inputs "gcc")))
+ (setenv "CPLUS_INCLUDE_PATH"
+ (string-join
+ (cons* (string-append (assoc-ref inputs "libcxx+libcxxabi")
+ "/include/c++/v1")
+ ;; Hide GCC's C++ headers so that they do not interfere with
+ ;; the Clang headers.
+ (delete (string-append gcc "/include/c++")
+ (string-split (getenv "CPLUS_INCLUDE_PATH")
+ #\:)))
+ ":"))
+ (format #true
+ "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
+ (getenv "CPLUS_INCLUDE_PATH"))))))))
+ (native-inputs
+ `(("clang" ,clang-toolchain-6)
+ ("libcxx+libcxxabi" ,libcxx+libcxxabi-6)
+ ("libcxxabi" ,libcxxabi-6)))))
+
(define-public p7zip
(package
(name "p7zip")
--
2.31.1
R
R
Ricardo Wurmus wrote on 23 Apr 2021 16:31
[PATCH 3/6] gnu: Add nanodbc-for-irods.
(address . 47972@debbugs.gnu.org)(name . Ricardo Wurmus)(address . rekado@elephly.net)
20210423143201.12831-3-rekado@elephly.net
* gnu/packages/databases.scm (nanodbc-for-irods): New variable.
---
gnu/packages/databases.scm | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)

Toggle diff (57 lines)
diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index b956833557..d159c47af8 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -98,6 +98,7 @@
#:use-module (gnu packages linux)
#:use-module (gnu packages lisp)
#:use-module (gnu packages lisp-xyz)
+ #:use-module (gnu packages llvm)
#:use-module (gnu packages logging)
#:use-module (gnu packages man)
#:use-module (gnu packages maths)
@@ -2103,6 +2104,42 @@ a simpler and less verbose API for working with ODBC. Common tasks should be
easy, requiring concise and simple code.")
(license license:expat)))
+(define-public nanodbc-for-irods
+ (package
+ (inherit nanodbc)
+ (arguments
+ `(#:tests? #false
+ #:configure-flags
+ '("-DBUILD_SHARED_LIBS=ON"
+ ;; The tests require ODBC backends to be installed.
+ "-DNANODBC_DISABLE_TESTS=ON"
+ "-DCMAKE_CXX_COMPILER=clang++"
+ "-DCMAKE_CXX_FLAGS=-stdlib=libc++"
+ "-DCMAKE_EXE_LINKER_FLAGS=-lc++abi")
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((gcc (assoc-ref inputs "gcc")))
+ (setenv "CPLUS_INCLUDE_PATH"
+ (string-join
+ (cons (string-append (assoc-ref inputs "libcxx")
+ "/include/c++/v1")
+ ;; Hide GCC's C++ headers so that they do not interfere with
+ ;; the Clang headers.
+ (delete (string-append gcc "/include/c++")
+ (string-split (getenv "CPLUS_INCLUDE_PATH")
+ #\:)))
+ ":"))
+ (format #true
+ "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
+ (getenv "CPLUS_INCLUDE_PATH"))))))))
+ (inputs
+ `(("unixodbc" ,unixodbc)
+ ("libcxx" ,libcxx+libcxxabi-6)
+ ("libcxxabi" ,libcxxabi-6)
+ ("clang" ,clang-6)))))
+
(define-public unqlite
(package
(name "unqlite")
--
2.31.1
R
R
Ricardo Wurmus wrote on 23 Apr 2021 16:31
[PATCH 4/6] gnu: Add fmt-for-irods.
(address . 47972@debbugs.gnu.org)(name . Ricardo Wurmus)(address . rekado@elephly.net)
20210423143201.12831-4-rekado@elephly.net
* gnu/packages/pretty-print.scm (fmt-for-irods): New variable.
---
gnu/packages/pretty-print.scm | 55 ++++++++++++++++++++++++++++++++++-
1 file changed, 54 insertions(+), 1 deletion(-)

Toggle diff (81 lines)
diff --git a/gnu/packages/pretty-print.scm b/gnu/packages/pretty-print.scm
index 4662a1e717..7e7da53599 100644
--- a/gnu/packages/pretty-print.scm
+++ b/gnu/packages/pretty-print.scm
@@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
-;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2016, 2021 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2017, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2017–2021 Tobias Geerinckx-Rice <me@tobias.gr>
@@ -41,6 +41,7 @@
#:use-module (gnu packages gperf)
#:use-module (gnu packages groff)
#:use-module (gnu packages gv)
+ #:use-module (gnu packages llvm)
#:use-module (gnu packages lua)
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
@@ -189,6 +190,58 @@ to @code{IOStreams}.")
;; The library is bsd-2, but documentation and tests include other licenses.
(license (list bsd-2 bsd-3 psfl))))
+(define-public fmt-for-irods
+ (package
+ (name "fmt-for-irods")
+ (version "6.1.2")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/fmtlib/fmt/releases/download/"
+ version "/fmt-" version ".zip"))
+ (sha256
+ (base32 "1s1hxaby5byb07rgmrk4a0q11fxhz7b42khch7sp2qx974y0yrb3"))))
+ (build-system cmake-build-system)
+ (arguments
+ '(#:tests? #f ; TODO: posix-mock-test segfaults
+ #:configure-flags
+ '("-DBUILD_SHARED_LIBS=ON"
+ "-DCMAKE_CXX_COMPILER=clang++"
+ "-DCMAKE_CXX_FLAGS=-stdlib=libc++"
+ "-DCMAKE_EXE_LINKER_FLAGS=-lc++abi")
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((gcc (assoc-ref inputs "gcc")))
+ (setenv "CPLUS_INCLUDE_PATH"
+ (string-join
+ (cons (string-append (assoc-ref inputs "libcxx")
+ "/include/c++/v1")
+ ;; Hide GCC's C++ headers so that they do not interfere with
+ ;; the Clang headers.
+ (delete (string-append gcc "/include/c++")
+ (string-split (getenv "CPLUS_INCLUDE_PATH")
+ #\:)))
+ ":"))
+ (format #true
+ "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
+ (getenv "CPLUS_INCLUDE_PATH"))))))))
+ (native-inputs
+ `(("unzip" ,unzip)))
+ (inputs
+ `(("libcxx" ,libcxx+libcxxabi-6)
+ ("libcxxabi" ,libcxxabi-6)
+ ("clang" ,clang-6)))
+ (home-page "https://fmt.dev")
+ (synopsis "Small and fast C++ formatting library")
+ (description
+ "@code{fmt} (formerly @code{cppformat}) is a formatting library for C++.
+It can be used as a safe alternative to @code{printf} or as a fast alternative
+to @code{IOStreams}.")
+ ;; The library is bsd-2, but documentation and tests include other licenses.
+ (license (list bsd-2 bsd-3 psfl))))
+
(define-public source-highlight
(package
(name "source-highlight")
--
2.31.1
R
R
Ricardo Wurmus wrote on 23 Apr 2021 16:32
[PATCH 5/6] gnu: Add irods.
(address . 47972@debbugs.gnu.org)(name . Ricardo Wurmus)(address . rekado@elephly.net)
20210423143201.12831-5-rekado@elephly.net
* gnu/packages/irods.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
---
gnu/local.mk | 1 +
gnu/packages/irods.scm | 200 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 201 insertions(+)
create mode 100644 gnu/packages/irods.scm

Toggle diff (220 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 50b11a8ca2..f18fed6fbc 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -296,6 +296,7 @@ GNU_SYSTEM_MODULES = \
%D%/packages/installers.scm \
%D%/packages/ipfs.scm \
%D%/packages/irc.scm \
+ %D%/packages/irods.scm \
%D%/packages/iso-codes.scm \
%D%/packages/jami.scm \
%D%/packages/java.scm \
diff --git a/gnu/packages/irods.scm b/gnu/packages/irods.scm
new file mode 100644
index 0000000000..75a58d97cb
--- /dev/null
+++ b/gnu/packages/irods.scm
@@ -0,0 +1,200 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Ricardo Wurmus <rekado@elephly.net>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages irods)
+ #:use-module ((guix licenses) #:prefix license:)
+ #:use-module (guix packages)
+ #:use-module (guix download)
+ #:use-module (guix build-system cmake)
+ #:use-module (guix utils)
+ #:use-module (gnu packages)
+ #:use-module (gnu packages backup)
+ #:use-module (gnu packages boost)
+ #:use-module (gnu packages check)
+ #:use-module (gnu packages compression)
+ #:use-module (gnu packages cpp)
+ #:use-module (gnu packages databases)
+ #:use-module (gnu packages gcc)
+ #:use-module (gnu packages kerberos)
+ #:use-module (gnu packages linux)
+ #:use-module (gnu packages llvm)
+ #:use-module (gnu packages logging)
+ #:use-module (gnu packages networking)
+ #:use-module (gnu packages pretty-print)
+ #:use-module (gnu packages python)
+ #:use-module (gnu packages serialization)
+ #:use-module (gnu packages tls)
+ #:use-module (srfi srfi-1))
+
+(define-public irods
+ (package
+ (name "irods")
+ (version "4.2.8")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/irods/irods/releases/download/"
+ version "/irods-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0ny54c3r0j692rvbr4iibg7xgd2i7g9x8yyrw04j889bywix14rc"))))
+ (build-system cmake-build-system)
+ (arguments
+ `(#:configure-flags
+ (list
+ "-DCMAKE_BUILD_TYPE=Release"
+ (string-append "-DCMAKE_MODULE_LINKER_FLAGS=-Wl,-rpath="
+ (assoc-ref %outputs "out") "/lib")
+ (string-append "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath="
+ (assoc-ref %outputs "out") "/lib")
+ (string-append "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath="
+ (assoc-ref %outputs "out") "/lib")
+
+ ;; Configuration aborts if no generator format is set
+ "-DCPACK_GENERATOR=TGZ"
+
+ ;; Configuration attempts to guess the distribution with Python.
+ "-DIRODS_LINUX_DISTRIBUTION_NAME=guix"
+ "-DIRODS_LINUX_DISTRIBUTION_VERSION_MAJOR=1"
+
+ (string-append "-DIRODS_EXTERNALS_FULLPATH_CLANG="
+ (assoc-ref %build-inputs "clang"))
+ (string-append "-DIRODS_EXTERNALS_FULLPATH_CLANG_RUNTIME="
+ (assoc-ref %build-inputs "clang-runtime"))
+ (string-append "-DIRODS_EXTERNALS_FULLPATH_CPPZMQ="
+ (assoc-ref %build-inputs "cppzmq"))
+ (string-append "-DIRODS_EXTERNALS_FULLPATH_ARCHIVE="
+ (assoc-ref %build-inputs "libarchive"))
+ (string-append "-DIRODS_EXTERNALS_FULLPATH_AVRO="
+ (assoc-ref %build-inputs "avro-cpp"))
+ (string-append "-DIRODS_EXTERNALS_FULLPATH_BOOST="
+ (assoc-ref %build-inputs "boost"))
+ (string-append "-DIRODS_EXTERNALS_FULLPATH_ZMQ="
+ (assoc-ref %build-inputs "zeromq"))
+ (string-append "-DIRODS_EXTERNALS_FULLPATH_JSON="
+ (assoc-ref %build-inputs "json"))
+ (string-append "-DIRODS_EXTERNALS_FULLPATH_CATCH2="
+ (assoc-ref %build-inputs "catch2"))
+ (string-append "-DIRODS_EXTERNALS_FULLPATH_NANODBC="
+ (assoc-ref %build-inputs "nanodbc"))
+ (string-append "-DIRODS_EXTERNALS_FULLPATH_FMT="
+ (assoc-ref %build-inputs "fmt")))
+
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'unset-Werror
+ (lambda _
+ ;; -Werror kills the build due to a comparison REQUIRE(errs.size() == err->len);
+ ;; in unit_tests/src/test_irods_lifetime_manager.cpp
+ (substitute* "CMakeLists.txt"
+ (("-Werror") ""))))
+ (add-after 'unpack 'remove-FHS-and-prefix-assumptions
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* '("CMakeLists.txt"
+ "cmake/server.cmake"
+ "cmake/development_library.cmake"
+ "cmake/runtime_library.cmake")
+ (("usr/") ""))
+ (substitute* "lib/core/src/irods_default_paths.cpp"
+ (("path.append\\(\"usr\"\\)") "path")
+ (("path.remove_filename\\(\\).remove_filename\\(\\).remove_filename\\(\\)")
+ "path.remove_filename().remove_filename()"))
+ (substitute* "scripts/irods/paths.py"
+ (("'usr', 'lib', 'irods'") "'lib', 'irods'"))
+ (substitute* "scripts/irods/pypyodbc.py"
+ (("\"/usr/lib/libodbc.so\"")
+ (string-append (assoc-ref inputs "unixodbc") "/lib/libodbc.so")))))
+ (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((gcc (assoc-ref inputs "gcc")))
+ (setenv "CPLUS_INCLUDE_PATH"
+ (string-join
+ (cons* (string-append (assoc-ref inputs "libcxx+libcxxabi")
+ "/include/c++/v1")
+ (string-append (assoc-ref inputs "catch2")
+ "/include/catch2")
+ (string-append (assoc-ref inputs "json")
+ "/include/nlohmann")
+ ;; Hide GCC's C++ headers so that they do not interfere with
+ ;; the Clang headers.
+ (delete (string-append gcc "/include/c++")
+ (string-split (getenv "CPLUS_INCLUDE_PATH")
+ #\:)))
+ ":"))
+ (format #true
+ "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
+ (getenv "CPLUS_INCLUDE_PATH"))))))))
+ (inputs
+ `(("avro-cpp" ,(package
+ (inherit avro-cpp-1.9)
+ (arguments
+ `(#:configure-flags
+ '("-DCMAKE_CXX_COMPILER=clang++"
+ "-DCMAKE_CXX_FLAGS=-stdlib=libc++"
+ "-DCMAKE_EXE_LINKER_FLAGS=-lc++abi -lz")
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'chdir
+ (lambda _ (chdir "lang/c++")))
+ (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((gcc (assoc-ref inputs "gcc")))
+ (setenv "CPLUS_INCLUDE_PATH"
+ (string-join
+ (cons* (string-append (assoc-ref inputs "libcxx+libcxxabi")
+ "/include/c++/v1")
+ ;; Hide GCC's C++ headers so that they do not interfere with
+ ;; the Clang headers.
+ (delete (string-append gcc "/include/c++")
+ (string-split (getenv "CPLUS_INCLUDE_PATH")
+ #\:)))
+ ":"))
+ (format #true
+ "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
+ (getenv "CPLUS_INCLUDE_PATH"))))))))
+ (inputs
+ `(("boost" ,boost-for-irods)
+ ("clang" ,clang-toolchain-6)
+ ("libcxx+libcxxabi" ,libcxx+libcxxabi-6)
+ ("libcxxabi" ,libcxxabi-6)
+ ("snappy" ,snappy-with-clang6)
+ ("zlib" ,zlib)))))
+ ("boost" ,boost-for-irods)
+ ("cppzmq" ,cppzmq)
+ ("fmt" ,fmt-for-irods)
+ ("json" ,json-modern-cxx)
+ ("libarchive" ,libarchive)
+ ("libcxxabi" ,libcxxabi-6) ; we need this for linking with -lc++abi
+ ("linux-pam" ,linux-pam)
+ ("mit-krb5" ,mit-krb5)
+ ("nanodbc" ,nanodbc-for-irods)
+ ("openssl" ,openssl)
+ ("python" ,python-wrapper)
+ ("unixodbc" ,unixodbc)
+ ("zeromq" ,zeromq)))
+ (native-inputs
+ `(("catch2" ,catch-framework2)
+ ("clang" ,clang-toolchain-6)
+ ("clang-runtime" ,clang-runtime-6)
+ ("libcxx+libcxxabi" ,libcxx+libcxxabi-6)))
+ (home-page "https://irods.org")
+ (synopsis "Data management software")
+ (description "The Integrated Rule-Oriented Data System (iRODS) is data
+management software. iRODS virtualizes data storage resources, so users can
+take control of their data, regardless of where and on what device the data is
+stored.")
+ (license license:bsd-3)))
--
2.31.1
R
R
Ricardo Wurmus wrote on 23 Apr 2021 16:32
[PATCH 6/6] gnu: Add irods-client-icommands.
(address . 47972@debbugs.gnu.org)(name . Ricardo Wurmus)(address . rekado@elephly.net)
20210423143201.12831-6-rekado@elephly.net
* gnu/packages/irods.scm (irods-client-icommands): New variable.
---
gnu/packages/irods.scm | 137 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 137 insertions(+)

Toggle diff (165 lines)
diff --git a/gnu/packages/irods.scm b/gnu/packages/irods.scm
index 75a58d97cb..e757c1d80a 100644
--- a/gnu/packages/irods.scm
+++ b/gnu/packages/irods.scm
@@ -20,10 +20,12 @@
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix download)
+ #:use-module (guix git-download)
#:use-module (guix build-system cmake)
#:use-module (guix utils)
#:use-module (gnu packages)
#:use-module (gnu packages backup)
+ #:use-module (gnu packages base)
#:use-module (gnu packages boost)
#:use-module (gnu packages check)
#:use-module (gnu packages compression)
@@ -34,6 +36,7 @@
#:use-module (gnu packages linux)
#:use-module (gnu packages llvm)
#:use-module (gnu packages logging)
+ #:use-module (gnu packages man)
#:use-module (gnu packages networking)
#:use-module (gnu packages pretty-print)
#:use-module (gnu packages python)
@@ -198,3 +201,137 @@ management software. iRODS virtualizes data storage resources, so users can
take control of their data, regardless of where and on what device the data is
stored.")
(license license:bsd-3)))
+
+(define-public irods-client-icommands
+ (package
+ (name "irods-client-icommands")
+ (version "4.2.8")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/irods/irods_client_icommands")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "069n647p5ypf44gim8z26mwayg5lzgk7r9qyyqd8f9n7h0p4jxpn"))))
+ (build-system cmake-build-system)
+ (arguments
+ `(#:tests? #false ; not clear how to run tests
+ #:configure-flags
+ (list
+ "-DCMAKE_BUILD_TYPE=Release"
+
+ ;; Configuration attempts to guess the distribution with Python.
+ "-DIRODS_LINUX_DISTRIBUTION_NAME=guix"
+ "-DIRODS_LINUX_DISTRIBUTION_VERSION_MAJOR=1"
+
+ (string-append "-DIRODS_DIR="
+ (assoc-ref %build-inputs "irods")
+ "/lib/irods/cmake")
+ (string-append "-DIRODS_EXTERNALS_FULLPATH_CLANG="
+ (assoc-ref %build-inputs "clang"))
+ (string-append "-DIRODS_EXTERNALS_FULLPATH_CLANG_RUNTIME="
+ (assoc-ref %build-inputs "clang-runtime"))
+ (string-append "-DIRODS_EXTERNALS_FULLPATH_CPPZMQ="
+ (assoc-ref %build-inputs "cppzmq"))
+ (string-append "-DIRODS_EXTERNALS_FULLPATH_ARCHIVE="
+ (assoc-ref %build-inputs "libarchive"))
+ (string-append "-DIRODS_EXTERNALS_FULLPATH_AVRO="
+ (assoc-ref %build-inputs "avro-cpp"))
+ (string-append "-DIRODS_EXTERNALS_FULLPATH_BOOST="
+ (assoc-ref %build-inputs "boost"))
+ (string-append "-DIRODS_EXTERNALS_FULLPATH_ZMQ="
+ (assoc-ref %build-inputs "zeromq"))
+ (string-append "-DIRODS_EXTERNALS_FULLPATH_JSON="
+ (assoc-ref %build-inputs "json"))
+ (string-append "-DIRODS_EXTERNALS_FULLPATH_FMT="
+ (assoc-ref %build-inputs "fmt")))
+
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'unset-Werror ;
+ (lambda _ ;
+ ;; -Werror kills the build due to a deprecation warning
+ (substitute* "CMakeLists.txt" ;
+ (("-Werror") ""))))
+ (add-after 'unpack 'remove-/usr-prefix
+ (lambda _
+ (substitute* "CMakeLists.txt"
+ (("usr/") ""))))
+ (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((gcc (assoc-ref inputs "gcc")))
+ (setenv "CPLUS_INCLUDE_PATH"
+ (string-join
+ (cons* (string-append (assoc-ref inputs "libcxx+libcxxabi")
+ "/include/c++/v1")
+ (string-append (assoc-ref inputs "json")
+ "/include/nlohmann")
+ ;; Hide GCC's C++ headers so that they do not interfere with
+ ;; the Clang headers.
+ (delete (string-append gcc "/include/c++")
+ (string-split (getenv "CPLUS_INCLUDE_PATH")
+ #\:)))
+ ":"))
+ (format #true
+ "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
+ (getenv "CPLUS_INCLUDE_PATH"))))))))
+ (inputs
+ `(("avro-cpp" ,(package
+ (inherit avro-cpp-1.9)
+ (arguments
+ `(#:configure-flags
+ '("-DCMAKE_CXX_COMPILER=clang++"
+ "-DCMAKE_CXX_FLAGS=-stdlib=libc++"
+ "-DCMAKE_EXE_LINKER_FLAGS=-lc++abi -lz")
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'chdir
+ (lambda _ (chdir "lang/c++")))
+ (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((gcc (assoc-ref inputs "gcc")))
+ (setenv "CPLUS_INCLUDE_PATH"
+ (string-join
+ (cons* (string-append (assoc-ref inputs "libcxx+libcxxabi")
+ "/include/c++/v1")
+ ;; Hide GCC's C++ headers so that they do not interfere with
+ ;; the Clang headers.
+ (delete (string-append gcc "/include/c++")
+ (string-split (getenv "CPLUS_INCLUDE_PATH")
+ #\:)))
+ ":"))
+ (format #true
+ "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
+ (getenv "CPLUS_INCLUDE_PATH"))))))))
+ (inputs
+ `(("boost" ,boost-for-irods)
+ ("clang" ,clang-toolchain-6)
+ ("libcxx+libcxxabi" ,libcxx+libcxxabi-6)
+ ("libcxxabi" ,libcxxabi-6)
+ ("snappy" ,snappy-with-clang6)
+ ("zlib" ,zlib)))))
+ ("boost" ,boost-for-irods)
+ ("cppzmq" ,cppzmq)
+ ("fmt" ,fmt-for-irods)
+ ("irods" ,irods)
+ ("json" ,json-modern-cxx)
+ ("libarchive" ,libarchive)
+ ("libcxxabi" ,libcxxabi-6) ; we need this for linking with -lc++abi
+ ("mit-krb5" ,mit-krb5)
+ ("openssl" ,openssl)
+ ("zeromq" ,zeromq)))
+ (native-inputs
+ `(("clang" ,clang-toolchain-6)
+ ("clang-runtime" ,clang-runtime-6)
+ ("libcxx+libcxxabi" ,libcxx+libcxxabi-6)
+ ("help2man" ,help2man)
+ ("which" ,which)))
+ (home-page "https://irods.org")
+ (synopsis "Data management software")
+ (description "The Integrated Rule-Oriented Data System (iRODS) is data
+management software. iRODS virtualizes data storage resources, so users can
+take control of their data, regardless of where and on what device the data is
+stored.")
+ (license license:bsd-3)))
--
2.31.1
M
M
Maxime Devos wrote on 24 Apr 2021 13:02
Re: [bug#47972] [PATCH 1/6] gnu: Add boost-for-irods.
115b5c8ccca573a6086d5cbc929619ef30335266.camel@telenet.be
Ricardo Wurmus schreef op vr 23-04-2021 om 16:31 [+0200]:
Toggle quote (8 lines)
> *+;; Sadly, this is needed for irods. It won't link with 1.69 or later.
> +(define-public boost-for-irods
> + [...]
> + (native-inputs
> + `(("clang" ,clang-6)

> + ("libcxx" ,libcxx+libcxxabi-6)
> + ("libcxxabi" ,libcxxabi-6)
"libcxx" and "libcxxabi" look lik they should be in "inputs", but perhaps something
special is going on here.

Toggle quote (19 lines)
> + ("perl" ,perl)
> + ("tcsh" ,tcsh)))
> + (arguments
> + `(#:tests? #f
> + #:make-flags
> + (list "threading=multi" "link=shared"
> + "cxxflags=-stdlib=libc++"
> + "--without-python"
> +
> + ;; Set the RUNPATH to $libdir so that the libs find each other.
> + (string-append "linkflags=-stdlib=libc++ -Wl,-rpath="
> + (assoc-ref %outputs "out") "/lib"))
> + #:phases
> + (modify-phases %standard-phases
> + (delete 'bootstrap)
> + (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
> + (lambda* (#:key inputs #:allow-other-keys)
> + (let ((gcc (assoc-ref inputs "gcc")))

For cross-compilation, this should be (assoc-ref (or native-inputs inputs) "gcc").

Toggle quote (2 lines)
> + (setenv "CPLUS_INCLUDE_PATH"

Maybe you need to set "CROSS_CPLUS_INCLUDE_PATH" here instead, not sure though.

Toggle quote (24 lines)
> + (string-join
> + (cons (string-append (assoc-ref inputs "libcxx")
> + "/include/c++/v1")
> + ;; Hide GCC's C++ headers so that they do not interfere with
> + ;; the Clang headers.
> + (delete (string-append gcc "/include/c++")
> + (string-split (getenv "CPLUS_INCLUDE_PATH")
> + #\:)))
> + ":"))
> + (format #true
> + "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
> + (getenv "CPLUS_INCLUDE_PATH")))))
> + (replace 'configure
> + (lambda* (#:key inputs outputs #:allow-other-keys)
> + (let ((icu (assoc-ref inputs "icu4c"))
> + (zlib (assoc-ref inputs "zlib"))
> + (out (assoc-ref outputs "out")))
> + (substitute* '("libs/config/configure"
> + "libs/spirit/classic/phoenix/test/runtest.sh"
> + "tools/build/src/engine/execunix.c"
> + "tools/build/src/engine/Jambase"
> + "tools/build/src/engine/jambase.c")
> + (("/bin/sh") (which "sh")))

When cross-compiling, "which" looks in the 'native-inputs', and not 'inputs'.
For tools/**/*.c, you should use (string-append (assoc-ref inputs "bash") "/bin/sh")
or something like that. If/when https://issues.guix.gnu.org/47869 is merged,
you can write the simpler (which "sh" inputs) instead, but that's not (yet) the case.

Toggle quote (14 lines)
> +
> + (setenv "SHELL" (which "sh"))
> + (setenv "CONFIG_SHELL" (which "sh"))
> +
> + (invoke "./bootstrap.sh"
> + (string-append "--prefix=" out)
> + ;; Auto-detection looks for ICU only in traditional
> + ;; install locations.
> + (string-append "--with-icu=" icu)
> + "--with-toolset=clang"))))
> + (replace 'build
> + (lambda* (#:key inputs make-flags #:allow-other-keys)
> + (let ((zlib (assoc-ref inputs "zlib")))

The ((zlib (assoc-ref ...))) binding seems unused here.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYIP6sxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7vUgAP9etwEXC5TEIqHE5YaZWjA7shU5
I8KrjKTzXvBDiq11FAEA9Rrx2Z35iQ7QJ5p0hZmQG0SDwqymvKN1O3xcN1nNXg4=
=YPzB
-----END PGP SIGNATURE-----


L
L
Ludovic Courtès wrote on 10 Jun 2021 10:28
Re: bug#47972: Add irods.
(name . Ricardo Wurmus)(address . rekado@elephly.net)(address . 47972@debbugs.gnu.org)
874ke6aztm.fsf_-_@gnu.org
Hi Ricardo,

Ricardo Wurmus <rekado@elephly.net> skribis:

Toggle quote (2 lines)
> * gnu/packages/boost.scm (boost-for-irods): New variable.

[...]

Toggle quote (6 lines)
> +;; Sadly, this is needed for irods. It won't link with 1.69 or later.
> +(define-public boost-for-irods
> + (package
> + (name "boost-for-irods")
> + (version "1.68.0")

For this and the other “for-irods” packages, how about:

1. Inheriting from the original package (‘boost’ in this case), to at
least avoid duplicating the synopsis, description, and license?

2. Adding the ‘hidden?’ property, because they are not meant to be
installed on their own?

Apart from that, it LGTM.

Thanks!

Ludo’.
R
R
Ricardo Wurmus wrote on 14 Jun 2021 16:48
(name . Ludovic Courtès)(address . ludovic.courtes@inria.fr)(address . 47972-done@debbugs.gnu.org)
87pmwoqz7m.fsf@elephly.net
Ludovic Courtès <ludovic.courtes@inria.fr> writes:

Toggle quote (26 lines)
> Hi Ricardo,
>
> Ricardo Wurmus <rekado@elephly.net> skribis:
>
>> * gnu/packages/boost.scm (boost-for-irods): New variable.
>
> [...]
>
>> +;; Sadly, this is needed for irods. It won't link with 1.69
>> or later.
>> +(define-public boost-for-irods
>> + (package
>> + (name "boost-for-irods")
>> + (version "1.68.0")
>
> For this and the other “for-irods” packages, how about:
>
> 1. Inheriting from the original package (‘boost’ in this
> case), to at
> least avoid duplicating the synopsis, description, and
> license?
>
> 2. Adding the ‘hidden?’ property, because they are not meant
> to be
> installed on their own?

Done.

I also addressed what I could of Maxime’s comments. Thank you.

I split out the package variant of avro-cpp that is used by both
irods packages and pushed the patch series to the “master” branch.


--
Ricardo
Closed
?