From 9808effe7407068e2c8da473012594b2154f837d Mon Sep 17 00:00:00 2001
From: TomaSajt <62384384+TomaSajt@users.noreply.github.com>
Date: Thu, 11 Jan 2024 14:53:12 +0100
Subject: ktfmt: make deterministic
---
pkgs/by-name/kt/ktfmt/package.nix | 7 ++-
.../ktfmt/pin-default-maven-plugin-versions.patch | 60 ++++++++++++++++++++++
2 files changed, 65 insertions(+), 2 deletions(-)
create mode 100644 pkgs/by-name/kt/ktfmt/pin-default-maven-plugin-versions.patch
(limited to 'pkgs/by-name/kt')
diff --git a/pkgs/by-name/kt/ktfmt/package.nix b/pkgs/by-name/kt/ktfmt/package.nix
index 49546fd411018..99d5b03f9a53d 100644
--- a/pkgs/by-name/kt/ktfmt/package.nix
+++ b/pkgs/by-name/kt/ktfmt/package.nix
@@ -11,14 +11,17 @@ maven.buildMavenPackage rec {
hash = "sha256-vdvKHTTD84OAQacv/VE/5BxYdW4n3bxPUHF2MdH+sQQ=";
};
- mvnHash = "sha256-Cl7P2i4VFJ/yk7700u62YPcacfKkhBztFvcDkYBfZEA=";
+ patches = [ ./pin-default-maven-plugin-versions.patch ];
+
+ mvnHash = "sha256-iw28HS0WMFC9BKQKr0v33D77rMQeIMKjXduqPcYU1XA=";
+
+ mvnParameters = "-Dproject.build.outputTimestamp=1980-01-01T00:00:02Z";
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
- mkdir -p $out/bin
install -Dm644 core/target/ktfmt-*-jar-with-dependencies.jar $out/share/ktfmt/ktfmt.jar
makeWrapper ${jre_headless}/bin/java $out/bin/ktfmt \
diff --git a/pkgs/by-name/kt/ktfmt/pin-default-maven-plugin-versions.patch b/pkgs/by-name/kt/ktfmt/pin-default-maven-plugin-versions.patch
new file mode 100644
index 0000000000000..d3425669da0f9
--- /dev/null
+++ b/pkgs/by-name/kt/ktfmt/pin-default-maven-plugin-versions.patch
@@ -0,0 +1,60 @@
+diff --git a/core/pom.xml b/core/pom.xml
+index 267689e..6b6e04d 100644
+--- a/core/pom.xml
++++ b/core/pom.xml
+@@ -34,6 +34,55 @@
+ ${project.basedir}/src/main/java
+ ${project.basedir}/src/test/java
+
++
++ org.apache.maven.plugins
++ maven-enforcer-plugin
++ 3.4.1
++
++
++ require-all-plugin-versions-to-be-set
++ validate
++
++ enforce
++
++
++
++
++
++
++
++
++
++
++ org.apache.maven.plugins
++ maven-surefire-plugin
++ 3.2.5
++
++
++ org.apache.maven.plugins
++ maven-clean-plugin
++ 3.3.2
++
++
++ org.apache.maven.plugins
++ maven-install-plugin
++ 3.1.1
++
++
++ org.apache.maven.plugins
++ maven-site-plugin
++ 4.0.0-M13
++
++
++ org.apache.maven.plugins
++ maven-resources-plugin
++ 3.3.1
++
++
++ org.apache.maven.plugins
++ maven-deploy-plugin
++ 3.1.1
++
+
+ org.jetbrains.kotlin
+ kotlin-maven-plugin
--
cgit 1.4.1