From ca26bc13e27a433de50cb3a1b71e1818d6d0e5bc Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Fri, 29 Mar 2024 21:39:08 +0100 Subject: [PATCH 1/6] httping: format with nixfmt-rfc-style --- pkgs/tools/networking/httping/default.nix | 29 ++++++++++++----------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/pkgs/tools/networking/httping/default.nix b/pkgs/tools/networking/httping/default.nix index 1933dc41de0f..087e002723e5 100644 --- a/pkgs/tools/networking/httping/default.nix +++ b/pkgs/tools/networking/httping/default.nix @@ -1,12 +1,13 @@ -{ lib -, stdenv -, fetchFromGitHub -, fetchpatch -, fftw ? null -, gettext -, libintl -, ncurses -, openssl +{ + fetchFromGitHub, + fetchpatch, + fftw ? null, + gettext, + lib, + libintl, + ncurses, + openssl, + stdenv, }: stdenv.mkDerivation rec { @@ -16,7 +17,7 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "folkertvanheusden"; repo = "HTTPing"; - rev = "v${version}"; + rev = "refs/tags/v${version}"; hash = "sha256-aExTXXtW03UKMuMjTMx1k/MUpcRMh1PdSPkDGH+Od70="; }; @@ -47,17 +48,17 @@ stdenv.mkDerivation rec { ]; meta = with lib; { - homepage = "https://vanheusden.com/httping"; description = "ping with HTTP requests"; + homepage = "https://vanheusden.com/httping"; + license = licenses.agpl3Only; longDescription = '' Give httping an url, and it'll show you how long it takes to connect, send a request and retrieve the reply (only the headers). Be aware that the transmission across the network also takes time! So it measures the latency of the webserver + network. It supports IPv6. ''; - license = licenses.agpl3Only; - maintainers = []; - platforms = platforms.linux ++ platforms.darwin; mainProgram = "httping"; + maintainers = [ ]; + platforms = platforms.linux ++ platforms.darwin; }; } From bc7d0c3ed19d226b6d2cb6d3ee5bca504aa208e9 Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Fri, 29 Mar 2024 21:40:20 +0100 Subject: [PATCH 2/6] httping: add passthru.{tests.version,updateScript} --- pkgs/tools/networking/httping/default.nix | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/networking/httping/default.nix b/pkgs/tools/networking/httping/default.nix index 087e002723e5..c6c2c765c459 100644 --- a/pkgs/tools/networking/httping/default.nix +++ b/pkgs/tools/networking/httping/default.nix @@ -6,18 +6,20 @@ lib, libintl, ncurses, + nix-update-script, openssl, stdenv, + testers, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "httping"; version = "2.9"; src = fetchFromGitHub { owner = "folkertvanheusden"; repo = "HTTPing"; - rev = "refs/tags/v${version}"; + rev = "refs/tags/v${finalAttrs.version}"; hash = "sha256-aExTXXtW03UKMuMjTMx1k/MUpcRMh1PdSPkDGH+Od70="; }; @@ -47,6 +49,14 @@ stdenv.mkDerivation rec { "PREFIX=" ]; + passthru = { + tests.version = testers.testVersion { + command = "${lib.getExe finalAttrs.finalPackage} --version"; + package = finalAttrs.finalPackage; + }; + updateScript = nix-update-script { }; + }; + meta = with lib; { description = "ping with HTTP requests"; homepage = "https://vanheusden.com/httping"; @@ -61,4 +71,4 @@ stdenv.mkDerivation rec { maintainers = [ ]; platforms = platforms.linux ++ platforms.darwin; }; -} +}) From e6cb8bef457f52e2bcc124fa0c23b7be13586ed4 Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Fri, 29 Mar 2024 23:47:01 +0100 Subject: [PATCH 3/6] httping: 2.9 -> 3.6 https://github.com/folkertvanheusden/HTTPing/compare/v2.9...v3.6 --- pkgs/tools/networking/httping/default.nix | 35 +++++++++++------------ 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/pkgs/tools/networking/httping/default.nix b/pkgs/tools/networking/httping/default.nix index c6c2c765c459..4a9647bf4c16 100644 --- a/pkgs/tools/networking/httping/default.nix +++ b/pkgs/tools/networking/httping/default.nix @@ -1,7 +1,7 @@ { + cmake, fetchFromGitHub, - fetchpatch, - fftw ? null, + fftw, gettext, lib, libintl, @@ -14,26 +14,17 @@ stdenv.mkDerivation (finalAttrs: { pname = "httping"; - version = "2.9"; + version = "3.6"; src = fetchFromGitHub { owner = "folkertvanheusden"; repo = "HTTPing"; rev = "refs/tags/v${finalAttrs.version}"; - hash = "sha256-aExTXXtW03UKMuMjTMx1k/MUpcRMh1PdSPkDGH+Od70="; + hash = "sha256-lDgQC3VzfcLqMOQSaRZ/znMamAAGYq/9C9bHgI4G7B8="; }; - patches = [ - # Pull upstream fix for missing - # https://github.com/folkertvanheusden/HTTPing/pull/8 - (fetchpatch { - name = "add-unistd.patch"; - url = "https://github.com/folkertvanheusden/HTTPing/commit/aad3c275686344fe9a235faeac4ee3832f3aa8d5.patch"; - hash = "sha256-bz3AMQTSfSTwUyf9WbkAFWVmFo06ei+Qd55x+RRDREY="; - }) - ]; - nativeBuildInputs = [ + cmake gettext ]; @@ -44,11 +35,16 @@ stdenv.mkDerivation (finalAttrs: { openssl ]; - makeFlags = [ - "DESTDIR=$(out)" - "PREFIX=" + cmakeFlags = [ + (lib.cmakeFeature "CMAKE_BUILD_TYPE" "Release") ]; + installPhase = '' + runHook preInstall + install -D httping $out/bin/httping + runHook postInstall + ''; + passthru = { tests.version = testers.testVersion { command = "${lib.getExe finalAttrs.finalPackage} --version"; @@ -58,7 +54,8 @@ stdenv.mkDerivation (finalAttrs: { }; meta = with lib; { - description = "ping with HTTP requests"; + changelog = "https://github.com/folkertvanheusden/HTTPing/releases/tag/v${finalAttrs.version}"; + description = "Ping with HTTP requests"; homepage = "https://vanheusden.com/httping"; license = licenses.agpl3Only; longDescription = '' @@ -69,6 +66,6 @@ stdenv.mkDerivation (finalAttrs: { ''; mainProgram = "httping"; maintainers = [ ]; - platforms = platforms.linux ++ platforms.darwin; + platforms = platforms.linux; }; }) From b5bbd44a8cb6efe63aee2df963a172ca493a84ad Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Fri, 29 Mar 2024 23:51:19 +0100 Subject: [PATCH 4/6] httping: remove `with lib;` --- pkgs/tools/networking/httping/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/networking/httping/default.nix b/pkgs/tools/networking/httping/default.nix index 4a9647bf4c16..1d781a7cd653 100644 --- a/pkgs/tools/networking/httping/default.nix +++ b/pkgs/tools/networking/httping/default.nix @@ -53,11 +53,11 @@ stdenv.mkDerivation (finalAttrs: { updateScript = nix-update-script { }; }; - meta = with lib; { + meta = { changelog = "https://github.com/folkertvanheusden/HTTPing/releases/tag/v${finalAttrs.version}"; description = "Ping with HTTP requests"; homepage = "https://vanheusden.com/httping"; - license = licenses.agpl3Only; + license = lib.licenses.agpl3Only; longDescription = '' Give httping an url, and it'll show you how long it takes to connect, send a request and retrieve the reply (only the headers). Be aware that @@ -66,6 +66,6 @@ stdenv.mkDerivation (finalAttrs: { ''; mainProgram = "httping"; maintainers = [ ]; - platforms = platforms.linux; + platforms = lib.platforms.linux; }; }) From e06d19df93001511f333a8841b9741ae2b840aa6 Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Sat, 30 Mar 2024 00:01:01 +0100 Subject: [PATCH 5/6] httping: migrate to pkgs/by-name --- .../httping/default.nix => by-name/ht/httping/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 deletions(-) rename pkgs/{tools/networking/httping/default.nix => by-name/ht/httping/package.nix} (100%) diff --git a/pkgs/tools/networking/httping/default.nix b/pkgs/by-name/ht/httping/package.nix similarity index 100% rename from pkgs/tools/networking/httping/default.nix rename to pkgs/by-name/ht/httping/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9135e7f94e33..cd9baa9f0320 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8977,8 +8977,6 @@ with pkgs; httpie = with python3Packages; toPythonApplication httpie; - httping = callPackage ../tools/networking/httping { }; - httplz = callPackage ../tools/networking/httplz { }; httpfs2 = callPackage ../tools/filesystems/httpfs { }; From 8e6c03f300aab9ba972e8fee155de471bb33a94f Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Fri, 29 Mar 2024 23:52:32 +0100 Subject: [PATCH 6/6] httping: add anthonyroussel to maintainers --- pkgs/by-name/ht/httping/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/ht/httping/package.nix b/pkgs/by-name/ht/httping/package.nix index 1d781a7cd653..85fcc843ef0f 100644 --- a/pkgs/by-name/ht/httping/package.nix +++ b/pkgs/by-name/ht/httping/package.nix @@ -65,7 +65,7 @@ stdenv.mkDerivation (finalAttrs: { latency of the webserver + network. It supports IPv6. ''; mainProgram = "httping"; - maintainers = [ ]; + maintainers = [ lib.maintainers.anthonyroussel ]; platforms = lib.platforms.linux; }; })