Unverified Commit f1ea0704 authored by Lin Jian's avatar Lin Jian
Browse files

emacsPackages.notdeft: improve build process of notdeft-xapian

Before, the upstream Makefile[1] is used, which does not work well
with nix:
- Hardening flags of nix are ignored.
- One binary of buildInput xapian is run at build time.

[1]: https://github.com/hasu/notdeft/blob/1b7054dcfc3547a7cafeb621552cec01d0540478/xapian/Makefile#L10
parent 72b5f58e
Loading
Loading
Loading
Loading
+16 −3
Original line number Diff line number Diff line
@@ -30,14 +30,23 @@ let
    pname = "notdeft-xapian";
    inherit version src;

    sourceRoot = "${src.name}/xapian";
    strictDeps = true;

    nativeBuildInputs = [
      pkg-config
    nativeBuildInputs = [ pkg-config ];

    buildInputs = [
      tclap
      xapian
    ];

    buildPhase = ''
      runHook preBuild

      $CXX -std=c++11 -o notdeft-xapian xapian/notdeft-xapian.cc -lxapian

      runHook postBuild
    '';

    installPhase = ''
      runHook preInstall

@@ -66,6 +75,10 @@ melpaBuild {
     ${lib.optionalString withIvy ''"extras/notdeft-ivy.el"''})
  '';

  passthru = {
    inherit notdeft-xapian;
  };

  meta = {
    homepage = "https://tero.hasu.is/notdeft/";
    description = "Fork of Deft that uses Xapian as a search engine";