Date: Tuesday, July 7, 2020 @ 12:39:17 Author: diabonas Revision: 658171
upgpkg: junit-system-rules 1.19.0-7: replace strip-nondeterminism by project.build.outputTimestamp This is the officially supported way for reproducible builds with Apache Maven, see https://maven.apache.org/guides/mini/guide-reproducible-builds.html However it needs a patch to update maven-jar-plugin to a version supporting this property. Added: junit-system-rules/trunk/junit-system-rules-1.19.0_update-maven-jar-plugin.patch Modified: junit-system-rules/trunk/PKGBUILD ---------------------------------------------------------+ PKGBUILD | 22 ++++++---- junit-system-rules-1.19.0_update-maven-jar-plugin.patch | 29 ++++++++++++++ 2 files changed, 42 insertions(+), 9 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2020-07-07 12:39:04 UTC (rev 658170) +++ PKGBUILD 2020-07-07 12:39:17 UTC (rev 658171) @@ -2,15 +2,17 @@ pkgname=junit-system-rules pkgver=1.19.0 _commit=f4782ebfd72c08bd3f00aa04ad20fe499c5463b4 # signed commit corresponding to tag "system-rules-$pkgver" -pkgrel=6 +pkgrel=7 pkgdesc='A collection of JUnit rules for testing code that uses java.lang.System' arch=('any') url='https://stefanbirkner.github.io/system-rules/' license=('CPL') depends=('junit') -makedepends=('git' 'jdk8-openjdk' 'maven' 'strip-nondeterminism') -source=("$pkgname::git+https://github.com/stefanbirkner/system-rules.git?signed#commit=$_commit") -sha512sums=('SKIP') +makedepends=('git' 'jdk8-openjdk' 'maven') +source=("$pkgname::git+https://github.com/stefanbirkner/system-rules.git?signed#commit=$_commit" + 'junit-system-rules-1.19.0_update-maven-jar-plugin.patch') +sha512sums=('SKIP' + 'ec9fb99770b406ac3e56c49820e33ff255958566724534f0d6afc340ebfb1fbbd7043fc188d39d553ca230058ff7d592ede8729feb8434c6090849bb26a7dea4') validpgpkeys=('F4AF40991AECE57728B0034F9ECE1F68817F4996') # Stefan Birkner <[email protected]> pkgver() { @@ -18,6 +20,12 @@ git describe --tags | sed 's/^system-rules-//;s/\([^-]*-g\)/r\1/;s/-/./g' } +prepare() { + cd "$pkgname" + # Update the plugin generating the JAR file to a version supporting reproducible builds + patch --strip=1 --input="$srcdir/junit-system-rules-1.19.0_update-maven-jar-plugin.patch" +} + build() { cd "$pkgname" @@ -25,11 +33,7 @@ # (https://github.com/stefanbirkner/system-rules/issues/65#issuecomment-402837535) export PATH="/usr/lib/jvm/java-8-openjdk/bin:$PATH" - mvn -DskipTests=true clean package - - # Timestamps in JAR files generated by Maven do not honour SOURCE_DATE_EPOCH - # (https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=74682318) - strip-nondeterminism --timestamp "$SOURCE_DATE_EPOCH" "target/system-rules-$pkgver.jar" + mvn -Dproject.build.outputTimestamp="$SOURCE_DATE_EPOCH" -DskipTests=true clean package } check() { Added: junit-system-rules-1.19.0_update-maven-jar-plugin.patch =================================================================== --- junit-system-rules-1.19.0_update-maven-jar-plugin.patch (rev 0) +++ junit-system-rules-1.19.0_update-maven-jar-plugin.patch 2020-07-07 12:39:17 UTC (rev 658171) @@ -0,0 +1,29 @@ +From 13fd4bb331dae0ae99c97c5b7bdaa7eb7247a57b Mon Sep 17 00:00:00 2001 +From: Jonas Witschel <[email protected]> +Date: Tue, 7 Jul 2020 14:09:37 +0200 +Subject: [PATCH] Update maven-jar-plugin to version 3.2.0 + +This is the minimal plugin version to support reproducible builds using the +"project.build.outputTimestamp" property. +--- + pom.xml | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/pom.xml b/pom.xml +index e764bd9..596e3cc 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -121,6 +121,10 @@ + <forkMode>always</forkMode> + </configuration> + </plugin> ++ <plugin> ++ <artifactId>maven-jar-plugin</artifactId> ++ <version>3.2.0</version> ++ </plugin> + </plugins> + </build> + +-- +2.27.0 +
