1 { lib, stdenv, runtimeShell, writeText, fetchFromGitHub, gradle_7, openjdk17, git, perl, cmake }:
6 src = fetchFromGitHub {
10 fetchSubmodules = true;
11 hash = "sha256-oqbSIzsYUwD8bTqGKZ9he9d18EDq9mHZFoNUp0RK0qU=";
16 # fake build to pre-download deps into fixed-output derivation
17 deps = stdenv.mkDerivation {
18 pname = "${pname}-deps";
20 nativeBuildInputs = [ gradle openjdk17 perl ];
23 export GRADLE_USER_HOME=$(mktemp -d);
24 gradle --no-daemon -x submodulesUpdate assemble
27 # perl code mavenizes paths (com.squareup.okio/okio/1.13.0/a9283170b7305c8d92d25aff02a6ab7e45d06cbe/okio-1.13.0.jar -> com/squareup/okio/okio/1.13.0/okio-1.13.0.jar)
29 find $GRADLE_USER_HOME/caches/modules-2 -type f -regex '.*\.\(jar\|pom\)' \
30 | perl -pe 's#(.*/([^/]+)/([^/]+)/([^/]+)/[0-9a-f]{30,40}/([^/\s]+))$# ($x = $2) =~ tr|\.|/|; "install -Dm444 $1 \$out/$x/$3/$4/$5" #e' \
36 outputHashAlgo = "sha256";
37 outputHashMode = "recursive";
38 outputHash = "sha256-YkVRp6TXI7/5O+u0DDYiCq7DITfGJ4lT/L4hT90JOL8=";
42 inherit pname src version;
44 nativeBuildInputs = [ gradle openjdk17 ];
46 # use our offline deps
51 maven { url "${deps}" }\
53 }' thirdparty/idl-parser/settings.gradle
54 sed -ie "s#mavenCentral()#maven { url '${deps}' }#g" build.gradle
55 sed -ie "s#mavenCentral()#maven { url '${deps}' }#g" thirdparty/idl-parser/build.gradle
61 export GRADLE_USER_HOME=$(mktemp -d)
63 # Run gradle with daemon to make installPhase faster
64 gradle --offline -x submodulesUpdate assemble
72 gradle --offline -x submodulesUpdate install --install_path=$out
74 # Override the default start script to use absolute java path
75 cat <<EOF >$out/bin/fastddsgen
77 exec ${openjdk17}/bin/java -jar "$out/share/fastddsgen/java/fastddsgen.jar" "\$@"
79 chmod a+x "$out/bin/fastddsgen"
85 description = "Fast-DDS IDL code generator tool";
86 mainProgram = "fastddsgen";
87 homepage = "https://github.com/eProsima/Fast-DDS-Gen";
88 license = licenses.asl20;
90 eProsima Fast DDS-Gen is a Java application that generates
91 eProsima Fast DDS C++ or Python source code using the data types
92 defined in an IDL (Interface Definition Language) file. This
93 generated source code can be used in any Fast DDS application in
94 order to define the data type of a topic, which will later be
95 used to publish or subscribe.
97 maintainers = with maintainers; [ wentasah ];
98 platforms = openjdk17.meta.platforms;