2023-05-24 13:37:59 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, erlang
|
|
|
|
, icu
|
|
|
|
, openssl
|
|
|
|
, spidermonkey_91
|
|
|
|
, python3
|
|
|
|
, nixosTests
|
|
|
|
}:
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "couchdb";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "3.3.2";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://apache/couchdb/source/${version}/apache-${pname}-${version}.tar.gz";
|
2023-05-24 13:37:59 +00:00
|
|
|
hash = "sha256-PWgj1C0Qzw1PhsnE/lnJkyyJ1oV4/LbEtCeNx2kwjao=";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
2022-04-27 09:35:20 +00:00
|
|
|
substituteInPlace src/couch/rebar.config.script --replace '/usr/include/mozjs-91' "${spidermonkey_91.dev}/include/mozjs-91"
|
2023-05-24 13:37:59 +00:00
|
|
|
substituteInPlace configure --replace '/usr/include/''${SM_HEADERS}' "${spidermonkey_91.dev}/include/mozjs-91"
|
2020-09-25 04:45:31 +00:00
|
|
|
patchShebangs bin/rebar
|
|
|
|
'';
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
erlang
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
icu
|
|
|
|
openssl
|
|
|
|
spidermonkey_91
|
|
|
|
(python3.withPackages(ps: with ps; [ requests ]))
|
|
|
|
];
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
dontAddPrefix= "True";
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--spidermonkey-version=91"
|
|
|
|
];
|
|
|
|
|
|
|
|
buildFlags = [
|
|
|
|
"release"
|
|
|
|
];
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2023-05-24 13:37:59 +00:00
|
|
|
runHook preInstall
|
2020-09-25 04:45:31 +00:00
|
|
|
mkdir -p $out
|
|
|
|
cp -r rel/couchdb/* $out
|
2023-05-24 13:37:59 +00:00
|
|
|
runHook postInstall
|
2020-09-25 04:45:31 +00:00
|
|
|
'';
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests) couchdb;
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-09-25 04:45:31 +00:00
|
|
|
description = "A database that uses JSON for documents, JavaScript for MapReduce queries, and regular HTTP for an API";
|
2021-12-30 13:39:12 +00:00
|
|
|
homepage = "https://couchdb.apache.org";
|
2020-09-25 04:45:31 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ lostnet ];
|
|
|
|
};
|
|
|
|
}
|