treewide: unify ant determinism methods

This commit is contained in:
TomaSajt 2024-03-17 13:35:55 +01:00
parent 0e20953796
commit 436fe7b59b
No known key found for this signature in database
GPG Key ID: F011163C050122A1
6 changed files with 12 additions and 36 deletions

View File

@ -6,6 +6,7 @@
, jre
, ant
, makeWrapper
, stripJavaArchivesHook
, doCheck ? true
, withExamples ? false
}:
@ -30,10 +31,6 @@ stdenv.mkDerivation rec {
];
postPatch = with deps; ''
# Fix the output jar timestamps for reproducibility
substituteInPlace build.xml \
--replace-fail '<jar ' '<jar modificationtime="0" '
# Manually create version properties file for reproducibility
mkdir -p build/classes
cat > build/classes/mkgmap-version.properties << EOF
@ -61,7 +58,7 @@ stdenv.mkDerivation rec {
'') testInputs}
'';
nativeBuildInputs = [ jdk ant makeWrapper ];
nativeBuildInputs = [ jdk ant makeWrapper stripJavaArchivesHook ];
buildPhase = ''
runHook preBuild

View File

@ -6,6 +6,7 @@
, jre
, ant
, makeWrapper
, stripJavaArchivesHook
, doCheck ? true
}:
let
@ -30,10 +31,6 @@ stdenv.mkDerivation rec {
];
postPatch = with deps; ''
# Fix the output jar timestamps for reproducibility
substituteInPlace build.xml \
--replace-fail '<jar ' '<jar modificationtime="0" '
# Manually create version properties file for reproducibility
mkdir -p build/classes
cat > build/classes/splitter-version.properties << EOF
@ -58,7 +55,7 @@ stdenv.mkDerivation rec {
'') testInputs}
'';
nativeBuildInputs = [ jdk ant makeWrapper ];
nativeBuildInputs = [ jdk ant makeWrapper stripJavaArchivesHook ];
buildPhase = ''
runHook preBuild

View File

@ -4,6 +4,7 @@
, makeDesktopItem
, makeWrapper
, wrapGAppsHook
, stripJavaArchivesHook
, ant
, jdk
, jre
@ -46,13 +47,7 @@ stdenv.mkDerivation rec {
hash = "sha256-MSVSd5DyVL+dcfTDv1M99hxickPwT2Pt6QGNsu6DGZI=";
};
postPatch = ''
# Fix jar timestamps for reproducibility
substituteInPlace build/build.xml \
--replace-fail '<jar ' '<jar modificationtime="0" '
'';
nativeBuildInputs = [ ant jdk wrapGAppsHook makeWrapper ];
nativeBuildInputs = [ ant jdk wrapGAppsHook makeWrapper stripJavaArchivesHook ];
buildInputs = lib.optionals stdenv.isLinux [ gtk2 glib libXtst ]
++ lib.optional stdenv.isDarwin Cocoa;

View File

@ -5,6 +5,7 @@
, jdk11
, git
, xmlstarlet
, stripJavaArchivesHook
, xcbuild
, udev
, xorg
@ -42,13 +43,6 @@ stdenv.mkDerivation {
substituteInPlace gluegen/src/java/com/jogamp/common/util/IOUtil.java \
--replace-fail '#!/bin/true' '#!${coreutils}/bin/true'
''
# set timestamp of files in jar to a fixed point in time
+ ''
xmlstarlet ed --inplace \
--append //jar --type attr -n modificationtime --value 1980-01-01T00:00Z \
gluegen/make/{build.xml,gluegen-cpptasks-base.xml} \
jogl/make/{build.xml,build-nativewindow.xml,build-jogl.xml}
''
# prevent looking for native libraries in /usr/lib
+ ''
substituteInPlace jogl/make/build-*.xml \
@ -72,6 +66,7 @@ stdenv.mkDerivation {
jdk11
git
xmlstarlet
stripJavaArchivesHook
] ++ lib.optionals stdenv.isDarwin [
xcbuild
];

View File

@ -4,6 +4,7 @@
, ant
, jdk8
, sharutils
, stripJavaArchivesHook
}:
stdenv.mkDerivation (finalAttrs: {
@ -20,16 +21,11 @@ stdenv.mkDerivation (finalAttrs: {
ant
jdk8
sharutils
stripJavaArchivesHook
];
sourceRoot = "${finalAttrs.src.name}/freetts-${finalAttrs.version}";
postPatch = ''
# Fix jar timestamps for reproducibility
substituteInPlace build.xml demo.xml \
--replace-fail '<jar ' '<jar modificationtime="0" '
'';
buildPhase = ''
runHook preBuild

View File

@ -5,6 +5,7 @@
, jdk
, jre
, makeWrapper
, stripJavaArchivesHook
}:
stdenv.mkDerivation (finalAttrs: {
@ -16,16 +17,11 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-b7Av17wu6Ar/npKOiwYqzlvBFSIuXTpqTacM1sxtBvc=";
};
postPatch = ''
# Fix jar timestamps for reproducibility
substituteInPlace fop/build.xml \
--replace-fail '<jar ' '<jar modificationtime="0" '
'';
nativeBuildInputs = [
ant
jdk
makeWrapper
stripJavaArchivesHook
];
# Note: not sure if this is needed anymore