From b53a60087dec25abe91db40bf3bb9e7d08be9d1e Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Mon, 19 Nov 2018 12:06:54 +0100 Subject: [PATCH] scdoc: 1.5.2 -> 1.6.0 --- pkgs/tools/typesetting/scdoc/default.nix | 6 +- .../scdoc/use-source-date-epoch.patch | 75 ------------------- 2 files changed, 2 insertions(+), 79 deletions(-) delete mode 100644 pkgs/tools/typesetting/scdoc/use-source-date-epoch.patch diff --git a/pkgs/tools/typesetting/scdoc/default.nix b/pkgs/tools/typesetting/scdoc/default.nix index a5bf2d261e1c..1ff804f0d4a4 100644 --- a/pkgs/tools/typesetting/scdoc/default.nix +++ b/pkgs/tools/typesetting/scdoc/default.nix @@ -2,15 +2,13 @@ stdenv.mkDerivation rec { name = "scdoc-${version}"; - version = "1.5.2"; + version = "1.6.0"; src = fetchurl { url = "https://git.sr.ht/~sircmpwn/scdoc/archive/${version}.tar.gz"; - sha256 = "0a9sxifzsbj24kjnpc0525i91ni2vkwizhgvwx1m9shvfkiisnc6"; + sha256 = "1ca3js4arkg28gg2iszxxyrq7kgsrz482d1szv5dfd471h3vr5m3"; }; - patches = [ ./use-source-date-epoch.patch ]; - postPatch = '' substituteInPlace Makefile \ --replace "-static" "" \ diff --git a/pkgs/tools/typesetting/scdoc/use-source-date-epoch.patch b/pkgs/tools/typesetting/scdoc/use-source-date-epoch.patch deleted file mode 100644 index 5a2496d63583..000000000000 --- a/pkgs/tools/typesetting/scdoc/use-source-date-epoch.patch +++ /dev/null @@ -1,75 +0,0 @@ -diff --git a/src/main.c b/src/main.c -index 14b08d2..e2cc33e 100644 ---- a/src/main.c -+++ b/src/main.c -@@ -3,6 +3,7 @@ - #include - #include - #include -+#define __USE_XOPEN - #include - #include - #include "string.h" -@@ -66,10 +67,17 @@ static void parse_preamble(struct parser *p) { - int section = -1; - uint32_t ch; - char date[256]; -- time_t now; -- time(&now); -- struct tm *now_tm = localtime(&now); -- strftime(date, sizeof(date), "%F", now_tm); -+ char *source_date_epoch = getenv("SOURCE_DATE_EPOCH"); -+ if (source_date_epoch != NULL) { -+ struct tm source_date_epoch_tm; -+ strptime(source_date_epoch, "%s", &source_date_epoch_tm); -+ strftime(date, sizeof(date), "%F", &source_date_epoch_tm); -+ } else { -+ time_t now; -+ time(&now); -+ struct tm *now_tm = localtime(&now); -+ strftime(date, sizeof(date), "%F", now_tm); -+ } - while ((ch = parser_getch(p)) != UTF8_INVALID) { - if ((ch < 0x80 && isalnum(ch)) || ch == '_' || ch == '-' || ch == '.') { - assert(str_append_ch(name, ch) != -1); -diff --git a/test/preamble b/test/preamble -index 03e2d0c..eeb734b 100755 ---- a/test/preamble -+++ b/test/preamble -@@ -38,31 +38,31 @@ EOF - end 0 - - begin "Writes the appropriate header" --scdoc </dev/null -+scdoc </dev/null - test(8) - EOF - end 0 - - begin "Preserves dashes" --scdoc </dev/null -+scdoc </dev/null - test-manual(8) - EOF - end 0 - - begin "Handles extra footer field" --scdoc </dev/null -+scdoc </dev/null - test-manual(8) "Footer" - EOF - end 0 - - begin "Handles both extra fields" --scdoc </dev/null -+scdoc </dev/null - test-manual(8) "Footer" "Header" - EOF - end 0 - - begin "Emits empty footer correctly" --scdoc </dev/null -+scdoc </dev/null - test-manual(8) "" "Header" - EOF - end 0