Skip to content

Commit e20d911

Browse files
Install Time::Piece Perl module required by OpenSSL 3.0.18+ build system
1 parent fabd7bb commit e20d911

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

src/python/install.sh

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,67 @@ fi
8282
if type apt-get > /dev/null 2>&1; then
8383
PKG_MGR_CMD=apt-get
8484
INSTALL_CMD="${PKG_MGR_CMD} -y install --no-install-recommends"
85+
TIME_PIECE_PKG="libtime-piece-perl"
8586
elif type microdnf > /dev/null 2>&1; then
8687
PKG_MGR_CMD=microdnf
8788
INSTALL_CMD="${PKG_MGR_CMD} ${INSTALL_CMD_ADDL_REPOS} -y install --refresh --best --nodocs --noplugins --setopt=install_weak_deps=0"
89+
TIME_PIECE_PKG="perl-Time-Piece"
8890
elif type dnf > /dev/null 2>&1; then
8991
PKG_MGR_CMD=dnf
9092
INSTALL_CMD="${PKG_MGR_CMD} ${INSTALL_CMD_ADDL_REPOS} -y install --refresh --best --nodocs --noplugins --setopt=install_weak_deps=0"
93+
TIME_PIECE_PKG="perl-Time-Piece"
9194
else
9295
PKG_MGR_CMD=yum
9396
INSTALL_CMD="${PKG_MGR_CMD} ${INSTALL_CMD_ADDL_REPOS} -y install --noplugins --setopt=install_weak_deps=0"
97+
TIME_PIECE_PKG="perl-Time-Piece"
9498
fi
99+
# Install Time::Piece Perl module required by OpenSSL 3.0.18+ build system
100+
install_time_piece() {
101+
echo "(*) Ensuring Time::Piece Perl module is available..."
102+
103+
# Check if Time::Piece is already available (it's usually in Perl core)
104+
if perl -MTime::Piece -e 'exit 0' 2>/dev/null; then
105+
echo "(*) Time::Piece already available"
106+
return 0
107+
fi
108+
109+
echo "(*) Time::Piece not found, attempting installation..."
110+
111+
case ${ADJUSTED_ID} in
112+
debian)
113+
# Update package cache
114+
pkg_mgr_update
115+
116+
# Try different package combinations
117+
if ${INSTALL_CMD} perl-modules-5.36 2>/dev/null; then
118+
echo "(*) Installed perl-modules-5.36"
119+
elif ${INSTALL_CMD} perl-modules-5.34 2>/dev/null; then
120+
echo "(*) Installed perl-modules-5.34"
121+
elif ${INSTALL_CMD} perl-modules 2>/dev/null; then
122+
echo "(*) Installed perl-modules"
123+
elif ${INSTALL_CMD} perl-base perl-modules-5.* 2>/dev/null; then
124+
echo "(*) Installed perl-base and modules"
125+
else
126+
echo "(*) Warning: Could not install Time::Piece via packages"
127+
echo "(*) Time::Piece is usually built into Perl core, continuing..."
128+
fi
129+
;;
130+
rhel)
131+
${INSTALL_CMD} ${TIME_PIECE_PKG} || {
132+
echo "(*) Warning: Could not install ${TIME_PIECE_PKG}"
133+
}
134+
;;
135+
esac
136+
137+
# Final check
138+
if perl -MTime::Piece -e 'exit 0' 2>/dev/null; then
139+
echo "(*) Time::Piece is now available"
140+
else
141+
echo "(*) Warning: Time::Piece may not be available"
142+
echo "(*) This could cause issues with OpenSSL 3.0.18+ builds"
143+
fi
144+
}
145+
95146

96147
# Clean up
97148
clean_up() {
@@ -1090,6 +1141,8 @@ if [ "${INSTALL_JUPYTERLAB}" = "true" ]; then
10901141
fi
10911142
fi
10921143

1144+
# Call the installation function
1145+
install_time_piece
10931146
# Clean up
10941147
clean_up
10951148

0 commit comments

Comments
 (0)