1{
2 lib,
3 python3Packages,
4 fetchFromGitHub,
5 groff,
6 nix-update-script,
7 versionCheckHook,
8 writableTmpDirAsHomeHook,
9}:
10python3Packages.buildPythonApplication rec {
11 pname = "cppman";
12 version = "0.5.9";
13 pyproject = true;
14
15 src = fetchFromGitHub {
16 owner = "aitjcize";
17 repo = "cppman";
18 tag = version;
19 hash = "sha256-iPJR4XAjNrBhFHZVOATPi3WwTC1/Y6HK3qmKLqbaK98=";
20 };
21
22 build-system = with python3Packages; [
23 setuptools
24 distutils
25 ];
26
27 dependencies = [
28 python3Packages.beautifulsoup4
29 python3Packages.html5lib
30 python3Packages.lxml
31 python3Packages.six
32 python3Packages.soupsieve
33 python3Packages.typing-extensions
34 python3Packages.webencodings
35 groff
36 ];
37
38 # cppman pins all dependency versions via requirements.txt as install_requires
39 pythonRelaxDeps = true;
40
41 # bs4 is merely a dummy package and can be safely removed
42 # Ideally, its version would also stay fixed.
43 postPatch = ''
44 substituteInPlace requirements.txt \
45 --replace-fail "bs4==0.0.2" ""
46 '';
47
48 pythonImportsCheck = [
49 "cppman"
50 ];
51
52 nativeCheckInputs = [
53 versionCheckHook
54 writableTmpDirAsHomeHook
55 ];
56 # Writable $HOME is required for `cppman --version` to work
57 versionCheckKeepEnvironment = "HOME";
58 versionCheckProgramArg = "--version";
59
60 passthru.updateScript = nix-update-script { };
61
62 meta = {
63 description = "Terminal viewer for C++ 98/11/14 manual pages";
64 homepage = "https://github.com/aitjcize/cppman";
65 changelog = "https://github.com/aitjcize/cppman/blob/${src.tag}/ChangeLog";
66 license = lib.licenses.gpl3Only;
67 maintainers = with lib.maintainers; [ ryan4yin ];
68 mainProgram = "cppman";
69 };
70}