[packages/pesign] - added types patch (fixes build with 32-bit long and 64-bit time_t, like on x32), BR: mandoc

qboosh qboosh at pld-linux.org
Sun May 19 18:46:13 CEST 2024


commit f5d5d025469a011d2bef17064a342d7d22e71758
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun May 19 18:46:10 2024 +0200

    - added types patch (fixes build with 32-bit long and 64-bit time_t, like on x32), BR: mandoc

 pesign-types.patch | 25 +++++++++++++++++++++++++
 pesign.spec        |  3 +++
 2 files changed, 28 insertions(+)
---
diff --git a/pesign.spec b/pesign.spec
index ea737f4..ad9f25d 100644
--- a/pesign.spec
+++ b/pesign.spec
@@ -10,9 +10,11 @@ Source0:	https://github.com/rhboot/pesign/releases/download/%{version}/%{name}-%
 # Source0-md5:	10cd95bf1bee5097321efc141e8ab292
 Patch0:		%{name}-pld.patch
 Patch1:		%{name}-gcc.patch
+Patch2:		%{name}-types.patch
 URL:		https://github.com/rhboot/pesign
 BuildRequires:	efivar-devel
 BuildRequires:	libuuid-devel
+BuildRequires:	mandoc
 BuildRequires:	nspr-devel
 BuildRequires:	nss-devel
 BuildRequires:	pkgconfig
@@ -81,6 +83,7 @@ Statyczna biblioteka libdpe.
 %setup -q
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %{__sed} -i -e 's,\$(libdatadir)systemd/system,%{systemdunitdir},' src/Makefile
 
diff --git a/pesign-types.patch b/pesign-types.patch
new file mode 100644
index 0000000..9c7c90e
--- /dev/null
+++ b/pesign-types.patch
@@ -0,0 +1,25 @@
+Fix for 32-bit platforms with 64-bit time_t
+--- pesign-116/src/util.h.orig	2023-01-31 15:55:13.000000000 +0100
++++ pesign-116/src/util.h	2024-05-19 18:31:51.158999714 +0200
+@@ -272,8 +272,8 @@ extern long verbosity(void);
+ #define dbgprintf_(tv, file, func, line, fmt, args...) ({	\
+ 		struct timeval tv;				\
+ 		gettimeofday(&tv, NULL);			\
+-		warnx("%ld.%lu %s:%s():%d: " fmt,		\
+-		      tv.tv_sec, tv.tv_usec,			\
++		warnx("%lld.%lu %s:%s():%d: " fmt,		\
++		      (long long)tv.tv_sec, (unsigned long)tv.tv_usec, \
+ 		      file, func, line, ##args);		\
+ 	})
+ #if defined(PESIGN_DEBUG)
+--- pesign-116/src/efikeygen.c.orig	2023-01-31 15:55:13.000000000 +0100
++++ pesign-116/src/efikeygen.c	2024-05-19 18:42:56.652988457 +0200
+@@ -1101,7 +1101,7 @@ int main(int argc, char *argv[])
+ 		}
+ 	} else {
+ 		// Mon Jan 19 03:14:07 GMT 2037, aka 0x7fffffff minus 1 year.
+-		time_t time = 0x7ffffffful - 60ul * 60 * 24 * 365;
++		unsigned long time = 0x7ffffffful - 60ul * 60 * 24 * 365;
+ 		dbgprintf("not_valid_after:%lu", time);
+ 		not_after = (PRTime)time * PR_USEC_PER_SEC;
+ 	}
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/pesign.git/commitdiff/e13bd960e1cc8c3d83b1cfaf5b3f41b58f7e971f



More information about the pld-cvs-commit mailing list