From bacf5293569fee452a01b2525be10b4eb35f8224 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Thu, 22 Dec 2022 14:37:43 -0600 Subject: [PATCH] nimPackages.getdns: init at 20221222 --- pkgs/development/libraries/getdns/default.nix | 4 ++- .../nim-packages/getdns/default.nix | 25 +++++++++++++++++++ pkgs/top-level/nim-packages.nix | 3 +++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/nim-packages/getdns/default.nix diff --git a/pkgs/development/libraries/getdns/default.nix b/pkgs/development/libraries/getdns/default.nix index 3691dc164077..00a15e831ae7 100644 --- a/pkgs/development/libraries/getdns/default.nix +++ b/pkgs/development/libraries/getdns/default.nix @@ -1,7 +1,7 @@ # Getdns and Stubby are released together, see https://getdnsapi.net/releases/ { lib, stdenv, fetchurl, cmake, darwin, doxygen, libidn2, libyaml, openssl -, systemd, unbound, yq }: +, systemd, unbound, yq, nimPackages }: let metaCommon = with lib; { maintainers = with maintainers; [ leenaars ehmry ]; @@ -38,6 +38,8 @@ in rec { postInstall = "rm -r $out/share/doc"; + passthru.tests.nim = nimPackages.getdns; + meta = with lib; metaCommon // { description = "A modern asynchronous DNS API"; diff --git a/pkgs/development/nim-packages/getdns/default.nix b/pkgs/development/nim-packages/getdns/default.nix new file mode 100644 index 000000000000..035770da98be --- /dev/null +++ b/pkgs/development/nim-packages/getdns/default.nix @@ -0,0 +1,25 @@ +{ lib, buildNimPackage, fetchFromSourcehut, pkg-config, getdns }: + +buildNimPackage rec { + pname = "getdns"; + version = "20221222"; + src = fetchFromSourcehut { + owner = "~ehmry"; + repo = pname + "-nim"; + rev = version; + hash = "sha256-y7yzY1PcodIK2kC9409FuTpLn0TsWHGiEPnrULrob+k="; + }; + + propagatedNativeBuildInputs = [ pkg-config ]; + propagatedBuildInputs = [ getdns ]; + + doCheck = true; + checkPhase = "nim c tests/test_example_synchronous"; + # The test requires network but check if it builds. + + meta = { + inherit (getdns.meta) homepage license platforms; + description = "Nim wrapper over the getdns library"; + maintainers = with lib.maintainers; [ ehmry ]; + }; +} diff --git a/pkgs/top-level/nim-packages.nix b/pkgs/top-level/nim-packages.nix index a666177a92f1..2277a1f1b7b4 100644 --- a/pkgs/top-level/nim-packages.nix +++ b/pkgs/top-level/nim-packages.nix @@ -26,6 +26,9 @@ lib.makeScope newScope (self: frosty = callPackage ../development/nim-packages/frosty { }; + getdns = callPackage ../development/nim-packages/getdns { + inherit (pkgs) getdns; }; + hts-nim = callPackage ../development/nim-packages/hts-nim { }; jester = callPackage ../development/nim-packages/jester { };