nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 fetchgit,
6 cmake,
7 libuuid,
8 expat,
9 libiconv,
10 botan2,
11 systemd,
12 pkg-config,
13 python3Packages,
14 withIDN ? true,
15 libidn,
16 withPostgreSQL ? false,
17 libpq,
18 withSQLite ? true,
19 sqlite,
20 withUDNS ? true,
21 udns,
22}:
23
24assert lib.assertMsg (
25 withPostgreSQL || withSQLite
26) "At least one Biboumi database provider required";
27
28let
29 louiz_catch = fetchgit {
30 url = "https://lab.louiz.org/louiz/Catch.git";
31 rev = "0a34cc201ef28bf25c88b0062f331369596cb7b7"; # v2.2.1
32 sha256 = "0ad0sjhmzx61a763d2ali4vkj8aa1sbknnldks7xlf4gy83jfrbl";
33 };
34in
35stdenv.mkDerivation rec {
36 pname = "biboumi";
37 version = "9.0";
38
39 src = fetchurl {
40 url = "https://git.louiz.org/biboumi/snapshot/biboumi-${version}.tar.xz";
41 sha256 = "1jvygri165aknmvlinx3jb8cclny6cxdykjf8dp0a3l3228rmzqy";
42 };
43
44 patches = [ ./catch.patch ];
45
46 nativeBuildInputs = [
47 cmake
48 pkg-config
49 python3Packages.sphinx
50 ];
51 buildInputs = [
52 libuuid
53 expat
54 libiconv
55 systemd
56 botan2
57 ]
58 ++ lib.optional withIDN libidn
59 ++ lib.optional withPostgreSQL libpq
60 ++ lib.optional withSQLite sqlite
61 ++ lib.optional withUDNS udns;
62
63 buildFlags = [
64 "all"
65 "man"
66 ];
67
68 preConfigure = ''
69 substituteInPlace CMakeLists.txt --replace /etc/biboumi $out/etc/biboumi
70 cp ${louiz_catch}/single_include/catch.hpp tests/
71 '';
72
73 doCheck = true;
74
75 meta = with lib; {
76 description = "Modern XMPP IRC gateway";
77 mainProgram = "biboumi";
78 platforms = platforms.unix;
79 homepage = "https://lab.louiz.org/louiz/biboumi";
80 license = licenses.zlib;
81 maintainers = [ maintainers.woffs ];
82 };
83}