Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for package replacements and replace liburdfdom-dev #13

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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