From c1c757cea4f47a6ee3cec8f8db217bc92335b7fb Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Wed, 15 Jul 2015 17:46:31 -0700 Subject: [PATCH] ceph: 9.0.1 -> 9.0.2 --- pkgs/tools/filesystems/ceph/dev.nix | 6 ++-- .../filesystems/ceph/fix-pythonpath.patch | 31 +++++++++++++++++++ pkgs/tools/filesystems/ceph/generic.nix | 12 +++++-- 3 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 pkgs/tools/filesystems/ceph/fix-pythonpath.patch diff --git a/pkgs/tools/filesystems/ceph/dev.nix b/pkgs/tools/filesystems/ceph/dev.nix index 3a9aacbcd30e..5cc183d1053c 100644 --- a/pkgs/tools/filesystems/ceph/dev.nix +++ b/pkgs/tools/filesystems/ceph/dev.nix @@ -1,11 +1,13 @@ { callPackage, fetchgit, ... } @ args: callPackage ./generic.nix (args // rec { - version = "9.0.1"; + version = "9.0.2"; src = fetchgit { url = "https://github.com/ceph/ceph.git"; rev = "refs/tags/v${version}"; - sha256 = "1sq6gim7dik04lih5krwm4qpnf2blby3xj2vz9n4cknjnj0dbg7x"; + sha256 = "0kydjyvb1566mh33p6dlljfx1r4cfdj8ic4i19h5r9vavkc46nf0"; }; + + patches = [ ./fix-pythonpath.patch ]; }) diff --git a/pkgs/tools/filesystems/ceph/fix-pythonpath.patch b/pkgs/tools/filesystems/ceph/fix-pythonpath.patch new file mode 100644 index 000000000000..7458a46aca15 --- /dev/null +++ b/pkgs/tools/filesystems/ceph/fix-pythonpath.patch @@ -0,0 +1,31 @@ +diff --git a/src/Makefile-env.am b/src/Makefile-env.am +index e176596..384e230 100644 +--- a/src/Makefile-env.am ++++ b/src/Makefile-env.am +@@ -40,7 +40,7 @@ check_SCRIPTS = + export VERBOSE = true + + # python unit tests need to know where the scripts are located +-export PYTHONPATH=$(top_srcdir)/src/pybind ++export PYTHONPATH+=:$(top_srcdir)/src/pybind + + # when doing a debug build, make sure to make the targets + if WITH_DEBUG +diff --git a/src/ceph-detect-init/Makefile.am b/src/ceph-detect-init/Makefile.am +index 3e5ad03..66d6683 100644 +--- a/src/ceph-detect-init/Makefile.am ++++ b/src/ceph-detect-init/Makefile.am +@@ -64,9 +64,10 @@ install-data-local:: + if test "$(DESTDIR)" ; then \ + if lsb_release -si | grep --quiet 'Ubuntu\|Debian\|Devuan' ; then \ + options=--install-layout=deb ; \ +- else \ +- options=--prefix=/usr ; \ + fi ; \ + root="--root=$(DESTDIR)" ; \ + fi ; \ +- python setup.py install $$root $$options ++ if test "$(prefix)"; then \ ++ prefix="--prefix=$(prefix)" ; \ ++ fi ; \ ++ python setup.py install $$prefix $$root $$options diff --git a/pkgs/tools/filesystems/ceph/generic.nix b/pkgs/tools/filesystems/ceph/generic.nix index 4d358d6a9c59..b899192aa3cf 100644 --- a/pkgs/tools/filesystems/ceph/generic.nix +++ b/pkgs/tools/filesystems/ceph/generic.nix @@ -113,7 +113,9 @@ stdenv.mkDerivation { ]; nativeBuildInputs = [ autoconf automake makeWrapper pkgconfig libtool which ] - ++ optionals (versionAtLeast version "10.0.0") [ pythonPackages.setuptools ]; + ++ optionals (versionAtLeast version "9.0.2") [ + pythonPackages.setuptools pythonPackages.argparse + ]; buildInputs = buildInputs ++ cryptoLibsMap.${cryptoStr} ++ [ boost python libxml2 optYasm optLibatomic_ops optLibs3 malloc pythonPackages.flask zlib ] ++ optional (versionAtLeast version "9.0.0") [ @@ -147,7 +149,7 @@ stdenv.mkDerivation { preConfigure = '' # Ceph expects the arch command to be usable during configure # for detecting the assembly type - mkdir mybin + mkdir -p mybin echo "#${stdenv.shell} -e" >> mybin/arch echo "uname -m" >> mybin/arch chmod +x mybin/arch @@ -157,6 +159,10 @@ stdenv.mkDerivation { # Fix the python site-packages install directory sed -i "s,\(PYTHON\(\|_EXEC\)_PREFIX=\).*,\1'$lib',g" configure + + # Fix the PYTHONPATH for installing ceph-detect-init to $out + mkdir -p "$(toPythonPath $out)" + export PYTHONPATH="$(toPythonPath $out):$PYTHONPATH" ''; configureFlags = [ @@ -200,7 +206,7 @@ stdenv.mkDerivation { ] ++ optional (versionAtLeast version "9.0.1") [ (mkWith false "tcmalloc-minimal" null) (mkWith false "valgrind" null) - ] ++ optional (versionAtLeast version "10.0.0") [ + ] ++ optional (versionAtLeast version "9.0.2") [ (mkWith true "man-pages" null) (mkWith true "systemd-libexec-dir" "\${TMPDIR}") ];