diff --git a/Ubuntu/INSTALL_ISSUS_UBUNTU_25.md b/Ubuntu/INSTALL_ISSUS_UBUNTU_25.md new file mode 100644 index 000000000..2aab28ba5 --- /dev/null +++ b/Ubuntu/INSTALL_ISSUS_UBUNTU_25.md @@ -0,0 +1,130 @@ +# eSim 2.5 Installation on Ubuntu 25.04 + +## Issue 1: Ubuntu 25.04 Not Supported by Installer + +### Description +The eSim installer script does not recognize Ubuntu 25.04 and exits or installs incorrect dependencies. + +### Error Observed +Installer checks OS version and fails due to unsupported Ubuntu release. + +### Root Cause +eSim 2.5 officially supports Ubuntu 24.04 and earlier. Ubuntu 25.04 is not yet handled in the installer logic. + +### Fix Applied +Mapped Ubuntu 25.04 to Ubuntu 24.04 in `install-eSim.sh` so that supported dependency logic could be reused. + +### Result +Installer proceeds beyond OS detection stage successfully. + +### Status +Fixed + +## Issue 2: Invalid apt operations for xz-utils + +### Description +After fixing the Ubuntu 25.04 OS version mapping, the installer failed during dependency installation with the following error: Invalid operation xz-utils +This caused the installation process to abort even though `xz-utils` is a valid and required package. + +### Error Observed +Installer invoked `apt` incorrectly and got xz-utils error. + +### Root Cause +Invalid operation `xz-utils` + +### Incorrect Command +```bash +sudo apt xz-utils + +###Corrected commands +sudo apt install -y xz-utils + +### Result +Installation proceeds successfully after correcting the xz-utils installation command. + +### Status +Fixed + + +##Issue 3: Kicad ppa not available on ubuntu 25.04 + +##Description + +apt update failed with: + +The repository 'ppa:kicad/kicad-6.0-releases' does not have a Release file + +###Root Cause + +KiCad PPAs are not published for Ubuntu 25.04. Ubuntu 25.04 already provides KiCad 8 via official repositories. + +###Fix Applied + +For Ubuntu 25.04: + +All KiCad PPAs are skipped + +KiCad is installed directly from Ubuntu’s official repositories: + +###Result + +No repository or dependency errors occur during KiCad installation. + +###Status + +Fixed + +##Issue 4:KiCad library extraction path failure + +###Description + +Installation failed with: +tar: library/kicadLibrary.tar.xz: No such file or directory + +###Root Cause + +The installer used relative paths that were invalid depending on the working directory. + +###Fix Applied + +The extraction logic was updated to use paths based on eSim_HOME, ensuring the archive is always found correctly. + +###Result + +The KiCad library archive is extracted reliably. + +###Status + +Fixed + +##Issue 6: Incorrect KiCad library path in configuration + +###Description + +KiCad symbols were not detected even after successful extraction. + +###Root Cause + +The configuration file pointed to: + +kicadLibrary.tar.xz instead of the extracted directory. + +###Fix Applied + +The configuration entry was updated to reference the extracted directory: + +KicadLib = %(eSim_HOME)s/library/kicadLibrary + +###Result + +KiCad correctly loads eSim custom symbols. + +###Status + +Fixed + +###Final working state +esim runs on ubuntu 25.04 (Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-10 14-26-05.png) + + +eSim runs on the version Ubuntu 25.04. diff --git a/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-09 13-46-14.png b/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-09 13-46-14.png new file mode 100644 index 000000000..f2f7faeee Binary files /dev/null and b/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-09 13-46-14.png differ diff --git a/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-09 14-33-57.png b/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-09 14-33-57.png new file mode 100644 index 000000000..09ea37ad9 Binary files /dev/null and b/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-09 14-33-57.png differ diff --git a/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-09 14-40-13.png b/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-09 14-40-13.png new file mode 100644 index 000000000..f3daa0f43 Binary files /dev/null and b/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-09 14-40-13.png differ diff --git a/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-10 05-45-26.png b/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-10 05-45-26.png new file mode 100644 index 000000000..86339431f Binary files /dev/null and b/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-10 05-45-26.png differ diff --git a/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-10 05-53-54.png b/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-10 05-53-54.png new file mode 100644 index 000000000..f14fa9565 Binary files /dev/null and b/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-10 05-53-54.png differ diff --git a/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-10 06-22-32.png b/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-10 06-22-32.png new file mode 100644 index 000000000..4d05f590a Binary files /dev/null and b/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-10 06-22-32.png differ diff --git a/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-10 08-42-04.png b/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-10 08-42-04.png new file mode 100644 index 000000000..241b45d77 Binary files /dev/null and b/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-10 08-42-04.png differ diff --git a/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-10 11-44-39.png b/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-10 11-44-39.png new file mode 100644 index 000000000..cd9eb5300 Binary files /dev/null and b/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-10 11-44-39.png differ diff --git a/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-10 14-19-53.png b/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-10 14-19-53.png new file mode 100644 index 000000000..29aa24d38 Binary files /dev/null and b/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-10 14-19-53.png differ diff --git a/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-10 14-25-12.png b/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-10 14-25-12.png new file mode 100644 index 000000000..f26d6a0ef Binary files /dev/null and b/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-10 14-25-12.png differ diff --git a/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-10 14-25-38.png b/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-10 14-25-38.png new file mode 100644 index 000000000..72c09aa8f Binary files /dev/null and b/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-10 14-25-38.png differ diff --git a/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-10 14-26-05.png b/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-10 14-26-05.png new file mode 100644 index 000000000..25ed2263a Binary files /dev/null and b/Ubuntu/docs/ubuntu-25.04-bugs/Screenshot From 2026-02-10 14-26-05.png differ diff --git a/Ubuntu/install-eSim-scripts/install-eSim-22.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-22.04.sh index c996ed22e..3bb8bab6b 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-22.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-22.04.sh @@ -107,24 +107,34 @@ function installSky130Pdk function installKicad { echo "Installing KiCad..." + ubuntu_version=$(lsb_release -rs) + + #For ubuntu 25.04 use official repo ONLY (no PPAs exist) + if [[ "$ubuntu_version" == "25.04" ]]; then + echo "Ubuntu 25.04 detected — using official repositories" + sudo apt update + sudo apt install -y kicad + echo "KiCad installed successfully on Ubuntu 25.04" + return + fi + + # Ubuntu <= 24.04: use KiCad PPA kicadppa="kicad/kicad-8.0-releases" - findppa=$(grep -h -r "^deb.$kicadppa" /etc/apt/sources.list* > /dev/null 2>&1 || test $? = 1) - - if [ -z "$findppa" ]; then + + if ! grep -qr "$kicadppa" /etc/apt/sources.list /etc/apt/sources.list.d; then echo "Adding KiCad-8 PPA to local apt repository..." - sudo add-apt-repository -y ppa:kicad/kicad-8.0-releases + sudo add-apt-repository -y "ppa:$kicadppa" sudo apt update else echo "KiCad-8 PPA is already added." fi - echo "Installing KiCad and necessary libraries..." + echo "Installing KiCad..." sudo apt install -y --no-install-recommends kicad echo "KiCad installation completed successfully!" } - function installDependency { set +e # Temporary disable exit on error trap "" ERR # Do not trap on error of any command @@ -191,7 +201,7 @@ function installDependency { pip3 install PyQt5 echo "Installing volare" - sudo apt-get xz-utils + sudo apt-get install -y xz-utils pip3 install volare } @@ -204,7 +214,7 @@ function copyKicadLibrary { trap 'echo "An error occurred! Exiting..."; exit 1' ERR echo "Extracting custom KiCad Library..." - tar -xJf library/kicadLibrary.tar.xz -C library || { echo "Extraction failed!"; exit 1; } + tar -xJf ../library/kicadLibrary.tar.xz -C ../library || { echo "Extraction failed!"; exit 1; } # Detect the latest installed KiCad version kicad_config_dir="$HOME/.config/kicad" diff --git a/Ubuntu/install-eSim-scripts/install-eSim-23.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-23.04.sh index a4dfb28d5..081a1997e 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-23.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-23.04.sh @@ -182,26 +182,37 @@ function installSky130Pdk } -function installKicad -{ +function installKicad { + echo "Installing KiCad..." + + ubuntu_version=$(lsb_release -rs) - echo "Installing KiCad..........................." + # Ubuntu 25.04: use official repo ONLY (no PPAs exist) + if [[ "$ubuntu_version" == "25.04" ]]; then + echo "Ubuntu 25.04 detected — using official repositories" + sudo apt update + sudo apt install -y kicad + echo "KiCad installed successfully on Ubuntu 25.04" + return + fi - kicadppa="kicad/kicad-6.0-releases" - findppa=$(grep -h -r "^deb.*$kicadppa*" /etc/apt/sources.list* > /dev/null 2>&1 || test $? = 1) - if [ -z "$findppa" ]; then - echo "Adding KiCad-6 ppa to local apt-repository" - sudo add-apt-repository -y ppa:kicad/kicad-6.0-releases - sudo apt-get update + # Ubuntu <= 24.04: use KiCad PPA + kicadppa="kicad/kicad-8.0-releases" + + if ! grep -qr "$kicadppa" /etc/apt/sources.list /etc/apt/sources.list.d; then + echo "Adding KiCad-8 PPA to local apt repository..." + # sudo add-apt-repository -y "ppa:$kicadppa" + sudo apt update else - echo "KiCad-6 is available in synaptic" + echo "KiCad-8 PPA is already added." fi - sudo apt-get install -y --no-install-recommends kicad kicad-footprints kicad-libraries kicad-symbols kicad-templates + echo "Installing KiCad..." + sudo apt install -y --no-install-recommends kicad + echo "KiCad installation completed successfully!" } - function installDependency { @@ -251,7 +262,7 @@ function installDependency pip3 install sandpiper-saas 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-24.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-24.04.sh index 4e8948fdf..e6ee8edaa 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-24.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-24.04.sh @@ -63,15 +63,33 @@ function installNghdl { echo "Installing NGHDL..........................." + + # HARD EXIT: NGHDL is not supported on Ubuntu 25.04 (LLVM 20 incompatibility) + if [[ "$VERSION_ID" == "25.04" ]]; then + echo "Skipping NGHDL installation on Ubuntu 25.04 (LLVM 20 unsupported)" + return 0 + fi unzip -o nghdl.zip + + # --- Fix NGHDL installer for Ubuntu 25.04 --- + # 1. Fix broken FULL_VERSION assignment if present + sed -i 's/FULL_VERSION=.*/FULL_VERSION="$VERSION_ID"/' nghdl/install-nghdl.sh + + # 2. Allow Ubuntu 25.04 to reuse 24.04 installer + sed -i 's/"24.04")/"24.04" | "25.04")/' nghdl/install-nghdl.sh + + # Skip obsolete libcanberra-gtk-module on Ubuntu 25.04+ + sed -i 's/libcanberra-gtk-module/ /g' nghdl/install-nghdl-scripts/install-nghdl-24.04.sh + + # Prevent tar utime failures on restricted filesystems + sed -i 's/tar -x/tar --touch --no-same-owner --no-same-permissions -x/' nghdl/install-nghdl-scripts/install-nghdl-24.04.sh + 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 @@ -106,56 +124,34 @@ function installSky130Pdk function installKicad { - echo "Installing KiCad..........................." - # Detect Ubuntu version - ubuntu_version=$(lsb_release -rs) - - # Define KiCad PPAs based on Ubuntu version - if [[ "$ubuntu_version" == "24.04" ]]; then - echo "Ubuntu 24.04 detected." - kicadppa="kicad/kicad-8.0-releases" - - # Check if KiCad is installed using dpkg-query for the main package - if dpkg -s kicad &>/dev/null; then - installed_version=$(dpkg-query -W -f='${Version}' kicad | cut -d'.' -f1) - if [[ "$installed_version" != "8" ]]; then - echo "A different version of KiCad ($installed_version) is installed." - read -p "Do you want to remove it and install KiCad 8.0? (yes/no): " response - - if [[ "$response" =~ ^([Yy][Ee][Ss]|[Yy])$ ]]; then - echo "Removing KiCad $installed_version..." - sudo apt-get remove --purge -y kicad kicad-footprints kicad-libraries kicad-symbols kicad-templates - sudo apt-get autoremove -y - else - echo "Exiting installation. KiCad $installed_version remains installed." - exit 1 - fi - else - echo "KiCad 8.0 is already installed." - exit 0 - fi - fi +ubuntu_version=$(lsb_release -rs) - else - kicadppa="kicad/kicad-6.0-releases" - fi +echo "Detected Ubuntu version: $ubuntu_version" + +# Ubuntu 24.04+ (including 25.04) +if [[ "$ubuntu_version" == "24.04" || "$ubuntu_version" == "25.04" ]]; then + echo "Using system KiCad from Ubuntu repositories (no PPA)." + + # Ensure apt is updated + sudo apt-get update - # Check if the PPA is already added - if ! grep -q "^deb .*${kicadppa}" /etc/apt/sources.list /etc/apt/sources.list.d/* 2>/dev/null; then - echo "Adding KiCad PPA to local apt repository: $kicadppa" - sudo add-apt-repository -y "ppa:$kicadppa" - sudo apt-get update + # Install KiCad if not already installed + if ! dpkg -s kicad &>/dev/null; then + echo "Installing KiCad from Ubuntu repository..." + sudo apt-get install -y kicad kicad-footprints kicad-symbols else - echo "KiCad PPA is already present in sources." + echo "KiCad already installed. Skipping." fi - # Install KiCad packages - sudo apt-get install -y --no-install-recommends kicad kicad-footprints kicad-libraries kicad-symbols kicad-templates +else + echo "Unsupported Ubuntu version for this installer." + exit 1 +fi - echo "KiCad installation completed successfully!" -} +echo "KiCad installation completed successfully!" +} function installDependency { @@ -224,7 +220,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..d1a3d3510 --- /dev/null +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -0,0 +1,453 @@ +#!/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 +config_dir="$HOME/.esim" +config_file="config.ini" +eSim_Home=`pwd` +ngspiceFlag=0 + +## All Functions goes here + +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 + + # --- Fix NGHDL installer for Ubuntu 25.04 --- + # 1. Fix broken FULL_VERSION assignment if present + sed -i 's/FULL_VERSION=.*/FULL_VERSION="$VERSION_ID"/' nghdl/install-nghdl.sh + + # 2. Allow Ubuntu 25.04 to reuse 24.04 installer + sed -i 's/"24.04")/"24.04" | "25.04")/' nghdl/install-nghdl.sh + + # Skip obsolete libcanberra-gtk-module on Ubuntu 25.04+ + sed -i 's/libcanberra-gtk-module/ /g' nghdl/install-nghdl-scripts/install-nghdl-24.04.sh + + # Prevent tar utime failures on restricted filesystems + sed -i 's/tar -x/tar --touch --no-same-owner --no-same-permissions -x/' nghdl/install-nghdl-scripts/install-nghdl-24.04.sh + + + 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 +{ + # Detect Ubuntu version +ubuntu_version=$(lsb_release -rs) + +echo "Detected Ubuntu version: $ubuntu_version" + +# Ubuntu 24.04+ (including 25.04) +if [[ "$ubuntu_version" == "24.04" || "$ubuntu_version" == "25.04" ]]; then + echo "Using system KiCad from Ubuntu repositories (no PPA)." + + # Ensure apt is updated + sudo apt-get update + + # Install KiCad if not already installed + if ! dpkg -s kicad &>/dev/null; then + echo "Installing KiCad from Ubuntu repository..." + sudo apt-get install -y kicad kicad-footprints kicad-symbols + else + echo "KiCad already installed. Skipping." + fi + +else + echo "Unsupported Ubuntu version for this installer." + exit 1 +fi + +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 + 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..9355610aa 100755 --- a/Ubuntu/install-eSim.sh +++ b/Ubuntu/install-eSim.sh @@ -43,7 +43,7 @@ run_version_script() { "23.04") SCRIPT="$SCRIPT_DIR/install-eSim-23.04.sh" ;; - "24.04") + "24.04" | "25.04") SCRIPT="$SCRIPT_DIR/install-eSim-24.04.sh" ;; *)