diff --git a/pkgs/by-name/ch/chawan/mancha-augment-path.diff b/pkgs/by-name/ch/chawan/mancha-augment-path.diff index cbe4f6aed80e..5a1be54fdfa3 100644 --- a/pkgs/by-name/ch/chawan/mancha-augment-path.diff +++ b/pkgs/by-name/ch/chawan/mancha-augment-path.diff @@ -1,15 +1,13 @@ -Add the -m option to man's command line to augment the list of paths -searched by man. The string "OUT" must be substituted with chawan's $out -path after patching. +Add the -m option to man's command line to augment the list of paths searched by man. The required -m option is only available in the mandoc implementation. ---- a/adapter/protocol/man -+++ b/adapter/protocol/man -@@ -75,7 +75,7 @@ EOF +--- a/adapter/protocol/man.nim ++++ b/adapter/protocol/man.nim +@@ -264,7 +264,7 @@ proc myOpen(cmd: string): tuple[ofile, efile: File] = - $section =~ s:([^-\w\200-\377.,])::g; - $man =~ s:([^-\w\200-\377.,])::g; -- open(F, "GROFF_NO_SGR=1 MAN_KEEP_FORMATTING=1 $MAN $section $man 2> /dev/null |"); -+ open(F, "GROFF_NO_SGR=1 MAN_KEEP_FORMATTING=1 $MAN -m OUT/share/man $section $man 2> /dev/null |"); - } - - $ok = 0; + proc doMan(man, keyword, section: string) = + let sectionOpt = if section == "": "" else: ' ' & quoteShellPosix(section) + let cmd = "MANCOLOR=1 GROFF_NO_SGR=1 MAN_KEEP_FORMATTING=1 " & +- man & sectionOpt & ' ' & quoteShellPosix(keyword) ++ man & sectionOpt & " -m @out@ " & quoteShellPosix(keyword) + let (ofile, efile) = myOpen(cmd) + if ofile == nil: diff --git a/pkgs/by-name/ch/chawan/package.nix b/pkgs/by-name/ch/chawan/package.nix index de47458ff974..c2c81ba5cdcc 100644 --- a/pkgs/by-name/ch/chawan/package.nix +++ b/pkgs/by-name/ch/chawan/package.nix @@ -7,34 +7,37 @@ , ncurses , nim , pandoc -, perl , pkg-config , zlib , unstableGitUpdater +, libseccomp +, substituteAll }: stdenv.mkDerivation { pname = "chawan"; - version = "0-unstable-2024-03-01"; + version = "0-unstable-2024-07-14"; src = fetchFromSourcehut { owner = "~bptato"; repo = "chawan"; - rev = "87ba9a87be15abbe06837f1519cfb76f4bf759f3"; - hash = "sha256-Xs+Mxe5/uoxPMf4FuelpO+bRJ1KdfASVI7rWqtboJZw="; + rev = "0e3d67f31df2c2d53aa0e578439852731e5f5af9"; + hash = "sha256-eVoZisQyaebWO58a0a0KR7fwsL1kTmPX1SayqdnmSuk="; fetchSubmodules = true; }; patches = [ # Include chawan's man pages in mancha's search path - ./mancha-augment-path.diff + (substituteAll { + src = ./mancha-augment-path.diff; + out = placeholder "out"; + }) ]; env.NIX_CFLAGS_COMPILE = toString ( lib.optional stdenv.cc.isClang "-Wno-error=implicit-function-declaration" ); - buildInputs = [ curlMinimal ncurses perl zlib ]; nativeBuildInputs = [ makeBinaryWrapper nim @@ -42,10 +45,12 @@ stdenv.mkDerivation { pkg-config ]; - postPatch = '' - substituteInPlace adapter/protocol/man \ - --replace-fail "OUT" $out - ''; + buildInputs = [ + curlMinimal + libseccomp + ncurses + zlib + ]; buildFlags = [ "all" "manpage" ]; installFlags = [