From 29bcaf04cbc9052acd4522733fe8ee1fa91902dc Mon Sep 17 00:00:00 2001 From: ajs124 Date: Wed, 3 Mar 2021 02:44:44 +0100 Subject: [PATCH] couchdb2: drop --- nixos/modules/services/databases/couchdb.nix | 19 ++----- nixos/tests/couchdb.nix | 2 - pkgs/servers/http/couchdb/2.0.0.nix | 57 ------------------- pkgs/servers/http/couchdb/jsapi.patch | 60 -------------------- pkgs/top-level/aliases.nix | 3 +- pkgs/top-level/all-packages.nix | 4 -- 6 files changed, 7 insertions(+), 138 deletions(-) delete mode 100644 pkgs/servers/http/couchdb/2.0.0.nix delete mode 100644 pkgs/servers/http/couchdb/jsapi.patch diff --git a/nixos/modules/services/databases/couchdb.nix b/nixos/modules/services/databases/couchdb.nix index c99a7529213..6cc29cd717e 100644 --- a/nixos/modules/services/databases/couchdb.nix +++ b/nixos/modules/services/databases/couchdb.nix @@ -4,24 +4,17 @@ with lib; let cfg = config.services.couchdb; - useVersion2 = strings.versionAtLeast (strings.getVersion cfg.package) "2.0"; configFile = pkgs.writeText "couchdb.ini" ( '' [couchdb] database_dir = ${cfg.databaseDir} uri_file = ${cfg.uriFile} view_index_dir = ${cfg.viewIndexDir} - '' + (if cfg.adminPass != null then - '' + '' + (optionalString (cfg.adminPass != null) '' [admins] ${cfg.adminUser} = ${cfg.adminPass} - '' else - "") + (if useVersion2 then - '' + '' + '' [chttpd] - '' else - '' - [httpd] '') + '' port = ${toString cfg.port} @@ -30,8 +23,7 @@ let [log] file = ${cfg.logFile} ''); - executable = if useVersion2 then "${cfg.package}/bin/couchdb" - else ''${cfg.package}/bin/couchdb -a ${configFile} -a ${pkgs.writeText "couchdb-extra.ini" cfg.extraConfig} -a ${cfg.configFile}''; + executable = "${cfg.package}/bin/couchdb"; in { @@ -177,8 +169,7 @@ in { environment.systemPackages = [ cfg.package ]; - services.couchdb.configFile = mkDefault - (if useVersion2 then "/var/lib/couchdb/local.ini" else "/var/lib/couchdb/couchdb.ini"); + services.couchdb.configFile = mkDefault "/var/lib/couchdb/local.ini"; systemd.tmpfiles.rules = [ "d '${dirOf cfg.uriFile}' - ${cfg.user} ${cfg.group} - -" @@ -195,7 +186,7 @@ in { touch ${cfg.configFile} ''; - environment = mkIf useVersion2 { + environment = { # we are actually specifying 4 configuration files: # 1. the preinstalled default.ini # 2. the module configuration diff --git a/nixos/tests/couchdb.nix b/nixos/tests/couchdb.nix index d038ee7d890..b0b865767f3 100644 --- a/nixos/tests/couchdb.nix +++ b/nixos/tests/couchdb.nix @@ -24,8 +24,6 @@ with lib; }; nodes = { - couchdb1 = makeNode pkgs.couchdb testuser testpass; - couchdb2 = makeNode pkgs.couchdb2 testuser testpass; couchdb3 = makeNode pkgs.couchdb3 testuser testpass; }; diff --git a/pkgs/servers/http/couchdb/2.0.0.nix b/pkgs/servers/http/couchdb/2.0.0.nix deleted file mode 100644 index 2881a3dc196..00000000000 --- a/pkgs/servers/http/couchdb/2.0.0.nix +++ /dev/null @@ -1,57 +0,0 @@ -{ lib, 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 < #!${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 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/pkgs/servers/http/couchdb/jsapi.patch b/pkgs/servers/http/couchdb/jsapi.patch deleted file mode 100644 index bb7d4ca610c..00000000000 --- a/pkgs/servers/http/couchdb/jsapi.patch +++ /dev/null @@ -1,60 +0,0 @@ -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 - #include - #include --#include -+#include - #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 - #endif - --#include -+#include - #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 -+#include - #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 - #include - --#include -+#include - - #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 -+#include - - typedef struct { - int no_eval; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 9673e9a0410..3d10ed004cb 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -120,7 +120,8 @@ mapAliases ({ conntrack_tools = conntrack-tools; # added 2018-05 cool-old-term = cool-retro-term; # added 2015-01-31 coprthr = throw "coprthr has been removed."; # added 2019-12-08 - couchdb = throw "couchdb was removed from nixpkgs, use couchdb2 or couchdb3 instead"; # added 2021-03-03 + couchdb = throw "couchdb was removed from nixpkgs, use couchdb3 instead"; # added 2021-03-03 + couchdb2 = throw "couchdb2 was removed from nixpkgs, use couchdb3 instead"; # added 2021-03-03 corebird = throw "corebird was deprecated 2019-10-02: See https://www.patreon.com/posts/corebirds-future-18921328. Please use Cawbird as replacement."; coredumper = throw "coredumper has been removed: abandoned by upstream."; # added 2019-11-16 cpp_ethereum = throw "cpp_ethereum has been removed; abandoned upstream."; # added 2020-11-30 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b5947d7f7d5..e8c23f6d027 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18542,10 +18542,6 @@ in clickhouse-cli = with python3Packages; toPythonApplication clickhouse-cli; - couchdb2 = callPackage ../servers/http/couchdb/2.0.0.nix { - erlang = erlangR21; - }; - couchdb3 = callPackage ../servers/http/couchdb/3.nix { erlang = erlangR22; };