Commit c1a2de4b authored by Steven Allen's avatar Steven Allen
Browse files

bogofilter: split into bogofilter-db and bogofilter-sqlite

Split the `bogofilter` package into `bogofilter-db` and
`bogofilter-sqlite`, aliasing `bogofilter` to `bogofilter-db`. Users may
also build with any of the supported databases (`kyotocabinet`, `lmdb`,
`sqlite`, or `db`) by passing their preferred database as an override.

The next release (1.3.0) will switch to the sqlite backend by default so
splitting now:

1. Gives users a chance to upgrade at their leisure before the default
switches.
2. Gives users a way to explicitly stick with Berkeley DB (by switching
to `bogofilter-db`.
parent 29f160d4
Loading
Loading
Loading
Loading
+17 −3
Original line number Diff line number Diff line
@@ -7,10 +7,14 @@
  makeWrapper,
  pax,
  perl,
  database ? db,
}:

let
  dbName = lib.getName database;
in
stdenv.mkDerivation (finalAttrs: {
  pname = "bogofilter";
  pname = "bogofilter-${dbName}";
  version = "1.2.5";

  src = fetchurl {
@@ -22,14 +26,23 @@ stdenv.mkDerivation (finalAttrs: {

  buildInputs = [
    flex
    db
    perl # required by bogoupgrade
    database
  ]
  ++ lib.optional (dbName == "db") perl; # required by bogoupgrade

  configureFlags = [
    "--with-database=${dbName}"
  ];

  doCheck = false; # needs "y" tool

  postInstall = ''
    wrapProgram "$out/bin/bf_tar" --prefix PATH : "${lib.makeBinPath [ pax ]}"
  ''
  # Only supports upgrading through various db versions, not useful for
  # other database types.
  + lib.optionalString (dbName != "db") ''
    rm "$out/bin/bogoupgrade"
  '';

  meta = {
@@ -42,6 +55,7 @@ stdenv.mkDerivation (finalAttrs: {
      filter.
    '';
    license = lib.licenses.gpl2Plus;
    mainProgram = "bogofilter";
    platforms = lib.platforms.linux;
  };
})
+3 −0
Original line number Diff line number Diff line
@@ -1590,6 +1590,9 @@ with pkgs;

  blockdiag = with python3Packages; toPythonApplication blockdiag;

  bogofilter-sqlite = bogofilter.override { database = sqlite; };
  bogofilter-db = bogofilter.override { database = db; };

  boomerang = libsForQt5.callPackage ../development/tools/boomerang { };

  bozohttpd-minimal = bozohttpd.override { minimal = true; };