judy: make build reproducible by removing timestamps from manpages and LC_UUID on macos (#394620)

This commit is contained in:
Arnout Engelen
2025-04-02 11:11:02 +02:00
committed by GitHub
2 changed files with 35 additions and 1 deletions
@@ -0,0 +1,25 @@
diff -Naur judy-1.0.5.orig/jhton.c judy-1.0.5/jhton.c
--- judy-1.0.5.orig/tool/jhton.c 2025-03-29 18:37:09
+++ judy-1.0.5/tool/jhton.c 2025-03-29 18:40:47
@@ -674,7 +674,6 @@
char * pagesection; // such as "3X".
char lcletter; // manual tab section, such as "j".
char * revision; // from centered table datum.
- time_t currtime; // for ctime().
// Extract "weird" header values:
//
@@ -690,11 +689,8 @@
"contain revision information");
}
-// Emit file header; note, ctime() output already contains a newline:
-
- (void) time(&currtime);
- (void) printf(".\\\" Auto-translated to nroff -man from %s by %s at %s",
- Filename, gc_myname, ctime(&currtime));
+ (void) printf(".\\\" Auto-translated to nroff -man from %s by %s\n",
+ Filename, gc_myname);
(void) printf(".\\\" %s\n", filerev);
(void) printf(".TA %c\n", lcletter);
+10 -1
View File
@@ -17,7 +17,16 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ autoreconfHook ];
depsBuildBuild = [ pkgsBuildBuild.stdenv.cc ];
patches = [ ./cross.patch ];
patches = [
./cross.patch
# Fix reproducible timestamps.
./fix-source-date.patch
];
# fixes non-determinism between builds on macos
preConfigure = lib.optional stdenv.hostPlatform.isDarwin ''
export LDFLAGS="$LDFLAGS -Wl,-no_uuid -Wl,-install_name,@rpath/libJudy.1.dylib"
'';
# Disable parallel builds as manpages lack some dependencies:
# ../tool/jhton ext/JudyHS_funcs_3.htm | grep -v '^[ ]*$' | sed -e 's/\.C//' > man/man3/JudyHS_funcs