chawan: 0.2.2 -> 0.3.0 (#464253)

This commit is contained in:
Aleksana
2025-11-28 13:23:42 +00:00
committed by GitHub
2 changed files with 8 additions and 38 deletions
@@ -1,13 +0,0 @@
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.nim
+++ b/adapter/protocol/man.nim
@@ -264,7 +264,7 @@ proc myOpen(cmd: string): tuple[ofile, efile: File] =
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:
+8 -25
View File
@@ -3,38 +3,26 @@
stdenv,
fetchFromSourcehut,
makeBinaryWrapper,
curlMinimal,
mandoc,
ncurses,
openssl,
libssh2,
nim,
pandoc,
pkg-config,
brotli,
zlib,
gitUpdater,
versionCheckHook,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "chawan";
version = "0.2.2";
version = "0.3.0";
src = fetchFromSourcehut {
owner = "~bptato";
repo = "chawan";
rev = "v${finalAttrs.version}";
hash = "sha256-pUwwqFvTtLAGFQG62W90hEH+yPN+ifa5BDRYNh/Jupg=";
tag = "v${finalAttrs.version}";
hash = "sha256-y1z1MlwbKGpvtgt4OZtfvxvsOSE6RhnsWUeaRvu7etU=";
};
patches = [ ./mancha-augment-path.diff ];
# Include chawan's man pages in mancha's search path
postPatch = ''
# As we need the $out reference, we can't use `replaceVars` here.
substituteInPlace adapter/protocol/man.nim \
--replace-fail '@out@' "$out"
'';
env.NIX_CFLAGS_COMPILE = toString (
lib.optional stdenv.cc.isClang "-Wno-error=implicit-function-declaration"
);
@@ -42,20 +30,17 @@ stdenv.mkDerivation (finalAttrs: {
nativeBuildInputs = [
makeBinaryWrapper
nim
pandoc
pkg-config
brotli
];
buildInputs = [
curlMinimal
ncurses
zlib
openssl
libssh2
];
buildFlags = [
"all"
"manpage"
];
installFlags = [
"DESTDIR=$(out)"
@@ -65,12 +50,10 @@ stdenv.mkDerivation (finalAttrs: {
postInstall =
let
makeWrapperArgs = ''
--set MANCHA_CHA $out/bin/cha \
--set MANCHA_MAN ${mandoc}/bin/man
--set MANCHA_CHA $out/bin/cha
'';
in
''
wrapProgram $out/bin/cha ${makeWrapperArgs}
wrapProgram $out/bin/mancha ${makeWrapperArgs}
'';