about summary refs log tree commit diff
path: root/pkgs/tools/filesystems/ceph
diff options
context:
space:
mode:
authorDaniel Kuehn <daniel@kuehn.se>2018-02-24 18:56:25 +0100
committerDaniel Kuehn <daniel@kuehn.se>2018-02-24 18:56:25 +0100
commit987cad84cef6d083be3b26a145a2969704b47f6a (patch)
tree53a666c4ec7f824a921162df9333225e8cd21204 /pkgs/tools/filesystems/ceph
parent3b512ca185edb4f2462000d5ee9b0eb72425db24 (diff)
ceph: Modify ceph package so that it compiles and runs fine on nixos
With adding a patch that makes 2 absolute paths into 2 relative paths, ensuring the third-party libraries are available
in the python environment used and wrapping the python tools with wrapPrograms does so that the fixed ceph pkg can
compile and run as intended on NixOS.
Diffstat (limited to 'pkgs/tools/filesystems/ceph')
-rw-r--r--pkgs/tools/filesystems/ceph/0002-fix-absolute-include-path.patch19
-rw-r--r--pkgs/tools/filesystems/ceph/generic.nix26
2 files changed, 38 insertions, 7 deletions
diff --git a/pkgs/tools/filesystems/ceph/0002-fix-absolute-include-path.patch b/pkgs/tools/filesystems/ceph/0002-fix-absolute-include-path.patch
new file mode 100644
index 0000000000000..01aa194dddf2b
--- /dev/null
+++ b/pkgs/tools/filesystems/ceph/0002-fix-absolute-include-path.patch
@@ -0,0 +1,19 @@
+diff -ru ceph/src/key_value_store/kv_flat_btree_async.cc ceph-copy/src/key_value_store/kv_flat_btree_async.cc
+--- ceph/src/key_value_store/kv_flat_btree_async.cc	1980-01-02 00:00:00.000000000 +0100
++++ ceph-copy/src/key_value_store/kv_flat_btree_async.cc	2018-02-13 21:49:59.232860487 +0100
+@@ -15,13 +15,13 @@
+ #include "key_value_store/kv_flat_btree_async.h"
+ #include "key_value_store/kvs_arg_types.h"
+ #include "include/rados/librados.hpp"
+-#include "/usr/include/asm-generic/errno.h"
+-#include "/usr/include/asm-generic/errno-base.h"
+ #include "common/ceph_context.h"
+ #include "common/Clock.h"
+ #include "include/types.h"
+ 
+ 
++#include <asm-generic/errno.h>
++#include <asm-generic/errno-base.h>
+ #include <string>
+ #include <iostream>
+ #include <cassert>
diff --git a/pkgs/tools/filesystems/ceph/generic.nix b/pkgs/tools/filesystems/ceph/generic.nix
index a18051f9c126e..32b85eaa68157 100644
--- a/pkgs/tools/filesystems/ceph/generic.nix
+++ b/pkgs/tools/filesystems/ceph/generic.nix
@@ -86,12 +86,17 @@ let
   };
 
   ceph-python-env = python2Packages.python.withPackages (ps: [ 
-	ps.sphinx
-	ps.flask
-	ps.argparse
-	ps.cython 
-	ps.setuptools
-	ps.pip
+    ps.sphinx
+    ps.flask
+    ps.argparse
+    ps.cython 
+    ps.setuptools
+    ps.pip
+    # Libraries needed by the python tools
+    ps.Mako
+    ps.pecan
+    ps.prettytable
+    ps.webob
 	]);
 
 in
@@ -103,11 +108,13 @@ stdenv.mkDerivation {
   patches = [ 
  #	 ./ceph-patch-cmake-path.patch
     ./0001-kv-RocksDBStore-API-break-additional.patch   
+  ] ++ optionals stdenv.isLinux [
+    ./0002-fix-absolute-include-path.patch
   ];
 
   nativeBuildInputs = [
     cmake
-    pkgconfig which git
+    pkgconfig which git python2Packages.wrapPython
     (ensureNewerSourcesHook { year = "1980"; })
   ];
   
@@ -122,6 +129,7 @@ stdenv.mkDerivation {
   ] ++ optionals hasKinetic [
     optKinetic-cpp-client
   ];
+
   
   preConfigure =''
     # rip off submodule that interfer with system libs
@@ -149,6 +157,10 @@ stdenv.mkDerivation {
     "-DWITH_LIBCEPHFS=OFF"
   ];
 
+  postFixup = ''
+    wrapPythonPrograms
+  '';
+
   enableParallelBuilding = true;
   
   outputs = [ "dev" "lib" "out" "doc" ];