fastddsgen: unpin gradle and openjdk

* gradle_7 is marked insecure (#452022) and up for removal (#358845)
* switch to openjdk21, the current LTS
* add a basic version package test
This commit is contained in:
Nicolas Benes
2025-11-06 11:12:45 +01:00
parent 5cd0e0f97f
commit ffc5fcf336
2 changed files with 54 additions and 15 deletions
@@ -0,0 +1,17 @@
Fix gradle error
https://docs.gradle.org/9.1.0/userguide/validation_problems.html#private_method_must_not_be_annotated
diff --git a/build.gradle b/build.gradle
index c6d537e..9029aae 100644
--- a/build.gradle
+++ b/build.gradle
@@ -69,7 +69,7 @@ public abstract class InstallPath extends DefaultTask {
* Install Task Action that copies the script and jar files
*/
@TaskAction
- private void install() {
+ public void install() {
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
final String install_path = (path != null && !path.isEmpty()) ? path : "C:\\Program Files\\fastddsgen\\";
+37 -15
View File
@@ -3,36 +3,53 @@
stdenv,
makeWrapper,
fetchFromGitHub,
gradle_7,
openjdk17,
fetchpatch2,
gradle,
openjdk,
testers,
}:
let
stdenv.mkDerivation (finalAttrs: {
pname = "fastddsgen";
version = "4.2.0";
gradle = gradle_7;
in
stdenv.mkDerivation {
inherit pname version;
src = fetchFromGitHub {
owner = "eProsima";
repo = "Fast-DDS-Gen";
tag = "v${version}";
tag = "v${finalAttrs.version}";
fetchSubmodules = true;
hash = "sha256-weGS340MvPitWMgWx1cWTgYgGcQfJSTUus8EcBob7hY=";
};
patches = [
# Note: PR is not yet merged
# Select commit from https://github.com/eProsima/IDL-Parser/pull/179
(fetchpatch2 {
url = "https://github.com/eProsima/IDL-Parser/commit/801ed2f671322c0134b8db180529c9a400d5ed2b.patch";
stripLen = 1;
extraPrefix = "thirdparty/idl-parser/";
includes = [ "thirdparty/idl-parser/build.gradle" ];
hash = "sha256-OzywQ02yaMnya+536DeHWeKwZefI4meYqmZcp3onwR8=";
})
# Note: PR is not yet merged
# Select commit from https://github.com/eProsima/Fast-DDS-Gen/pull/493
(fetchpatch2 {
url = "https://github.com/eProsima/Fast-DDS-Gen/commit/b1b66d587f38d4fd6227aa1969c3a10c2095ae7d.patch";
hash = "sha256-qVp9Xk8og8Ga2BMiqt2BFM0lAtDnmmwzteceievfcXE=";
})
./493-addendum.patch
];
nativeBuildInputs = [
gradle
openjdk17
openjdk
makeWrapper
];
mitmCache = gradle.fetchDeps {
inherit pname;
inherit (finalAttrs) pname;
data = ./deps.json;
};
@@ -51,7 +68,7 @@ stdenv.mkDerivation {
# Override the default start script to use absolute java path.
# Make the unwrapped "cpp" available in the path, since the wrapped "cpp"
# passes additional flags and produces output incompatible with fastddsgen.
makeWrapper ${openjdk17}/bin/java $out/bin/fastddsgen \
makeWrapper ${openjdk}/bin/java $out/bin/fastddsgen \
--add-flags "-jar $out/share/fastddsgen/java/fastddsgen.jar" \
--prefix PATH : ${lib.makeBinPath [ stdenv.cc.cc ]}
@@ -65,6 +82,11 @@ stdenv.mkDerivation {
gradle nixDownloadDeps
'';
passthru.tests = testers.testVersion {
command = "${finalAttrs.meta.mainProgram} -version";
package = finalAttrs.finalPackage;
};
meta = with lib; {
description = "Fast-DDS IDL code generator tool";
mainProgram = "fastddsgen";
@@ -79,6 +101,6 @@ stdenv.mkDerivation {
used to publish or subscribe.
'';
maintainers = with maintainers; [ wentasah ];
platforms = openjdk17.meta.platforms;
platforms = openjdk.meta.platforms;
};
}
})