Unverified Commit 81fc89bb authored by Aleksana's avatar Aleksana Committed by GitHub
Browse files

chawan: 0.2.2 -> 0.3.0 (#464253)

parents 5902241c cffa3bc6
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
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
Original line number Diff line number Diff line
@@ -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}
    '';