2017-02-10 11:50:28 +00:00
|
|
|
{ stdenv, fetchurl, erlang, icu, openssl, spidermonkey
|
|
|
|
, coreutils, bash, makeWrapper }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "couchdb-${version}";
|
2018-08-17 11:35:22 +00:00
|
|
|
version = "2.2.0";
|
2017-02-10 11:50:28 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://apache/couchdb/source/${version}/apache-${name}.tar.gz";
|
2018-08-17 11:35:22 +00:00
|
|
|
sha256 = "11brqv302j999sd5x8amhj9iqns9cbrlkjg2l9a8xbvkmf5fng0f";
|
2017-02-10 11:50:28 +00:00
|
|
|
};
|
|
|
|
|
2017-11-19 16:39:01 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ erlang icu openssl spidermonkey ];
|
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";
|
2017-08-01 20:03:30 +00:00
|
|
|
homepage = http://couchdb.apache.org;
|
2017-02-10 11:50:28 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ garbas ];
|
|
|
|
};
|
|
|
|
}
|