ceph: Changes rollup from triton

This commit is contained in:
William A. Kennington III 2015-06-24 18:25:53 -07:00
parent f80dc98ca9
commit 6b0f0c6f41
4 changed files with 123 additions and 68 deletions

View File

@ -1,12 +1,12 @@
{ callPackage, fetchgit, ... } @ args: { callPackage, fetchgit, ... } @ args:
callPackage ./generic.nix (args // rec { callPackage ./generic.nix (args // rec {
version = "0.94.1.2"; version = "0.94.2";
src = fetchgit { src = fetchgit {
url = "https://github.com/ceph/ceph.git"; url = "https://github.com/ceph/ceph.git";
rev = "refs/tags/v${version}"; rev = "refs/tags/v${version}";
sha256 = "0ks5djgfhjpydjdlw7s940m3mlzrvz0xhhk75nqx7sbvymgcc73q"; sha256 = "1nhqzmxv7bz93b8rbd88wgmw9icm2lhmc94dfscgh23kfpipyd6l";
}; };
patches = [ ./fix-pgrefdebugging.patch ]; patches = [ ./fix-pgrefdebugging.patch ];

View File

@ -1 +0,0 @@
0.94.nix

View File

@ -0,0 +1,11 @@
{ callPackage, fetchgit, ... } @ args:
callPackage ./generic.nix (args // rec {
version = "9.0.1";
src = fetchgit {
url = "https://github.com/ceph/ceph.git";
rev = "refs/tags/v${version}";
sha256 = "1sq6gim7dik04lih5krwm4qpnf2blby3xj2vz9n4cknjnj0dbg7x";
};
})

View File

