forked from ros-tooling/setup-ros
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapt.ts
100 lines (93 loc) · 2.85 KB
/
apt.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import * as utils from "../utils";
const aptCommandLine: string[] = [
"DEBIAN_FRONTEND=noninteractive",
"RTI_NC_LICENSE_ACCEPTED=yes",
"apt-get",
"install",
"--no-install-recommends",
"--quiet",
"--yes",
];
const aptDependencies: string[] = [
"libssl-dev", // required for pip3 cryptography module
"python3-dev", // required for pip3 cryptography module
"build-essential",
"clang",
"cmake",
"git",
"lcov",
"python3-catkin-pkg-modules",
"python3-pip",
"python3-rosinstall-generator",
"python3-vcstool",
"wget",
// FastRTPS dependencies
"libasio-dev",
"libtinyxml2-dev",
];
const distributionSpecificAptDependencies = {
bionic: [
// OpenSplice
"libopensplice69",
// python3-rosdep is conflicting with ros-melodic-desktop-full,
// and should not be used here. See ros-tooling/setup-ros#74
"python-rosdep",
// python required for sourcing setup.sh
"python",
"libc++-dev",
"libc++abi-dev",
],
focal: [
// python-rosdep does not exist on Focal, so python3-rosdep is used.
// The issue with ros-melodic-desktop-full is also non-applicable.
"python3-rosdep",
// python required for sourcing setup.sh
"python",
"libc++-dev",
"libc++abi-dev",
],
jammy: [
// python-rosdep does not exist on Jammy, so python3-rosdep is used.
// The issue with ros-melodic-desktop-full is also non-applicable.
"python3-rosdep",
// libc++-dev and libc++abi-dev installs intentionally removed because https://github.com/ros-tooling/setup-ros/issues/506
],
};
const aptRtiConnextDds = {
bionic: "rti-connext-dds-5.3.1",
focal: "rti-connext-dds-5.3.1",
jammy: "rti-connext-dds-6.0.1",
};
/**
* Run apt-get install on list of specified packages.
*
* This invokation guarantees that APT install will be non-blocking.
*
* In particular, it automatically accepts the RTI Connext license, which would block forever otherwise.
* Skipping the license agreement page requires RTI_NC_LICENSE_ACCEPTED to be set to "yes".
* This package would normally be installed automatically by rosdep, but
* there is no way to pass RTI_NC_LICENSE_ACCEPTED through rosdep.
*
* @param packages list of Debian pacakges to be installed
* @returns Promise<number> exit code
*/
export async function runAptGetInstall(packages: string[]): Promise<number> {
return utils.exec("sudo", aptCommandLine.concat(packages));
}
/**
* Run ROS 2 APT dependencies.
*
* @returns Promise<number> exit code
*/
export async function installAptDependencies(
installConnext = false
): Promise<number> {
const distribCodename = await utils.determineDistribCodename();
let aptPackages: string[] = installConnext
? aptDependencies.concat(aptRtiConnextDds[distribCodename] || [])
: aptDependencies;
const additionalAptPackages =
distributionSpecificAptDependencies[distribCodename] || [];
aptPackages = aptPackages.concat(additionalAptPackages);
return runAptGetInstall(aptPackages);
}