From d4c80a478b9b8d3303f39fb788f382dfaa823bdc Mon Sep 17 00:00:00 2001 From: Ruud van Asseldonk Date: Tue, 19 May 2020 23:01:00 +0200 Subject: [PATCH 1/3] acme-client: 0.2.5 -> 1.0.0 The upstream version fails to compile due to a missing limits.h include. I added a patch to fix that. I opened a pull request to upstream it too, but the project has moved from GitHub onto sr.ht and now asks me to send a patch to the mailing list. My default email client is not really suitable for that, and getting git-send-email set up will take some work, so in the meantime it is easier to just patch it here. --- pkgs/tools/networking/acme-client/default.nix | 6 ++- .../networking/acme-client/limits.h.patch | 41 +++++++++++++++++++ 2 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 pkgs/tools/networking/acme-client/limits.h.patch diff --git a/pkgs/tools/networking/acme-client/default.nix b/pkgs/tools/networking/acme-client/default.nix index 06c2898248d0..e05adae530eb 100644 --- a/pkgs/tools/networking/acme-client/default.nix +++ b/pkgs/tools/networking/acme-client/default.nix @@ -12,13 +12,13 @@ with stdenv.lib; stdenv.mkDerivation rec { pname = "acme-client"; - version = "0.2.5"; + version = "1.0.0"; src = fetchFromGitHub { owner = "graywolf"; repo = "acme-client-portable"; rev = "v${version}"; - sha256 = "1d9yk87nj5gizkq26m4wqfh4xhlrn5xlfj7mfgvrpsdiwibqxrrw"; + sha256 = "1p6jbxg00ing9v3jnpvq234w5r2gf8b04k9qm06mn336lcd2lgpl"; }; nativeBuildInputs = [ autoreconfHook bison pkgconfig ]; @@ -26,6 +26,8 @@ stdenv.mkDerivation rec { makeFlags = [ "PREFIX=${placeholder "out"}" ]; + patches = [ ./limits.h.patch ]; + meta = { homepage = "https://github.com/graywolf/acme-client-portable"; description = "Secure ACME/Let's Encrypt client"; diff --git a/pkgs/tools/networking/acme-client/limits.h.patch b/pkgs/tools/networking/acme-client/limits.h.patch new file mode 100644 index 000000000000..2a2e04fb8fac --- /dev/null +++ b/pkgs/tools/networking/acme-client/limits.h.patch @@ -0,0 +1,41 @@ +From 05b32236adf0f3f43d74b7824b7b20bc917c6db9 Mon Sep 17 00:00:00 2001 +From: Ruud van Asseldonk +Date: Tue, 19 May 2020 22:32:01 +0200 +Subject: [PATCH] Include limits.h in compat.c + +Without this, the compiler says: + + compat.c: In function 'strtonum': + compat.c:235:19: error: 'LLONG_MIN' undeclared (first use in this function) + 235 | else if ((ll == LLONG_MIN && errno == ERANGE) || ll < minval) + | ^~~~~~~~~ + compat.c:9:1: note: 'LLONG_MIN' is defined in header ''; did you forget to '#include '? + 8 | #include + +++ |+#include + 9 | + compat.c:235:19: note: each undeclared identifier is reported only once for each function it appears in + 235 | else if ((ll == LLONG_MIN && errno == ERANGE) || ll < minval) + | ^~~~~~~~~ + compat.c:237:19: error: 'LLONG_MAX' undeclared (first use in this function) + 237 | else if ((ll == LLONG_MAX && errno == ERANGE) || ll > maxval) + | ^~~~~~~~~ + compat.c:237:19: note: 'LLONG_MAX' is defined in header ''; did you forget to '#include '? +--- + compat.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git ./compat.c ./compat.c +index 72a2f96..f990eca 100644 +--- compat.c ++++ compat.c +@@ -1,6 +1,7 @@ + #include "compat.h" + + #include ++#include + #include + #include + #include +-- +2.26.2 + From d4d36c37c7ba945597f3ad25a278e304108bab9d Mon Sep 17 00:00:00 2001 From: Ruud van Asseldonk Date: Sun, 24 May 2020 23:00:17 +0200 Subject: [PATCH 2/3] acme-client: 1.0.0 -> 1.0.1 I submitted my patch upstream, it was merged, and version 1.0.1 which includes it has been released. So the patch here is no longer necessary. Also, the maintainer added a Nixpkgs-based build environment to the upstream CI setup, so in the future the upstream version will likely not need any patching. --- pkgs/tools/networking/acme-client/default.nix | 6 +-- .../networking/acme-client/limits.h.patch | 41 ------------------- 2 files changed, 2 insertions(+), 45 deletions(-) delete mode 100644 pkgs/tools/networking/acme-client/limits.h.patch diff --git a/pkgs/tools/networking/acme-client/default.nix b/pkgs/tools/networking/acme-client/default.nix index e05adae530eb..02af803db724 100644 --- a/pkgs/tools/networking/acme-client/default.nix +++ b/pkgs/tools/networking/acme-client/default.nix @@ -12,13 +12,13 @@ with stdenv.lib; stdenv.mkDerivation rec { pname = "acme-client"; - version = "1.0.0"; + version = "1.0.1"; src = fetchFromGitHub { owner = "graywolf"; repo = "acme-client-portable"; rev = "v${version}"; - sha256 = "1p6jbxg00ing9v3jnpvq234w5r2gf8b04k9qm06mn336lcd2lgpl"; + sha256 = "0ds7lxn08yiq7hap1xh014smjhd4gf9lv9ypfrf1ahqna3s2w7k8"; }; nativeBuildInputs = [ autoreconfHook bison pkgconfig ]; @@ -26,8 +26,6 @@ stdenv.mkDerivation rec { makeFlags = [ "PREFIX=${placeholder "out"}" ]; - patches = [ ./limits.h.patch ]; - meta = { homepage = "https://github.com/graywolf/acme-client-portable"; description = "Secure ACME/Let's Encrypt client"; diff --git a/pkgs/tools/networking/acme-client/limits.h.patch b/pkgs/tools/networking/acme-client/limits.h.patch deleted file mode 100644 index 2a2e04fb8fac..000000000000 --- a/pkgs/tools/networking/acme-client/limits.h.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 05b32236adf0f3f43d74b7824b7b20bc917c6db9 Mon Sep 17 00:00:00 2001 -From: Ruud van Asseldonk -Date: Tue, 19 May 2020 22:32:01 +0200 -Subject: [PATCH] Include limits.h in compat.c - -Without this, the compiler says: - - compat.c: In function 'strtonum': - compat.c:235:19: error: 'LLONG_MIN' undeclared (first use in this function) - 235 | else if ((ll == LLONG_MIN && errno == ERANGE) || ll < minval) - | ^~~~~~~~~ - compat.c:9:1: note: 'LLONG_MIN' is defined in header ''; did you forget to '#include '? - 8 | #include - +++ |+#include - 9 | - compat.c:235:19: note: each undeclared identifier is reported only once for each function it appears in - 235 | else if ((ll == LLONG_MIN && errno == ERANGE) || ll < minval) - | ^~~~~~~~~ - compat.c:237:19: error: 'LLONG_MAX' undeclared (first use in this function) - 237 | else if ((ll == LLONG_MAX && errno == ERANGE) || ll > maxval) - | ^~~~~~~~~ - compat.c:237:19: note: 'LLONG_MAX' is defined in header ''; did you forget to '#include '? ---- - compat.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git ./compat.c ./compat.c -index 72a2f96..f990eca 100644 ---- compat.c -+++ compat.c -@@ -1,6 +1,7 @@ - #include "compat.h" - - #include -+#include - #include - #include - #include --- -2.26.2 - From bdd706ccb24375ac1acf8a168f8a9a57b0fc258e Mon Sep 17 00:00:00 2001 From: Ruud van Asseldonk Date: Sun, 24 May 2020 23:11:56 +0200 Subject: [PATCH 3/3] acme-client: use source tarball to avoid autoreconf This was suggested by the upstream maintainer [1], and it is a nice simplification. Also change the url to sr.ht as the project has moved there. [1]: https://github.com/NixOS/nixpkgs/pull/88201#issuecomment-633260151 --- pkgs/tools/networking/acme-client/default.nix | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/pkgs/tools/networking/acme-client/default.nix b/pkgs/tools/networking/acme-client/default.nix index 02af803db724..00f8778cafd5 100644 --- a/pkgs/tools/networking/acme-client/default.nix +++ b/pkgs/tools/networking/acme-client/default.nix @@ -1,7 +1,5 @@ { stdenv -, fetchFromGitHub -, autoreconfHook -, bison +, fetchurl , apple_sdk ? null , libbsd , libressl @@ -14,20 +12,18 @@ stdenv.mkDerivation rec { pname = "acme-client"; version = "1.0.1"; - src = fetchFromGitHub { - owner = "graywolf"; - repo = "acme-client-portable"; - rev = "v${version}"; - sha256 = "0ds7lxn08yiq7hap1xh014smjhd4gf9lv9ypfrf1ahqna3s2w7k8"; + src = fetchurl { + url = "https://data.wolfsden.cz/sources/acme-client-${version}.tar.xz"; + sha256 = "0gmdvmyw8a61w08hrxllypf7rpnqg0fxipbk3zmvsxj7m5i6iysj"; }; - nativeBuildInputs = [ autoreconfHook bison pkgconfig ]; + nativeBuildInputs = [ pkgconfig ]; buildInputs = [ libbsd libressl ] ++ optional stdenv.isDarwin apple_sdk.sdk; makeFlags = [ "PREFIX=${placeholder "out"}" ]; meta = { - homepage = "https://github.com/graywolf/acme-client-portable"; + homepage = "https://sr.ht/~graywolf/acme-client-portable/"; description = "Secure ACME/Let's Encrypt client"; platforms = platforms.unix; license = licenses.isc;