Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
95 lines
1.9 KiB
Nix
95 lines
1.9 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromSourcehut,
|
|
makeBinaryWrapper,
|
|
curlMinimal,
|
|
mandoc,
|
|
ncurses,
|
|
nim,
|
|
pandoc,
|
|
pkg-config,
|
|
brotli,
|
|
zlib,
|
|
gitUpdater,
|
|
versionCheckHook,
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "chawan";
|
|
version = "0.2.2";
|
|
|
|
src = fetchFromSourcehut {
|
|
owner = "~bptato";
|
|
repo = "chawan";
|
|
rev = "v${finalAttrs.version}";
|
|
hash = "sha256-pUwwqFvTtLAGFQG62W90hEH+yPN+ifa5BDRYNh/Jupg=";
|
|
};
|
|
|
|
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"
|
|
);
|
|
|
|
nativeBuildInputs = [
|
|
makeBinaryWrapper
|
|
nim
|
|
pandoc
|
|
pkg-config
|
|
brotli
|
|
];
|
|
|
|
buildInputs = [
|
|
curlMinimal
|
|
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}
|
|
'';
|
|
|
|
nativeInstallCheckInputs = [
|
|
versionCheckHook
|
|
];
|
|
doInstallCheck = true;
|
|
versionCheckProgramArg = "--version";
|
|
|
|
passthru.updateScript = gitUpdater { rev-prefix = "v"; };
|
|
|
|
meta = {
|
|
description = "Lightweight and featureful terminal web browser";
|
|
homepage = "https://sr.ht/~bptato/chawan/";
|
|
changelog = "https://git.sr.ht/~bptato/chawan/refs/v${finalAttrs.version}";
|
|
license = lib.licenses.unlicense;
|
|
platforms = lib.platforms.unix;
|
|
maintainers = [ ];
|
|
mainProgram = "cha";
|
|
};
|
|
})
|