From a34d5697f8eb08fc4c799692ffa28089bbb39c08 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Wed, 18 Dec 2024 09:25:22 +0530 Subject: [PATCH] getdns/stubby: move to pkgs/by-name --- pkgs/by-name/ge/getdns/package.nix | 70 ++++++++++ pkgs/by-name/st/stubby/package.nix | 64 +++++++++ pkgs/development/libraries/getdns/default.nix | 128 ------------------ pkgs/top-level/all-packages.nix | 5 - 4 files changed, 134 insertions(+), 133 deletions(-) create mode 100644 pkgs/by-name/ge/getdns/package.nix create mode 100644 pkgs/by-name/st/stubby/package.nix delete mode 100644 pkgs/development/libraries/getdns/default.nix diff --git a/pkgs/by-name/ge/getdns/package.nix b/pkgs/by-name/ge/getdns/package.nix new file mode 100644 index 000000000000..f811b534a535 --- /dev/null +++ b/pkgs/by-name/ge/getdns/package.nix @@ -0,0 +1,70 @@ +{ + lib, + stdenv, + fetchurl, + cmake, + doxygen, + libidn2, + openssl, + unbound, + yq, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "getdns"; + version = "1.7.3"; + outputs = [ + "out" + "dev" + "lib" + "man" + ]; + + src = fetchurl { + url = "https://getdnsapi.net/releases/getdns-${lib.concatStringsSep "-" (lib.splitVersion finalAttrs.version)}/getdns-${finalAttrs.version}.tar.gz"; + # upstream publishes hashes in hex format + sha256 = "f1404ca250f02e37a118aa00cf0ec2cbe11896e060c6d369c6761baea7d55a2c"; + }; + + nativeBuildInputs = [ + cmake + doxygen + ]; + + buildInputs = [ + libidn2 + openssl + unbound + ]; + + # https://github.com/getdnsapi/getdns/issues/517 + postPatch = '' + substituteInPlace getdns.pc.in \ + --replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ + --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ + ''; + + postInstall = "rm -r $out/share/doc"; + + meta = { + description = "Modern asynchronous DNS API"; + longDescription = '' + getdns is an implementation of a modern asynchronous DNS API; the + specification was originally edited by Paul Hoffman. It is intended to make all + types of DNS information easily available to application developers and non-DNS + experts. DNSSEC offers a unique global infrastructure for establishing and + enhancing cryptographic trust relations. With the development of this API the + developers intend to offer application developers a modern and flexible + interface that enables end-to-end trust in the DNS architecture, and which will + inspire application developers to implement innovative security solutions in + their applications. + ''; + homepage = "https://getdnsapi.net"; + maintainers = with lib.maintainers; [ + leenaars + ehmry + ]; + license = lib.licenses.bsd3; + platforms = lib.platforms.all; + }; +}) diff --git a/pkgs/by-name/st/stubby/package.nix b/pkgs/by-name/st/stubby/package.nix new file mode 100644 index 000000000000..42aab6d58a49 --- /dev/null +++ b/pkgs/by-name/st/stubby/package.nix @@ -0,0 +1,64 @@ +# Getdns and Stubby are released together, see https://getdnsapi.net/releases/ +# ../../ge/getdns/package.nix + +{ + lib, + stdenv, + cmake, + darwin, + getdns, + libyaml, + openssl, + systemd, + yq, + stubby, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "stubby"; + version = "0.4.3"; + outputs = [ + "out" + "man" + "stubbyExampleJson" + ]; + + inherit (getdns) src; + sourceRoot = "${getdns.pname}-${getdns.version}/stubby"; + + nativeBuildInputs = [ + cmake + yq + ]; + + buildInputs = + [ + getdns + libyaml + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ systemd ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.Security ]; + + postInstall = '' + rm -r $out/share/doc + yq \ + < $NIX_BUILD_TOP/$sourceRoot/stubby.yml.example \ + > $stubbyExampleJson + ''; + + passthru.settingsExample = builtins.fromJSON (builtins.readFile stubby.stubbyExampleJson); + + meta = getdns.meta // { + description = "Local DNS Privacy stub resolver (using DNS-over-TLS)"; + mainProgram = "stubby"; + longDescription = '' + Stubby is an application that acts as a local DNS Privacy stub + resolver (using RFC 7858, aka DNS-over-TLS). Stubby encrypts DNS + queries sent from a client machine (desktop or laptop) to a DNS + Privacy resolver increasing end user privacy. Stubby is developed by + the getdns team. + ''; + homepage = "https://dnsprivacy.org/dns_privacy_daemon_-_stubby/"; + }; +}) diff --git a/pkgs/development/libraries/getdns/default.nix b/pkgs/development/libraries/getdns/default.nix deleted file mode 100644 index 5916ca251dcf..000000000000 --- a/pkgs/development/libraries/getdns/default.nix +++ /dev/null @@ -1,128 +0,0 @@ -# Getdns and Stubby are released together, see https://getdnsapi.net/releases/ - -{ - lib, - stdenv, - fetchurl, - cmake, - doxygen, - libidn2, - libyaml, - openssl, - systemd, - unbound, - yq, -}: -let - metaCommon = { - maintainers = with lib.maintainers; [ - leenaars - ehmry - ]; - license = lib.licenses.bsd3; - platforms = lib.platforms.all; - }; -in -rec { - - getdns = stdenv.mkDerivation rec { - pname = "getdns"; - version = "1.7.3"; - outputs = [ - "out" - "dev" - "lib" - "man" - ]; - - src = fetchurl { - url = "https://getdnsapi.net/releases/${pname}-${lib.concatStringsSep "-" (lib.splitVersion version)}/${pname}-${version}.tar.gz"; - # upstream publishes hashes in hex format - sha256 = "f1404ca250f02e37a118aa00cf0ec2cbe11896e060c6d369c6761baea7d55a2c"; - }; - - nativeBuildInputs = [ - cmake - doxygen - ]; - - buildInputs = [ - libidn2 - openssl - unbound - ]; - - # https://github.com/getdnsapi/getdns/issues/517 - postPatch = '' - substituteInPlace getdns.pc.in \ - --replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ - --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ - ''; - - postInstall = "rm -r $out/share/doc"; - - meta = metaCommon // { - description = "Modern asynchronous DNS API"; - longDescription = '' - getdns is an implementation of a modern asynchronous DNS API; the - specification was originally edited by Paul Hoffman. It is intended to make all - types of DNS information easily available to application developers and non-DNS - experts. DNSSEC offers a unique global infrastructure for establishing and - enhancing cryptographic trust relations. With the development of this API the - developers intend to offer application developers a modern and flexible - interface that enables end-to-end trust in the DNS architecture, and which will - inspire application developers to implement innovative security solutions in - their applications. - ''; - homepage = "https://getdnsapi.net"; - }; - }; - - stubby = stdenv.mkDerivation { - pname = "stubby"; - version = "0.4.3"; - outputs = [ - "out" - "man" - "stubbyExampleJson" - ]; - - inherit (getdns) src; - sourceRoot = "${getdns.pname}-${getdns.version}/stubby"; - - nativeBuildInputs = [ - cmake - doxygen - yq - ]; - - buildInputs = [ - getdns - libyaml - openssl - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ systemd ]; - - postInstall = '' - rm -r $out/share/doc - yq \ - < $NIX_BUILD_TOP/$sourceRoot/stubby.yml.example \ - > $stubbyExampleJson - ''; - - passthru.settingsExample = builtins.fromJSON (builtins.readFile stubby.stubbyExampleJson); - - meta = metaCommon // { - description = "Local DNS Privacy stub resolver (using DNS-over-TLS)"; - mainProgram = "stubby"; - longDescription = '' - Stubby is an application that acts as a local DNS Privacy stub - resolver (using RFC 7858, aka DNS-over-TLS). Stubby encrypts DNS - queries sent from a client machine (desktop or laptop) to a DNS - Privacy resolver increasing end user privacy. Stubby is developed by - the getdns team. - ''; - homepage = "https://dnsprivacy.org/dns_privacy_daemon_-_stubby/"; - }; - }; - -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index cf224e5838c6..0e42ed31c64c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8174,11 +8174,6 @@ with pkgs; geos_3_9 = callPackage ../development/libraries/geos/3.9.nix { }; - inherit (callPackages ../development/libraries/getdns { }) - getdns - stubby - ; - gettext = callPackage ../development/libraries/gettext { }; gdalMinimal = gdal.override {