From 3ff5532a827279042816c19f2c2895eba3eeca50 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Fri, 19 Sep 2014 11:26:57 -0700 Subject: [PATCH] ceph: 0.79 -> 0.85 --- .../ceph/0001-Cleanup-boost-optionals.patch | 42 +++++++++++++ .../0001-Makefile-env-Don-t-force-sbin.patch | 25 ++++++++ pkgs/tools/filesystems/ceph/default.nix | 62 ++++++++++++------- 3 files changed, 107 insertions(+), 22 deletions(-) create mode 100644 pkgs/tools/filesystems/ceph/0001-Cleanup-boost-optionals.patch create mode 100644 pkgs/tools/filesystems/ceph/0001-Makefile-env-Don-t-force-sbin.patch diff --git a/pkgs/tools/filesystems/ceph/0001-Cleanup-boost-optionals.patch b/pkgs/tools/filesystems/ceph/0001-Cleanup-boost-optionals.patch new file mode 100644 index 000000000000..a99e16ddc266 --- /dev/null +++ b/pkgs/tools/filesystems/ceph/0001-Cleanup-boost-optionals.patch @@ -0,0 +1,42 @@ +From 2507ab33236f0da12899fbcdd36535f7c7b68a06 Mon Sep 17 00:00:00 2001 +From: "William A. Kennington III" +Date: Sat, 20 Sep 2014 22:52:31 -0700 +Subject: [PATCH] Cleanup boost optionals + +--- + src/osd/ECBackend.cc | 2 +- + src/osd/ReplicatedPG.cc | 5 ++++- + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc +index a87b5b4..c386900 100644 +--- a/src/osd/ECBackend.cc ++++ b/src/osd/ECBackend.cc +@@ -81,7 +81,7 @@ ostream &operator<<(ostream &lhs, const ECBackend::read_result_t &rhs) + lhs << "read_result_t(r=" << rhs.r + << ", errors=" << rhs.errors; + if (rhs.attrs) { +- lhs << ", attrs=" << rhs.attrs; ++ lhs << ", attrs=" << rhs.attrs.get(); + } else { + lhs << ", noattrs"; + } +diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc +index 5e5510d..79e8616 100644 +--- a/src/osd/ReplicatedPG.cc ++++ b/src/osd/ReplicatedPG.cc +@@ -5259,7 +5259,10 @@ void ReplicatedPG::do_osd_op_effects(OpContext *ctx) + for (list::iterator p = ctx->notify_acks.begin(); + p != ctx->notify_acks.end(); + ++p) { +- dout(10) << "notify_ack " << make_pair(p->watch_cookie, p->notify_id) << dendl; ++ if (p->watch_cookie) ++ dout(10) << "notify_ack " << make_pair(p->watch_cookie.get(), p->notify_id) << dendl; ++ else ++ dout(10) << "notify_ack " << make_pair("NULL", p->notify_id) << dendl; + for (map, WatchRef>::iterator i = + ctx->obc->watchers.begin(); + i != ctx->obc->watchers.end(); +-- +2.1.0 + diff --git a/pkgs/tools/filesystems/ceph/0001-Makefile-env-Don-t-force-sbin.patch b/pkgs/tools/filesystems/ceph/0001-Makefile-env-Don-t-force-sbin.patch new file mode 100644 index 000000000000..cb2de6ad4f5b --- /dev/null +++ b/pkgs/tools/filesystems/ceph/0001-Makefile-env-Don-t-force-sbin.patch @@ -0,0 +1,25 @@ +From 34c27f66210570adf5aba624d7da3c0382d5493f Mon Sep 17 00:00:00 2001 +From: "William A. Kennington III" +Date: Sun, 21 Sep 2014 12:19:30 -0700 +Subject: [PATCH] Makefile-env: Don't force /sbin + +--- + src/Makefile-env.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/Makefile-env.am b/src/Makefile-env.am +index f2ab655..bf8876e 100644 +--- a/src/Makefile-env.am ++++ b/src/Makefile-env.am +@@ -27,7 +27,7 @@ bin_DEBUGPROGRAMS = + ceph_sbindir = $(sbindir) + + # certain things go straight into /sbin, though! +-su_sbindir = /sbin ++su_sbindir = $(sbindir) + + # C/C++ tests to build will be appended to this + check_PROGRAMS = +-- +2.1.0 + diff --git a/pkgs/tools/filesystems/ceph/default.nix b/pkgs/tools/filesystems/ceph/default.nix index 7a8b85a8945f..ea4a1b061244 100644 --- a/pkgs/tools/filesystems/ceph/default.nix +++ b/pkgs/tools/filesystems/ceph/default.nix @@ -1,37 +1,55 @@ -{stdenv, fetchgit, libatomic_ops, autoconf, automake, boost, btrfsProgs, cryptopp, curl, expat, - fcgi, fuse, gperftools, keyutils, leveldb, libaio, libedit, libtool, - libuuid, linuxHeaders, openssl, pkgconfig, python, snappy, which, xfsprogs, xz}: +{ stdenv, fetchgit, autoconf, automake, makeWrapper, pkgconfig, libtool, which +, boost, btrfsProgs, cryptopp, curl, expat, fcgi, fuse, gperftools, keyutils +, leveldb, libaio, libatomic_ops, libedit, libuuid, linuxHeaders, openssl +, python, snappy, udev, xfsprogs, xz +}: +let + wrapArgs = "--prefix PYTHONPATH : \"$(toPythonPath $out)\"" + + " --prefix PATH : \"$out/bin\"" + + " --prefix LD_LIBRARY_PATH : \"$out/lib\""; +in stdenv.mkDerivation rec { - baseName="ceph"; - version="0.79"; - name="${baseName}-${version}"; + name="ceph-${version}"; + version="0.85"; + + src = fetchgit { + url = "git://github.com/ceph/ceph.git"; + rev = "refs/tags/v0.85"; + sha256 = "0g98cgrs3gfsc8azg3k0n61bgna2w906qm69j4qbjkb61l83ld1z"; + }; + + patches = [ + ./0001-Cleanup-boost-optionals.patch # Remove in 0.86 + ./0001-Makefile-env-Don-t-force-sbin.patch + ]; + + nativeBuildInputs = [ autoconf automake makeWrapper pkgconfig libtool which ]; buildInputs = [ - fuse linuxHeaders pkgconfig libatomic_ops autoconf automake boost btrfsProgs cryptopp expat - fcgi fuse gperftools keyutils leveldb libaio libedit libtool libuuid openssl pkgconfig - python snappy which xfsprogs.lib xz + boost boost.lib btrfsProgs cryptopp curl expat fcgi fuse gperftools keyutils + libatomic_ops leveldb libaio libedit libuuid linuxHeaders openssl python + snappy udev xfsprogs.lib xz ]; preConfigure = '' ./autogen.sh ''; - installFlags = "DESTDIR=\${out}"; + configureFlags = [ "--exec_prefix=$(out)" ]; + + postInstall = '' + wrapProgram $out/bin/ceph ${wrapArgs} + wrapProgram $out/bin/ceph-brag ${wrapArgs} + wrapProgram $out/bin/ceph-rest-api ${wrapArgs} + ''; enableParallelBuilding = true; - src = fetchgit { - url = "https://github.com/ceph/ceph"; - rev = "4c2d73a5095f527c3a2168deb5fa54b3c8991a6e"; - sha256 = "0850m817wqqmw2qdnwm5jvbdgifzlc7kcd05jv526pdvmq1x92rf"; - }; - meta = { - inherit version; + meta = with stdenv.lib; { + homepage = http://ceph.com/; description = "Distributed storage system"; - maintainers = [ - stdenv.lib.maintainers.ak - ]; - platforms = with stdenv.lib.platforms; - linux; + license = licenses.lgpl21; + maintainers = with maintainers; [ ak wkennington ]; + platforms = with platforms; linux; }; }