571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
81 lines
2.0 KiB
Nix
81 lines
2.0 KiB
Nix
{ lib
|
|
, stdenv
|
|
, makeWrapper
|
|
, fetchFromGitHub
|
|
, gradle_7
|
|
, openjdk17
|
|
}:
|
|
|
|
let
|
|
pname = "fastddsgen";
|
|
version = "4.0.2";
|
|
|
|
gradle = gradle_7;
|
|
|
|
in
|
|
stdenv.mkDerivation {
|
|
inherit pname version;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "eProsima";
|
|
repo = "Fast-DDS-Gen";
|
|
rev = "v${version}";
|
|
fetchSubmodules = true;
|
|
hash = "sha256-dwShzcS0sCiVZghpjvPYvYu89NNkGWUWPsAzwdzfAqo=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
gradle
|
|
openjdk17
|
|
makeWrapper
|
|
];
|
|
|
|
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.
|
|
# 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 \
|
|
--add-flags "-jar $out/share/fastddsgen/java/fastddsgen.jar" \
|
|
--prefix PATH : ${lib.makeBinPath [ stdenv.cc.cc ]}
|
|
|
|
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;
|
|
};
|
|
}
|