Merge pull request #292494 from jtbx/chawan

chawan: init at 0-unstable-2024-03-01

authored by éclairevoyant and committed by GitHub 516de991 45838d1d

+91
+15
pkgs/by-name/ch/chawan/mancha-augment-path.diff
··· 1 + Add the -m option to man's command line to augment the list of paths 2 + searched by man. The string "OUT" must be substituted with chawan's $out 3 + path after patching. 4 + The required -m option is only available in the mandoc implementation. 5 + --- a/adapter/protocol/man 6 + +++ b/adapter/protocol/man 7 + @@ -75,7 +75,7 @@ EOF 8 + 9 + $section =~ s:([^-\w\200-\377.,])::g; 10 + $man =~ s:([^-\w\200-\377.,])::g; 11 + - open(F, "GROFF_NO_SGR=1 MAN_KEEP_FORMATTING=1 $MAN $section $man 2> /dev/null |"); 12 + + open(F, "GROFF_NO_SGR=1 MAN_KEEP_FORMATTING=1 $MAN -m OUT/share/man $section $man 2> /dev/null |"); 13 + } 14 + 15 + $ok = 0;
+76
pkgs/by-name/ch/chawan/package.nix
··· 1 + { lib 2 + , stdenv 3 + , fetchFromSourcehut 4 + , makeBinaryWrapper 5 + , curlMinimal 6 + , mandoc 7 + , ncurses 8 + , nim 9 + , pandoc 10 + , perl 11 + , pkg-config 12 + , zlib 13 + }: 14 + 15 + stdenv.mkDerivation { 16 + pname = "chawan"; 17 + version = "0-unstable-2024-03-01"; 18 + 19 + src = fetchFromSourcehut { 20 + owner = "~bptato"; 21 + repo = "chawan"; 22 + rev = "87ba9a87be15abbe06837f1519cfb76f4bf759f3"; 23 + hash = "sha256-Xs+Mxe5/uoxPMf4FuelpO+bRJ1KdfASVI7rWqtboJZw="; 24 + fetchSubmodules = true; 25 + }; 26 + 27 + patches = [ 28 + # Include chawan's man pages in mancha's search path 29 + ./mancha-augment-path.diff 30 + ]; 31 + 32 + env.NIX_CFLAGS_COMPILE = toString ( 33 + lib.optional stdenv.cc.isClang "-Wno-error=implicit-function-declaration" 34 + ); 35 + 36 + buildInputs = [ curlMinimal ncurses perl zlib ]; 37 + nativeBuildInputs = [ 38 + makeBinaryWrapper 39 + nim 40 + pandoc 41 + pkg-config 42 + ]; 43 + 44 + postPatch = '' 45 + substituteInPlace adapter/protocol/man \ 46 + --replace-fail "OUT" $out 47 + ''; 48 + 49 + buildFlags = [ "all" "manpage" ]; 50 + installFlags = [ 51 + "DESTDIR=$(out)" 52 + "PREFIX=/" 53 + ]; 54 + 55 + postInstall = 56 + let 57 + makeWrapperArgs = '' 58 + --set MANCHA_CHA $out/bin/cha \ 59 + --set MANCHA_MAN ${mandoc}/bin/man 60 + ''; 61 + in 62 + '' 63 + wrapProgram $out/bin/cha ${makeWrapperArgs} 64 + wrapProgram $out/bin/mancha ${makeWrapperArgs} 65 + ''; 66 + 67 + meta = { 68 + description = "Lightweight and featureful terminal web browser"; 69 + homepage = "https://sr.ht/~bptato/chawan/"; 70 + license = lib.licenses.publicDomain; 71 + platforms = lib.platforms.unix; 72 + maintainers = with lib.maintainers; [ jtbx ]; 73 + mainProgram = "cha"; 74 + broken = stdenv.isDarwin; # pending PR #292043 75 + }; 76 + }