@ -26,43 +26,79 @@
# We must have one crypto library # We must have one crypto library
assert cryptopp != null || (nss != null && nspr != null); assert cryptopp != null || (nss != null && nspr != null);
with stdenv;
with stdenv.lib; with stdenv.lib;
let let
mkFlag = trueStr: falseStr: cond: name: val: mkFlag = trueStr: falseStr: cond: name: val:
if cond == null then null else if cond == null then null else
"--${if cond != false then trueStr else falseStr}${name}${if val != null && cond != false then "=${val}" else ""}"; "--${if cond != false then trueStr else falseStr}${name}"
+ "${if val != null && cond != false then "=${val}" else ""}";
mkEnable = mkFlag "enable-" "disable-"; mkEnable = mkFlag "enable-" "disable-";
mkWith = mkFlag "with-" "without-"; mkWith = mkFlag "with-" "without-";
mkOther = mkFlag "" "" true; mkOther = mkFlag "" "" true;
hasServer = snappy != null && leveldb != null; shouldUsePkg = pkg_: let pkg = (builtins.tryEval pkg_).value;
in if lib.any (x: x == system) (pkg.meta.platforms or [])
then pkg else null;
optSnappy = shouldUsePkg snappy;
optLeveldb = shouldUsePkg leveldb;
optYasm = shouldUsePkg yasm;
optFcgi = shouldUsePkg fcgi;
optExpat = shouldUsePkg expat;
optCurl = shouldUsePkg curl;
optFuse = shouldUsePkg fuse;
optAccelio = shouldUsePkg accelio;
optLibibverbs = shouldUsePkg libibverbs;
optLibrdmacm = shouldUsePkg librdmacm;
optLibedit = shouldUsePkg libedit;
optLibatomic_ops = shouldUsePkg libatomic_ops;
optKinetic-cpp-client = shouldUsePkg kinetic-cpp-client;
optRocksdb = shouldUsePkg rocksdb;
optLibs3 = shouldUsePkg libs3;
optJemalloc = shouldUsePkg jemalloc;
optGperftools = shouldUsePkg gperftools;
optCryptopp = shouldUsePkg cryptopp;
optNss = shouldUsePkg nss;
optNspr = shouldUsePkg nspr;
optLibaio = shouldUsePkg libaio;
optLibxfs = shouldUsePkg libxfs;
optZfs = shouldUsePkg zfs;
hasServer = optSnappy != null && optLeveldb != null;
hasMon = hasServer; hasMon = hasServer;
hasMds = hasServer; hasMds = hasServer;
hasOsd = hasServer; hasOsd = hasServer;
hasRadosgw = fcgi != null && expat != null && curl != null && libedit != null; hasRadosgw = optFcgi != null && optExpat != null && optCurl != null && optLibedit != null;
hasXio = (stdenv.isLinux || stdenv.isFreeBSD) && /*hasXio = (stdenv.isLinux || stdenv.isFreeBSD) &&
versionAtLeast version "0.95" && versionAtLeast version "9.0.0" &&
accelio != null && libibverbs != null && librdmacm != null; optAccelio != null && optLibibverbs != null && optLibrdmacm != null;*/
hasXio = false; # Broken with xio 1.4
hasRocksdb = versionAtLeast version "0.95" && rocksdb != null; hasRocksdb = versionAtLeast version "9.0.0" && optRocksdb != null;
# TODO: Reenable when kinetic support is fixed # TODO: Reenable when kinetic support is fixed
hasKinetic = versionAtLeast version "0.95" && kinetic-cpp-client != null && false; #hasKinetic = versionAtLeast version "9.0.0" && optKinetic-cpp-client != null;
hasKinetic = false;
# Malloc implementation (can be jemalloc, tcmalloc or null) # Malloc implementation (can be jemalloc, tcmalloc or null)
malloc = if jemalloc != null then jemalloc else gperftools; malloc = if optJemalloc != null then optJemalloc else optGperftools;
# We prefer nss over cryptopp # We prefer nss over cryptopp
cryptoStr = if nss != null && nspr != null then "nss" else cryptoStr = if optNss != null && optNspr != null then "nss" else
if cryptopp != null then "cryptopp" else "none"; if optCryptopp != null then "cryptopp" else "none";
cryptoLibsMap = { cryptoLibsMap = {
nss = [ nss nspr ]; nss = [ optNss optNspr ];
cryptopp = [ cryptopp ]; cryptopp = [ optCryptopp ];
none = [ ]; none = [ ];
}; };
wrapArgs = "--set PYTHONPATH : \"$(toPythonPath $lib)\"" wrapArgs = "--set PYTHONPATH \"$(toPythonPath $lib)\""
+ " --prefix PYTHONPATH : \"$(toPythonPath ${python.modules.readline})\"" + " --prefix PYTHONPATH : \"$(toPythonPath ${python.modules.readline})\""
+ " --prefix PYTHONPATH : \"$(toPythonPath ${pythonPackages.flask})\"" + " --prefix PYTHONPATH : \"$(toPythonPath ${pythonPackages.flask})\""
+ " --set PATH : \"$out/bin\""; + " --set PATH : \"$out/bin\"";
@ -76,24 +112,25 @@ stdenv.mkDerivation {
./0001-Makefile-env-Don-t-force-sbin.patch ./0001-Makefile-env-Don-t-force-sbin.patch
]; ];
nativeBuildInputs = [ autoconf automake makeWrapper pkgconfig libtool which ]; nativeBuildInputs = [ autoconf automake makeWrapper pkgconfig libtool which ]
++ optionals (versionAtLeast version "10.0.0") [ pythonPackages.setuptools ];
buildInputs = buildInputs ++ cryptoLibsMap.${cryptoStr} ++ [ buildInputs = buildInputs ++ cryptoLibsMap.${cryptoStr} ++ [
boost python libxml2 yasm libatomic_ops libs3 malloc pythonPackages.flask zlib boost python libxml2 optYasm optLibatomic_ops optLibs3 malloc pythonPackages.flask zlib
] ++ optional (versionAtLeast version "9.0.0") [ ] ++ optional (versionAtLeast version "9.0.0") [
git # Used for the gitversion string git # Used for the gitversion string
pythonPackages.sphinx # Used for docs pythonPackages.sphinx # Used for docs
] ++ optional stdenv.isLinux [ ] ++ optional stdenv.isLinux [
linuxHeaders libuuid udev keyutils libaio libxfs zfs linuxHeaders libuuid udev keyutils optLibaio optLibxfs optZfs
] ++ optional hasServer [ ] ++ optional hasServer [
snappy leveldb optSnappy optLeveldb
] ++ optional hasRadosgw [ ] ++ optional hasRadosgw [
fcgi expat curl fuse libedit optFcgi optExpat optCurl optFuse optLibedit
] ++ optional hasXio [ ] ++ optional hasXio [
accelio libibverbs librdmacm optAccelio optLibibverbs optLibrdmacm
] ++ optional hasRocksdb [ ] ++ optional hasRocksdb [
rocksdb optRocksdb
] ++ optional hasKinetic [ ] ++ optional hasKinetic [
kinetic-cpp-client optKinetic-cpp-client
]; ];
postPatch = '' postPatch = ''
@ -102,6 +139,9 @@ stdenv.mkDerivation {
# Fix seagate kinetic linking # Fix seagate kinetic linking
sed -i 's,libcrypto.a,-lcrypto,g' src/os/Makefile.am sed -i 's,libcrypto.a,-lcrypto,g' src/os/Makefile.am
'' + optionalString (versionAtLeast version "9.0.0") ''
# Fix gmock
patchShebangs src/gmock
''; '';
preConfigure = '' preConfigure = ''
@ -120,50 +160,55 @@ stdenv.mkDerivation {
''; '';
configureFlags = [ configureFlags = [
"--exec_prefix=\${out}" (mkOther "exec_prefix" "\${out}")
"--sysconfdir=/etc" (mkOther "sysconfdir" "/etc")
"--localstatedir=/var" (mkOther "localstatedir" "/var")
"--libdir=\${lib}/lib" (mkOther "libdir" "\${lib}/lib")
"--includedir=\${lib}/include" (mkOther "includedir" "\${lib}/include")
(mkWith true "rbd" null)
(mkWith true "rbd" null) (mkWith true "cephfs" null)
(mkWith true "cephfs" null) (mkWith hasRadosgw "radosgw" null)
(mkWith hasRadosgw "radosgw" null) (mkWith true "radosstriper" null)
(mkWith true "radosstriper" null) (mkWith hasServer "mon" null)
(mkWith hasServer "mon" null) (mkWith hasServer "osd" null)
(mkWith hasServer "osd" null) (mkWith hasServer "mds" null)
(mkWith hasServer "mds" null) (mkEnable true "client" null)
(mkEnable true "client" null) (mkEnable hasServer "server" null)
(mkEnable hasServer "server" null) (mkWith (cryptoStr == "cryptopp") "cryptopp" null)
(mkWith (cryptoStr == "cryptopp") "cryptopp" null) (mkWith (cryptoStr == "nss") "nss" null)
(mkWith (cryptoStr == "nss") "nss" null) (mkEnable false "root-make-check" null)
(mkEnable false "root-make-check" null) (mkWith false "profiler" null)
(mkWith false "profiler" null) (mkWith false "debug" null)
(mkWith false "debug" null) (mkEnable false "coverage" null)
(mkEnable false "coverage" null) (mkWith (optFuse != null) "fuse" null)
(mkWith (fuse != null) "fuse" null) (mkWith (malloc == optJemalloc) "jemalloc" null)
(mkWith (malloc == jemalloc) "jemalloc" null) (mkWith (malloc == optGperftools) "tcmalloc" null)
(mkWith (malloc == gperftools) "tcmalloc" null) (mkEnable false "pgrefdebugging" null)
(mkEnable false "pgrefdebugging" null) (mkEnable false "cephfs-java" null)
(mkEnable false "cephfs-java" null) (mkEnable hasXio "xio" null)
(mkEnable hasXio "xio" null) (mkWith (optLibatomic_ops != null) "libatomic-ops" null)
(mkWith (libatomic_ops != null) "libatomic-ops" null) (mkWith true "ocf" null)
(mkWith true "ocf" null) (mkWith hasKinetic "kinetic" null)
(mkWith hasKinetic "kinetic" null) (mkWith hasRocksdb "librocksdb" null)
(mkWith hasRocksdb "librocksdb" null) (mkWith false "librocksdb-static" null)
(mkWith false "librocksdb-static" null) (mkWith (optLibs3 != null) "system-libs3" null)
(mkWith (libs3 != null) "system-libs3" null) (mkWith true "rest-bench" null)
(mkWith true "rest-bench" null)
] ++ optional stdenv.isLinux [ ] ++ optional stdenv.isLinux [
(mkWith (libaio != null) "libaio" null) (mkWith (optLibaio != null) "libaio" null)
(mkWith (libxfs != null) "libxfs" null) (mkWith (optLibxfs != null) "libxfs" null)
(mkWith (zfs != null) "libzfs" null) (mkWith (optZfs != null) "libzfs" null)
] ++ optional (versionAtLeast version "9.0.1") [
(mkWith false "tcmalloc-minimal" null)
(mkWith false "valgrind" null)
] ++ optional (versionAtLeast version "10.0.0") [ ] ++ optional (versionAtLeast version "10.0.0") [
(mkWith true "man-pages" null) (mkWith true "man-pages" null)
(mkWith false "tcmalloc-minimal" null) (mkWith true "systemd-libexec-dir" "\${TMPDIR}")
(mkWith false "valgrind" null)
]; ];
preBuild = optionalString (versionAtLeast version "9.0.0") ''
(cd src/gmock; make -j $NIX_BUILD_CORES)
'';
installFlags = [ "sysconfdir=\${out}/etc" ]; installFlags = [ "sysconfdir=\${out}/etc" ];
outputs = [ "out" "lib" ]; outputs = [ "out" "lib" ];

View File

@ -1,11 +1,11 @@
{ callPackage, fetchgit, git, ... } @ args: { callPackage, fetchgit, git, ... } @ args:
callPackage ./generic.nix (args // rec { callPackage ./generic.nix (args // rec {
version = "2015-04-22"; version = "2015-06-06";
src = fetchgit { src = fetchgit {
url = "git://github.com/ceph/ceph.git"; url = "git://github.com/ceph/ceph.git";
rev = "89262abc53e324f3ef4d504473a4f1d6eb337c20"; rev = "efededa0107eebd4abc0e08dd34200d6ca175626";
sha256 = "0d6hlk1nwgx9cdhvppggz6sbjc1jl8j26l9739qspw1sviac5lcb"; sha256 = "18lcn4misyvgjh7r0vkal480x23yr8pcjwzl4k4hbrpqmm97znp9";
}; };
}) })