Packaging OpenDDS

I’m trying to build OpenDDS, the issue comes from how to build it’s dependencies; it relies on GitHub - DOCGroup/ACE_TAO: ACE and TAO, which uses GitHub - DOCGroup/MPC: MPC (The Makefile, Project, and Workspace Creator) to build it. OpenDDS’ cmake script deals with all this which I’d very much like to use, the issue being nix’s sandbox won’t let cmake download the dependencies. Is there a way to predownload them (I tried with git submodules) and pass those directories to OpenDDS’ cmake call? The following (with submodules) got further but ACE_TAO’s configuration step involves editing files in the source directory, which nix causes a permission denied error (presumably because of the sandoxing as well?).

I’m working out of a flake for now trying to get this to work.

{
  description = "Dev environment";

  inputs = {
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs = { self, nixpkgs, flake-utils }:
    flake-utils.lib.eachDefaultSystem (system:
      let

        pkgs = (import nixpkgs) {
          inherit system;
        };
      in
      {
        defaultPackage = pkgs.stdenv.mkDerivation {
          name = "OpenDDS";

          src = ./.;

          cmakeFlags = [
            "-DOPENDDS_ACE_TAO_SRC=${./.}/ACE_TAO"
            "-DOPENDDS_MPC=${./.}/MPC"
          ];

          nativeBuildInputs = with pkgs; [
            perl
            cmake
          ];
        };
      }
    );
}

Is someone able to help package this, I’m not sure how to get this done?

Trying to figure this out some more, I’ve created this, but still have the issue of ACE_TAO needing to be modified during configuration

{ stdenv, fetchFromGitHub, cmake, perl }:

stdenv.mkDerivation rec {
  pname = "OpenDDS";
  version = "3.26.1";

  opendds_src = (fetchFromGitHub {
    name = pname;
    owner = "OpenDDS";
    repo = pname;
    rev = "DDS-${version}";
    hash = "sha256-j1WPdiBMb9+usybhtM123e+j7yKfJI6sqQOOTManAoA=";
  });

  ace_tao_src = (fetchFromGitHub {
    name = "ACE_TAO";
    owner = "DOCGroup";
    repo = "ACE_TAO";
    rev = "ACE+TAO-7_1_2";
    hash = "sha256-+jKw/E2ugmOogC3QRvwz8ZyziqdvF/G0RHUFPjcHSAs=";
  });

  mpc_src = (fetchFromGitHub {
    name = "MPC";
    owner = "DOCGroup";
    repo = "MPC";
    rev = "master";
    hash = "sha256-YCdXWopefVAbEFszrog8Nurqqy6WAQhKJYhwFgHsRbg=";
  });


  srcs = [
    opendds_src
    ace_tao_src
    mpc_src
  ];

  sourceRoot = pname;

  nativeBuildInputs = [
    perl
    cmake
  ];

  unpackPhase = ''
    cp -rv $ace_tao_src $opendds_src/ACE_TAO
  '';

  cmakeFlags = [
    "-DOPENDDS_MPC=${mpc_src}"
    "-DOPENDDS_ACE_TAO_SRC=${opendds_src}/ACE_TAO"
  ];
}