2024-04-21 15:54:59 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromSourcehut
|
|
|
|
, makeBinaryWrapper
|
|
|
|
, curlMinimal
|
|
|
|
, mandoc
|
|
|
|
, ncurses
|
|
|
|
, nim
|
|
|
|
, pandoc
|
|
|
|
, pkg-config
|
|
|
|
, zlib
|
2024-07-27 06:49:29 +00:00
|
|
|
, unstableGitUpdater
|
|
|
|
, libseccomp
|
|
|
|
, substituteAll
|
2024-04-21 15:54:59 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "chawan";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "0-unstable-2024-09-03";
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
src = fetchFromSourcehut {
|
|
|
|
owner = "~bptato";
|
|
|
|
repo = "chawan";
|
2024-09-19 14:19:46 +00:00
|
|
|
rev = "298684d174be90be57967f15c2f1bf0d24ba2446";
|
|
|
|
hash = "sha256-R/+qLoyewqoOfi264GvZUvpZbN5FX8LtGikQ3FxJEvw=";
|
2024-04-21 15:54:59 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Include chawan's man pages in mancha's search path
|
2024-07-27 06:49:29 +00:00
|
|
|
(substituteAll {
|
|
|
|
src = ./mancha-augment-path.diff;
|
|
|
|
out = placeholder "out";
|
|
|
|
})
|
2024-04-21 15:54:59 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
env.NIX_CFLAGS_COMPILE = toString (
|
|
|
|
lib.optional stdenv.cc.isClang "-Wno-error=implicit-function-declaration"
|
|
|
|
);
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
makeBinaryWrapper
|
|
|
|
nim
|
|
|
|
pandoc
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
buildInputs = [
|
|
|
|
curlMinimal
|
|
|
|
libseccomp
|
|
|
|
ncurses
|
|
|
|
zlib
|
|
|
|
];
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
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}
|
|
|
|
'';
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
passthru.updateScript = unstableGitUpdater { };
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
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";
|
2024-09-26 11:04:55 +00:00
|
|
|
broken = stdenv.hostPlatform.isDarwin; # pending PR #292043
|
2024-04-21 15:54:59 +00:00
|
|
|
};
|
|
|
|
}
|