Skip to content

Commit

Permalink
Add support for package replacements and replace liburdfdom-dev (#13)
Browse files Browse the repository at this point in the history
Signed-off-by: Addisu Z. Taddese <[email protected]>
  • Loading branch information
azeey authored Nov 4, 2024
1 parent e450acc commit 04dc933
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion create_gz_vendor_pkg/create_vendor_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@
"spdlog": "spdlog_vendor",
}

# Some packages have better alternatives in the ROS ecosystem or use
# vendored versions when built in the ROS buildfarm.
# The keys in this dictionary are the packages in the original package.xml
# and the values are used as replacements.
PACKAGE_REPLACEMENTS = {
"liburdfdom-dev": "urdfdom",
}

# These dependencies will be removed from the package.xml provided by the upstream Gazebo library
DEPENDENCY_DISALLOW_LIST = [
# python3-distutils is not needed for CMake > 3.12. Also, it is currently failing to install on Noble
Expand Down Expand Up @@ -140,7 +148,6 @@ def vendorize_gz_dependency(dep: Dependency):
pkg_name_no_version = remove_version(dep.name)
dep.name = create_vendor_name(pkg_name_no_version)


def separate_gz_deps(deps):
gz_deps = []
non_gz_deps = []
Expand Down Expand Up @@ -222,6 +229,11 @@ def github_pkg_name(pkg_name_no_version):

def separate_and_vendorize_gz_deps(src_pkg_xml: Package):
vendor_pkg_xml = copy.deepcopy(src_pkg_xml)

for dep_type in DEPENDENCY_TYPES:
for dep in getattr(vendor_pkg_xml, dep_type):
dep.name = PACKAGE_REPLACEMENTS.get(dep.name, dep.name)

# The gazebo dependencies need to be vendored and we need to use `<depend>`
# on each dependency regardless of whether it's a build or exec dependency
gz_build_deps, vendor_pkg_xml.build_depends = separate_gz_deps(
Expand Down

0 comments on commit 04dc933

Please sign in to comment.