1{
2 autoreconfHook,
3 autoconf-archive,
4 doxygen,
5 ell,
6 fetchFromGitHub,
7 fontconfig,
8 graphviz,
9 lib,
10 pandoc,
11 perl,
12 pkg-config,
13 stdenv,
14 systemd,
15}:
16
17stdenv.mkDerivation (finalAttrs: {
18 pname = "mptcpd";
19 version = "0.13";
20
21 src = fetchFromGitHub {
22 owner = "multipath-tcp";
23 repo = "mptcpd";
24 rev = "v${finalAttrs.version}";
25 hash = "sha256-gPXtYmCLJ8eL6VfCi3kpDA7lNn38WB6J4FXefdu2D7M=";
26 };
27
28 outputs = [
29 "out"
30 "doc"
31 ];
32
33 nativeBuildInputs = [
34 autoreconfHook
35 autoconf-archive
36 doxygen
37 graphviz
38 pandoc
39 perl
40 pkg-config
41 ];
42
43 # ref. https://github.com/multipath-tcp/mptcpd/blob/main/README.md#bootstrapping
44 preConfigure = "./bootstrap";
45
46 # fix: 'To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"'
47 postConfigure = "doxygen -u";
48
49 configureFlags = [
50 "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
51 ];
52
53 # fix: 'Fontconfig error: Cannot load default config file: No such file: (null)'
54 env.FONTCONFIG_FILE = "${fontconfig.out}/etc/fonts/fonts.conf";
55
56 buildInputs = [
57 ell
58 systemd
59 ];
60
61 # fix: 'Fontconfig error: No writable cache directories'
62 preBuild = "export XDG_CACHE_HOME=$(mktemp -d)";
63
64 # build and install doc
65 postBuild = "make doxygen-doc";
66 postInstall = "mv doc $doc";
67
68 doCheck = true;
69
70 meta = {
71 description = "Daemon for Linux that performs Multipath TCP path management related operations in the user space";
72 homepage = "https://github.com/multipath-tcp/mptcpd";
73 changelog = "https://github.com/multipath-tcp/mptcpd/blob/${finalAttrs.src.rev}/NEWS";
74 license = lib.licenses.bsd3;
75 maintainers = with lib.maintainers; [ nim65s ];
76 mainProgram = "mptcpize";
77 platforms = lib.platforms.linux;
78 };
79})