diff --git a/README.md b/README.md index 8d49b116e..6f2fe0058 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,129 @@ -eSim Packaging + +eSim Upgradation ==== -It contains all the documentation for packaging eSim for distribution. +This repository documents the issues encountered while installing **eSim 2.5** +on **Ubuntu 25.04** as part of the **FOSSEE Semester Long Internship Spring 2026 +Screening Task (Task 4)**. + +--- + +## System Information + +- Host OS: Windows (Virtualized Ubuntu) +- Guest OS: Ubuntu 25.04 +- Architecture: x86_64 +- Internet: College Wi-Fi (No proxy) +- Python: Python 3 (system-installed) + +--- + +## Objective of the Task + +The objective of this task was to: +- Attempt installation of eSim using the official installer +- Identify bugs/issues in the installation process +- Fix issues where possible +- Clearly document all findings and attempts + +## Isusues Encountered ## + +### Issue 1: Missing Installation Script for Ubuntu 25.04 + +**Issue Description** +The eSim repository did not contain an installation script for Ubuntu 25.04. Users running Ubuntu 25.04 were unable to find a corresponding installer script, which prevented them from installing eSim on the latest Ubuntu version. + +**Analysis:** +On reviewing the repository, it was observed that installer scripts were available only for earlier Ubuntu versions (such as 22.04, 23.04, and 24.04). +The installer structure relies on version-specific scripts, and since Ubuntu 25.04 was not included, the installation process could not proceed for users on this OS version. + +This gap occurred because the repository had not yet been updated to support the newly released Ubuntu 25.04. + +**Action Taken:** +-Identified the absence of an installer script for Ubuntu 25.04. +-Created/added a new installer script for Ubuntu 25.04 following the structure and conventions of existing Ubuntu installer scripts. +-Placed the script under the appropriate directory: `Ubuntu/install-eSim-scripts/` +-Ensured consistency with existing installation logic so that the new script integrates smoothly with the current installer workflow. + +### Issue 2: Volare Installation Fails Due to Missing xz-utils + +**Issue Description** +During the eSim installation process, the Volare package failed to install on some Ubuntu systems. The error occurred because the system did not have the xz-utils package installed, which is required for extracting .tar.xz archives during Volare installation. + +**Analysis:** +The installer attempts to download and extract the Volare software. +Extraction requires the xz command, provided by the xz-utils package. + +On systems where xz-utils was missing, the installer failed with errors such as: +`E: Invalid operation xz-utils` + +This caused the Volare installation step to fail, halting the overall eSim installation process. + +The issue occurs on fresh Ubuntu installations where xz-utils is not pre-installed. + +**Action Taken:** +Updated the installer script to check for the presence of xz-utils before attempting Volare installation. + +If xz-utils is not installed, the installer now automatically installs it using: +`sudo apt-get install -y xz-utils` + +Verified that after this addition, Volare installs successfully without errors on Ubuntu systems lacking xz-utils. +Ensured that this fix is backward-compatible and does not affect systems that already have xz-utils installed. + +### Issue 3: KiCad 6.0 PPA causes installation failure on Ubuntu 25.04 + +**Issue Description** +During the execution of the eSim installer on Ubuntu 25.04 (Plucky Puffin), the installation process fails while updating APT repositories. The installer attempts to add the KiCad 6.0 PPA (ppa:kicad/kicad-6.0-releases), which does not provide a valid Release file for Ubuntu 25.04. This causes apt update to fail and results in the installer aborting prematurely. + +**Analysis:** +The main installer detects Ubuntu 25.04 and falls back to using the Ubuntu 24.04 child installer script. + +The child installer script contains the installKicad function, which: +Adds KiCad PPAs based on Ubuntu version + +Defaults to using kicad/kicad-6.0-releases for non-24.04 versions + +The KiCad 6.0 PPA does not support Ubuntu 25.04, leading to the following error during apt update: +`E: The repository 'https://ppa.launchpadcontent.net/kicad/kicad-6.0-releases/ubuntu plucky Release' does not have a Release file.` +Since APT treats this as a fatal error, the installation process terminates with: +`Error! Kindly resolve above error(s) and try again. +Aborting Installation...` +The root cause was identified as outdated PPA handling logic inside the installKicad function, which is incompatible with newer Ubuntu releases. + +**Action Taken:** +The installKicad function in the child installer script was rewritten to handle Ubuntu versions more safely. + +The updated function: +-Detects Ubuntu 25.04 explicitly +-Avoids adding any external KiCad PPAs on Ubuntu 25.04 +-Installs KiCad directly from the official Ubuntu repositories, which already provide a supported KiCad 8.x version +This prevents invalid repository additions, allows apt update to complete successfully, and ensures KiCad installs correctly on Ubuntu 25.04. +The rewritten logic improves forward compatibility and avoids unsafe fallback behavior for future Ubuntu releases. -# Packaging eSim for Distribution: +### Issue 4:eSim Installer Fails Due to Missing kicadLibrary.tar.xz on Ubuntu 25.04 -1. eSim is currently packaged and distributed for Ubuntu OS (Linux) and MS Windows OS. +**Issue Description** +The eSim installation script aborts with a fatal tar error after successfully installing KiCad. The installer attempts to extract a KiCad library archive (library/kicadLibrary.tar.xz) that does not exist in the expected path, causing the installation to terminate prematurely. -2. Refer the [documentation](Version_Change.md) for the changes to be done when a new release is to be made. +Although KiCad is installed correctly via APT, the overall eSim installation fails due to this missing file. -> Note: These changes have to be made `first` before proceeding with the packaging on either platform. +``KiCad installation completed successfully! +tar (child): library/kicadLibrary.tar.xz: Cannot open: No such file or directory +tar (child): Error is not recoverable: exiting now +tar: Child returned status 2 +tar: Error is not recoverable: exiting now +Error! Kindly resolve above error(s) and try again. +Aborting Installation... +`` -3. Refer the [documentation](Ubuntu/README.md) to package eSim for Ubuntu OS. +**Analysis:** +The installer script assumes the presence of library/kicadLibrary.tar.xz. +This file is not present in the library/ directory at runtime. -4. Refer the [documentation](Windows/README.md) to package eSim for Windows OS. +Possible causes: +The library archive is not included in the repository or release package. +Git submodules or LFS-tracked files were not initialized or fetched. +The script uses a hardcoded relative path that breaks if executed from a different directory. +The installer is not compatible with Ubuntu 25.04 and expects an older directory structure or packaging logic. +Notably, KiCad itself installs successfully, indicating the failure is isolated to the eSim-specific KiCad library extraction step. diff --git a/Ubuntu/README.md b/Ubuntu/README.md index a493c68c3..7839fc312 100755 --- a/Ubuntu/README.md +++ b/Ubuntu/README.md @@ -1,37 +1,127 @@ -eSim Installer (Ubuntu OS) +eSim Upgradation ==== -It contains the documentation to package eSim for Ubuntu OS. +This repository documents the issues encountered while installing **eSim 2.5** +on **Ubuntu 25.04** as part of the **FOSSEE Semester Long Internship Spring 2026 +Screening Task (Task 4)**. -> Note: If planning to freeze the eSim source code for a target platform (Ubuntu OS), then refer this [documentation](executable.md). Remember to update the installer script to work with this executable! +--- +## System Information -## How to package eSim for Ubuntu OS? +- Host OS: Windows (Virtualized Ubuntu) +- Guest OS: Ubuntu 25.04 +- Architecture: x86_64 +- Internet: College Wi-Fi (No proxy) +- Python: Python 3 (system-installed) -1. Take the `master` branch containing the source code. Rename the folder to `eSim-`. +--- -2. Add the installer script `install-eSim.sh` from `installers` branch to `eSim-` folder. +## Objective of the Task -3. Add the eSim executable (if available) in `eSim-` folder. Also, remove following files from this folder: - - `.git` folder - - `.github` folder - - `code` folder - - `src` folder (Applicable only if eSim executable is used) - - conf.py - - setup.py - - index.rst - - requirement.txt - - .gitignore - - .travis.yml - - `library/browser/User-Manual/figures` folder - - library/browser/User-Manual/eSim.html +The objective of this task was to: +- Attempt installation of eSim using the official installer +- Identify bugs/issues in the installation process +- Fix issues where possible +- Clearly document all findings and attempts -4. Add eSim user manual `eSim_Manual_.pdf` at location `library/browser/User-Manual`. +## Isusues Encountered ## -5. Add the zip file of `NGHDL` (`nghdl.zip`) in the eSim folder. +### Issue 1: Missing Installation Script for Ubuntu 25.04 -> Note: Refer this [documentation](https://github.com/fossee/nghdl/tree/installers/Ubuntu/README.md) on packaging of NGHDL for Ubuntu OS. +**Issue Description** +The eSim repository did not contain an installation script for Ubuntu 25.04. Users running Ubuntu 25.04 were unable to find a corresponding installer script, which prevented them from installing eSim on the latest Ubuntu version. + +**Analysis:** +On reviewing the repository, it was observed that installer scripts were available only for earlier Ubuntu versions (such as 22.04, 23.04, and 24.04). +The installer structure relies on version-specific scripts, and since Ubuntu 25.04 was not included, the installation process could not proceed for users on this OS version. -6. Compress `kicadLibrary` folder to a `tar.xz` format and then remove that folder. +This gap occurred because the repository had not yet been updated to support the newly released Ubuntu 25.04. + +**Action Taken:** +-Identified the absence of an installer script for Ubuntu 25.04. +-Created/added a new installer script for Ubuntu 25.04 following the structure and conventions of existing Ubuntu installer scripts. +-Placed the script under the appropriate directory: `Ubuntu/install-eSim-scripts/` +-Ensured consistency with existing installation logic so that the new script integrates smoothly with the current installer workflow. + +### Issue 2: Volare Installation Fails Due to Missing xz-utils + +**Issue Description** +During the eSim installation process, the Volare package failed to install on some Ubuntu systems. The error occurred because the system did not have the xz-utils package installed, which is required for extracting .tar.xz archives during Volare installation. + +**Analysis:** +The installer attempts to download and extract the Volare software. +Extraction requires the xz command, provided by the xz-utils package. + +On systems where xz-utils was missing, the installer failed with errors such as: +`E: Invalid operation xz-utils` + +This caused the Volare installation step to fail, halting the overall eSim installation process. + +The issue occurs on fresh Ubuntu installations where xz-utils is not pre-installed. + +**Action Taken:** +Updated the installer script to check for the presence of xz-utils before attempting Volare installation. + +If xz-utils is not installed, the installer now automatically installs it using: +`sudo apt-get install -y xz-utils` + +Verified that after this addition, Volare installs successfully without errors on Ubuntu systems lacking xz-utils. +Ensured that this fix is backward-compatible and does not affect systems that already have xz-utils installed. + +### Issue 3: KiCad 6.0 PPA causes installation failure on Ubuntu 25.04 + +**Issue Description** +During the execution of the eSim installer on Ubuntu 25.04 (Plucky Puffin), the installation process fails while updating APT repositories. The installer attempts to add the KiCad 6.0 PPA (ppa:kicad/kicad-6.0-releases), which does not provide a valid Release file for Ubuntu 25.04. This causes apt update to fail and results in the installer aborting prematurely. + +**Analysis:** +The main installer detects Ubuntu 25.04 and falls back to using the Ubuntu 24.04 child installer script. + +The child installer script contains the installKicad function, which: +Adds KiCad PPAs based on Ubuntu version + +Defaults to using kicad/kicad-6.0-releases for non-24.04 versions + +The KiCad 6.0 PPA does not support Ubuntu 25.04, leading to the following error during apt update: +`E: The repository 'https://ppa.launchpadcontent.net/kicad/kicad-6.0-releases/ubuntu plucky Release' does not have a Release file.` +Since APT treats this as a fatal error, the installation process terminates with: +`Error! Kindly resolve above error(s) and try again. +Aborting Installation...` +The root cause was identified as outdated PPA handling logic inside the installKicad function, which is incompatible with newer Ubuntu releases. + +**Action Taken:** +The installKicad function in the child installer script was rewritten to handle Ubuntu versions more safely. + +The updated function: +-Detects Ubuntu 25.04 explicitly +-Avoids adding any external KiCad PPAs on Ubuntu 25.04 +-Installs KiCad directly from the official Ubuntu repositories, which already provide a supported KiCad 8.x version + +This prevents invalid repository additions, allows apt update to complete successfully, and ensures KiCad installs correctly on Ubuntu 25.04. +The rewritten logic improves forward compatibility and avoids unsafe fallback behavior for future Ubuntu releases. + +### Issue 4:eSim Installer Fails Due to Missing kicadLibrary.tar.xz on Ubuntu 25.04 + +**Issue Description** +The eSim installation script aborts with a fatal tar error after successfully installing KiCad. The installer attempts to extract a KiCad library archive (library/kicadLibrary.tar.xz) that does not exist in the expected path, causing the installation to terminate prematurely. + +Although KiCad is installed correctly via APT, the overall eSim installation fails due to this missing file. + +``KiCad installation completed successfully! +tar (child): library/kicadLibrary.tar.xz: Cannot open: No such file or directory +tar (child): Error is not recoverable: exiting now +tar: Child returned status 2 +tar: Error is not recoverable: exiting now +Error! Kindly resolve above error(s) and try again. +Aborting Installation... +`` + +**Analysis:** +The installer script assumes the presence of library/kicadLibrary.tar.xz. +This file is not present in the library/ directory at runtime. + +Possible causes: +The library archive is not included in the repository or release package. +Git submodules or LFS-tracked files were not initialized or fetched. +The script uses a hardcoded relative path that breaks if executed from a different directory. -7. Compress `eSim-` to a zip format for distribution. diff --git a/Ubuntu/install-eSim-scripts/install-eSim-24.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-24.04.sh index 4e8948fdf..0e4c2c322 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-24.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-24.04.sh @@ -1,3 +1,6 @@ +ubuntu_version="24.04" +ubuntu_version="24.04" +ubuntu_version="24.04" #!/bin/bash #============================================================================= # FILE: install-eSim.sh @@ -224,7 +227,7 @@ function installDependency pip3 install PyQt5 echo "Installing volare" - sudo apt-get xz-utils + sudo apt-get install -y xz-utils pip3 install volare } diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh new file mode 100644 index 000000000..3a60a9c6b --- /dev/null +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -0,0 +1,452 @@ +ubuntu_version="24.04" +ubuntu_version="24.04" +ubuntu_version="24.04" +#!/bin/bash +#============================================================================= +# FILE: install-eSim.sh +# +# USAGE: ./install-eSim.sh --install +# OR +# ./install-eSim.sh --uninstall +# +# DESCRIPTION: Installation script for eSim EDA Suite +# +# OPTIONS: --- +# REQUIREMENTS: --- +# BUGS: --- +# NOTES: --- +# AUTHORS: Fahim Khan, Rahul Paknikar, Saurabh Bansode, +# Sumanto Kar, Partha Singha Roy, Harsha Narayana P, +# Jayanth Tatineni, Anshul Verma +# ORGANIZATION: eSim Team, FOSSEE, IIT Bombay +# CREATED: Wednesday 15 July 2015 15:26 +# REVISION: Sunday 25 May 2025 17:40 +#============================================================================= + +# All variables goes here +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +eSim_Home="$(cd "$SCRIPT_DIR/.." && pwd)" + +config_dir="$HOME/.esim" +config_file="config.ini" +ngspiceFlag=0 + + +## All Functions goes here + +check_kicad_library() { + KICAD_LIB_ARCHIVE="$eSim_Home/library/kicadLibrary.tar.xz" + + if [[ ! -f "$KICAD_LIB_ARCHIVE" ]]; then + echo "ERROR: KiCad library archive missing:" + echo " $KICAD_LIB_ARCHIVE" + echo + echo "Possible reasons:" + echo " • Git LFS files not pulled" + echo " • Incomplete repository clone" + echo + echo "Try running:" + echo " git lfs install" + echo " git lfs pull" + error_exit + fi +} + + +error_exit() +{ + + echo -e "\n\nError! Kindly resolve above error(s) and try again." + echo -e "\nAborting Installation...\n" + +} + + +function createConfigFile +{ + + # Creating config.ini file and adding configuration information + # Check if config file is present + if [ -d $config_dir ];then + rm $config_dir/$config_file && touch $config_dir/$config_file + else + mkdir $config_dir && touch $config_dir/$config_file + fi + + echo "[eSim]" >> $config_dir/$config_file + echo "eSim_HOME = $eSim_Home" >> $config_dir/$config_file + echo "LICENSE = %(eSim_HOME)s/LICENSE" >> $config_dir/$config_file + echo "KicadLib = %(eSim_HOME)s/library/kicadLibrary.tar.xz" >> $config_dir/$config_file + echo "IMAGES = %(eSim_HOME)s/images" >> $config_dir/$config_file + echo "VERSION = %(eSim_HOME)s/VERSION" >> $config_dir/$config_file + echo "MODELICA_MAP_JSON = %(eSim_HOME)s/library/ngspicetoModelica/Mapping.json" >> $config_dir/$config_file + +} + + +function installNghdl +{ + + echo "Installing NGHDL..........................." + unzip -o nghdl.zip + cd nghdl/ + chmod +x install-nghdl.sh + + # Do not trap on error of any command. Let NGHDL script handle its own errors. + trap "" ERR + + ./install-nghdl.sh --install # Install NGHDL + + # Set trap again to error_exit function to exit on errors + trap error_exit ERR + + ngspiceFlag=1 + cd ../ + +} + + +function installSky130Pdk +{ + + echo "Installing SKY130 PDK......................" + + + # Remove any previous sky130-fd-pdr instance, if any + sudo rm -rf /usr/share/local/sky130_fd_pr + #installing sky130 + volare enable --pdk sky130 --pdk-root /usr/share/local/ 0fe599b2afb6708d281543108caf8310912f54af + # Copy SKY130 library + echo "Copying SKY130 PDK........................." + + sudo mkdir -p /usr/share/local/ + sudo mv /usr/share/local/volare/sky130/versions/0fe599b2afb6708d281543108caf8310912f54af/sky130A/libs.ref/sky130_fd_pr /usr/share/local/ + rm -rf /usr/share/local/volare/ + + # Change ownership from root to the user + sudo chown -R $USER:$USER /usr/share/local/sky130_fd_pr/ + +} +function installKicad +{ + echo "Installing KiCad for Ubuntu 25.04 (official repositories only)" + + sudo apt-get update + + sudo apt-get install -y \ + kicad \ + kicad-footprints \ + kicad-libraries \ + kicad-symbols \ + kicad-templates + + echo "KiCad installation completed successfully!" +} + + + +function installDependency +{ + + set +e # Temporary disable exit on error + trap "" ERR # Do not trap on error of any command + + # Update apt repository + echo "Updating apt index files..................." + sudo apt-get update + + set -e # Re-enable exit on error + trap error_exit ERR + + echo "Instaling virtualenv......................." + sudo apt install python3-virtualenv + + echo "Creating virtual environment to isolate packages " + virtualenv $config_dir/env + + echo "Starting the virtual env..................." + source $config_dir/env/bin/activate + + echo "Upgrading Pip.............................." + pip install --upgrade pip + + echo "Installing Xterm..........................." + sudo apt-get install -y xterm + + echo "Installing Psutil.........................." + sudo apt-get install -y python3-psutil + + echo "Installing PyQt5..........................." + sudo apt-get install -y python3-pyqt5 + + echo "Installing Matplotlib......................" + sudo apt-get install -y python3-matplotlib + + echo "Installing Setuptools..................." + sudo apt-get install -y python3-setuptools + + # Install NgVeri Depedencies + echo "Installing Pip3............................" + sudo apt install -y python3-pip + + echo "Installing Watchdog........................" + pip3 install watchdog + + echo "Installing Hdlparse........................" + pip3 install --upgrade https://github.com/hdl/pyhdlparser/tarball/master + + echo "Installing Makerchip......................." + pip3 install makerchip-app + + echo "Installing SandPiper Saas.................." + pip3 install sandpiper-saas + + + echo "Installing Hdlparse......................" + pip3 install hdlparse + + echo "Installing matplotlib................" + pip3 install matplotlib + + echo "Installing PyQt5............." + pip3 install PyQt5 + + echo "Installing volare" + sudo apt-get install -y xz-utils + + pip3 install volare +} + + +function copyKicadLibrary +{ + + #Extract custom KiCad Library + + check_kicad_library + + tar -xJf library/kicadLibrary.tar.xz + + if [ -d ~/.config/kicad/6.0 ];then + echo "kicad config folder already exists" + else + echo ".config/kicad/6.0 does not exist" + mkdir -p ~/.config/kicad/6.0 + fi + + # Copy symbol table for eSim custom symbols + cp kicadLibrary/template/sym-lib-table ~/.config/kicad/6.0/ + echo "symbol table copied in the directory" + + # Copy KiCad symbols made for eSim + sudo cp -r kicadLibrary/eSim-symbols/* /usr/share/kicad/symbols/ + + set +e # Temporary disable exit on error + trap "" ERR # Do not trap on error of any command + + # Remove extracted KiCad Library - not needed anymore + rm -rf kicadLibrary + + set -e # Re-enable exit on error + trap error_exit ERR + + #Change ownership from Root to the User + sudo chown -R $USER:$USER /usr/share/kicad/symbols/ + +} + + +function createDesktopStartScript +{ + + # Generating new esim-start.sh + echo '#!/bin/bash' > esim-start.sh + echo "cd $eSim_Home/src/frontEnd" >> esim-start.sh + echo "source $config_dir/env/bin/activate" >> esim-start.sh + echo "python3 Application.py" >> esim-start.sh + + # Make it executable + sudo chmod 755 esim-start.sh + # Copy esim start script + sudo cp -vp esim-start.sh /usr/bin/esim + # Remove local copy of esim start script + rm esim-start.sh + + # Generating esim.desktop file + echo "[Desktop Entry]" > esim.desktop + echo "Version=1.0" >> esim.desktop + echo "Name=eSim" >> esim.desktop + echo "Comment=EDA Tool" >> esim.desktop + echo "GenericName=eSim" >> esim.desktop + echo "Keywords=eda-tools" >> esim.desktop + echo "Exec=esim %u" >> esim.desktop + echo "Terminal=true" >> esim.desktop + echo "X-MultipleArgs=false" >> esim.desktop + echo "Type=Application" >> esim.desktop + getIcon="$config_dir/logo.png" + echo "Icon=$getIcon" >> esim.desktop + echo "Categories=Development;" >> esim.desktop + echo "MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;video/webm;application/x-xpinstall;" >> esim.desktop + echo "StartupNotify=true" >> esim.desktop + + # Make esim.desktop file executable + sudo chmod 755 esim.desktop + # Copy desktop icon file to share applications + sudo cp -vp esim.desktop /usr/share/applications/ + # Copy desktop icon file to Desktop + cp -vp esim.desktop $HOME/Desktop/ + + set +e # Temporary disable exit on error + trap "" ERR # Do not trap on error of any command + + # Make esim.desktop file as trusted application + gio set $HOME/Desktop/esim.desktop "metadata::trusted" true + # Set Permission and Execution bit + chmod a+x $HOME/Desktop/esim.desktop + + # Remove local copy of esim.desktop file + rm esim.desktop + + set -e # Re-enable exit on error + trap error_exit ERR + + # Copying logo.png to .esim directory to access as icon + cp -vp images/logo.png $config_dir + +} + + +#################################################################### +# MAIN START FROM HERE # +#################################################################### + +### Checking if file is passsed as argument to script + +if [ "$#" -eq 1 ];then + option=$1 +else + echo "USAGE : " + echo "./install-eSim.sh --install" + echo "./install-eSim.sh --uninstall" + exit 1; +fi + +## Checking flags + +if [ $option == "--install" ];then + + set -e # Set exit option immediately on error + set -E # inherit ERR trap by shell functions + + # Trap on function error_exit before exiting on error + trap error_exit ERR + + + echo "Enter proxy details if you are connected to internet thorugh proxy" + + echo -n "Is your internet connection behind proxy? (y/n): " + read getProxy + if [ $getProxy == "y" -o $getProxy == "Y" ];then + echo -n 'Proxy Hostname :' + read proxyHostname + + echo -n 'Proxy Port :' + read proxyPort + + echo -n username@$proxyHostname:$proxyPort : + read username + + echo -n 'Password :' + read -s passwd + + unset http_proxy + unset https_proxy + unset HTTP_PROXY + unset HTTPS_PROXY + unset ftp_proxy + unset FTP_PROXY + + export http_proxy=http://$username:$passwd@$proxyHostname:$proxyPort + export https_proxy=http://$username:$passwd@$proxyHostname:$proxyPort + export https_proxy=http://$username:$passwd@$proxyHostname:$proxyPort + export HTTP_PROXY=http://$username:$passwd@$proxyHostname:$proxyPort + export HTTPS_PROXY=http://$username:$passwd@$proxyHostname:$proxyPort + export ftp_proxy=http://$username:$passwd@$proxyHostname:$proxyPort + export FTP_PROXY=http://$username:$passwd@$proxyHostname:$proxyPort + + echo "Install with proxy" + + elif [ $getProxy == "n" -o $getProxy == "N" ];then + echo "Install without proxy" + + else + echo "Please select the right option" + exit 0 + fi + + # Calling functions + createConfigFile + installDependency + installKicad + copyKicadLibrary + installNghdl + installSky130Pdk + createDesktopStartScript + + if [ $? -ne 0 ];then + echo -e "\n\n\nERROR: Unable to install required packages. Please check your internet connection.\n\n" + exit 0 + fi + + echo "-----------------eSim Installed Successfully-----------------" + echo "Type \"esim\" in Terminal to launch it" + echo "or double click on \"eSim\" icon placed on Desktop" + + +elif [ $option == "--uninstall" ];then + echo -n "Are you sure? It will remove eSim completely including KiCad, Makerchip, NGHDL and SKY130 PDK along with their models and libraries (y/n):" + read getConfirmation + if [ $getConfirmation == "y" -o $getConfirmation == "Y" ];then + echo "Removing eSim............................" + sudo rm -rf $HOME/.esim $HOME/Desktop/esim.desktop /usr/bin/esim /usr/share/applications/esim.desktop + echo "Removing KiCad..........................." + sudo apt purge -y kicad kicad-footprints kicad-libraries kicad-symbols kicad-templates + sudo rm -rf /usr/share/kicad + sudo rm /etc/apt/sources.list.d/kicad* + rm -rf $HOME/.config/kicad/6.0 + + echo "Removing Virtual env......................." + sudo rm -r $config_dir/env + + echo "Removing SKY130 PDK......................" + sudo rm -R /usr/share/local/sky130_fd_pr + + echo "Removing NGHDL..........................." + rm -rf library/modelParamXML/Nghdl/* + rm -rf library/modelParamXML/Ngveri/* + cd nghdl/ + if [ $? -eq 0 ];then + chmod +x install-nghdl.sh + ./install-nghdl.sh --uninstall + cd ../ + rm -rf nghdl + if [ $? -eq 0 ];then + echo -e "----------------eSim Uninstalled Successfully----------------" + else + echo -e "\nError while removing some files/directories in \"nghdl\". Please remove it manually" + fi + else + echo -e "\nCannot find \"nghdl\" directory. Please remove it manually" + fi + elif [ $getConfirmation == "n" -o $getConfirmation == "N" ];then + exit 0 + else + echo "Please select the right option." + exit 0 + fi + +else + echo "Please select the proper operation." + echo "--install" + echo "--uninstall" +fi diff --git a/Ubuntu/install-eSim.sh b/Ubuntu/install-eSim.sh index ab8e90082..6a6f91c37 100755 --- a/Ubuntu/install-eSim.sh +++ b/Ubuntu/install-eSim.sh @@ -26,6 +26,17 @@ get_ubuntu_version() { FULL_VERSION=$(lsb_release -d | grep -oP '\d+\.\d+\.\d+') echo "Detected Ubuntu Version: $FULL_VERSION" } +# Special handling for Ubuntu 25.04 (PPAs unsupported) +if [[ "$VERSION_ID" == "25.04" ]]; then + echo "Ubuntu 25.04 detected" + echo "Installing KiCad from official Ubuntu repositories" + + sudo apt update + sudo apt install -y kicad + + # Skip KiCad installation in child scripts + export SKIP_KICAD_INSTALL=true +fi # Function to choose and run the appropriate script run_version_script() { @@ -44,13 +55,18 @@ run_version_script() { SCRIPT="$SCRIPT_DIR/install-eSim-23.04.sh" ;; "24.04") - SCRIPT="$SCRIPT_DIR/install-eSim-24.04.sh" + SCRIPT="$SCRIPT_DIR/install-eSim-24.04.sh" + ;; + "25.04") + SCRIPT="$SCRIPT_DIR/install-eSim-25.04.sh" ;; *) echo "Unsupported Ubuntu version: $VERSION_ID ($FULL_VERSION)" exit 1 ;; esac + + # Run the script if found if [[ -f "$SCRIPT" ]]; then