1{
2 lib,
3 stdenv,
4 fetchurl,
5 cmake,
6 openssl,
7 pkg-config,
8 withPerl ? false,
9 perl,
10 withPython ? false,
11 python3,
12 withTcl ? false,
13 tcl,
14 withCyrus ? true,
15 cyrus_sasl,
16 withUnicode ? true,
17 icu,
18 withZlib ? true,
19 zlib,
20 withIPv6 ? true,
21 withDebug ? false,
22}:
23
24stdenv.mkDerivation (finalAttrs: {
25 pname = "znc";
26 version = "1.10.1";
27
28 src = fetchurl {
29 url = "https://znc.in/releases/archive/znc-${finalAttrs.version}.tar.gz";
30 hash = "sha256-Tm52hR2/JgYYWXK1PsXeytaP5TtjpW5N+LizwKbEaAA=";
31 };
32
33 postPatch = ''
34 substituteInPlace znc.pc.cmake.in \
35 --replace-fail 'bindir=''${exec_prefix}/@CMAKE_INSTALL_BINDIR@' "bindir=@CMAKE_INSTALL_FULL_BINDIR@" \
36 --replace-fail 'libdir=''${prefix}/@CMAKE_INSTALL_LIBDIR@' "libdir=@CMAKE_INSTALL_FULL_LIBDIR@" \
37 --replace-fail 'datadir=''${prefix}/@CMAKE_INSTALL_DATADIR@' "datadir=@CMAKE_INSTALL_FULL_DATADIR@" \
38 --replace-fail 'includedir=''${prefix}/@CMAKE_INSTALL_INCLUDEDIR@' "includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@" \
39 --replace-fail 'datarootdir=''${prefix}/@CMAKE_INSTALL_DATAROOTDIR@' "datarootdir=@CMAKE_INSTALL_FULL_DATAROOTDIR@"
40 '';
41
42 nativeBuildInputs = [
43 cmake
44 pkg-config
45 ];
46
47 buildInputs = [
48 openssl
49 ]
50 ++ lib.optional withPerl perl
51 ++ lib.optional withPython python3
52 ++ lib.optional withTcl tcl
53 ++ lib.optional withCyrus cyrus_sasl
54 ++ lib.optional withUnicode icu
55 ++ lib.optional withZlib zlib;
56
57 configureFlags = [
58 (lib.enableFeature withPerl "perl")
59 (lib.enableFeature withPython "python")
60 (lib.enableFeature withTcl "tcl")
61 (lib.withFeatureAs withTcl "tcl" "${tcl}/lib")
62 (lib.enableFeature withCyrus "cyrus")
63 ]
64 ++ lib.optionals (!withIPv6) [ "--disable-ipv6" ]
65 ++ lib.optionals withDebug [ "--enable-debug" ];
66
67 enableParallelBuilding = true;
68
69 meta = {
70 description = "Advanced IRC bouncer";
71 homepage = "https://wiki.znc.in/ZNC";
72 maintainers = with lib.maintainers; [
73 schneefux
74 lnl7
75 ];
76 license = lib.licenses.asl20;
77 platforms = lib.platforms.unix;
78 };
79})