diff --git a/pkgs/by-name/ju/judy/fix-source-date.patch b/pkgs/by-name/ju/judy/fix-source-date.patch new file mode 100644 index 000000000000..0a663d787d4c --- /dev/null +++ b/pkgs/by-name/ju/judy/fix-source-date.patch @@ -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); diff --git a/pkgs/by-name/ju/judy/package.nix b/pkgs/by-name/ju/judy/package.nix index 8d2918cc5a53..df21e56c30ba 100644 --- a/pkgs/by-name/ju/judy/package.nix +++ b/pkgs/by-name/ju/judy/package.nix @@ -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