about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/ldns/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/ldns/default.nix')
-rw-r--r--nixpkgs/pkgs/development/libraries/ldns/default.nix50
1 files changed, 50 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/ldns/default.nix b/nixpkgs/pkgs/development/libraries/ldns/default.nix
new file mode 100644
index 000000000000..5873e707e7cc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ldns/default.nix
@@ -0,0 +1,50 @@
+{ lib, stdenv, fetchurl, openssl, perl, which, dns-root-data }:
+
+stdenv.mkDerivation rec {
+  pname = "ldns";
+  version = "1.7.1";
+
+  src = fetchurl {
+    url = "https://www.nlnetlabs.nl/downloads/ldns/${pname}-${version}.tar.gz";
+    sha256 = "0ac242n7996fswq1a3nlh1bbbhrsdwsq4mx7xq8ffq6aplb4rj4a";
+  };
+
+  postPatch = ''
+    patchShebangs doc/doxyparse.pl
+  '';
+
+  outputs = [ "out" "dev" "man" "examples" ];
+
+  nativeBuildInputs = [ perl ];
+  buildInputs = [ openssl ];
+
+  configureFlags = [
+    "--with-ssl=${openssl.dev}"
+    "--with-trust-anchor=${dns-root-data}/root.key"
+    "--with-drill"
+    "--disable-gost"
+    "--with-examples"
+  ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+    "ac_cv_func_malloc_0_nonnull=yes"
+    "ac_cv_func_realloc_0_nonnull=yes"
+  ];
+
+  checkInputs = [ which ];
+  doCheck = false; # fails. missing some files
+
+  postInstall = ''
+    # Only 'drill' stays in $out
+    # the rest are examples:
+    moveToOutput "bin/ldns*" "$examples"
+    # with exception of ldns-config, which goes to $dev:
+    moveToOutput "bin/ldns-config" "$dev"
+  '';
+
+  meta = with lib; {
+    description = "Library with the aim of simplifying DNS programming in C";
+    license = licenses.bsd3;
+    homepage = "http://www.nlnetlabs.nl/projects/ldns/";
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ dtzWill ];
+  };
+}