2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv, fetchurl, erlang, icu, openssl, spidermonkey_1_8_5
|
2019-08-13 18:05:21 +02:00
|
|
|
, coreutils, bash, makeWrapper, python3 }:
|
2017-02-10 12:50:28 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "couchdb";
|
2019-08-04 02:34:19 +02:00
|
|
|
version = "2.3.1";
|
2017-02-10 12:50:28 +01:00
|
|
|
|
|
|
|
|
2019-07-16 10:35:47 +02:00
|
|
|
# when updating this, please consider bumping the OTP version
|
|
|
|
# in all-packages.nix
|
2017-02-10 12:50:28 +01:00
|
|
|
src = fetchurl {
|
2019-08-15 14:41:18 +02:00
|
|
|
url = "mirror://apache/couchdb/source/${version}/apache-${pname}-${version}.tar.gz";
|
2019-08-04 02:34:19 +02:00
|
|
|
sha256 = "0z926hjqyhxhyr65kqxwpmp80nyfqbig6d9dy8dqflpb87n8rss3";
|
2017-02-10 12:50:28 +01:00
|
|
|
};
|
|
|
|
|
2017-11-19 17:39:01 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2020-10-09 19:42:05 +02:00
|
|
|
buildInputs = [ erlang icu openssl spidermonkey_1_8_5 (python3.withPackages(ps: with ps; [ requests ]))];
|
2017-02-10 12:50:28 +01:00
|
|
|
|
|
|
|
patches = [ ./jsapi.patch ];
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/couch/rebar.config.script --replace '-DHAVE_CURL -I/usr/local/include' "-DHAVE_CURL -I/usr/local/include $NIX_CFLAGS_COMPILE"
|
|
|
|
|
|
|
|
patch bin/rebar <<EOF
|
|
|
|
1c1
|
|
|
|
< #!/usr/bin/env escript
|
|
|
|
---
|
|
|
|
> #!${coreutils}/bin/env escript
|
|
|
|
EOF
|
|
|
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Configure a username. The build system would use "couchdb" as
|
|
|
|
# default if none is provided. Note that it is unclear where this
|
|
|
|
# username is actually used in the build, as any choice seems to be
|
|
|
|
# working.
|
|
|
|
configurePhase = ''
|
|
|
|
./configure -u nobody
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
make release
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -r rel/couchdb/* $out
|
|
|
|
wrapProgram $out/bin/couchdb --suffix PATH : ${bash}/bin
|
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2017-02-10 12:50:28 +01:00
|
|
|
description = "A database that uses JSON for documents, JavaScript for MapReduce queries, and regular HTTP for an API";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://couchdb.apache.org";
|
2017-02-10 12:50:28 +01:00
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.all;
|
2019-07-03 11:27:39 +02:00
|
|
|
maintainers = with maintainers; [ ];
|
2017-02-10 12:50:28 +01:00
|
|
|
};
|
|
|
|
}
|