1{
2 lib,
3 stdenv,
4 cmake,
5 fetchFromGitHub,
6 python3,
7 flex,
8 bison,
9 qt5,
10 libiconv,
11 spdlog,
12 sqlite,
13}:
14
15stdenv.mkDerivation (finalAttrs: {
16 pname = "doxygen";
17 version = "1.14.0";
18
19 src = fetchFromGitHub {
20 owner = "doxygen";
21 repo = "doxygen";
22 tag = "Release_${lib.replaceStrings [ "." ] [ "_" ] finalAttrs.version}";
23 hash = "sha256-d90fIP8rDQ30fY1vF3wAPlIa8xrSEOdHTpPjYnduZdI=";
24 };
25
26 # https://github.com/doxygen/doxygen/issues/10928#issuecomment-2179320509
27 postPatch = ''
28 substituteInPlace CMakeLists.txt \
29 --replace-fail 'JAVACC_CHAR_TYPE=\"unsigned char\"' \
30 'JAVACC_CHAR_TYPE=\"char8_t\"' \
31 --replace-fail "CMAKE_CXX_STANDARD 17" "CMAKE_CXX_STANDARD 20"
32 '';
33
34 nativeBuildInputs = [
35 cmake
36 python3
37 flex
38 bison
39 ];
40
41 buildInputs = [
42 libiconv
43 spdlog
44 sqlite
45 ]
46 ++ lib.optionals (qt5 != null) (
47 with qt5;
48 [
49 qtbase
50 wrapQtAppsHook
51 ]
52 );
53
54 cmakeFlags = [
55 "-Duse_sys_spdlog=ON"
56 "-Duse_sys_sqlite3=ON"
57 ]
58 ++ lib.optional (qt5 != null) "-Dbuild_wizard=YES";
59
60 # put examples in an output so people/tools can test against them
61 outputs = [
62 "out"
63 "examples"
64 ];
65
66 postInstall = ''
67 cp -r ../examples $examples
68 '';
69
70 meta = {
71 license = lib.licenses.gpl2Plus;
72 homepage = "https://www.doxygen.nl";
73 changelog = "https://www.doxygen.nl/manual/changelog.html";
74 description = "Source code documentation generator tool";
75 mainProgram = "doxygen";
76 longDescription = ''
77 Doxygen is the de facto standard tool for generating documentation from
78 annotated C++ sources, but it also supports other popular programming
79 languages such as C, Objective-C, C#, PHP, Java, Python, IDL (Corba,
80 Microsoft, and UNO/OpenOffice flavors), Fortran, VHDL and to some extent
81 D. It can generate an on-line documentation browser (in HTML) and/or an
82 off-line reference manual (in LaTeX) from a set of documented source
83 files.
84 '';
85 platforms = if qt5 != null then lib.platforms.linux else lib.platforms.unix;
86 };
87})