Merge pull request #266453 from nessdoor/emacsPackages/notdeft

emacsPackages.notdeft: init at 20211204.0846
This commit is contained in:
adisbladis 2023-11-10 10:23:13 +13:00 committed by GitHub
commit 1f37660f64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 77 additions and 0 deletions

View File

@ -65,6 +65,8 @@ in
mu4e = callPackage ./manual-packages/mu4e { };
notdeft = callPackage ./manual-packages/notdeft { };
ott-mode = callPackage ./manual-packages/ott-mode { };
perl-completion = callPackage ./manual-packages/perl-completion { };

View File

@ -0,0 +1,75 @@
{ lib
, stdenv
, trivialBuild
, fetchFromGitHub
, emacs
, hydra
, ivy
, pkg-config
, tclap
, xapian
# Include pre-configured hydras
, withHydra ? false
# Include Ivy integration
, withIvy ? false
}:
let
pname = "notdeft";
version = "20211204.0846";
src = fetchFromGitHub {
owner = "hasu";
repo = "notdeft";
rev = "1b7054dcfc3547a7cafeb621552cec01d0540478";
hash = "sha256-LMMLJFVpmoE/y3MqrgY2fmsehmzk6TkLsVoHmFUxiSw=";
};
# Xapian bindings for NotDeft
notdeft-xapian = stdenv.mkDerivation {
pname = "notdeft-xapian";
inherit version src;
sourceRoot = "${src.name}/xapian";
nativeBuildInputs = [ pkg-config tclap xapian ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp notdeft-xapian $out/bin
runHook postInstall
'';
};
in
trivialBuild {
inherit pname version src;
packageRequires = lib.optional withHydra hydra
++ lib.optional withIvy ivy;
buildInputs = [ xapian ];
postPatch = ''
substituteInPlace notdeft-xapian.el \
--replace 'defcustom notdeft-xapian-program nil' \
"defcustom notdeft-xapian-program \"${notdeft-xapian}/bin/notdeft-xapian\""
'';
# Extra modules are contained in the extras/ directory
preBuild = lib.optionalString withHydra ''
mv extras/notdeft-{mode-hydra,global-hydra}.el ./
'' +
lib.optionalString withIvy ''
mv extras/notdeft-ivy.el ./
'' + ''
rm -r extras/
'';
meta = with lib; {
homepage = "https://tero.hasu.is/notdeft/";
description = "Fork of Deft that uses Xapian as a search engine";
maintainers = [ maintainers.nessdoor ];
platforms = platforms.linux;
};
}