1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 doxygen,
7}:
8
9stdenv.mkDerivation rec {
10 pname = "uri";
11 version = "1.1.0";
12
13 src = fetchFromGitHub {
14 owner = "cpp-netlib";
15 repo = "uri";
16 rev = "v${version}";
17 sha256 = "148361pixrm94q6v04k13s1msa04bx9yc3djb0lxpa7dlw19vhcd";
18 };
19
20 env.NIX_CFLAGS_COMPILE = toString (
21 [
22 "-Wno-error=parentheses"
23 # Needed with GCC 12
24 "-Wno-error=deprecated-declarations"
25 "-Wno-error=nonnull"
26 ]
27 ++ lib.optionals stdenv.cc.isClang [
28 # Needed with Clang 16
29 "-Wno-error=deprecated-builtins"
30 ]
31 );
32
33 nativeBuildInputs = [
34 cmake
35 doxygen
36 ];
37
38 cmakeFlags = [
39 "-DUri_BUILD_TESTS=OFF"
40 "-DUri_BUILD_DOCS=ON"
41 "-DBUILD_SHARED_LIBS=ON"
42 ];
43
44 postBuild = "make doc";
45
46 postInstall = ''
47 install -vd $out/share/doc
48 cp -vR html $out/share/doc
49 '';
50
51 meta = {
52 description = "C++ URI library";
53 homepage = "https://cpp-netlib.org";
54 license = lib.licenses.boost;
55 platforms = lib.platforms.all;
56 };
57}