unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Marius Bakke <mbakke@fastmail.com>
To: guix-devel@gnu.org
Cc: Marius Bakke <mbakke@fastmail.com>
Subject: [PATCH 5/6] gnu: Add ceph.
Date: Sun, 15 Jan 2017 21:33:37 +0100	[thread overview]
Message-ID: <20170115203338.19769-6-mbakke@fastmail.com> (raw)
In-Reply-To: <20170115203338.19769-1-mbakke@fastmail.com>

* gnu/packages/distributed-filesystems.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
---
 gnu/local.mk                             |   1 +
 gnu/packages/distributed-filesystems.scm | 172 +++++++++++++++++++++++++++++++
 2 files changed, 173 insertions(+)
 create mode 100644 gnu/packages/distributed-filesystems.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 81d774eb6..417e7a0a5 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -102,6 +102,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/dillo.scm			\
   %D%/packages/disk.scm				\
   %D%/packages/display-managers.scm		\
+  %D%/packages/distributed-filesystems.scm	\
   %D%/packages/django.scm			\
   %D%/packages/djvu.scm				\
   %D%/packages/dns.scm				\
diff --git a/gnu/packages/distributed-filesystems.scm b/gnu/packages/distributed-filesystems.scm
new file mode 100644
index 000000000..f215a847e
--- /dev/null
+++ b/gnu/packages/distributed-filesystems.scm
@@ -0,0 +1,172 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages distributed-filesystems)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix build-system gnu)
+  #:use-module (gnu packages bdw-gc)
+  #:use-module (gnu packages boost)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages crypto)
+  #:use-module (gnu packages curl)
+  #:use-module (gnu packages databases)
+  #:use-module (gnu packages gnuzilla)
+  #:use-module (gnu packages jemalloc)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages openldap)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages web)
+  #:use-module (gnu packages xml))
+
+(define-public ceph
+  (package
+    (name "ceph")
+    (version "10.2.5")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://download.ceph.com/tarballs/ceph-"
+                                  version ".tar.gz"))
+              (sha256
+               (base32
+                "1x6m69il34x4rjhybk5cpw4yiad4a193l9vgy57vidwfy5ql5pc2"))
+              (modules '((guix build utils)))
+              (snippet
+               '(begin
+                  ;; Delete bundled software.
+                  (delete-file-recursively "src/test/downloads") ; python-cram
+                  (delete-file-recursively "src/rocksdb")
+                  ;; TODO: unbundle gtest, civetweb, DPDK, SPDK, xxHash.
+                  #t))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:configure-flags
+       (list (string-append "--exec_prefix=" (assoc-ref %outputs "out"))
+             (string-append "--libdir=" (assoc-ref %outputs "lib") "/lib")
+             (string-append "--includedir=" (assoc-ref %outputs "lib") "/include")
+             "--localstatedir=/var"
+             "--sysconfdir=/etc"
+             "--enable-static=no" ; TODO: separate output
+             "--with-man-pages"
+             (string-append "--with-systemd-unit-dir="
+                            (assoc-ref %outputs "out") "/etc/systemd/system")
+             "--without-libxfs" ; TODO: enable when xfsprogs is added.
+             ;; Use jemalloc instead of tcmalloc.
+             "--with-jemalloc")
+       #:make-flags
+       ;; Pass sysconfdir here too so that the sample configuration files
+       ;; and directories are installed to the output instead of root level.
+       (list (string-append "sysconfdir=" (assoc-ref %outputs "out") "/etc")
+             (string-append "LDFLAGS=-Wl,-rpath="
+                            (assoc-ref %outputs "lib") "/lib")
+             ;; The python libraries depend on the ceph libraries,
+             ;; so make sure they are in RUNPATH.
+             (string-append "PYTHON_LDFLAGS=-Wl,-rpath="
+                            (assoc-ref %outputs "lib") "/lib"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-source
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "src/Makefile.in"
+               ;; By default, the PYTHONPATH is set to "src/pybind".
+               ;; Make sure our libraries are found too.
+               (("export PYTHONPATH=") (string-append "export PYTHONPATH="
+                                                      (getenv "PYTHONPATH")
+                                                      ":"))
+
+               ;; Replace 'rocksdb/librocksdb.a' with the rocksdb store path.
+               (("rocksdb/librocksdb\\.a") (string-append
+                                            (assoc-ref inputs "rocksdb:static")
+                                            "/lib/librocksdb.a"))
+               ;; The above string is used both as a make target and a compile
+               ;; flag. No-op the make target.
+               (("^.*cd rocksdb &&.*$") "\ttrue\n"))
+
+             (substitute* "src/test/run-cli-tests"
+               ;; Use our python-cram instead of the (un)bundled one.
+               (("CRAM_BIN=.*$")
+                (string-append "CRAM_BIN=" (which "cram") "\n")))
+
+             (substitute* "src/Makefile.in"
+               ;; Install python packages to default output.
+               (("\\$\\$root \\$\\$options") (string-append
+                                              "--root=/ --prefix="
+                                              (assoc-ref outputs "out"))))
+             #t)))
+       ;; XXX: Tests need more work. The bundled cram tarball (!) needs
+       ;; patching to work on Guix, and the system version does not support
+       ;; '--error-dir'. TODO: How to run other tests/targets?
+       #:tests? #f
+       ;; Tests uses lots of file descriptors and warns about using
+       ;; -j without raising limits on large systems.
+       #:parallel-tests? #f))
+    (outputs
+     '("out"
+       "lib"))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("rocksdb" ,rocksdb) ; for headers
+       ("python2-cram" ,python2-cram)
+       ("python2-cython" ,python2-cython)
+       ("python2-nose" ,python2-nose)
+       ("python2-pip" ,python2-pip)
+       ("python2-sphinx" ,python2-sphinx)
+       ("python2-tox" ,python2-tox)
+       ("python2-virtualenv" ,python2-virtualenv)))
+    (inputs
+     `(("boost" ,boost)
+       ("curl" ,curl)
+       ("expat" ,expat)
+       ("fcgi" ,fcgi)
+       ("fuse" ,fuse)
+       ("jemalloc" ,jemalloc)
+       ("keyutils" ,keyutils)
+       ("leveldb" ,leveldb)
+       ("libaio" ,libaio)
+       ("libatomic-ops" ,libatomic-ops)
+       ("lz4" ,lz4)
+       ("openldap" ,openldap)
+       ("openssl" ,openssl)
+       ("nss" ,nss)
+       ("python" ,python-2)
+       ("rocksdb:static" ,rocksdb "static")
+       ("snappy" ,snappy)
+       ("udev" ,eudev)
+       ("util-linux" ,util-linux)
+       ("zlib" ,zlib)))
+    (home-page "https://ceph.com")
+    (synopsis "Distributed object store and file system")
+    (description
+     "Ceph is a distributed storage system designed for reliability and
+performance.  It provides network-based block devices (RBD), a POSIX
+compliant filesystem (CephFS), and offers compatibility with various
+storage protocols (S3, NFS, and others) through the RADOS gateway.")
+    ;; Ceph is licensed under LGPL2.1, but includes a number of components
+    ;; covered by other licenses. Consult COPYING for full information.
+    (license (list license:lgpl2.1
+                   license:cc-by-sa3.0    ; documentation
+                   license:bsd-2          ; xxHash
+                   license:bsd-3
+                   license:gpl3
+                   license:gpl2
+                   license:public-domain
+                   license:boost1.0
+                   license:expat))))
-- 
2.11.0

  parent reply	other threads:[~2017-01-15 20:34 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-15 20:33 [PATCH 0/6] gnu: Add ceph Marius Bakke
2017-01-15 20:33 ` [PATCH 1/6] gnu: Add leveldb Marius Bakke
2017-01-17 22:34   ` Ludovic Courtès
2017-01-15 20:33 ` [PATCH 2/6] gnu: Add crypto++ Marius Bakke
2017-01-17 22:38   ` Ludovic Courtès
2017-01-17 22:46   ` Leo Famulari
2017-01-17 22:57     ` Marius Bakke
2017-01-15 20:33 ` [PATCH 3/6] gnu: Add python-cram Marius Bakke
2017-01-17 22:36   ` Ludovic Courtès
2017-01-15 20:33 ` [PATCH 4/6] gnu: Add rocksdb Marius Bakke
2017-01-17 22:42   ` Ludovic Courtès
2017-01-18  0:10     ` Marius Bakke
2017-01-18 21:29       ` Ludovic Courtès
2017-01-15 20:33 ` Marius Bakke [this message]
2017-01-17 22:47   ` [PATCH 5/6] gnu: Add ceph Ludovic Courtès
2017-01-17 23:11     ` Marius Bakke
2017-01-18 21:27       ` Ludovic Courtès
2017-01-15 20:33 ` [PATCH 6/6] gnu: fio: Enable rbd support Marius Bakke
2017-01-17 22:48   ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170115203338.19769-6-mbakke@fastmail.com \
    --to=mbakke@fastmail.com \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).