2017-02-10 11:50:28 +00:00
|
|
|
{ stdenv, fetchurl, erlang, icu, openssl, spidermonkey
|
2019-08-13 17:05:21 +01:00
|
|
|
, coreutils, bash, makeWrapper, python3 }:
|
2017-02-10 11:50:28 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "couchdb";
|
2019-08-04 01:34:19 +01:00
|
|
|
version = "2.3.1";
|
2017-02-10 11:50:28 +00:00
|
|
|
|
|
|
|
|
2019-07-16 09:35:47 +01:00
|
|
|
# when updating this, please consider bumping the OTP version
|
|
|
|
# in all-packages.nix
|
2017-02-10 11:50:28 +00:00
|
|
|
src = fetchurl {
|
2019-08-15 13:41:18 +01:00
|
|
|
url = "mirror://apache/couchdb/source/${version}/apache-${pname}-${version}.tar.gz";
|
2019-08-04 01:34:19 +01:00
|
|
|
sha256 = "0z926hjqyhxhyr65kqxwpmp80nyfqbig6d9dy8dqflpb87n8rss3";
|
2017-02-10 11:50:28 +00:00
|
|
|
};
|
|
|
|
|
2017-11-19 16:39:01 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2019-08-13 17:05:21 +01:00
|
|
|
buildInputs = [ erlang icu openssl spidermonkey (python3.withPackages(ps: with ps; [ requests ]))];
|
2017-02-10 11:50:28 +00: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
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A database that uses JSON for documents, JavaScript for MapReduce queries, and regular HTTP for an API";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://couchdb.apache.org";
|
2017-02-10 11:50:28 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.all;
|
2019-07-03 10:27:39 +01:00
|
|
|
maintainers = with maintainers; [ ];
|
2017-02-10 11:50:28 +00:00
|
|
|
};
|
|
|
|
}
|