From a0cb583e17db62c9669f33c546d27c2bfb1541b4 Mon Sep 17 00:00:00 2001 From: Harsh Kumar Date: Tue, 3 Mar 2026 01:08:02 +0530 Subject: [PATCH 1/2] Add Debian and Kali GNU/Linux support to DependencyInstaller MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves #3910 (ORFS side) The ORFS DependencyInstaller.sh only matches "Ubuntu" and "Debian GNU/Linux rodete" in OS detection — both "Debian GNU/Linux" and "Kali GNU/Linux" hit the "unsupported system" fallback. Add a dedicated _installDebianPackages function and case entry for Debian/Kali that: - Installs the same base apt packages as Ubuntu - Uses KLayout from Debian repos instead of Ubuntu-specific .deb URLs - Uses Docker's Debian repo URL instead of Ubuntu's - Handles failures gracefully with warnings Existing Ubuntu, Enterprise Linux, and Darwin code paths are completely untouched. Signed-off-by: Harsh Kumar Patwa Signed-off-by: Harsh Kumar --- etc/DependencyInstaller.sh | 75 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/etc/DependencyInstaller.sh b/etc/DependencyInstaller.sh index ce71b18133..8412d69943 100755 --- a/etc/DependencyInstaller.sh +++ b/etc/DependencyInstaller.sh @@ -258,6 +258,64 @@ _installUbuntuPackages() { fi } +_installDebianPackages() { + export DEBIAN_FRONTEND="noninteractive" + apt-get -y update + apt-get -y install --no-install-recommends \ + bison \ + curl \ + flex \ + help2man \ + libfl-dev \ + libfl2 \ + libgit2-dev \ + libgoogle-perftools-dev \ + libqt5multimediawidgets5 \ + libqt5opengl5 \ + libqt5svg5-dev \ + libqt5xmlpatterns5-dev \ + libz-dev \ + perl \ + python3-pip \ + python3-venv \ + qtmultimedia5-dev \ + qttools5-dev \ + ruby \ + ruby-dev \ + time \ + zlib1g \ + zlib1g-dev + + # Install KLayout from Debian repos + apt-get -y install --no-install-recommends klayout python3-pandas \ + || echo "WARNING: KLayout not available via apt. Please install manually." + + if command -v docker &> /dev/null; then + echo "Docker is already installed, skip docker reinstall." + return 0 + fi + + # Add Docker's official GPG key: + install -m 0755 -d /etc/apt/keyrings + curl -fsSL https://download.docker.com/linux/debian/gpg \ + -o /etc/apt/keyrings/docker.asc + chmod a+r /etc/apt/keyrings/docker.asc + + # Add the Debian Docker repository + echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \ + $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ + tee /etc/apt/sources.list.d/docker.list > /dev/null + + apt-get -y update + apt-get -y install --no-install-recommends \ + docker-ce \ + docker-ce-cli \ + containerd.io \ + docker-buildx-plugin \ + docker-compose-plugin \ + || echo "WARNING: Docker installation failed. You may need to install Docker manually." +} + _installDarwinPackages() { brew install libffi tcl-tk ruby brew install python libomp doxygen capnp tbb bison flex boost spdlog zlib @@ -483,6 +541,23 @@ case "${os}" in fi fi ;; + "Debian GNU/Linux" | "Kali GNU/Linux" ) + version=$(awk -F= '/^VERSION_ID/{print $2}' /etc/os-release | sed 's/"//g') + if [[ -z ${version} ]]; then + version=$(awk -F= '/^VERSION_CODENAME/{print $2}' /etc/os-release | sed 's/"//g') + fi + if [[ ${CI} == "yes" ]]; then + echo "WARNING: Installing CI dependencies is only supported on Ubuntu 22.04" >&2 + fi + _installORDependencies + if [[ "${option}" == "base" || "${option}" == "all" ]]; then + _installDebianPackages + _installUbuntuCleanUp + fi + if [[ "${option}" == "common" || "${option}" == "all" ]]; then + _installPipCommon + fi + ;; "Darwin" ) if [[ ${CI} == "yes" ]]; then echo "WARNING: Installing CI dependencies is only supported on Ubuntu 22.04" >&2 From 17a344dbd4b8ade75bcbd11ecd5b7a8a97a43e95 Mon Sep 17 00:00:00 2001 From: Harsh Kumar Date: Tue, 3 Mar 2026 04:39:08 +0530 Subject: [PATCH 2/2] Reuse _installUbuntuPackages for Debian/Kali instead of duplicating Address review feedback: remove separate _installDebianPackages function and reuse _installUbuntuPackages with distro-aware handling for Docker repo URL, KLayout install method, and libstdc++ version selection. Signed-off-by: Harsh Kumar Patwa Co-Authored-By: Claude Opus 4.6 Signed-off-by: Harsh Kumar --- etc/DependencyInstaller.sh | 98 +++++++++++--------------------------- 1 file changed, 27 insertions(+), 71 deletions(-) diff --git a/etc/DependencyInstaller.sh b/etc/DependencyInstaller.sh index 8412d69943..2783bf2bd4 100755 --- a/etc/DependencyInstaller.sh +++ b/etc/DependencyInstaller.sh @@ -148,6 +148,10 @@ _installKlayoutDependenciesUbuntuAarch64() { } _installUbuntuPackages() { + # Detect distro for Docker repo URL and KLayout install method + local distro_id + distro_id=$(. /etc/os-release && echo "${ID}") + export DEBIAN_FRONTEND="noninteractive" apt-get -y update apt-get -y install --no-install-recommends \ @@ -175,19 +179,23 @@ _installUbuntuPackages() { zlib1g \ zlib1g-dev - packages=() - # Choose libstdc++ version - if _versionCompare $1 -ge 25.04; then - packages+=("libstdc++-15-dev") - elif _versionCompare $1 -ge 24.04; then - packages+=("libstdc++-14-dev") - elif _versionCompare $1 -ge 22.10; then - packages+=("libstdc++-12-dev") + # Choose libstdc++ version (Ubuntu-specific versioned packages) + if [[ "$distro_id" == "ubuntu" ]]; then + packages=() + if _versionCompare $1 -ge 25.04; then + packages+=("libstdc++-15-dev") + elif _versionCompare $1 -ge 24.04; then + packages+=("libstdc++-14-dev") + elif _versionCompare $1 -ge 22.10; then + packages+=("libstdc++-12-dev") + fi + apt-get install -y --no-install-recommends ${packages[@]} fi - apt-get install -y --no-install-recommends ${packages[@]} # install KLayout - if [[ $1 == "rodete" ]]; then + # Debian/Kali and rodete use apt; Ubuntu >= 23.04 uses apt; + # older Ubuntu uses version-specific .deb downloads + if [[ $1 == "rodete" ]] || [[ "$distro_id" != "ubuntu" ]]; then apt-get -y install --no-install-recommends klayout python3-pandas elif _versionCompare "$1" -ge 23.04; then apt-get -y install --no-install-recommends klayout python3-pandas @@ -236,14 +244,20 @@ _installUbuntuPackages() { return 0 fi + # Determine Docker repo distro (Kali uses Debian repos) + local docker_distro="$distro_id" + if [[ "$distro_id" == "kali" ]]; then + docker_distro="debian" + fi + # Add Docker's official GPG key: install -m 0755 -d /etc/apt/keyrings - curl -fsSL https://download.docker.com/linux/ubuntu/gpg \ + curl -fsSL https://download.docker.com/linux/${docker_distro}/gpg \ -o /etc/apt/keyrings/docker.asc chmod a+r /etc/apt/keyrings/docker.asc # Add the repository to Apt sources: - echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ + echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/${docker_distro} \ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ tee /etc/apt/sources.list.d/docker.list > /dev/null @@ -258,64 +272,6 @@ _installUbuntuPackages() { fi } -_installDebianPackages() { - export DEBIAN_FRONTEND="noninteractive" - apt-get -y update - apt-get -y install --no-install-recommends \ - bison \ - curl \ - flex \ - help2man \ - libfl-dev \ - libfl2 \ - libgit2-dev \ - libgoogle-perftools-dev \ - libqt5multimediawidgets5 \ - libqt5opengl5 \ - libqt5svg5-dev \ - libqt5xmlpatterns5-dev \ - libz-dev \ - perl \ - python3-pip \ - python3-venv \ - qtmultimedia5-dev \ - qttools5-dev \ - ruby \ - ruby-dev \ - time \ - zlib1g \ - zlib1g-dev - - # Install KLayout from Debian repos - apt-get -y install --no-install-recommends klayout python3-pandas \ - || echo "WARNING: KLayout not available via apt. Please install manually." - - if command -v docker &> /dev/null; then - echo "Docker is already installed, skip docker reinstall." - return 0 - fi - - # Add Docker's official GPG key: - install -m 0755 -d /etc/apt/keyrings - curl -fsSL https://download.docker.com/linux/debian/gpg \ - -o /etc/apt/keyrings/docker.asc - chmod a+r /etc/apt/keyrings/docker.asc - - # Add the Debian Docker repository - echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \ - $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ - tee /etc/apt/sources.list.d/docker.list > /dev/null - - apt-get -y update - apt-get -y install --no-install-recommends \ - docker-ce \ - docker-ce-cli \ - containerd.io \ - docker-buildx-plugin \ - docker-compose-plugin \ - || echo "WARNING: Docker installation failed. You may need to install Docker manually." -} - _installDarwinPackages() { brew install libffi tcl-tk ruby brew install python libomp doxygen capnp tbb bison flex boost spdlog zlib @@ -551,7 +507,7 @@ case "${os}" in fi _installORDependencies if [[ "${option}" == "base" || "${option}" == "all" ]]; then - _installDebianPackages + _installUbuntuPackages "${version}" _installUbuntuCleanUp fi if [[ "${option}" == "common" || "${option}" == "all" ]]; then