summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2021-04-23 16:31:58 +0200
committerRicardo Wurmus <rekado@elephly.net>2021-06-14 16:05:07 +0200
commit9e220f099d32e8773455a9fbf607ebfa821bbe5b (patch)
tree513cce43862dc26dd4912061e44bdc7c9ec3b6a9 /gnu
parenta94aef3f8d22b4e4c5b37390a396c4c1194ccae6 (diff)
downloadguix-9e220f099d32e8773455a9fbf607ebfa821bbe5b.tar.gz
gnu: Add nanodbc-for-irods.
* gnu/packages/databases.scm (nanodbc-for-irods): New variable.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/databases.scm38
1 files changed, 38 insertions, 0 deletions
diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index 23e25f5a66..f90b6e1bd8 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -101,6 +101,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)
@@ -2107,6 +2108,43 @@ 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"))))))))
+    (properties `((hidden? . #true)))
+    (inputs
+     `(("unixodbc" ,unixodbc)
+       ("libcxx" ,libcxx+libcxxabi-6)
+       ("libcxxabi" ,libcxxabi-6)
+       ("clang" ,clang-6)))))
+
 (define-public unqlite
   (package
     (name "unqlite")