Luke Granger-Brown
57725ef3ec
git-subtree-dir: third_party/nixpkgs git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
84 lines
1.7 KiB
Nix
84 lines
1.7 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchFromSourcehut
|
|
, makeBinaryWrapper
|
|
, curlMinimal
|
|
, mandoc
|
|
, ncurses
|
|
, nim
|
|
, pandoc
|
|
, pkg-config
|
|
, zlib
|
|
, unstableGitUpdater
|
|
, libseccomp
|
|
, substituteAll
|
|
}:
|
|
|
|
stdenv.mkDerivation {
|
|
pname = "chawan";
|
|
version = "0-unstable-2024-10-25";
|
|
|
|
src = fetchFromSourcehut {
|
|
owner = "~bptato";
|
|
repo = "chawan";
|
|
rev = "28bf2922a33dd987a0a3095bc461589ef23ad37d";
|
|
hash = "sha256-Bxt9uovo69whyAtrpCDz3DyAYjCYaZfMZknnFW0WDao=";
|
|
fetchSubmodules = true;
|
|
};
|
|
|
|
patches = [
|
|
# Include chawan's man pages in mancha's search path
|
|
(substituteAll {
|
|
src = ./mancha-augment-path.diff;
|
|
out = placeholder "out";
|
|
})
|
|
];
|
|
|
|
env.NIX_CFLAGS_COMPILE = toString (
|
|
lib.optional stdenv.cc.isClang "-Wno-error=implicit-function-declaration"
|
|
);
|
|
|
|
nativeBuildInputs = [
|
|
makeBinaryWrapper
|
|
nim
|
|
pandoc
|
|
pkg-config
|
|
];
|
|
|
|
buildInputs = [
|
|
curlMinimal
|
|
libseccomp
|
|
ncurses
|
|
zlib
|
|
];
|
|
|
|
buildFlags = [ "all" "manpage" ];
|
|
installFlags = [
|
|
"DESTDIR=$(out)"
|
|
"PREFIX=/"
|
|
];
|
|
|
|
postInstall =
|
|
let
|
|
makeWrapperArgs = ''
|
|
--set MANCHA_CHA $out/bin/cha \
|
|
--set MANCHA_MAN ${mandoc}/bin/man
|
|
'';
|
|
in
|
|
''
|
|
wrapProgram $out/bin/cha ${makeWrapperArgs}
|
|
wrapProgram $out/bin/mancha ${makeWrapperArgs}
|
|
'';
|
|
|
|
passthru.updateScript = unstableGitUpdater { };
|
|
|
|
meta = {
|
|
description = "Lightweight and featureful terminal web browser";
|
|
homepage = "https://sr.ht/~bptato/chawan/";
|
|
license = lib.licenses.publicDomain;
|
|
platforms = lib.platforms.unix;
|
|
maintainers = with lib.maintainers; [ jtbx ];
|
|
mainProgram = "cha";
|
|
broken = stdenv.hostPlatform.isDarwin; # pending PR #292043
|
|
};
|
|
}
|