{ lib, stdenv, fetchFromGitHub, cmake, gbenchmark, gtest, simdjson, simdutf, testers, validatePkgConfig, nix-update-script, }: stdenv.mkDerivation (finalAttrs: { pname = "ada"; version = "4.0.0"; src = fetchFromGitHub { owner = "ada-url"; repo = "ada"; tag = "v${finalAttrs.version}"; hash = "sha256-TvjoLUKO2+YgS1mlyglLb+rBLTO/SWSBVA2S34Z6kMI="; }; outputs = [ "out" "dev" ]; strictDeps = true; nativeBuildInputs = [ cmake validatePkgConfig ]; buildInputs = [ simdutf ]; doCheck = true; checkInputs = [ simdjson gtest gbenchmark ]; cmakeFlags = [ # uses CPM that requires network access (lib.cmakeBool "ADA_TOOLS" false) (lib.cmakeBool "ADA_TESTING" finalAttrs.finalPackage.doCheck) (lib.cmakeBool "ADA_USE_SIMDUTF" true) (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic)) (lib.cmakeBool "FETCHCONTENT_FULLY_DISCONNECTED" true) (lib.cmakeBool "CPM_USE_LOCAL_PACKAGES" true) ]; passthru = { updateScript = nix-update-script { }; tests.pkg-config = testers.hasPkgConfigModules { package = finalAttrs.finalPackage; }; }; __structuredAttrs = true; meta = { description = "WHATWG-compliant and fast URL parser written in modern C"; homepage = "https://github.com/ada-url/ada"; license = with lib.licenses; [ asl20 mit ]; maintainers = with lib.maintainers; [ nickcao ]; platforms = lib.platforms.all; pkgConfigModules = [ "ada" ]; }; })