1{ lib, stdenv, fetchurl, cmake, gtest }:
2
3stdenv.mkDerivation rec {
4 pname = "uriparser";
5 version = "0.9.8";
6
7 # Release tarball differs from source tarball
8 src = fetchurl {
9 url = "https://github.com/uriparser/uriparser/releases/download/${pname}-${version}/${pname}-${version}.tar.bz2";
10 hash = "sha256-ctG1Wb46GAb3iKPZvjShsGPUKqI4spuk7mM9bv/NM70=";
11 };
12
13 nativeBuildInputs = [ cmake ];
14
15 cmakeFlags = [
16 "-DURIPARSER_BUILD_DOCS=OFF"
17 ] ++ lib.optional (!doCheck) "-DURIPARSER_BUILD_TESTS=OFF";
18
19 nativeCheckInputs = [ gtest ];
20 doCheck = stdenv.buildPlatform == stdenv.hostPlatform;
21
22 meta = with lib; {
23 changelog = "https://github.com/uriparser/uriparser/blob/uriparser-${version}/ChangeLog";
24 description = "Strictly RFC 3986 compliant URI parsing library";
25 longDescription = ''
26 uriparser is a strictly RFC 3986 compliant URI parsing and handling library written in C.
27 API documentation is available on uriparser website.
28 '';
29 homepage = "https://uriparser.github.io/";
30 license = licenses.bsd3;
31 maintainers = with maintainers; [ bosu ];
32 mainProgram = "uriparse";
33 platforms = platforms.unix;
34 };
35}