aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/servers/http/couchdb
diff options
context:
space:
mode:
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/servers/http/couchdb')
-rw-r--r--infra/libkookie/nixpkgs/pkgs/servers/http/couchdb/2.0.0.nix57
-rw-r--r--infra/libkookie/nixpkgs/pkgs/servers/http/couchdb/3.nix38
-rw-r--r--infra/libkookie/nixpkgs/pkgs/servers/http/couchdb/default.nix39
-rw-r--r--infra/libkookie/nixpkgs/pkgs/servers/http/couchdb/jsapi.patch60
4 files changed, 194 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/servers/http/couchdb/2.0.0.nix b/infra/libkookie/nixpkgs/pkgs/servers/http/couchdb/2.0.0.nix
new file mode 100644
index 000000000000..737947c0524b
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/servers/http/couchdb/2.0.0.nix
@@ -0,0 +1,57 @@
+{ stdenv, fetchurl, erlang, icu, openssl, spidermonkey_1_8_5
+, coreutils, bash, makeWrapper, python3 }:
+
+stdenv.mkDerivation rec {
+ pname = "couchdb";
+ version = "2.3.1";
+
+
+ # when updating this, please consider bumping the OTP version
+ # in all-packages.nix
+ src = fetchurl {
+ url = "mirror://apache/couchdb/source/${version}/apache-${pname}-${version}.tar.gz";
+ sha256 = "0z926hjqyhxhyr65kqxwpmp80nyfqbig6d9dy8dqflpb87n8rss3";
+ };
+
+ nativeBuildInputs = [ makeWrapper ];
+ buildInputs = [ erlang icu openssl spidermonkey_1_8_5 (python3.withPackages(ps: with ps; [ requests ]))];
+
+ 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; [ ];
+ };
+}
diff --git a/infra/libkookie/nixpkgs/pkgs/servers/http/couchdb/3.nix b/infra/libkookie/nixpkgs/pkgs/servers/http/couchdb/3.nix
new file mode 100644
index 000000000000..bb856d7aa07d
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/servers/http/couchdb/3.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchurl, erlang, icu, openssl, spidermonkey_68
+, coreutils, bash, makeWrapper, python3 }:
+
+stdenv.mkDerivation rec {
+ pname = "couchdb";
+ version = "3.1.1";
+
+
+ # when updating this, please consider bumping the erlang/OTP version
+ # in all-packages.nix
+ src = fetchurl {
+ url = "mirror://apache/couchdb/source/${version}/apache-${pname}-${version}.tar.gz";
+ sha256 = "18wcqxrv2bz88xadkqpqznprrxmcmwr0g6k895xrm8rbp9mpdzlg";
+ };
+
+ buildInputs = [ erlang icu openssl spidermonkey_68 (python3.withPackages(ps: with ps; [ requests ]))];
+ postPatch = ''
+ substituteInPlace src/couch/rebar.config.script --replace '/usr/include/mozjs-68' "${spidermonkey_68.dev}/include/mozjs-68"
+ patchShebangs bin/rebar
+ '';
+
+ dontAddPrefix= "True";
+ configureFlags = ["--spidermonkey-version=68"];
+ buildFlags = ["release"];
+
+ installPhase = ''
+ mkdir -p $out
+ cp -r rel/couchdb/* $out
+ '';
+
+ 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; [ lostnet ];
+ };
+}
diff --git a/infra/libkookie/nixpkgs/pkgs/servers/http/couchdb/default.nix b/infra/libkookie/nixpkgs/pkgs/servers/http/couchdb/default.nix
new file mode 100644
index 000000000000..b484cce15a26
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/servers/http/couchdb/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl, erlang, icu, openssl, spidermonkey_1_8_5, curl, help2man
+, sphinx, which, file, pkgconfig, getopt }:
+
+stdenv.mkDerivation rec {
+ pname = "couchdb";
+ version = "1.7.1";
+
+ src = fetchurl {
+ url = "mirror://apache/couchdb/source/${version}/apache-${pname}-${version}.tar.gz";
+ sha256 = "1b9cbdrmh1i71mrwvhm17v4cf7lckpil1vvq7lpmxyn6zfk0l84i";
+ };
+
+ nativeBuildInputs = [ help2man which file pkgconfig sphinx ];
+ buildInputs = [ erlang icu openssl spidermonkey_1_8_5 curl ];
+
+ postInstall = ''
+ substituteInPlace $out/bin/couchdb --replace getopt "${getopt}/bin/getopt"
+ '';
+
+ /*
+ Versions of SpiderMonkey after the js185-1.0.0 release remove the optional
+ enforcement of preventing anonymous functions in a statement context. This
+ will most likely break your existing JavaScript code as well as render all
+ example code invalid.
+
+ If you wish to ignore this error pass --enable-js-trunk to ./configure.
+ */
+ configureFlags = [
+ "--enable-js-trunk"
+ ];
+
+ 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; [ ];
+ };
+}
diff --git a/infra/libkookie/nixpkgs/pkgs/servers/http/couchdb/jsapi.patch b/infra/libkookie/nixpkgs/pkgs/servers/http/couchdb/jsapi.patch
new file mode 100644
index 000000000000..bb7d4ca610c7
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/servers/http/couchdb/jsapi.patch
@@ -0,0 +1,60 @@
+diff -ru couch_js/http.c couch_js-patched/http.c
+--- apache-couchdb-2.0.0/src/couch/priv/couch_js/http.c 2016-09-12 11:28:51.000000000 +0200
++++ apache-couchdb-2.0.0-patched/src/couch/priv/couch_js/http.c 2017-02-10 10:52:33.025854045 +0100
+@@ -15,7 +15,7 @@
+ #include <string.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+-#include <jsapi.h>
++#include <js/jsapi.h>
+ #include "config.h"
+ #include "utf8.h"
+ #include "util.h"
+diff -ru couch_js/main.c couch_js-patched/main.c
+--- apache-couchdb-2.0.0/src/couch/priv/couch_js/main.c 2016-09-12 11:28:51.000000000 +0200
++++ apache-couchdb-2.0.0-patched/src/couch/priv/couch_js/main.c 2017-02-10 10:52:33.001854154 +0100
+@@ -20,7 +20,7 @@
+ #include <unistd.h>
+ #endif
+
+-#include <jsapi.h>
++#include <js/jsapi.h>
+ #include "config.h"
+ #include "http.h"
+ #include "utf8.h"
+diff -ru couch_js/utf8.c couch_js-patched/utf8.c
+--- apache-couchdb-2.0.0/src/couch/priv/couch_js/utf8.c 2016-09-12 11:28:51.000000000 +0200
++++ apache-couchdb-2.0.0-patched/src/couch/priv/couch_js/utf8.c 2017-02-10 10:52:33.009854117 +0100
+@@ -10,7 +10,7 @@
+ // License for the specific language governing permissions and limitations under
+ // the License.
+
+-#include <jsapi.h>
++#include <js/jsapi.h>
+ #include "config.h"
+
+ static int
+diff -ru couch_js/util.c couch_js-patched/util.c
+--- apache-couchdb-2.0.0/src/couch/priv/couch_js/util.c 2016-09-12 11:28:51.000000000 +0200
++++ apache-couchdb-2.0.0-patched/src/couch/priv/couch_js/util.c 2017-02-10 10:52:33.017854081 +0100
+@@ -13,7 +13,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+
+-#include <jsapi.h>
++#include <js/jsapi.h>
+
+ #include "help.h"
+ #include "util.h"
+diff -ru couch_js/util.h couch_js-patched/util.h
+--- apache-couchdb-2.0.0/src/couch/priv/couch_js/util.h 2016-09-12 11:28:51.000000000 +0200
++++ apache-couchdb-2.0.0-patched/src/couch/priv/couch_js/util.h 2017-02-10 10:52:32.988854212 +0100
+@@ -13,7 +13,7 @@
+ #ifndef COUCHJS_UTIL_H
+ #define COUCHJS_UTIL_H
+
+-#include <jsapi.h>
++#include <js/jsapi.h>
+
+ typedef struct {
+ int no_eval;