From patchwork Tue Mar 3 09:50:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lars-Dominik Braun X-Patchwork-Id: 20502 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id A58FC27BBE4; Tue, 3 Mar 2020 09:51:12 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 2A14427BBEA for ; Tue, 3 Mar 2020 09:51:11 +0000 (GMT) Received: from localhost ([::1]:44348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j94Ck-0006N9-NT for patchwork@mira.cbaines.net; Tue, 03 Mar 2020 04:51:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49582) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j94Ce-0006N3-2z for guix-patches@gnu.org; Tue, 03 Mar 2020 04:51:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j94Cc-0005ik-LS for guix-patches@gnu.org; Tue, 03 Mar 2020 04:51:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:60955) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j94Cc-0005ig-HL for guix-patches@gnu.org; Tue, 03 Mar 2020 04:51:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j94Cc-0005qL-G5 for guix-patches@gnu.org; Tue, 03 Mar 2020 04:51:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#39881] Add couchdb Resent-From: Lars-Dominik Braun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 03 Mar 2020 09:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 39881 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 39881@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.158322905722448 (code B ref -1); Tue, 03 Mar 2020 09:51:02 +0000 Received: (at submit) by debbugs.gnu.org; 3 Mar 2020 09:50:57 +0000 Received: from localhost ([127.0.0.1]:38695 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j94CX-0005pz-4i for submit@debbugs.gnu.org; Tue, 03 Mar 2020 04:50:57 -0500 Received: from lists.gnu.org ([209.51.188.17]:44545) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j94CV-0005ps-9U for submit@debbugs.gnu.org; Tue, 03 Mar 2020 04:50:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49557) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j94CT-0006KR-33 for guix-patches@gnu.org; Tue, 03 Mar 2020 04:50:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j94CR-0005fO-D7 for guix-patches@gnu.org; Tue, 03 Mar 2020 04:50:53 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:37050) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j94CQ-0005f0-Or for guix-patches@gnu.org; Tue, 03 Mar 2020 04:50:51 -0500 Received: by mail-wr1-x436.google.com with SMTP id q8so3496740wrm.4 for ; Tue, 03 Mar 2020 01:50:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leibniz-psychology-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:subject:message-id:mime-version:content-disposition :content-transfer-encoding:user-agent; bh=lPnLC4duS8Ld4ED+6um0ty+9El3ICRkQpOEBcZEMtqI=; b=veVhHLYRHA/V1ZyMb4AutI2rKuReC4t2OzF85KogOiQzlovBebZ1Y5Bl6c7eyOLHvN lI6dTwAs6nKBJ+0d75LP78egZevYogEUdhs8aOwqbHidhQxtyAl48Q0/gvAwl0Omv8Gq /UZnNZWoIQuyxOubJpANTUDFU8BsBXOT6CJ+G9OzlrsZ2J1bEPBIV03jhwxky8Xku4HO FPKyB5lDN88IMv6nFhcokclTiFbOQQXN7v/OQ0AE8K39I1lVNpDgbdRMSfThqTH4/4Uc 4j9RanlZykcDSd/98OLxK/K9bmfw6Q0vnKoT2D1GdyUUU2jJacpgF21179CNTqVqP/1T L2mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:content-transfer-encoding:user-agent; bh=lPnLC4duS8Ld4ED+6um0ty+9El3ICRkQpOEBcZEMtqI=; b=GVrMxjDw6SzodT/C7rZfAmgXsvg4b4zTfxCynmQYDcuBFwZ4ByQAWytwHgHETD853S xlNfTcOENm9IRwlrGP6NHwfSCDB/7UIxKTQK1ZsZLrNZSLoy17zYCxeIbr8KGpzMODKW l1vj7YDk3GKs4cFQlltPhTnSO/+f6LzrJNuRlHJJz9uUv+BaO50JGZ0ZOxjC3phQ1ZEu zOkcEepXYIMmwLEFfAyNb/wKUDcGVb+vbvZxbE9lM1WdMHpamm6NIW9j6rHIYesIfahc KyASv7F+QKf9PZX1Obq+sdqnloZlvsm1mjCDjjp0rU6tWwnh4Ahjo+7cE9UojA/9SM+H xehQ== X-Gm-Message-State: ANhLgQ1Ny2JauQ2L7HfSSiULLMzMnP3ETbsXUwW0QoY/19wrYlsda8Na xqsjfuBEVQQayNab11oCEV63McGVpwliANSy3AbKhF8aBdGnlZjgtEEh0pIkEivB159aCupPH/B 1W0URnS1JPkDH+wtAiASRlshycSGs3DytfyiLoJXb4F6Eqe65uZbpeABuPfnoBDDG7YouHPn9Cz gjbcER+6g= X-Google-Smtp-Source: ADFU+vsLONQLpZN2OuCTaWONoKOKTxMxc5JQ1Ew9GkbRQaAgqAa7RlG3recWHwAKjRuCjHIPuWOzjA== X-Received: by 2002:adf:f7c4:: with SMTP id a4mr4624048wrq.91.1583229048811; Tue, 03 Mar 2020 01:50:48 -0800 (PST) Received: from localhost (zpidlx9.uni-trier.de. [136.199.85.49]) by smtp.gmail.com with ESMTPSA id p16sm32551354wrw.15.2020.03.03.01.50.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Mar 2020 01:50:48 -0800 (PST) Date: Tue, 3 Mar 2020 10:50:49 +0100 From: Lars-Dominik Braun Message-ID: <20200303095049.GA2963@zpidnp36> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hi, these two patches add couchdb. First, an upgrade to erlang is essential, since our version is quite outdated and has known issues with couchdb. I’m only bumping to a newer maintenance release of 21.x for now. `guix refresh --list-dependent` lists only elixir, which builds fine with the new version and emacs-erlang, build from the same sources, seems to work too. The second patch adds couchdb. I’ve got almost the entire test suite up and running. It is very extensive and takes a lot of time (compared to compilation). Some patching is required to unbundle Erlangs ERTS, so an update to Erlang in the future might break 'install due to the hard-coded version. Any thoughts? Future work: Shepherd service. Cheers, Lars From e3df880d9aa5cbdc983c1a5497cde536f1a13fe6 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Tue, 3 Mar 2020 10:38:40 +0100 Subject: [PATCH 2/2] gnu: Add couchdb * gnu/packages/databases.scm (couchdb): New variable --- gnu/packages/databases.scm | 93 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm index d4891841e4..a4ccb599f6 100644 --- a/gnu/packages/databases.scm +++ b/gnu/packages/databases.scm @@ -74,14 +74,17 @@ #:use-module (gnu packages cyrus-sasl) #:use-module (gnu packages dbm) #:use-module (gnu packages emacs) + #:use-module (gnu packages erlang) #:use-module (gnu packages flex) #:use-module (gnu packages gcc) #:use-module (gnu packages gettext) #:use-module (gnu packages glib) #:use-module (gnu packages gnupg) + #:use-module (gnu packages gnuzilla) #:use-module (gnu packages guile) #:use-module (gnu packages time) #:use-module (gnu packages golang) + #:use-module (gnu packages icu4c) #:use-module (gnu packages jemalloc) #:use-module (gnu packages language) #:use-module (gnu packages libevent) @@ -3368,3 +3371,93 @@ The drivers officially supported by @code{libdbi} are: @end itemize") (home-page "http://libdbi-drivers.sourceforge.net/") (license license:lgpl2.1+))) + +(define-public couchdb + (package + (name "couchdb") + (version "3.0.0") + (source + (origin + (method url-fetch) + (uri (string-append + "mirror://apache/couchdb/source/" version + "/apache-couchdb-" version ".tar.gz")) + (sha256 + (base32 + "1nbz2vafzhp9jv8xna8cfnf99jwn22xs4ydzm426qx7yf0dbn2fi")) + (modules '((guix build utils))) + ;; remove pre-built binary, will be rebuilt + (snippet '(begin (delete-file "bin/rebar") #t)))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'fix-paths + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "src/couch/rebar.config.script" + (("/usr/include/mozjs-60") + (string-append (assoc-ref inputs "mozjs") "/include/mozjs-60"))) + (substitute* "Makefile" + ;; disable python-black code formatting + (("check: all python-black") "check: all") + ;; disable venv creation and package installation + (("python3 -m venv .venv") "true") + (("\\.venv/bin/python3 -m pip install -r requirements.txt") "true") + ;; do not test elixir, depends on `mix` and several external dependencies + (("@\\$\\(MAKE\\) elixir") "") + ;; use system python + (("\\.venv/bin/python3") + (string-append (assoc-ref inputs "python") "/bin/python3"))) + #t)) + (add-after 'unpack 'set-env + (lambda* (#:key inputs #:allow-other-keys) + ;; make sure rebar finds a C compiler + (setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc")) + #t)) + (replace 'configure + (lambda* (#:key inputs #:allow-other-keys) + (invoke "./configure" "--skip-deps" "--spidermonkey-version" "60") + #t)) + (replace 'build + (lambda _ + ;; create a release build + (invoke "make" "release") + #t)) + (replace 'install + (lambda* (#:key inputs outputs #:allow-other-keys) + ;; couchdb tries to bundle erts, use our own copy + (let ((erts-version "10.3.5.9")) + (delete-file-recursively + (string-append "rel/couchdb/erts-" erts-version)) + (substitute* '("rel/couchdb/bin/couchdb" "rel/couchdb/bin/remsh") + (("ROOTDIR=\\$\\{ERTS_BIN_DIR%/\\*\\}") + (string-append "ROOTDIR=" (assoc-ref outputs "out"))) + (("BINDIR=\"[^\"]+\"") + (string-append + "BINDIR=" (assoc-ref inputs "erlang") + "/lib/erlang/erts-" erts-version "/bin"))) + (copy-recursively "rel/couchdb" (assoc-ref outputs "out"))) + #t))))) + (native-inputs + ;; for tests + `(("python" ,python) + ("python-nose" ,python-nose) + ("python-requests" ,python-requests) + ("python-hypothesis" ,python-hypothesis) + ("curl" ,curl) + ;; for documentation + ("python-sphinx" ,python-sphinx))) + (inputs + `(("erlang" ,erlang) + ("icu4c" ,icu4c) + ("openssl" ,openssl) + ("mozjs" ,mozjs-60))) + (home-page "https://couchdb.apache.org/") + (synopsis "Document-oriented NoSQL database, implemented in Erlang") + (description "CouchDB is a database that completely embraces the web. Store +your data with JSON documents. Access your documents with your web browser, via +HTTP. Query, combine, and transform your documents with JavaScript. CouchDB +works well with modern web and mobile apps. You can distribute your data, +efficiently using CouchDB’s incremental replication. CouchDB supports +master-master setups with automatic conflict detection.") + (license license:asl2.0))) -- 2.20.1