From 5049680bc864c579f7b5c854ab642b34a2783036 Mon Sep 17 00:00:00 2001 From: Anomalocaridid <29845794+Anomalocaridid@users.noreply.github.com> Date: Wed, 6 Sep 2023 22:15:32 -0400 Subject: [PATCH] nnn: add plugins, quitcd, and pcre and extra make flags build options --- pkgs/applications/file-managers/nnn/default.nix | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/file-managers/nnn/default.nix b/pkgs/applications/file-managers/nnn/default.nix index 6b7e8f9c6421..af4064abbec1 100644 --- a/pkgs/applications/file-managers/nnn/default.nix +++ b/pkgs/applications/file-managers/nnn/default.nix @@ -10,11 +10,14 @@ , readline , which , musl-fts +, pcre # options , conf ? null , withIcons ? false , withNerdIcons ? false , withEmojis ? false +, withPcre ? false +, extraMakeFlags ? [ ] }: # Mutually exclusive options @@ -44,7 +47,9 @@ stdenv.mkDerivation (finalAttrs: { preBuild = lib.optionalString (conf != null) "cp ${finalAttrs.configFile} src/nnn.h"; nativeBuildInputs = [ installShellFiles makeWrapper pkg-config ]; - buildInputs = [ readline ncurses ] ++ lib.optional stdenv.hostPlatform.isMusl musl-fts; + buildInputs = [ readline ncurses ] + ++ lib.optional stdenv.hostPlatform.isMusl musl-fts + ++ lib.optional withPcre pcre; env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isMusl "-I${musl-fts}/include"; NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isMusl "-lfts"; @@ -52,7 +57,9 @@ stdenv.mkDerivation (finalAttrs: { makeFlags = [ "PREFIX=$(out)" ] ++ lib.optionals withIcons [ "O_ICONS=1" ] ++ lib.optionals withNerdIcons [ "O_NERD=1" ] - ++ lib.optionals withEmojis [ "O_EMOJI=1" ]; + ++ lib.optionals withEmojis [ "O_EMOJI=1" ] + ++ lib.optionals withPcre [ "O_PCRE=1" ] + ++ extraMakeFlags; binPath = lib.makeBinPath [ file which ]; @@ -63,6 +70,9 @@ stdenv.mkDerivation (finalAttrs: { installShellCompletion --fish misc/auto-completion/fish/nnn.fish installShellCompletion --zsh misc/auto-completion/zsh/_nnn + cp -r plugins $out/share + cp -r misc/quitcd $out/share/quitcd + wrapProgram $out/bin/nnn --prefix PATH : "$binPath" '';