mirror of
https://github.com/lopsided98/nix-ros-overlay.git
synced 2025-06-12 10:44:50 +03:00
ament-cmake-core: use build platform Python
This commit is contained in:
parent
032fe0bbc8
commit
b6ad7f87f1
3 changed files with 21 additions and 4 deletions
9
distros/ament-cmake-core-setup-hook/default.nix
Normal file
9
distros/ament-cmake-core-setup-hook/default.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{ makeSetupHook, python }:
|
||||
|
||||
makeSetupHook {
|
||||
name = "ament-cmake-core-setup-hook";
|
||||
substitutions = {
|
||||
python_major = python.sourceVersion.major;
|
||||
python_executable = python.pythonForBuild.interpreter;
|
||||
};
|
||||
} ./setup-hook.sh
|
|
@ -20,12 +20,14 @@ _findAmentPackages() {
|
|||
fi
|
||||
_amentPackagesSeen["$pkg"]=1
|
||||
}
|
||||
addEnvHooks "$hostOffset" _findAmentPackages
|
||||
addEnvHooks "$targetOffset" _findAmentPackages
|
||||
|
||||
_amentCmakeCorePreConfigureHook() {
|
||||
# Don't create share/ament_index/resource_index/parent_prefix_path resource
|
||||
# that contains references to all dependencies. This file isn't used with Nix
|
||||
# and just bloats the closure.
|
||||
cmakeFlags+=" -DAMENT_CMAKE_ENVIRONMENT_PARENT_PREFIX_PATH_GENERATION=OFF"
|
||||
cmakeFlags+=" -DAMENT_CMAKE_ENVIRONMENT_PARENT_PREFIX_PATH_GENERATION:BOOL=OFF"
|
||||
# Point CMake at build platform Python so it can run it at build time
|
||||
cmakeFlags+=" -DPython@python_major@_EXECUTABLE:FILEPATH=@python_executable@"
|
||||
}
|
||||
preConfigureHooks+=(_amentCmakeCorePreConfigureHook)
|
|
@ -51,8 +51,14 @@ let
|
|||
}) ];
|
||||
});
|
||||
|
||||
ament-cmake-core = rosSuper.ament-cmake-core.overrideAttrs ({ ... }: {
|
||||
setupHook = ./ament-cmake-core-setup-hook.sh;
|
||||
ament-cmake-core = rosSuper.ament-cmake-core.overrideAttrs ({
|
||||
propagatedBuildInputs ? [],
|
||||
nativeBuildInputs ? [], ...
|
||||
}: let
|
||||
setupHook = rosSelf.callPackage ./ament-cmake-core-setup-hook { };
|
||||
in {
|
||||
propagatedBuildInputs = [ setupHook ] ++ propagatedBuildInputs;
|
||||
nativeBuildInputs = [ setupHook ] ++ nativeBuildInputs;
|
||||
});
|
||||
|
||||
camera-calibration-parsers = patchBoostPython rosSuper.camera-calibration-parsers;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue