1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-27 16:11:58 +00:00
nixpkgs/pkgs/servers/http/couchdb/2.0.0.nix
R. RyanTM 20c9b4727c couchdb2: 2.1.1 -> 2.1.2
Semi-automatic update generated by https://github.com/ryantm/nixpkgs-update tools. This update was made based on information from https://repology.org/metapackage/couchdb/versions.
2018-07-13 04:16:11 -07:00

55 lines
1.5 KiB
Nix

{ stdenv, fetchurl, erlang, icu, openssl, spidermonkey
, coreutils, bash, makeWrapper }:
stdenv.mkDerivation rec {
name = "couchdb-${version}";
version = "2.1.2";
src = fetchurl {
url = "mirror://apache/couchdb/source/${version}/apache-${name}.tar.gz";
sha256 = "1c1ghrmrcyjd3s3pzml6akxf8xxcqy4mfzn5xf8jg158dzarmk53";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ erlang icu openssl spidermonkey ];
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";
homepage = http://couchdb.apache.org;
license = licenses.asl20;
platforms = platforms.all;
maintainers = with maintainers; [ garbas ];
};
}