lol

Revert "file: 5.45 -> 5.46", to fix Zip files regressions

This reverts commit 75d2d3c2926a4184f1124f53f42e7794b5c5777a, after
multiple complains best summarized here:

https://github.com/NixOS/nixpkgs/pull/402318#issuecomment-2881163359

Doron Behar 7377f9e6 73f89b34

+53 -2
+38
pkgs/tools/misc/file/32-bit-time_t.patch
···
··· 1 + https://github.com/file/file/commit/218fdf813fd5ccecbb8887a1b62509cd1c6dd3a1.patch 2 + 3 + From 218fdf813fd5ccecbb8887a1b62509cd1c6dd3a1 Mon Sep 17 00:00:00 2001 4 + From: Christos Zoulas <christos@zoulas.com> 5 + Date: Fri, 28 Jul 2023 14:38:25 +0000 6 + Subject: [PATCH] deal with 32 bit time_t 7 + 8 + --- 9 + src/file.h | 8 +++++--- 10 + 1 file changed, 5 insertions(+), 3 deletions(-) 11 + 12 + diff --git a/src/file.h b/src/file.h 13 + index 2e0494d2f..78f574ea1 100644 14 + --- a/src/file.h 15 + +++ b/src/file.h 16 + @@ -27,7 +27,7 @@ 17 + */ 18 + /* 19 + * file.h - definitions for file(1) program 20 + - * @(#)$File: file.h,v 1.247 2023/07/27 19:40:22 christos Exp $ 21 + + * @(#)$File: file.h,v 1.248 2023/07/28 14:38:25 christos Exp $ 22 + */ 23 + 24 + #ifndef __file_h__ 25 + @@ -159,9 +159,11 @@ 26 + /* 27 + * Dec 31, 23:59:59 9999 28 + * we need to make sure that we don't exceed 9999 because some libc 29 + - * implementations like muslc crash otherwise 30 + + * implementations like muslc crash otherwise. If you are unlucky 31 + + * to be running on a system with a 32 bit time_t, then it is even less. 32 + */ 33 + -#define MAX_CTIME CAST(time_t, 0x3afff487cfULL) 34 + +#define MAX_CTIME \ 35 + + CAST(time_t, sizeof(time_t) > 4 ? 0x3afff487cfULL : 0x7fffffffULL) 36 + 37 + #define FILE_BADSIZE CAST(size_t, ~0ul) 38 + #define MAXDESC 64 /* max len of text description/MIME type */
+15 -2
pkgs/tools/misc/file/default.nix
··· 16 17 stdenv.mkDerivation (finalAttrs: { 18 pname = "file"; 19 - version = "5.46"; 20 21 src = fetchurl { 22 urls = [ 23 "https://astron.com/pub/file/file-${finalAttrs.version}.tar.gz" 24 "https://distfiles.macports.org/file/file-${finalAttrs.version}.tar.gz" 25 ]; 26 - hash = "sha256-ycx3x8VgxUMTXtxVWvYJ1WGdvvARmX6YjOQKPXXYYIg="; 27 }; 28 29 outputs = [ 30 "out" 31 "dev" 32 "man" 33 ]; 34 35 strictDeps = true;
··· 16 17 stdenv.mkDerivation (finalAttrs: { 18 pname = "file"; 19 + version = "5.45"; 20 21 src = fetchurl { 22 urls = [ 23 "https://astron.com/pub/file/file-${finalAttrs.version}.tar.gz" 24 "https://distfiles.macports.org/file/file-${finalAttrs.version}.tar.gz" 25 ]; 26 + hash = "sha256-/Jf1ECm7DiyfTjv/79r2ePDgOe6HK53lwAKm0Jx4TYI="; 27 }; 28 29 outputs = [ 30 "out" 31 "dev" 32 "man" 33 + ]; 34 + 35 + patches = [ 36 + # Upstream patch to fix 32-bit tests. 37 + # 38 + # It is included in 5.46+, but we are not updating to it or a later version until: 39 + # 40 + # https://bugs.astron.com/view.php?id=622 41 + # 42 + # is resolved. See also description of the bug here: 43 + # 44 + # https://github.com/NixOS/nixpkgs/pull/402318#issuecomment-2881163359 45 + ./32-bit-time_t.patch 46 ]; 47 48 strictDeps = true;