Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emacsPackages.notdeft: trivialBuild -> melpaBuild #328003

Merged
merged 3 commits into from
Jul 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{ lib
, stdenv
, trivialBuild
, fetchFromGitHub
, emacs
, hydra
, ivy
, pkg-config
, tclap
, xapian
{
lib,
stdenv,
melpaBuild,
fetchFromGitHub,
hydra,
ivy,
pkg-config,
tclap,
xapian,
# Include pre-configured hydras
, withHydra ? false
withHydra ? false,
# Include Ivy integration
, withIvy ? false
withIvy ? false,
}:

let
pname = "notdeft";
version = "20211204.0846";
version = "0-unstable-2021-12-04";

src = fetchFromGitHub {
owner = "hasu";
Expand All @@ -32,7 +32,11 @@ let

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

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

installPhase = ''
runHook preInstall
Expand All @@ -44,32 +48,29 @@ let
'';
};
in
trivialBuild {
melpaBuild {
inherit pname version src;
packageRequires = lib.optional withHydra hydra
++ lib.optional withIvy ivy;
buildInputs = [ xapian ];

packageRequires = lib.optional withHydra hydra ++ lib.optional withIvy ivy;

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/
files = ''
(:defaults
${lib.optionalString withHydra ''"extras/notdeft-global-hydra.el"''}
${lib.optionalString withHydra ''"extras/notdeft-mode-hydra.el"''}
${lib.optionalString withIvy ''"extras/notdeft-ivy.el"''})
'';

meta = with lib; {
meta = {
homepage = "https://tero.hasu.is/notdeft/";
description = "Fork of Deft that uses Xapian as a search engine";
maintainers = [ maintainers.nessdoor ];
platforms = platforms.linux;
maintainers = [ lib.maintainers.nessdoor ];
license = lib.licenses.bsd3;
platforms = lib.platforms.linux;
};
}