unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Efraim Flashner <efraim@flashner.co.il>
To: Lars-Dominik Braun <ldb@leibniz-psychology.org>
Cc: 39881@debbugs.gnu.org
Subject: [bug#39881] Add couchdb
Date: Tue, 10 Mar 2020 13:08:22 +0200	[thread overview]
Message-ID: <20200310110822.GW1423@E5400> (raw)
In-Reply-To: <20200303095049.GA2963@zpidnp36>


[-- Attachment #1.1: Type: text/plain, Size: 1157 bytes --]

I touched up the couchdb patch a bit and there were a couple of things
that stood out to me. The test suite passed for me without any problems.

There are a couple of bundled fonts as well as bundled javascript inside
the share directory, which also makes it to the output.

Looking at %out/lib/ it looks like there are a bunch of other libraries
bundled with couchdb. I don't know much about erlang but I assume all
these libraries should be unbundled. Looking inside erlang I see there
are also a lot of what looks like bundled libraries so I'm not really
sure how that goes.

On the other hand, after talking to you on IRC and looking at how Debian
takes erlang¹ and seems to split it into dozens of package outputs I'm
far more uncertain of how it works.

Anyway, take a look at the changes I made and see if anything/everything
works :)

¹ https://sources.debian.org/src/erlang/1:23.0%7Erc1+dfsg-1/debian/patterns/


-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #1.2: 0001-gnu-Add-couchdb.patch --]
[-- Type: text/plain, Size: 5797 bytes --]

From 238b40d1da1e486392c69840ad9439e5bbb60c4a Mon Sep 17 00:00:00 2001
From: Lars-Dominik Braun <ldb@leibniz-psychology.org>
Date: Tue, 3 Mar 2020 10:38:40 +0100
Subject: [PATCH] gnu: Add couchdb.

* gnu/packages/databases.scm (couchdb): New variable.

---
 gnu/packages/databases.scm | 91 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 90 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index c8d12f43b5..063292c68a 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -74,15 +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 jemalloc)
+  #:use-module (gnu packages icu4c)
   #:use-module (gnu packages language)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
@@ -110,6 +112,7 @@
   #:use-module (gnu packages tcl)
   #:use-module (gnu packages terminals)
   #:use-module (gnu packages textutils)
+  #:use-module (gnu packages time)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages valgrind)
   #:use-module (gnu packages web)
@@ -3403,3 +3406,89 @@ The drivers officially supported by @code{libdbi} are:
 PostreSQL, SQLite, ODBC and MySQL.")
     (home-page "http://soci.sourceforge.net/")
     (license license:boost1.0)))
+
+(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)))
+       ;; TODO: Unbundle fonts, others from share/docs/html/_static, share/www, share/server
+       ;; Remove pre-built binary, will be rebuilt.
+       (snippet '(begin (delete-file "bin/rebar") #t))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:make-flags '("release"
+                      "CC=gcc")
+       #:configure-flags (list "--skip-deps"
+                               "--spidermonkey-version"
+                               ,(version-major (package-version mozjs-60)))
+       #: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") (which "python3")))
+             #t))
+         (replace 'configure
+           (lambda* (#:key (configure-flags '()) #:allow-other-keys)
+             (apply invoke "./configure" configure-flags)))
+         (replace 'install
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             ;; CouchDB tries to bundle erts, use our own copy.
+             (let ((out          (assoc-ref outputs "out"))
+                   (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=" out))
+                 (("BINDIR=\"[^\"]+\"")
+                  (string-append
+                    "BINDIR=" (assoc-ref inputs "erlang")
+                    "/lib/erlang/erts-" erts-version "/bin")))
+               (copy-recursively "rel/couchdb" out))
+             #t)))))
+    (native-inputs
+     ;; for tests
+     `(("curl" ,curl)
+       ("python" ,python)
+       ("python-hypothesis" ,python-hypothesis)
+       ("python-nose" ,python-nose)
+       ("python-requests" ,python-requests)
+       ;; for documentation
+       ("python-sphinx" ,python-sphinx)))
+    (inputs
+     `(("erlang" ,erlang)
+       ("icu4c" ,icu4c)
+       ("mozjs" ,mozjs-60)
+       ("openssl" ,openssl)))
+    (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.25.1


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2020-03-10 11:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-03  9:50 [bug#39881] Add couchdb Lars-Dominik Braun
2020-03-03 12:09 ` Efraim Flashner
2020-03-10 11:08 ` Efraim Flashner [this message]
2020-03-12  9:07   ` Lars-Dominik Braun
2020-05-29  0:38     ` Leo Famulari
2020-05-29  6:28       ` Lars-Dominik Braun
2020-05-29 17:10         ` bug#39881: " Leo Famulari

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=20200310110822.GW1423@E5400 \
    --to=efraim@flashner.co.il \
    --cc=39881@debbugs.gnu.org \
    --cc=ldb@leibniz-psychology.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).