lol
1{ lib, stdenv, fetchFromGitHub, fetchpatch, meson, ninja, pkg-config, yaml-cpp, systemd
2, python3Packages, asciidoc, libxslt, docbook_xml_dtd_45, docbook_xsl
3, libxml2, docbook5
4}:
5
6stdenv.mkDerivation rec {
7 pname = "ip2unix";
8 version = "2.2.1";
9
10 src = fetchFromGitHub {
11 owner = "nixcloud";
12 repo = "ip2unix";
13 rev = "v${version}";
14 hash = "sha256-+p5wQbX35LAjZ4vIE4AhI4M6gQ7gVviqf9jJDAr9xg8";
15 };
16
17 patches = [
18 # https://github.com/nixcloud/ip2unix/pull/35
19 # fix out of range string_view access
20 (fetchpatch {
21 url = "https://github.com/nixcloud/ip2unix/commit/050ddf76b4b925f27e255fbb820b0700407ceb2b.patch";
22 hash = "sha256-5vaLmZmwuiMGV4KnVhuDSnXG1a390aBU51TShwpaMLs=";
23 })
24 ];
25
26 nativeBuildInputs = [
27 meson ninja pkg-config asciidoc libxslt.bin docbook_xml_dtd_45 docbook_xsl
28 libxml2.bin docbook5 python3Packages.pytest python3Packages.pytest-timeout
29 systemd
30 ];
31
32 buildInputs = [ yaml-cpp ];
33
34 doCheck = true;
35
36 doInstallCheck = true;
37 installCheckPhase = ''
38 found=0
39 for man in "$out/share/man/man1"/ip2unix.1*; do
40 test -s "$man" && found=1
41 done
42 if [ $found -ne 1 ]; then
43 echo "ERROR: Manual page hasn't been generated." >&2
44 exit 1
45 fi
46 '';
47
48 meta = {
49 homepage = "https://github.com/nixcloud/ip2unix";
50 description = "Turn IP sockets into Unix domain sockets";
51 platforms = lib.platforms.linux;
52 license = lib.licenses.lgpl3;
53 maintainers = [ lib.maintainers.aszlig ];
54 mainProgram = "ip2unix";
55 };
56}