depot/third_party/nixpkgs/pkgs/development/tools/fastddsgen/default.nix
Default email f34ce41345 Project import generated by Copybara.
GitOrigin-RevId: b73c2221a46c13557b1b3be9c2070cc42cf01eb3
2024-07-27 08:49:29 +02:00

69 lines
1.8 KiB
Nix

{ lib, stdenv, runtimeShell, fetchFromGitHub, gradle_7, openjdk17 }:
let
pname = "fastddsgen";
version = "3.3.0";
gradle = gradle_7;
in
stdenv.mkDerivation {
inherit pname version;
src = fetchFromGitHub {
owner = "eProsima";
repo = "Fast-DDS-Gen";
rev = "v${version}";
fetchSubmodules = true;
hash = "sha256-oqbSIzsYUwD8bTqGKZ9he9d18EDq9mHZFoNUp0RK0qU=";
};
nativeBuildInputs = [ gradle openjdk17 ];
mitmCache = gradle.fetchDeps {
inherit pname;
data = ./deps.json;
};
__darwinAllowLocalNetworking = true;
gradleFlags = [ "-x" "submodulesUpdate" ];
installPhase = ''
runHook preInstall
gradle install --install_path=$out
# Override the default start script to use absolute java path
cat <<EOF >$out/bin/fastddsgen
#!${runtimeShell}
exec ${openjdk17}/bin/java -jar "$out/share/fastddsgen/java/fastddsgen.jar" "\$@"
EOF
chmod a+x "$out/bin/fastddsgen"
runHook postInstall
'';
postGradleUpdate = ''
cd thirdparty/idl-parser
# fix "Task 'submodulesUpdate' not found"
gradleFlags=
gradle nixDownloadDeps
'';
meta = with lib; {
description = "Fast-DDS IDL code generator tool";
mainProgram = "fastddsgen";
homepage = "https://github.com/eProsima/Fast-DDS-Gen";
license = licenses.asl20;
longDescription = ''
eProsima Fast DDS-Gen is a Java application that generates
eProsima Fast DDS C++ or Python source code using the data types
defined in an IDL (Interface Definition Language) file. This
generated source code can be used in any Fast DDS application in
order to define the data type of a topic, which will later be
used to publish or subscribe.
'';
maintainers = with maintainers; [ wentasah ];
platforms = openjdk17.meta.platforms;
};
}