fix(installer): gate util-linux-extra to Ubuntu 24.04+ (#635)
* fix(installer): gate util-linux-extra to Ubuntu 24.04+ util-linux-extra does not exist on Ubuntu 22.04 (package split landed in 24.04). Listing it unconditionally in APT_PACKAGES_UBUNTU breaks install.sh on 22.04-based distros such as Linux Mint. Fixes #526 * fix(installer): probe util-linux-extra via apt-cache Replace Ubuntu VERSION_ID gate with apt-cache show probe (per review feedback). Handles Ubuntu derivatives (Mint, Zorin) whose VERSION_ID does not match the noble base where util-linux-extra exists. Fixes #526 --------- Co-authored-by: Jatin K Malik <jatinkrmalik@gmail.com>
This commit is contained in:
co-authored by
Jatin K Malik
parent
ecd5839a13
commit
00680c35c5
+10
-2
@@ -1621,10 +1621,10 @@ install_system_dependencies() {
|
||||
# Debian install they are absent and cause CMake's bootstrap to fail (Hurdle 2 from
|
||||
# https://medium.com/@cslev/talking-to-my-linux-box-without-talking-to-the-cloud-vocalinux-on-debian-without-the-tears-10bf053ea21b).
|
||||
local PYWHISPERCPP_BUILD_DEPS="libssl-dev autoconf automake libtool patchelf"
|
||||
local APT_PACKAGES_UBUNTU="python3-pip python3-gi python3-gi-cairo gir1.2-gtk-3.0 gir1.2-appindicator3-0.1 gir1.2-ibus-1.0 $GI_DEV_PKG libcairo2-dev cmake python3-dev build-essential portaudio19-dev python3-venv pkg-config wget curl unzip vulkan-tools libvulkan-dev $VULKAN_SHADER_PKG xclip xsel wl-clipboard util-linux-extra $PYWHISPERCPP_BUILD_DEPS"
|
||||
local APT_PACKAGES_UBUNTU="python3-pip python3-gi python3-gi-cairo gir1.2-gtk-3.0 gir1.2-appindicator3-0.1 gir1.2-ibus-1.0 $GI_DEV_PKG libcairo2-dev cmake python3-dev build-essential portaudio19-dev python3-venv pkg-config wget curl unzip vulkan-tools libvulkan-dev $VULKAN_SHADER_PKG xclip xsel wl-clipboard $PYWHISPERCPP_BUILD_DEPS"
|
||||
local APT_PACKAGES_DEBIAN_BASE="python3-pip python3-gi python3-gi-cairo gir1.2-gtk-3.0 gir1.2-ibus-1.0 libcairo2-dev cmake python3-dev build-essential portaudio19-dev python3-venv pkg-config wget curl unzip vulkan-tools libvulkan-dev $VULKAN_SHADER_PKG xclip xsel wl-clipboard $PYWHISPERCPP_BUILD_DEPS"
|
||||
local APT_PACKAGES_DEBIAN_11_12="$APT_PACKAGES_DEBIAN_BASE libgirepository1.0-dev gir1.2-ayatanaappindicator3-0.1"
|
||||
local APT_PACKAGES_DEBIAN_13_PLUS="$APT_PACKAGES_DEBIAN_BASE libgirepository-2.0-dev gir1.2-ayatanaappindicator3-0.1 util-linux-extra"
|
||||
local APT_PACKAGES_DEBIAN_13_PLUS="$APT_PACKAGES_DEBIAN_BASE libgirepository-2.0-dev gir1.2-ayatanaappindicator3-0.1"
|
||||
local DNF_PACKAGES="python3-pip python3-gobject gtk3 ibus-devel gobject-introspection-devel python3-devel portaudio-devel python3-virtualenv pkg-config cmake wget curl unzip vulkan-tools vulkan-loader-devel glslang xclip xsel wl-clipboard"
|
||||
local PACMAN_PACKAGES="python-pip python-gobject gtk3 ibus gobject-introspection python-cairo portaudio python-virtualenv pkg-config cmake wget curl unzip base-devel vulkan-tools vulkan-headers glslang xclip xsel wl-clipboard"
|
||||
local ZYPPER_PACKAGES="gtk3 ibus-devel gobject-introspection-devel portaudio-devel pkg-config cmake wget curl unzip xclip xsel wl-clipboard typelib-1_0-Notify-0_7 libnotify4"
|
||||
@@ -1653,6 +1653,14 @@ install_system_dependencies() {
|
||||
fi
|
||||
fi
|
||||
|
||||
# util-linux-extra only exists on newer Ubuntu/Debian (24.04+, Debian 13+).
|
||||
# On 22.04 those tools ship in the main util-linux package (always installed).
|
||||
# apt-cache probe handles Ubuntu derivatives (Mint, Zorin) whose VERSION_ID
|
||||
# does not track the Ubuntu base release.
|
||||
if apt-cache show util-linux-extra &>/dev/null 2>&1; then
|
||||
APT_PACKAGES="$APT_PACKAGES util-linux-extra"
|
||||
fi
|
||||
|
||||
# Check for missing packages
|
||||
for pkg in $APT_PACKAGES; do
|
||||
if ! apt_package_installed "$pkg"; then
|
||||
|
||||
@@ -90,6 +90,21 @@ class InstallerCudaDiagnosticsTests(unittest.TestCase):
|
||||
self.assertIn("xsel", line)
|
||||
self.assertIn("wl-clipboard", line)
|
||||
|
||||
def test_ubuntu_22_package_list_omits_util_linux_extra(self) -> None:
|
||||
"""util-linux-extra is probed via apt-cache, not hardcoded in base package lists."""
|
||||
source = _installer_source()
|
||||
|
||||
ubuntu_line = next(
|
||||
line for line in source.splitlines() if "local APT_PACKAGES_UBUNTU=" in line
|
||||
)
|
||||
debian_13_line = next(
|
||||
line for line in source.splitlines() if "local APT_PACKAGES_DEBIAN_13_PLUS=" in line
|
||||
)
|
||||
self.assertNotIn("util-linux-extra", ubuntu_line)
|
||||
self.assertNotIn("util-linux-extra", debian_13_line)
|
||||
self.assertIn("apt-cache show util-linux-extra", source)
|
||||
self.assertIn('APT_PACKAGES="$APT_PACKAGES util-linux-extra"', source)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user