From 6c023bce474449a5247918d7385c4ca5ec3822b2 Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Mon, 26 Jan 2026 12:26:13 +0000 Subject: [PATCH 01/41] updated regex format for version detection --- Ubuntu/install-eSim.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ubuntu/install-eSim.sh b/Ubuntu/install-eSim.sh index ab8e90082..a2c8865c9 100755 --- a/Ubuntu/install-eSim.sh +++ b/Ubuntu/install-eSim.sh @@ -23,7 +23,7 @@ # Function to detect Ubuntu version and full version string get_ubuntu_version() { VERSION_ID=$(grep "^VERSION_ID" /etc/os-release | cut -d '"' -f 2) - FULL_VERSION=$(lsb_release -d | grep -oP '\d+\.\d+\.\d+') + FULL_VERSION=$(lsb_release -d | grep -oP '\d+\.\d+(\.\d+)?') echo "Detected Ubuntu Version: $FULL_VERSION" } From 297f89f9e29d18b69b20276dcac5cc7baaac16f0 Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Mon, 26 Jan 2026 14:31:15 +0000 Subject: [PATCH 02/41] Added support for Ubuntu 25.04 --- Ubuntu/install-eSim.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Ubuntu/install-eSim.sh b/Ubuntu/install-eSim.sh index a2c8865c9..73cb3470d 100755 --- a/Ubuntu/install-eSim.sh +++ b/Ubuntu/install-eSim.sh @@ -46,6 +46,9 @@ run_version_script() { "24.04") 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 From c68082b841cfdce940b6a3254b3f3fa45d9ec9b7 Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Mon, 26 Jan 2026 14:32:41 +0000 Subject: [PATCH 03/41] Created script for Ubuntu 25.04 and by duplicating 24.04 script --- .../install-eSim-25.04.sh | 460 ++++++++++++++++++ 1 file changed, 460 insertions(+) create mode 100644 Ubuntu/install-eSim-scripts/install-eSim-25.04.sh 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..451a7e172 --- /dev/null +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -0,0 +1,460 @@ +#!/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 + 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..........................." + + # Detect Ubuntu version + ubuntu_version=$(lsb_release -rs) + + # Define KiCad PPAs based on Ubuntu version + if [[ "$ubuntu_version" == "25.04" ]]; then + echo "Ubuntu 25.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 + + else + kicadppa="kicad/kicad-6.0-releases" + fi + + # 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 + else + echo "KiCad PPA is already present in sources." + fi + + # Install KiCad packages + sudo apt-get install -y --no-install-recommends 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 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 From ed1daffcf65cdab9474c7c1ee13028990b9f0e0e Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Mon, 26 Jan 2026 15:30:31 +0000 Subject: [PATCH 04/41] fix: corrected installation command for xz-utils --- Ubuntu/install-eSim-scripts/install-eSim-25.04.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index 451a7e172..d7caabee6 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -224,7 +224,7 @@ function installDependency pip3 install PyQt5 echo "Installing volare" - sudo apt-get xz-utils + sudo apt-get install xz-utils -y xz-utils pip3 install volare } From dbcb25b84a2c8e8b17b1fbbeb522888b9c78d9df Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Mon, 26 Jan 2026 19:42:57 +0000 Subject: [PATCH 05/41] fix: suppress apt error from invalid CD-ROM repo --- Ubuntu/install-eSim-scripts/install-eSim-25.04.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index d7caabee6..c7624fc62 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -145,7 +145,7 @@ function installKicad 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 + sudo apt-get update || true else echo "KiCad PPA is already present in sources." fi From 98da01451e28642c139ede308bbbb531c23d79a4 Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Sat, 31 Jan 2026 19:46:37 +0000 Subject: [PATCH 06/41] Fix KiCad dependency fallback --- .../install-eSim-25.04.sh | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index c7624fc62..79b1b28f8 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -115,6 +115,13 @@ function installKicad if [[ "$ubuntu_version" == "25.04" ]]; then echo "Ubuntu 25.04 detected." kicadppa="kicad/kicad-8.0-releases" + use_kicad_ppa=true + + # Ubuntu 25.04 does not provide libgit2-1.8; avoid PPA if missing. + if apt-cache policy libgit2-1.8 | grep -q "Candidate: (none)"; then + echo "libgit2-1.8 not available. Falling back to Ubuntu KiCad repo." + use_kicad_ppa=false + fi # Check if KiCad is installed using dpkg-query for the main package if dpkg -s kicad &>/dev/null; then @@ -142,12 +149,20 @@ function installKicad fi # 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 || true + if [[ "$use_kicad_ppa" == true ]]; then + 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 || true + else + echo "KiCad PPA is already present in sources." + fi else - echo "KiCad PPA is already present in sources." + if grep -q "^deb .*${kicadppa}" /etc/apt/sources.list /etc/apt/sources.list.d/* 2>/dev/null; then + echo "Removing KiCad PPA due to libgit2 dependency mismatch." + sudo add-apt-repository -r -y "ppa:$kicadppa" || true + sudo apt-get update || true + fi fi # Install KiCad packages From 53b7786eb54670181a665fae101653fb11b0130e Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Sat, 31 Jan 2026 19:49:28 +0000 Subject: [PATCH 07/41] Remove KiCad PPA on 25.04 --- Ubuntu/install-eSim-scripts/install-eSim-25.04.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index 79b1b28f8..c4d22b671 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -158,9 +158,11 @@ function installKicad echo "KiCad PPA is already present in sources." fi else - if grep -q "^deb .*${kicadppa}" /etc/apt/sources.list /etc/apt/sources.list.d/* 2>/dev/null; then + if grep -Rqs "kicad-8.0-releases" /etc/apt/sources.list /etc/apt/sources.list.d 2>/dev/null; then echo "Removing KiCad PPA due to libgit2 dependency mismatch." sudo add-apt-repository -r -y "ppa:$kicadppa" || true + sudo rm -f /etc/apt/sources.list.d/kicad-ubuntu-kicad-8_0-releases-*.sources \ + /etc/apt/sources.list.d/kicad-ubuntu-kicad-8_0-releases-*.list || true sudo apt-get update || true fi fi From 4f63070ca064b6ed648941b500ac0277d31b0e19 Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Sat, 31 Jan 2026 19:52:12 +0000 Subject: [PATCH 08/41] Handle missing KiCad library --- .../install-eSim-25.04.sh | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index c4d22b671..b46e7cfb1 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -249,8 +249,20 @@ function installDependency function copyKicadLibrary { - #Extract custom KiCad Library - tar -xJf library/kicadLibrary.tar.xz + local kicad_lib_dir="" + local cleanup_tmp=false + + # Extract or use existing KiCad Library + if [ -f library/kicadLibrary.tar.xz ]; then + tar -xJf library/kicadLibrary.tar.xz + kicad_lib_dir="kicadLibrary" + cleanup_tmp=true + elif [ -d library/kicadLibrary ]; then + kicad_lib_dir="library/kicadLibrary" + else + echo "Warning: KiCad library archive not found. Skipping custom symbols." + return 0 + fi if [ -d ~/.config/kicad/6.0 ];then echo "kicad config folder already exists" @@ -260,17 +272,19 @@ function copyKicadLibrary fi # Copy symbol table for eSim custom symbols - cp kicadLibrary/template/sym-lib-table ~/.config/kicad/6.0/ + cp "$kicad_lib_dir/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/ + sudo cp -r "$kicad_lib_dir/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 + if [ "$cleanup_tmp" = true ]; then + rm -rf kicadLibrary + fi set -e # Re-enable exit on error trap error_exit ERR From 5f519c111485cc733a04d3810db6fae14b3fd8ce Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Sat, 31 Jan 2026 19:53:01 +0000 Subject: [PATCH 09/41] Continue after existing KiCad --- Ubuntu/install-eSim-scripts/install-eSim-25.04.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index b46e7cfb1..d3496449d 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -140,7 +140,7 @@ function installKicad fi else echo "KiCad 8.0 is already installed." - exit 0 + return 0 fi fi From acc75d934387e2c0f375db28d06efb2b1a71f9a9 Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Sat, 31 Jan 2026 19:56:23 +0000 Subject: [PATCH 10/41] Skip missing NGHDL archive --- Ubuntu/install-eSim-scripts/install-eSim-25.04.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index d3496449d..47b568dfd 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -63,8 +63,19 @@ function installNghdl { echo "Installing NGHDL..........................." - unzip -o nghdl.zip - cd nghdl/ + local nghdl_dir="" + + if [ -f nghdl.zip ]; then + unzip -o nghdl.zip + nghdl_dir="nghdl" + elif [ -d nghdl ]; then + nghdl_dir="nghdl" + else + echo "Warning: nghdl.zip not found. Skipping NGHDL install." + return 0 + fi + + cd "$nghdl_dir" || return 1 chmod +x install-nghdl.sh # Do not trap on error of any command. Let NGHDL script handle its own errors. From dec37c0d5c649f3b3420ad462a9b488153879331 Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Sat, 31 Jan 2026 20:00:40 +0000 Subject: [PATCH 11/41] Use sudo user Desktop --- Ubuntu/install-eSim-scripts/install-eSim-25.04.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index 47b568dfd..2d3ca2c63 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -399,6 +399,11 @@ if [ $option == "--install" ];then if [ $getProxy == "y" -o $getProxy == "Y" ];then echo -n 'Proxy Hostname :' read proxyHostname + local user_home="$HOME" + if [ -n "$SUDO_USER" ] && [ -d "/home/$SUDO_USER" ]; then + user_home="/home/$SUDO_USER" + fi + echo -n 'Proxy Port :' read proxyPort @@ -433,16 +438,15 @@ if [ $option == "--install" ];then echo "Please select the right option" exit 0 fi - - # Calling functions + cp -vp esim.desktop "$user_home/Desktop/" createConfigFile installDependency installKicad copyKicadLibrary installNghdl - installSky130Pdk + gio set "$user_home/Desktop/esim.desktop" "metadata::trusted" true createDesktopStartScript - + chmod a+x "$user_home/Desktop/esim.desktop" if [ $? -ne 0 ];then echo -e "\n\n\nERROR: Unable to install required packages. Please check your internet connection.\n\n" exit 0 From 48ed0253c088980eb6c355906070ede56ad14a77 Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Sat, 31 Jan 2026 20:02:52 +0000 Subject: [PATCH 12/41] Fix desktop install flow --- .../install-eSim-25.04.sh | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index 2d3ca2c63..557535a07 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -309,6 +309,11 @@ function copyKicadLibrary function createDesktopStartScript { + local user_home="$HOME" + if [ -n "$SUDO_USER" ] && [ -d "/home/$SUDO_USER" ]; then + user_home="/home/$SUDO_USER" + fi + # Generating new esim-start.sh echo '#!/bin/bash' > esim-start.sh echo "cd $eSim_Home/src/frontEnd" >> esim-start.sh @@ -344,15 +349,15 @@ function createDesktopStartScript # 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/ + cp -vp esim.desktop "$user_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 + gio set "$user_home/Desktop/esim.desktop" "metadata::trusted" true # Set Permission and Execution bit - chmod a+x $HOME/Desktop/esim.desktop + chmod a+x "$user_home/Desktop/esim.desktop" # Remove local copy of esim.desktop file rm esim.desktop @@ -399,12 +404,6 @@ if [ $option == "--install" ];then if [ $getProxy == "y" -o $getProxy == "Y" ];then echo -n 'Proxy Hostname :' read proxyHostname - local user_home="$HOME" - if [ -n "$SUDO_USER" ] && [ -d "/home/$SUDO_USER" ]; then - user_home="/home/$SUDO_USER" - fi - - echo -n 'Proxy Port :' read proxyPort @@ -438,15 +437,12 @@ if [ $option == "--install" ];then echo "Please select the right option" exit 0 fi - cp -vp esim.desktop "$user_home/Desktop/" createConfigFile installDependency installKicad copyKicadLibrary installNghdl - gio set "$user_home/Desktop/esim.desktop" "metadata::trusted" true createDesktopStartScript - chmod a+x "$user_home/Desktop/esim.desktop" if [ $? -ne 0 ];then echo -e "\n\n\nERROR: Unable to install required packages. Please check your internet connection.\n\n" exit 0 From 79d044c49b5d9e813663b1409094b10026801040 Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Sat, 31 Jan 2026 20:03:42 +0000 Subject: [PATCH 13/41] Handle missing logo file --- Ubuntu/install-eSim-scripts/install-eSim-25.04.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index 557535a07..e5074fc38 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -349,6 +349,7 @@ function createDesktopStartScript # Copy desktop icon file to share applications sudo cp -vp esim.desktop /usr/share/applications/ # Copy desktop icon file to Desktop + mkdir -p "$user_home/Desktop" cp -vp esim.desktop "$user_home/Desktop/" set +e # Temporary disable exit on error @@ -366,7 +367,11 @@ function createDesktopStartScript trap error_exit ERR # Copying logo.png to .esim directory to access as icon - cp -vp images/logo.png $config_dir + if [ -f images/logo.png ]; then + cp -vp images/logo.png $config_dir + else + echo "Warning: images/logo.png not found. Skipping icon copy." + fi } From 39bcf8716c3280df962c711a2a3599d42594223d Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Sat, 31 Jan 2026 20:47:42 +0000 Subject: [PATCH 14/41] Harden libgit2 detection --- Ubuntu/install-eSim-scripts/install-eSim-25.04.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index e5074fc38..c1393a8be 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -129,7 +129,8 @@ function installKicad use_kicad_ppa=true # Ubuntu 25.04 does not provide libgit2-1.8; avoid PPA if missing. - if apt-cache policy libgit2-1.8 | grep -q "Candidate: (none)"; then + libgit2_policy=$(apt-cache policy libgit2-1.8 2>&1 || true) + if echo "$libgit2_policy" | grep -Eq "Candidate: \(none\)|Unable to locate package"; then echo "libgit2-1.8 not available. Falling back to Ubuntu KiCad repo." use_kicad_ppa=false fi From 5c7b88a196b717877990f2cd6a839d0da07b717a Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Sat, 31 Jan 2026 20:49:19 +0000 Subject: [PATCH 15/41] Disable cdrom apt source --- Ubuntu/install-eSim-scripts/install-eSim-25.04.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index c1393a8be..5f60d9223 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -194,6 +194,11 @@ function installDependency # Update apt repository echo "Updating apt index files..................." + if grep -Rqs "file:/cdrom" /etc/apt/sources.list /etc/apt/sources.list.d 2>/dev/null; then + sudo sed -i 's|^deb cdrom:|# deb cdrom:|g' /etc/apt/sources.list 2>/dev/null || true + sudo sed -i '/file:\/cdrom/ s/^/# /' /etc/apt/sources.list.d/*.sources 2>/dev/null || true + sudo rm -f /etc/apt/sources.list.d/*cdrom*.list /etc/apt/sources.list.d/*cdrom*.sources 2>/dev/null || true + fi sudo apt-get update set -e # Re-enable exit on error From 414cd489f4dc8443298440e2d4911f636000c123 Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Sat, 31 Jan 2026 20:50:37 +0000 Subject: [PATCH 16/41] Comment cdrom file source --- Ubuntu/install-eSim-scripts/install-eSim-25.04.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index 5f60d9223..095d088bc 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -194,8 +194,9 @@ function installDependency # Update apt repository echo "Updating apt index files..................." - if grep -Rqs "file:/cdrom" /etc/apt/sources.list /etc/apt/sources.list.d 2>/dev/null; then + if grep -Rqs "cdrom" /etc/apt/sources.list /etc/apt/sources.list.d 2>/dev/null; then sudo sed -i 's|^deb cdrom:|# deb cdrom:|g' /etc/apt/sources.list 2>/dev/null || true + sudo sed -i 's|^deb .*file:///cdrom|# &|g' /etc/apt/sources.list 2>/dev/null || true sudo sed -i '/file:\/cdrom/ s/^/# /' /etc/apt/sources.list.d/*.sources 2>/dev/null || true sudo rm -f /etc/apt/sources.list.d/*cdrom*.list /etc/apt/sources.list.d/*cdrom*.sources 2>/dev/null || true fi From 5fe47be2596bbf652ea54257d1d2e155ece626b1 Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Sat, 31 Jan 2026 20:52:03 +0000 Subject: [PATCH 17/41] Silence gio trusted warning --- Ubuntu/install-eSim-scripts/install-eSim-25.04.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index 095d088bc..a6419a438 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -362,8 +362,10 @@ function createDesktopStartScript 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 "$user_home/Desktop/esim.desktop" "metadata::trusted" true + # Make esim.desktop file as trusted application (best-effort) + if command -v gio >/dev/null 2>&1; then + gio set "$user_home/Desktop/esim.desktop" "metadata::trusted" true 2>/dev/null || true + fi # Set Permission and Execution bit chmod a+x "$user_home/Desktop/esim.desktop" From cbfa3b1f1bb7dead89e5a6adeedb75d20b8972cb Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Sat, 31 Jan 2026 20:54:07 +0000 Subject: [PATCH 18/41] Fix esim launcher paths --- Ubuntu/install-eSim-scripts/install-eSim-25.04.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index a6419a438..c331e6faf 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -21,9 +21,14 @@ #============================================================================= # All variables goes here -config_dir="$HOME/.esim" +script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +eSim_Home=$(cd "$script_dir/../.." && pwd) +user_home="$HOME" +if [ -n "$SUDO_USER" ] && [ -d "/home/$SUDO_USER" ]; then + user_home="/home/$SUDO_USER" +fi +config_dir="$user_home/.esim" config_file="config.ini" -eSim_Home=`pwd` ngspiceFlag=0 ## All Functions goes here @@ -210,6 +215,7 @@ function installDependency echo "Creating virtual environment to isolate packages " virtualenv $config_dir/env + sudo chown -R "$user_home":"$user_home" "$config_dir" echo "Starting the virtual env..................." source $config_dir/env/bin/activate From 22ad7548f4159fadfee0c17aa0f565f40059d449 Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Sat, 31 Jan 2026 20:54:43 +0000 Subject: [PATCH 19/41] Fix venv chown user --- Ubuntu/install-eSim-scripts/install-eSim-25.04.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index c331e6faf..f12d90f9f 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -23,8 +23,10 @@ # All variables goes here script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) eSim_Home=$(cd "$script_dir/../.." && pwd) +user_name="$USER" user_home="$HOME" if [ -n "$SUDO_USER" ] && [ -d "/home/$SUDO_USER" ]; then + user_name="$SUDO_USER" user_home="/home/$SUDO_USER" fi config_dir="$user_home/.esim" @@ -215,7 +217,7 @@ function installDependency echo "Creating virtual environment to isolate packages " virtualenv $config_dir/env - sudo chown -R "$user_home":"$user_home" "$config_dir" + sudo chown -R "$user_name":"$user_name" "$config_dir" echo "Starting the virtual env..................." source $config_dir/env/bin/activate From c66c70146a410705d47bb5213b2432fa2cd2169b Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Sat, 31 Jan 2026 20:56:25 +0000 Subject: [PATCH 20/41] Harden esim launcher --- .../install-eSim-25.04.sh | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index f12d90f9f..acf596937 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -330,10 +330,25 @@ function createDesktopStartScript fi # 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 + cat > esim-start.sh < Date: Mon, 2 Feb 2026 22:20:13 +0000 Subject: [PATCH 21/41] Fix virtualenv ownership issues --- Ubuntu/install-eSim-scripts/install-eSim-25.04.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index acf596937..379b18f6d 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -216,8 +216,13 @@ function installDependency sudo apt install python3-virtualenv echo "Creating virtual environment to isolate packages " - virtualenv $config_dir/env + sudo mkdir -p "$config_dir" sudo chown -R "$user_name":"$user_name" "$config_dir" + if [ -d "$config_dir/env" ]; then + echo "Existing virtual environment found. Recreating it to fix permissions." + sudo rm -rf "$config_dir/env" + fi + sudo -u "$user_name" virtualenv "$config_dir/env" echo "Starting the virtual env..................." source $config_dir/env/bin/activate From a618d69cf1751c359a37559ab955103a2b3f5ac7 Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Mon, 2 Feb 2026 22:28:40 +0000 Subject: [PATCH 22/41] Add 25.04 NGHDL fallback --- Ubuntu/install-eSim-scripts/install-eSim-25.04.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index 379b18f6d..3ea0f2895 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -88,7 +88,11 @@ function installNghdl # Do not trap on error of any command. Let NGHDL script handle its own errors. trap "" ERR - ./install-nghdl.sh --install # Install NGHDL + if [[ "$(lsb_release -rs)" == "25.04" ]] && [ -f "install-nghdl-scripts/install-nghdl-24.04.sh" ]; then + ./install-nghdl-scripts/install-nghdl-24.04.sh --install + else + ./install-nghdl.sh --install # Install NGHDL + fi # Set trap again to error_exit function to exit on errors trap error_exit ERR From 5757c5f2f7490fc6d39527878b3a2d74ae6f2eda Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Mon, 2 Feb 2026 22:34:28 +0000 Subject: [PATCH 23/41] Fix NGHDL version detect --- Ubuntu/install-eSim-scripts/install-eSim-25.04.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index 3ea0f2895..21b72ba51 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -88,7 +88,15 @@ function installNghdl # Do not trap on error of any command. Let NGHDL script handle its own errors. trap "" ERR - if [[ "$(lsb_release -rs)" == "25.04" ]] && [ -f "install-nghdl-scripts/install-nghdl-24.04.sh" ]; then + local ubuntu_version="" + if command -v lsb_release >/dev/null 2>&1; then + ubuntu_version=$(lsb_release -rs 2>/dev/null || true) + fi + if [ -z "$ubuntu_version" ] && [ -r /etc/os-release ]; then + ubuntu_version=$(. /etc/os-release; echo "${VERSION_ID:-}") + fi + + if [[ "$ubuntu_version" == "25.04" ]] && [ -f "install-nghdl-scripts/install-nghdl-24.04.sh" ]; then ./install-nghdl-scripts/install-nghdl-24.04.sh --install else ./install-nghdl.sh --install # Install NGHDL From 9fa5173ec5588c04fe15d34f56e21332652a01ae Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Mon, 2 Feb 2026 22:38:44 +0000 Subject: [PATCH 24/41] Fix NGHDL fallback perms --- Ubuntu/install-eSim-scripts/install-eSim-25.04.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index 21b72ba51..059705198 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -97,6 +97,7 @@ function installNghdl fi if [[ "$ubuntu_version" == "25.04" ]] && [ -f "install-nghdl-scripts/install-nghdl-24.04.sh" ]; then + chmod +x install-nghdl-scripts/install-nghdl-24.04.sh ./install-nghdl-scripts/install-nghdl-24.04.sh --install else ./install-nghdl.sh --install # Install NGHDL From 791346613b04b013160394f87cfc33c322309113 Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Mon, 2 Feb 2026 22:56:10 +0000 Subject: [PATCH 25/41] Handle missing canberra module --- Ubuntu/install-eSim-scripts/install-eSim-25.04.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index 059705198..ab6fd9a8b 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -242,6 +242,15 @@ function installDependency echo "Upgrading Pip.............................." pip install --upgrade pip + + echo "Installing Gtk Canberra modules..........................." + if apt-cache show libcanberra-gtk-module >/dev/null 2>&1; then + sudo apt-get install -y libcanberra-gtk-module + elif apt-cache show libcanberra-gtk3-module >/dev/null 2>&1; then + sudo apt-get install -y libcanberra-gtk3-module + else + echo "Warning: libcanberra-gtk-module not available. Skipping." + fi echo "Installing Xterm..........................." sudo apt-get install -y xterm From aadfd828a01a030763cdc9ee1ca5daa6a26a72d1 Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Mon, 2 Feb 2026 22:58:54 +0000 Subject: [PATCH 26/41] Fix canberra candidate check --- .../install-eSim-scripts/install-eSim-25.04.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index ab6fd9a8b..90b666b77 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -244,12 +244,22 @@ function installDependency pip install --upgrade pip echo "Installing Gtk Canberra modules..........................." - if apt-cache show libcanberra-gtk-module >/dev/null 2>&1; then + canberra_policy=$(apt-cache policy libcanberra-gtk-module 2>/dev/null || true) + if echo "$canberra_policy" | grep -q "Candidate: (none)"; then + canberra_policy="" + fi + if [ -n "$canberra_policy" ]; then sudo apt-get install -y libcanberra-gtk-module - elif apt-cache show libcanberra-gtk3-module >/dev/null 2>&1; then - sudo apt-get install -y libcanberra-gtk3-module else - echo "Warning: libcanberra-gtk-module not available. Skipping." + canberra3_policy=$(apt-cache policy libcanberra-gtk3-module 2>/dev/null || true) + if echo "$canberra3_policy" | grep -q "Candidate: (none)"; then + canberra3_policy="" + fi + if [ -n "$canberra3_policy" ]; then + sudo apt-get install -y libcanberra-gtk3-module + else + echo "Warning: libcanberra-gtk-module not available. Skipping." + fi fi echo "Installing Xterm..........................." From 7cc53b1a74d4086ecc3c7b70f41e8984a3d8fbd8 Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Mon, 2 Feb 2026 23:04:34 +0000 Subject: [PATCH 27/41] Patch NGHDL canberra dependency --- Ubuntu/install-eSim-scripts/install-eSim-25.04.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index 90b666b77..ff6c24ff6 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -96,6 +96,14 @@ function installNghdl ubuntu_version=$(. /etc/os-release; echo "${VERSION_ID:-}") fi + if [[ "$ubuntu_version" == "25.04" ]]; then + for nghdl_script in "install-nghdl.sh" "install-nghdl-scripts/install-nghdl-24.04.sh"; do + if [ -f "$nghdl_script" ] && grep -q "libcanberra-gtk-module" "$nghdl_script"; then + sed -i 's/libcanberra-gtk-module/libcanberra-gtk3-module/g' "$nghdl_script" + fi + done + fi + if [[ "$ubuntu_version" == "25.04" ]] && [ -f "install-nghdl-scripts/install-nghdl-24.04.sh" ]; then chmod +x install-nghdl-scripts/install-nghdl-24.04.sh ./install-nghdl-scripts/install-nghdl-24.04.sh --install From 43bfefa781a9d7e8230bc95bf8288470634669a2 Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Mon, 2 Feb 2026 23:11:58 +0000 Subject: [PATCH 28/41] Allow LLVM 20.1 --- Ubuntu/install-eSim-scripts/install-eSim-25.04.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index ff6c24ff6..1ca016d1b 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -102,6 +102,15 @@ function installNghdl sed -i 's/libcanberra-gtk-module/libcanberra-gtk3-module/g' "$nghdl_script" fi done + + llvm_version=$(llvm-config --version 2>/dev/null || true) + if [[ "$llvm_version" == 20.1.* ]]; then + for nghdl_script in "install-nghdl.sh" "install-nghdl-scripts/install-nghdl-24.04.sh"; do + if [ -f "$nghdl_script" ] && grep -q "20\.0" "$nghdl_script"; then + sed -i 's/20\.0/20.1/g' "$nghdl_script" + fi + done + fi fi if [[ "$ubuntu_version" == "25.04" ]] && [ -f "install-nghdl-scripts/install-nghdl-24.04.sh" ]; then From cf6246578b29f4cad4a3dfcff1ed8fcc4a2ef9cd Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Mon, 2 Feb 2026 23:16:18 +0000 Subject: [PATCH 29/41] Shim llvm-config version --- Ubuntu/install-eSim-scripts/install-eSim-25.04.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index 1ca016d1b..921639f81 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -110,6 +110,16 @@ function installNghdl sed -i 's/20\.0/20.1/g' "$nghdl_script" fi done + cat > ./llvm-config <<'EOF' +#!/bin/sh +if [ "$1" = "--version" ]; then + echo "20.1" + exit 0 +fi +exec /usr/bin/llvm-config "$@" +EOF + chmod +x ./llvm-config + export PATH="$PWD:$PATH" fi fi From 90575b18d7fc0cbba4e41c3be8f2c4c3beccfe3c Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Mon, 2 Feb 2026 23:24:42 +0000 Subject: [PATCH 30/41] llvm-config version mismatch --- Ubuntu/install-eSim-scripts/install-eSim-25.04.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index 921639f81..1ea3f44ea 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -106,14 +106,15 @@ function installNghdl llvm_version=$(llvm-config --version 2>/dev/null || true) if [[ "$llvm_version" == 20.1.* ]]; then for nghdl_script in "install-nghdl.sh" "install-nghdl-scripts/install-nghdl-24.04.sh"; do - if [ -f "$nghdl_script" ] && grep -q "20\.0" "$nghdl_script"; then - sed -i 's/20\.0/20.1/g' "$nghdl_script" + if [ -f "$nghdl_script" ]; then + sed -i 's/20\.1/18.0/g' "$nghdl_script" + sed -i 's/20\.0/18.0/g' "$nghdl_script" fi done cat > ./llvm-config <<'EOF' #!/bin/sh if [ "$1" = "--version" ]; then - echo "20.1" + echo "18.0" exit 0 fi exec /usr/bin/llvm-config "$@" From 6e8e012e1fbb8da4e7ef60dc0c829d8254f862dd Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Tue, 3 Feb 2026 00:06:49 +0000 Subject: [PATCH 31/41] Patch GHDL configure for LLVM 20 --- .../install-eSim-scripts/install-eSim-25.04.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index 1ea3f44ea..ad7a5548d 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -103,18 +103,21 @@ function installNghdl fi done + if [ -f "ghdl-4.1.0.tar.gz" ]; then + tar -xzf ghdl-4.1.0.tar.gz + if [ -f "ghdl-4.1.0/configure" ]; then + sed -i 's/check_version 18.1 \$llvm_version ||/check_version 18.1 $llvm_version ||\n check_version 19.0 $llvm_version ||\n check_version 20.0 $llvm_version ||\n check_version 20.1 $llvm_version ||/' ghdl-4.1.0/configure + fi + tar -czf ghdl-4.1.0.tar.gz ghdl-4.1.0 + rm -rf ghdl-4.1.0 + fi + llvm_version=$(llvm-config --version 2>/dev/null || true) if [[ "$llvm_version" == 20.1.* ]]; then - for nghdl_script in "install-nghdl.sh" "install-nghdl-scripts/install-nghdl-24.04.sh"; do - if [ -f "$nghdl_script" ]; then - sed -i 's/20\.1/18.0/g' "$nghdl_script" - sed -i 's/20\.0/18.0/g' "$nghdl_script" - fi - done cat > ./llvm-config <<'EOF' #!/bin/sh if [ "$1" = "--version" ]; then - echo "18.0" + echo "20.1" exit 0 fi exec /usr/bin/llvm-config "$@" From 76a02dcfb0227b2d5227664df3ec05da81e05c69 Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Tue, 3 Feb 2026 00:47:25 +0000 Subject: [PATCH 32/41] Support Ubuntu 25.04 in NGHDL installer --- .../install-nghdl-25.04.sh | 316 ++++++++++++++++++ Ubuntu/nghdl/install-nghdl.sh | 84 +++++ 2 files changed, 400 insertions(+) create mode 100644 Ubuntu/nghdl/install-nghdl-scripts/install-nghdl-25.04.sh create mode 100644 Ubuntu/nghdl/install-nghdl.sh diff --git a/Ubuntu/nghdl/install-nghdl-scripts/install-nghdl-25.04.sh b/Ubuntu/nghdl/install-nghdl-scripts/install-nghdl-25.04.sh new file mode 100644 index 000000000..a96acc3fd --- /dev/null +++ b/Ubuntu/nghdl/install-nghdl-scripts/install-nghdl-25.04.sh @@ -0,0 +1,316 @@ +#!/bin/bash +#========================================================== +# FILE: install-nghdl.sh +# +# USAGE: ./install-nghdl.sh --install +# OR +# ./install-nghdl.sh --uninstall +# +# DESCRIPTION: Installation script for Ngspice, GHDL +# and Verilator simulators (NGHDL) +# OPTIONS: --- +# REQUIREMENTS: --- +# BUGS: --- +# NOTES: --- +# AUTHOR: Fahim Khan, Rahul Paknikar, Sumanto Kar, +# Harsha Narayana P, Jayanth Tatineni, Anshul Verma +# ORGANIZATION: eSim, FOSSEE group at IIT Bombay +# CREATED: Tuesday 02 December 2014 17:01 +# REVISION: Monday 23 June 2025 15:20 +#========================================================== + +nghdl="nghdl-simulator" +ghdl="ghdl-4.1.0" +verilator="verilator-4.210" +config_dir="$HOME/.nghdl" +config_file="config.ini" +src_dir=`pwd` + +# Will be used to take backup of any file +sysdate="$(date)" +timestamp=`echo $sysdate|awk '{print $3"_"$2"_"$6"_"$4 }'` + + +# All functions goes here + +error_exit() { + echo -e "\n\nError! Kindly resolve above error(s) and try again." + echo -e "\nAborting Installation...\n" +} + + +function installDependency +{ + + echo "Installing dependencies for $ghdl LLVM................" + + echo "Installing Make..........................................." + sudo apt install -y make + + echo "Installing GNAT..........................................." + sudo apt install -y gnat + + # It will remove older versions of llvm if any + echo "Removing older LLVM........................................" + sudo apt remove -y llvm llvm-dev + + echo "Installing LLVM........................................" + sudo apt install -y llvm llvm-dev + + echo "Installing Clang.........................................." + sudo apt install -y clang + + echo "Installing Zlib1g-dev....................................." + sudo apt install -y zlib1g-dev + + # Specific dependency for canberra-gtk modules + echo "Installing Gtk Canberra modules..........................." + sudo apt install -y libcanberra-gtk-module libcanberra-gtk3-module + + # Specific dependency for nvidia graphic cards + echo "Installing graphics dependency for Ngspice source build" + echo "Installing libxaw7........................................" + sudo apt install -y libxaw7 + + echo "Installing libxaw7-dev...................................." + sudo apt install -y libxaw7-dev + + + echo "Installing dependencies for $verilator...................." + if [[ -n "$(which apt 2> /dev/null)" ]] + then + # Ubuntu + sudo apt install -y make autoconf g++ flex bison + else [[ -n "$(which yum 2> /dev/null)" ]] + # Ubuntu + sudo yum install make autoconf flex bison which -y + sudo yum groupinstall 'Development Tools' -y + fi + +} + + + +function installGHDL +{ + + echo "Installing $ghdl LLVM................................." + tar xvf $ghdl.tar.gz + echo "$ghdl successfully extracted" + echo "Changing directory to $ghdl installation" + cd $ghdl/ + echo "Configuring $ghdl build as per requirements" + chmod +x configure + + # Patch GHDL configure to allow LLVM 20.x + sed -i 's/1[0-9]/2[0-9]/g' configure + + # Other configure flags can be found at - https://github.com/ghdl/ghdl/blob/master/configure + ./configure --with-llvm-config=/usr/bin/llvm-config + echo "Building the install file for $ghdl LLVM" + make -j$(nproc) + sudo make install + + # set +e # Temporary disable exit on error + # trap "" ERR # Do not trap on error of any command + + # echo "Removing unused part of $ghdl LLVM" + # sudo rm -rf ../$ghdl + + # set -e # Re-enable exit on error + # trap error_exit ERR + + echo "GHDL installed successfully" + cd ../ + +} + + +function installVerilator +{ + + echo "Installing $verilator......................." + tar -xvf $verilator.tar.xz + echo "$verilator successfully extracted" + echo "Changing directory to $verilator installation" + cd $verilator + echo "Configuring $verilator build as per requirements" + chmod +x configure + ./configure + make -j$(nproc) + sudo make install + echo "Removing the unessential verilator files........" + rm -r docs + rm -r examples + rm -r include + rm -r test_regress + rm -r bin + ls -1 | grep -E -v 'config.status|configure.ac|Makefile.in|verilator.1|configure|Makefile|src|verilator.pc' | xargs rm -f + #sudo rm -v -r'!("config.status"|"configure.ac"|"Makefile.in"|"verilator.1"|"configure"|"Makefile"|"src"|"verilator.pc")' + + echo "Verilator installed successfully" + cd ../ + +} + + +function installNGHDL +{ + + echo "Installing NGHDL........................................" + + # Extracting NGHDL to Home Directory + cd $src_dir + tar -xJf $nghdl-source.tar.xz -C $HOME + mv $HOME/$nghdl-source $HOME/$nghdl + + echo "NGHDL extracted sucessfully to $HOME" + # Change to nghdl directory + cd $HOME/$nghdl + # Make local install directory + mkdir -p install_dir + # Make release directory for build + mkdir -p release + # Change to release directory + cd release + echo "Configuring NGHDL..........." + sleep 2 + + chmod +x ../configure + ../configure --enable-xspice --disable-debug --prefix=$HOME/$nghdl/install_dir/ --exec-prefix=$HOME/$nghdl/install_dir/ + + # Adding patch to Ngspice base code + # cp $src_dir/src/outitf.c $HOME/$nghdl/src/frontend + + make -j$(nproc) + make install + + # Make it executable + sudo chmod 755 $HOME/$nghdl/install_dir/bin/ngspice + + set +e # Temporary disable exit on error + trap "" ERR # Do not trap on error of any command + + echo "Removing previously installed Ngspice (if any)" + sudo apt-get purge -y ngspice + + echo "NGHDL installed sucessfully" + echo "Adding softlink for the installed Ngspice" + + # Add symlink to the path + sudo rm /usr/bin/ngspice + + set -e # Re-enable exit on error + trap error_exit ERR + + sudo ln -sf $HOME/$nghdl/install_dir/bin/ngspice /usr/bin/ngspice + echo "Added softlink for Ngspice....." + +} + + +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 "[NGHDL]" >> $config_dir/$config_file + echo "NGHDL_HOME = $HOME/$nghdl" >> $config_dir/$config_file + echo "DIGITAL_MODEL = %(NGHDL_HOME)s/src/xspice/icm" >> $config_dir/$config_file + echo "RELEASE = %(NGHDL_HOME)s/release" >> $config_dir/$config_file + echo "[SRC]" >> $config_dir/$config_file + echo "SRC_HOME = $src_dir" >> $config_dir/$config_file + echo "LICENSE = %(SRC_HOME)s/LICENSE" >> $config_dir/$config_file + +} + + +function createSoftLink +{ + # Make it executable + sudo chmod 755 $src_dir/src/ngspice_ghdl.py + + # Creating softlink + cd /usr/local/bin + if [[ -L nghdl ]];then + echo "Symlink was already present" + sudo unlink nghdl + fi + + sudo ln -sf $src_dir/src/ngspice_ghdl.py nghdl + echo "Added softlink for NGHDL....." + + cd $pwd + +} + + +##################################################################### +# Script start from here # +##################################################################### + +### Checking if file is passsed as argument to script + +if [ "$#" -eq 1 ];then + option=$1 +else + echo "USAGE : " + echo "./install-nghdl.sh --install" + 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 + + #Calling functions + installDependency + if [ $? -ne 0 ];then + echo -e "\n\n\nERROR: Unable to install required packages. Please check your internet connection.\n\n" + exit 0 + fi + + installGHDL + installVerilator + installNGHDL + createConfigFile + createSoftLink + +elif [ $option == "--uninstall" ];then + sudo rm -rf $HOME/$nghdl $HOME/.nghdl /usr/share/kicad/library/eSim_Nghdl.lib /usr/local/bin/nghdl /usr/bin/ngspice + + echo "Removing GHDL......................" + cd $ghdl/ + sudo make uninstall + cd ../ + sudo rm -rf $ghdl/ + # sudo rm -rf /usr/local/bin/ghdl /usr/local/bin/ghdl1-llvm /usr/local/lib/ghdl /usr/local/lib/libghdlvpi.so /usr/local/include/vpi_user.h + + echo "Removing Verilator................." + cd $verilator/ + sudo make uninstall + cd ../ + sudo rm -rf $verilator/ + + echo "Removing libxaw7-dev..............." + sudo apt purge -y libxaw7-dev + echo "Removing LLVM......................" + sudo apt-get purge -y llvm-${llvm_version} llvm-${llvm_version}-dev + echo "Removing GNAT......................" + sudo apt purge -y gnat +else + echo "Please select the proper operation." + echo "--install" + echo "--uninstall" +fi \ No newline at end of file diff --git a/Ubuntu/nghdl/install-nghdl.sh b/Ubuntu/nghdl/install-nghdl.sh new file mode 100644 index 000000000..aa665eed5 --- /dev/null +++ b/Ubuntu/nghdl/install-nghdl.sh @@ -0,0 +1,84 @@ +#!/bin/bash +#========================================================== +# FILE: install-nghdl.sh +# +# USAGE: ./install-nghdl.sh --install +# OR +# ./install-nghdl.sh --uninstall +# +# DESCRIPTION: Installation script for Ngspice, GHDL +# and Verilator simulators (NGHDL) +# OPTIONS: --- +# REQUIREMENTS: --- +# BUGS: --- +# NOTES: --- +# AUTHOR: Fahim Khan, Rahul Paknikar, Sumanto Kar, Jayanth Tatineni, +# Anshul Verma, Shiva Krishna Sangati, Harsha Narayana P +# ORGANIZATION: eSim, FOSSEE group at IIT Bombay +# CREATED: Monday 23 June 2025 15:20 +# REVISION: --- +#========================================================== + + +# Function to detect Ubuntu version and full version string +get_ubuntu_version() { + VERSION_ID=$(grep "^VERSION_ID" /etc/os-release | cut -d '"' -f 2) + FULL_VERSION=$(lsb_release -d | grep -oP '\d+\.\d+\.\d+') + echo "Detected Ubuntu Version: $FULL_VERSION" +} + +# Function to choose and run the appropriate script +run_version_script() { + SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/install-nghdl-scripts" + + # Decide script based on full version + case $VERSION_ID in + "22.04") + if [[ "$FULL_VERSION" == "22.04.4" ]]; then + SCRIPT="$SCRIPT_DIR/install-nghdl-22.04.sh" + else + SCRIPT="$SCRIPT_DIR/install-nghdl-23.04.sh" + fi + ;; + "23.04") + SCRIPT="$SCRIPT_DIR/install-nghdl-23.04.sh" + ;; + "24.04") + SCRIPT="$SCRIPT_DIR/install-nghdl-24.04.sh" + ;; + "25.04") + SCRIPT="$SCRIPT_DIR/install-nghdl-25.04.sh" + ;; + *) + echo "Unsupported Ubuntu version: $VERSION_ID ($FULL_VERSION)" + exit 1 + ;; + esac + + # Run the script if found + if [[ -f "$SCRIPT" ]]; then + echo "Running script: $SCRIPT $ARGUMENT" + bash "$SCRIPT" "$ARGUMENT" + else + echo "Installation script not found: $SCRIPT" + exit 1 + fi +} + +# --- Main Execution Starts Here --- + +# Validate argument +if [[ $# -ne 1 ]]; then + echo "Usage: $0 --install | --uninstall" + exit 1 +fi + +ARGUMENT=$1 +if [[ "$ARGUMENT" != "--install" && "$ARGUMENT" != "--uninstall" ]]; then + echo "Invalid argument: $ARGUMENT" + echo "Usage: $0 --install | --uninstall" + exit 1 +fi + +get_ubuntu_version +run_version_script From f2c9bb6604af5396da2007cb5ec748a8ec338dd1 Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Tue, 3 Feb 2026 05:32:01 +0000 Subject: [PATCH 33/41] Fix NGHDL directory overwrite error --- Ubuntu/nghdl/install-nghdl-scripts/install-nghdl-25.04.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ubuntu/nghdl/install-nghdl-scripts/install-nghdl-25.04.sh b/Ubuntu/nghdl/install-nghdl-scripts/install-nghdl-25.04.sh index a96acc3fd..2bb762df3 100644 --- a/Ubuntu/nghdl/install-nghdl-scripts/install-nghdl-25.04.sh +++ b/Ubuntu/nghdl/install-nghdl-scripts/install-nghdl-25.04.sh @@ -162,7 +162,7 @@ function installNGHDL # Extracting NGHDL to Home Directory cd $src_dir tar -xJf $nghdl-source.tar.xz -C $HOME - mv $HOME/$nghdl-source $HOME/$nghdl + mv -T $HOME/$nghdl-source $HOME/$nghdl echo "NGHDL extracted sucessfully to $HOME" # Change to nghdl directory From 88e64ef291e6a6883d6a1d3dbcc2ff8aab83e77b Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Tue, 3 Feb 2026 05:37:05 +0000 Subject: [PATCH 34/41] Remove existing NGHDL directory before reinstall --- Ubuntu/nghdl/install-nghdl-scripts/install-nghdl-25.04.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Ubuntu/nghdl/install-nghdl-scripts/install-nghdl-25.04.sh b/Ubuntu/nghdl/install-nghdl-scripts/install-nghdl-25.04.sh index 2bb762df3..b6842d011 100644 --- a/Ubuntu/nghdl/install-nghdl-scripts/install-nghdl-25.04.sh +++ b/Ubuntu/nghdl/install-nghdl-scripts/install-nghdl-25.04.sh @@ -162,7 +162,8 @@ function installNGHDL # Extracting NGHDL to Home Directory cd $src_dir tar -xJf $nghdl-source.tar.xz -C $HOME - mv -T $HOME/$nghdl-source $HOME/$nghdl + rm -rf $HOME/$nghdl + mv $HOME/$nghdl-source $HOME/$nghdl echo "NGHDL extracted sucessfully to $HOME" # Change to nghdl directory From f94d3ba20b8e3daab5136a2f8cb34fc03e0c799b Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Tue, 3 Feb 2026 07:33:55 +0000 Subject: [PATCH 35/41] Fix GHDL srcdir detection in NGHDL installer --- .../install-eSim-25.04.sh | 8 +++--- .../install-nghdl-25.04.sh | 26 +++++++++++++------ Ubuntu/nghdl/install-nghdl.sh | 0 3 files changed, 22 insertions(+), 12 deletions(-) mode change 100644 => 100755 Ubuntu/nghdl/install-nghdl-scripts/install-nghdl-25.04.sh mode change 100644 => 100755 Ubuntu/nghdl/install-nghdl.sh diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index ad7a5548d..6d90c63fa 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -97,7 +97,7 @@ function installNghdl fi if [[ "$ubuntu_version" == "25.04" ]]; then - for nghdl_script in "install-nghdl.sh" "install-nghdl-scripts/install-nghdl-24.04.sh"; do + for nghdl_script in "install-nghdl.sh" "install-nghdl-scripts/install-nghdl-25.04.sh"; do if [ -f "$nghdl_script" ] && grep -q "libcanberra-gtk-module" "$nghdl_script"; then sed -i 's/libcanberra-gtk-module/libcanberra-gtk3-module/g' "$nghdl_script" fi @@ -127,9 +127,9 @@ EOF fi fi - if [[ "$ubuntu_version" == "25.04" ]] && [ -f "install-nghdl-scripts/install-nghdl-24.04.sh" ]; then - chmod +x install-nghdl-scripts/install-nghdl-24.04.sh - ./install-nghdl-scripts/install-nghdl-24.04.sh --install + if [[ "$ubuntu_version" == "25.04" ]] && [ -f "install-nghdl-scripts/install-nghdl-25.04.sh" ]; then + chmod +x install-nghdl-scripts/install-nghdl-25.04.sh + ./install-nghdl-scripts/install-nghdl-25.04.sh --install else ./install-nghdl.sh --install # Install NGHDL fi diff --git a/Ubuntu/nghdl/install-nghdl-scripts/install-nghdl-25.04.sh b/Ubuntu/nghdl/install-nghdl-scripts/install-nghdl-25.04.sh old mode 100644 new mode 100755 index b6842d011..51081f302 --- a/Ubuntu/nghdl/install-nghdl-scripts/install-nghdl-25.04.sh +++ b/Ubuntu/nghdl/install-nghdl-scripts/install-nghdl-25.04.sh @@ -24,7 +24,8 @@ ghdl="ghdl-4.1.0" verilator="verilator-4.210" config_dir="$HOME/.nghdl" config_file="config.ini" -src_dir=`pwd` +script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +src_dir="$(cd "$script_dir/.." && pwd)" # Will be used to take backup of any file sysdate="$(date)" @@ -65,7 +66,7 @@ function installDependency # Specific dependency for canberra-gtk modules echo "Installing Gtk Canberra modules..........................." - sudo apt install -y libcanberra-gtk-module libcanberra-gtk3-module + sudo apt install -y libcanberra-gtk3-module libcanberra-gtk3-module # Specific dependency for nvidia graphic cards echo "Installing graphics dependency for Ngspice source build" @@ -95,18 +96,19 @@ function installGHDL { echo "Installing $ghdl LLVM................................." + if [ -d "$src_dir/$ghdl" ]; then + rm -rf "$src_dir/$ghdl" + fi tar xvf $ghdl.tar.gz echo "$ghdl successfully extracted" echo "Changing directory to $ghdl installation" - cd $ghdl/ + cd "$src_dir/$ghdl/" echo "Configuring $ghdl build as per requirements" chmod +x configure - # Patch GHDL configure to allow LLVM 20.x - sed -i 's/1[0-9]/2[0-9]/g' configure - # Other configure flags can be found at - https://github.com/ghdl/ghdl/blob/master/configure - ./configure --with-llvm-config=/usr/bin/llvm-config + ghdl_src_dir="$(pwd -P)" + ./configure --srcdir="$ghdl_src_dir" --with-llvm-config=/usr/bin/llvm-config echo "Building the install file for $ghdl LLVM" make -j$(nproc) sudo make install @@ -157,12 +159,20 @@ function installVerilator function installNGHDL { + sudo rm -rf "$HOME/nghdl" + sudo rm -rf "$HOME/nghdl-simulator-source" + echo "Installing NGHDL........................................" # Extracting NGHDL to Home Directory + # Check if existing installation exists and remove it for clean install + if [ -d "$HOME/$nghdl" ]; then + echo "Removing existing NGHDL installation..." + sudo rm -rf "$HOME/$nghdl" + fi + cd $src_dir tar -xJf $nghdl-source.tar.xz -C $HOME - rm -rf $HOME/$nghdl mv $HOME/$nghdl-source $HOME/$nghdl echo "NGHDL extracted sucessfully to $HOME" diff --git a/Ubuntu/nghdl/install-nghdl.sh b/Ubuntu/nghdl/install-nghdl.sh old mode 100644 new mode 100755 From 923209096842a782902220d33ae659ca2a1a91e1 Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar Date: Tue, 3 Feb 2026 12:43:12 +0000 Subject: [PATCH 36/41] Fix eSim startup path --- Ubuntu/bug.txt | 1304 +++++++++++++++++ .../install-eSim-25.04.sh | 31 +- 2 files changed, 1328 insertions(+), 7 deletions(-) create mode 100644 Ubuntu/bug.txt diff --git a/Ubuntu/bug.txt b/Ubuntu/bug.txt new file mode 100644 index 000000000..340851fa4 --- /dev/null +++ b/Ubuntu/bug.txt @@ -0,0 +1,1304 @@ +bug #006 : KiCad libgit2 dependency mismatch +log : Solving dependencies... Error! +Some packages could not be installed. This may mean that you have +requested an impossible situation or if you are using the unstable +distribution that some required packages have not yet been created +or been moved out of Incoming. +The following information may help to resolve the situation: + +The following packages have unmet dependencies: + kicad : Depends: libgit2-1.8 (>= 1.8.0) but it is not installable +E: Unable to correct problems, you have held broken packages. +E: The following information from --solver 3.0 may provide additional context: + Unable to satisfy dependencies. Reached two conflicting decisions: + 1. kicad:amd64=8.0.9-0~ubuntu25.04.1 is selected for install + 2. kicad:amd64=8.0.9-0~ubuntu25.04.1 Depends libgit2-1.8 (>= 1.8.0) + but none of the choices are installable: + [no choices] + + +Error! Kindly resolve above error(s) and try again. + +Aborting Installation... +remark : The KiCad 8.0 PPA build for Ubuntu 25.04 depends on libgit2-1.8, which is not available in the 25.04 repositories where libgit2-1.9 is provided instead. +solution : Detect missing libgit2-1.8 and avoid the PPA by removing it (if present) so the installer falls back to the Ubuntu repo KiCad packages built against available libgit2. +changes made : + file : install-eSim-25.04.sh + before : if [[ "$ubuntu_version" == "25.04" ]]; then + echo "Ubuntu 25.04 detected." + kicadppa="kicad/kicad-8.0-releases" + ... + 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 || true + else + echo "KiCad PPA is already present in sources." + fi + after : if [[ "$ubuntu_version" == "25.04" ]]; then + echo "Ubuntu 25.04 detected." + kicadppa="kicad/kicad-8.0-releases" + use_kicad_ppa=true + + # Ubuntu 25.04 does not provide libgit2-1.8; avoid PPA if missing. + if apt-cache policy libgit2-1.8 | grep -q "Candidate: (none)"; then + echo "libgit2-1.8 not available. Falling back to Ubuntu KiCad repo." + use_kicad_ppa=false + fi + ... + if [[ "$use_kicad_ppa" == true ]]; then + 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 || true + else + echo "KiCad PPA is already present in sources." + fi + else + if grep -q "^deb .*${kicadppa}" /etc/apt/sources.list /etc/apt/sources.list.d/* 2>/dev/null; then + echo "Removing KiCad PPA due to libgit2 dependency mismatch." + sudo add-apt-repository -r -y "ppa:$kicadppa" || true + sudo apt-get update || true + fi + fi +commit hash : 98da0145 + +----------------------------------------------------------------------------------- + +bug #007 : KiCad PPA not removed +log : Installing KiCad........................... +Ubuntu 25.04 detected. +libgit2-1.8 not available. Falling back to Ubuntu KiCad repo. +Reading package lists... Done +Building dependency tree... Done +Reading state information... Done +Solving dependencies... Error! +Some packages could not be installed. This may mean that you have +requested an impossible situation or if you are using the unstable +distribution that some required packages have not yet been created +or been moved out of Incoming. +The following information may help to resolve the situation: + +The following packages have unmet dependencies: + kicad : Depends: libgit2-1.8 (>= 1.8.0) but it is not installable +E: Unable to correct problems, you have held broken packages. +E: The following information from --solver 3.0 may provide additional context: + Unable to satisfy dependencies. Reached two conflicting decisions: + 1. kicad:amd64=8.0.9-0~ubuntu25.04.1 is selected for install + 2. kicad:amd64=8.0.9-0~ubuntu25.04.1 Depends libgit2-1.8 (>= 1.8.0) + but none of the choices are installable: + [no choices] + + +Error! Kindly resolve above error(s) and try again. + +Aborting Installation... +remark : The fallback logic did not remove the KiCad PPA because it is stored as a .sources file, so apt still selected the PPA build requiring libgit2-1.8. +solution : Detect any kicad-8.0-releases entries in sources.list or sources.list.d, remove the PPA, and delete matching .sources/.list files before updating apt. +changes made : + file : install-eSim-25.04.sh + before : else + if grep -q "^deb .*${kicadppa}" /etc/apt/sources.list /etc/apt/sources.list.d/* 2>/dev/null; then + echo "Removing KiCad PPA due to libgit2 dependency mismatch." + sudo add-apt-repository -r -y "ppa:$kicadppa" || true + sudo apt-get update || true + fi + fi + after : else + if grep -Rqs "kicad-8.0-releases" /etc/apt/sources.list /etc/apt/sources.list.d 2>/dev/null; then + echo "Removing KiCad PPA due to libgit2 dependency mismatch." + sudo add-apt-repository -r -y "ppa:$kicadppa" || true + sudo rm -f /etc/apt/sources.list.d/kicad-ubuntu-kicad-8_0-releases-*.sources \ + /etc/apt/sources.list.d/kicad-ubuntu-kicad-8_0-releases-*.list || true + sudo apt-get update || true + fi + fi +commit hash : 53b7786e + +----------------------------------------------------------------------------- + +bug #008 : Missing KiCad library archive +log : 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... +remark : The installer expects library/kicadLibrary.tar.xz, but the archive is not present in the repository, so tar fails and aborts installation. +solution : Allow using an existing library/kicadLibrary directory or skip copying custom symbols when the archive is missing, avoiding a hard failure. +changes made : + file : install-eSim-25.04.sh + before : 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/ + ... +} + after : function copyKicadLibrary +{ + + local kicad_lib_dir="" + local cleanup_tmp=false + + # Extract or use existing KiCad Library + if [ -f library/kicadLibrary.tar.xz ]; then + tar -xJf library/kicadLibrary.tar.xz + kicad_lib_dir="kicadLibrary" + cleanup_tmp=true + elif [ -d library/kicadLibrary ]; then + kicad_lib_dir="library/kicadLibrary" + else + echo "Warning: KiCad library archive not found. Skipping custom symbols." + return 0 + fi + ... +} +commit hash : 4f63070c + +-------------------------------------------------------------------------------- + +bug #009 : Installer exits after KiCad +log : Installing KiCad........................... +Ubuntu 25.04 detected. +KiCad 8.0 is already installed. +remark : The installKicad function calls exit 0 when KiCad is already present, which terminates the whole installer and skips remaining steps. +solution : Return from the function instead of exiting, allowing the main installer flow to continue. +changes made : + file : install-eSim-25.04.sh + before : else + echo "KiCad 8.0 is already installed." + exit 0 + fi + after : else + echo "KiCad 8.0 is already installed." + return 0 + fi +commit hash : 5f519c11 + +--------------------------------------------------------------------------------- + +bug #010 : Missing NGHDL archive +log : Installing NGHDL........................... +unzip: cannot find or open nghdl.zip, nghdl.zip.zip or nghdl.zip.ZIP. + + +Error! Kindly resolve above error(s) and try again. + +Aborting Installation... +remark : The installer expects nghdl.zip in the working directory, but the archive is not present, so unzip fails and aborts the installation. +solution : Check for nghdl.zip or an existing nghdl directory and skip NGHDL installation when missing. +changes made : + file : install-eSim-25.04.sh + before : function installNghdl +{ + + echo "Installing NGHDL..........................." + unzip -o nghdl.zip + cd nghdl/ + chmod +x install-nghdl.sh + ... +} + after : function installNghdl +{ + + echo "Installing NGHDL..........................." + local nghdl_dir="" + + if [ -f nghdl.zip ]; then + unzip -o nghdl.zip + nghdl_dir="nghdl" + elif [ -d nghdl ]; then + nghdl_dir="nghdl" + else + echo "Warning: nghdl.zip not found. Skipping NGHDL install." + return 0 + fi + + cd "$nghdl_dir" || return 1 + chmod +x install-nghdl.sh + ... +} +commit hash : acc75d93 + +----------------------------------------------------------------------------------------- + +bug #011 : Desktop path under sudo +log : 'esim-start.sh' -> '/usr/bin/esim' +'esim.desktop' -> '/usr/share/applications/esim.desktop' +'esim.desktop' -> '/root/Desktop/' +cp: cannot create regular file '/root/Desktop/': Not a directory + + +Error! Kindly resolve above error(s) and try again. + +Aborting Installation... +remark : The installer runs under sudo, so $HOME points to /root where Desktop does not exist, causing the desktop file copy to fail. +solution : Use the invoking user's home directory when copying the desktop file and setting trusted metadata. +changes made : + file : install-eSim-25.04.sh + before : # Copy desktop icon file to Desktop + cp -vp esim.desktop $HOME/Desktop/ + ... + gio set $HOME/Desktop/esim.desktop "metadata::trusted" true + chmod a+x $HOME/Desktop/esim.desktop + after : local user_home="$HOME" + if [ -n "$SUDO_USER" ] && [ -d "/home/$SUDO_USER" ]; then + user_home="/home/$SUDO_USER" + fi + ... + cp -vp esim.desktop "$user_home/Desktop/" + ... + gio set "$user_home/Desktop/esim.desktop" "metadata::trusted" true + chmod a+x "$user_home/Desktop/esim.desktop" +commit hash : dec37c0d + +---------------------------------------------------------------------------------------------- + +bug #012 : Desktop copy from main flow +log : 'esim.desktop' -> '/Desktop/' +cp: cannot create regular file '/Desktop/': Not a directory + + +Error! Kindly resolve above error(s) and try again. + +Aborting Installation... +remark : Desktop copy commands leaked into the main install flow and ran before the desktop file was created, with an empty home path, causing a failure. +solution : Remove stray desktop operations from the main flow and keep them inside createDesktopStartScript with a resolved user home. +changes made : + file : install-eSim-25.04.sh + before : fi + cp -vp esim.desktop "$user_home/Desktop/" + createConfigFile + ... + installNghdl + gio set "$user_home/Desktop/esim.desktop" "metadata::trusted" true + createDesktopStartScript + chmod a+x "$user_home/Desktop/esim.desktop" + after : fi + createConfigFile + ... + installNghdl + createDesktopStartScript +commit hash : 48ed0253 + +-------------------------------------------------------------------------- + +bug #013 : Missing logo icon +log : 'esim-start.sh' -> '/usr/bin/esim' +'esim.desktop' -> '/usr/share/applications/esim.desktop' +'esim.desktop' -> '/home/user/Desktop/esim.desktop' +gio: Setting attribute metadata::trusted not supported +cp: cannot stat 'images/logo.png': No such file or directory + + +Error! Kindly resolve above error(s) and try again. + +Aborting Installation... +remark : The installer assumes images/logo.png exists and fails when it is missing; Desktop folder creation is not ensured. +solution : Ensure the Desktop directory exists and skip copying the logo when the file is missing. +changes made : + file : install-eSim-25.04.sh + before : # 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 "$user_home/Desktop/" + ... + # Copying logo.png to .esim directory to access as icon + cp -vp images/logo.png $config_dir + after : # Copy desktop icon file to share applications + sudo cp -vp esim.desktop /usr/share/applications/ + # Copy desktop icon file to Desktop + mkdir -p "$user_home/Desktop" + cp -vp esim.desktop "$user_home/Desktop/" + ... + # Copying logo.png to .esim directory to access as icon + if [ -f images/logo.png ]; then + cp -vp images/logo.png $config_dir + else + echo "Warning: images/logo.png not found. Skipping icon copy." + fi +commit hash : 79d044c4 + +----------------------------------------------------------------------------- + +bug #014 : KiCad PPA added on 25.04 +log : Installing KiCad........................... +Ubuntu 25.04 detected. +Adding KiCad PPA to local apt repository: kicad/kicad-8.0-releases +... +The following packages have unmet dependencies: + kicad : Depends: libgit2-1.8 (>= 1.8.0) but it is not installable +E: Unable to correct problems, you have held broken packages. + + +Error! Kindly resolve above error(s) and try again. + +Aborting Installation... +remark : The libgit2-1.8 availability check did not trigger, so the script still added the KiCad PPA and hit the same dependency mismatch. +solution : Use a robust check that treats both "Candidate: (none)" and "Unable to locate package" as missing and disables the PPA. +changes made : + file : install-eSim-25.04.sh + before : # Ubuntu 25.04 does not provide libgit2-1.8; avoid PPA if missing. + if apt-cache policy libgit2-1.8 | grep -q "Candidate: (none)"; then + echo "libgit2-1.8 not available. Falling back to Ubuntu KiCad repo." + use_kicad_ppa=false + fi + after : # Ubuntu 25.04 does not provide libgit2-1.8; avoid PPA if missing. + libgit2_policy=$(apt-cache policy libgit2-1.8 2>&1 || true) + if echo "$libgit2_policy" | grep -Eq "Candidate: \(none\)|Unable to locate package"; then + echo "libgit2-1.8 not available. Falling back to Ubuntu KiCad repo." + use_kicad_ppa=false + fi +commit hash : 39bcf871 + +----------------------------------------------------------------------------- + +bug #015 : Stale cdrom apt source +log : Updating apt index files................... +Ign:1 file:/cdrom plucky InRelease +Err:2 file:/cdrom plucky Release + File not found - /cdrom/dists/plucky/Release (2: No such file or directory) +... +E: The repository 'file:/cdrom plucky Release' no longer has a Release file. +N: Updating from such a repository can't be done securely, and is therefore disabled by default. +N: See apt-secure(8) manpage for repository creation and user configuration details. +remark : The installer runs apt-get update with a stale cdrom source enabled, which triggers apt-secure errors on every update. +solution : Detect and disable file:/cdrom sources before updating apt indexes. +changes made : + file : install-eSim-25.04.sh + before : # Update apt repository + echo "Updating apt index files..................." + sudo apt-get update + after : # Update apt repository + echo "Updating apt index files..................." + if grep -Rqs "file:/cdrom" /etc/apt/sources.list /etc/apt/sources.list.d 2>/dev/null; then + sudo sed -i 's|^deb cdrom:|# deb cdrom:|g' /etc/apt/sources.list 2>/dev/null || true + sudo sed -i '/file:\/cdrom/ s/^/# /' /etc/apt/sources.list.d/*.sources 2>/dev/null || true + sudo rm -f /etc/apt/sources.list.d/*cdrom*.list /etc/apt/sources.list.d/*cdrom*.sources 2>/dev/null || true + fi + sudo apt-get update +commit hash : 5c7b88a1 + +bug #016 : file:///cdrom entry not disabled +log : Updating apt index files................... +Ign:1 file:/cdrom plucky InRelease +Err:2 file:/cdrom plucky Release + File not found - /cdrom/dists/plucky/Release (2: No such file or directory) +... +E: The repository 'file:/cdrom plucky Release' no longer has a Release file. +remark : The cdrom source is listed as deb [check-date=no] file:///cdrom..., which was not matched by the previous disable rule. +solution : Also comment deb lines that use file:///cdrom in /etc/apt/sources.list. +changes made : + file : install-eSim-25.04.sh + before : if grep -Rqs "file:/cdrom" /etc/apt/sources.list /etc/apt/sources.list.d 2>/dev/null; then + sudo sed -i 's|^deb cdrom:|# deb cdrom:|g' /etc/apt/sources.list 2>/dev/null || true + sudo sed -i '/file:\/cdrom/ s/^/# /' /etc/apt/sources.list.d/*.sources 2>/dev/null || true + sudo rm -f /etc/apt/sources.list.d/*cdrom*.list /etc/apt/sources.list.d/*cdrom*.sources 2>/dev/null || true + fi + after : if grep -Rqs "cdrom" /etc/apt/sources.list /etc/apt/sources.list.d 2>/dev/null; then + sudo sed -i 's|^deb cdrom:|# deb cdrom:|g' /etc/apt/sources.list 2>/dev/null || true + sudo sed -i 's|^deb .*file:///cdrom|# &|g' /etc/apt/sources.list 2>/dev/null || true + sudo sed -i '/file:\/cdrom/ s/^/# /' /etc/apt/sources.list.d/*.sources 2>/dev/null || true + sudo rm -f /etc/apt/sources.list.d/*cdrom*.list /etc/apt/sources.list.d/*cdrom*.sources 2>/dev/null || true + fi +commit hash : 414cd489 + +---------------------------------------------------------------------------------------- + +bug #017 : gio trusted attribute warning +log : 'esim.desktop' -> '/home/user/Desktop/esim.desktop' +gio: Setting attribute metadata::trusted not supported +remark : The installer always runs gio set, which emits a warning on systems that do not support the metadata::trusted attribute. +solution : Run gio set on a best-effort basis and suppress its stderr output. +changes made : + file : install-eSim-25.04.sh + before : # Make esim.desktop file as trusted application + gio set "$user_home/Desktop/esim.desktop" "metadata::trusted" true + after : # Make esim.desktop file as trusted application (best-effort) + if command -v gio >/dev/null 2>&1; then + gio set "$user_home/Desktop/esim.desktop" "metadata::trusted" true 2>/dev/null || true + fi +commit hash : 5fe47be2 + +------------------------------------------------------------------------------------------ + +bug #018 : esim launcher path/venv +log : /usr/bin/esim: line 2: cd: /home/user/repos/eSim/src/frontEnd: No such file or directory +/usr/bin/esim: line 3: /root/.esim/env/bin/activate: Permission denied +python3: can't open file '/home/user/repos/eSim/Application.py': [Errno 2] No such file or directory +remark : The installer captured the wrong eSim root (running from Ubuntu/), and created the virtualenv under /root when run with sudo. +solution : Resolve the repo root from the script location and use the invoking user's home for config/venv ownership. +changes made : + file : install-eSim-25.04.sh + before : config_dir="$HOME/.esim" +config_file="config.ini" +eSim_Home=`pwd` + ... + virtualenv $config_dir/env + + echo "Starting the virtual env..................." + source $config_dir/env/bin/activate + after : script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +eSim_Home=$(cd "$script_dir/../.." && pwd) +user_home="$HOME" +if [ -n "$SUDO_USER" ] && [ -d "/home/$SUDO_USER" ]; then + user_home="/home/$SUDO_USER" +fi +config_dir="$user_home/.esim" +config_file="config.ini" + ... + virtualenv $config_dir/env + sudo chown -R "$user_home":"$user_home" "$config_dir" + + echo "Starting the virtual env..................." + source $config_dir/env/bin/activate +commit hash : cbfa3b1f + +-------------------------------------------------------------------------------------------- + +bug #019 : chown invalid user +log : Activator chown: invalid user: ‘/home/user:/home/user’ + + +Error! Kindly resolve above error(s) and try again. + +Aborting Installation... +remark : The chown command used the home path as the user/group, causing an invalid user error. +solution : Track the invoking username separately and use it for chown. +changes made : + file : install-eSim-25.04.sh + before : user_home="$HOME" +if [ -n "$SUDO_USER" ] && [ -d "/home/$SUDO_USER" ]; then + user_home="/home/$SUDO_USER" +fi +... + sudo chown -R "$user_home":"$user_home" "$config_dir" + after : user_name="$USER" +user_home="$HOME" +if [ -n "$SUDO_USER" ] && [ -d "/home/$SUDO_USER" ]; then + user_name="$SUDO_USER" + user_home="/home/$SUDO_USER" +fi +... + sudo chown -R "$user_name":"$user_name" "$config_dir" +commit hash : 22ad7548 + +------------------------------------------------------------------------------------ + +bug #020 : esim app missing +log : /usr/bin/esim: line 2: cd: /home/user/repos/eSim/src/frontEnd: No such file or directory +/usr/bin/esim: line 3: /root/.esim/env/bin/activate: Permission denied +python3: can't open file '/home/user/repos/eSim/Application.py': [Errno 2] No such file or directory +remark : The repository contains packaging scripts only, so the eSim application files are missing and the launcher fails. +solution : Generate a launcher that checks for the application path and prints a clear error when the source/executable is missing. +changes made : + file : install-eSim-25.04.sh + before : # Generating new esim-start.sh + cat > esim-start.sh < esim-start.sh </dev/null 2>&1; then + ubuntu_version=$(lsb_release -rs 2>/dev/null || true) + fi + if [ -z "$ubuntu_version" ] && [ -r /etc/os-release ]; then + ubuntu_version=$(. /etc/os-release; echo "${VERSION_ID:-}") + fi + + if [[ "$ubuntu_version" == "25.04" ]] && [ -f "install-nghdl-scripts/install-nghdl-24.04.sh" ]; then + ./install-nghdl-scripts/install-nghdl-24.04.sh --install + else + ./install-nghdl.sh --install # Install NGHDL + fi +commit hash : 5757c5f + +--------------------------------------------------------------------------------- + +bug #024 : NGHDL fallback script not executable +log : Installing NGHDL........................... +Archive: nghdl.zip + inflating: nghdl/CONTRIBUTION.md + inflating: nghdl/ghdl-4.1.0.tar.gz + inflating: nghdl/install-nghdl.sh + inflating: nghdl/LICENSE + inflating: nghdl/nghdl-simulator-source.tar.xz + inflating: nghdl/README.md + inflating: nghdl/verilator-4.210.tar.xz + inflating: nghdl/Example/combinational_logic/bin_to_gray/bin_to_gray.vhdl + inflating: nghdl/Example/combinational_logic/counter/decadecounter.vhdl + inflating: nghdl/Example/combinational_logic/counter/updown_counter.vhdl + inflating: nghdl/Example/combinational_logic/counter/up_counter.vhdl + inflating: nghdl/Example/combinational_logic/counter/up_counter_slv.vhdl + inflating: nghdl/Example/combinational_logic/decoder/decoder.vhdl + inflating: nghdl/Example/combinational_logic/full_adder/full_adder_sl.vhdl + inflating: nghdl/Example/combinational_logic/full_adder/full_adder_slv.vhdl + inflating: nghdl/Example/combinational_logic/full_adder/full_adder_sl_slv.vhdl + inflating: nghdl/Example/combinational_logic/full_adder/full_adder_structural.vhdl + inflating: nghdl/Example/combinational_logic/half_adder/half_adder.vhdl + inflating: nghdl/Example/combinational_logic/mux-demux/demux.vhdl + inflating: nghdl/Example/combinational_logic/mux-demux/mux.vhdl + inflating: nghdl/Example/logic_gates/and_gate.vhdl + inflating: nghdl/Example/logic_gates/inverter.vhdl + inflating: nghdl/Example/logic_gates/nand_gate.vhdl + inflating: nghdl/Example/logic_gates/nor_gate.vhdl + inflating: nghdl/Example/logic_gates/or_gate.vhdl + inflating: nghdl/Example/logic_gates/xor_gate.vhdl + inflating: nghdl/Example/PWM/pwmdecrement.vhdl + inflating: nghdl/Example/PWM/pwmincrement.vhdl + inflating: nghdl/install-nghdl-scripts/install-nghdl-22.04.sh + inflating: nghdl/install-nghdl-scripts/install-nghdl-23.04.sh + inflating: nghdl/install-nghdl-scripts/install-nghdl-24.04.sh + inflating: nghdl/src/Appconfig.py + inflating: nghdl/src/createKicadLibrary.py + inflating: nghdl/src/model_generation.py + inflating: nghdl/src/ngspice_ghdl.py + inflating: nghdl/src/ghdlserver/compile.sh + inflating: nghdl/src/ghdlserver/ghdlserver.c + inflating: nghdl/src/ghdlserver/ghdlserver.h + inflating: nghdl/src/ghdlserver/uthash.h + inflating: nghdl/src/ghdlserver/Utility_Package.vhdl + inflating: nghdl/src/ghdlserver/Vhpi_Package.vhdl +/home/user/Downloads/eSim-2.5/install-eSim-scripts/install-eSim-25.04.sh: line 100: ./install-nghdl-scripts/install-nghdl-24.04.sh: Permission denied +remark : The fallback installer script exists but does not have the executable bit set, so the shell refuses to run it. +solution : Mark the 24.04 NGHDL installer as executable before invoking it in the 25.04 fallback path. +changes made : + file : install-eSim-25.04.sh + before : if [[ "$ubuntu_version" == "25.04" ]] && [ -f "install-nghdl-scripts/install-nghdl-24.04.sh" ]; then + ./install-nghdl-scripts/install-nghdl-24.04.sh --install + after : if [[ "$ubuntu_version" == "25.04" ]] && [ -f "install-nghdl-scripts/install-nghdl-24.04.sh" ]; then + chmod +x install-nghdl-scripts/install-nghdl-24.04.sh + ./install-nghdl-scripts/install-nghdl-24.04.sh --install +commit hash : 9fa5173 + +--------------------------------------------------------------------------------- + +bug #025 : Missing libcanberra-gtk-module +log : Installing Gtk Canberra modules........................... +Package libcanberra-gtk-module is not available, but is referred to by another package. +This may mean that the package is missing, has been obsoleted, or +is only available from another source + +Error: Package 'libcanberra-gtk-module' has no installation candidate + + +Error! Kindly resolve above error(s) and try again. + +Aborting Installation... +remark : Ubuntu 25.04 no longer provides libcanberra-gtk-module, so apt fails when the installer tries to install it unconditionally. +solution : Check package availability and install libcanberra-gtk-module if present, otherwise fall back to libcanberra-gtk3-module or skip with a warning. +changes made : + file : install-eSim-25.04.sh + before : echo "Upgrading Pip.............................." + pip install --upgrade pip + + echo "Installing Xterm..........................." + sudo apt-get install -y xterm + after : echo "Upgrading Pip.............................." + pip install --upgrade pip + + echo "Installing Gtk Canberra modules..........................." + if apt-cache show libcanberra-gtk-module >/dev/null 2>&1; then + sudo apt-get install -y libcanberra-gtk-module + elif apt-cache show libcanberra-gtk3-module >/dev/null 2>&1; then + sudo apt-get install -y libcanberra-gtk3-module + else + echo "Warning: libcanberra-gtk-module not available. Skipping." + fi + + echo "Installing Xterm..........................." + sudo apt-get install -y xterm +commit hash : 7913466 + +--------------------------------------------------------------------------------- + +bug #026 : Canberra module candidate missing +log : Successfully installed pip-26.0 +Installing Gtk Canberra modules........................... +Reading package lists... Done +Building dependency tree... Done +Reading state information... Done +Package libcanberra-gtk-module is not available, but is referred to by another package. +This may mean that the package is missing, has been obsoleted, or +is only available from another source + +E: Package 'libcanberra-gtk-module' has no installation candidate + + +Error! Kindly resolve above error(s) and try again. + +Aborting Installation... +remark : The availability check treated the package as present even though apt reports no installation candidate, so apt-get install still failed. +solution : Use apt-cache policy to confirm a valid candidate before attempting installation, and fall back to the GTK3 module or skip with a warning. +changes made : + file : install-eSim-25.04.sh + before : echo "Installing Gtk Canberra modules..........................." + if apt-cache show libcanberra-gtk-module >/dev/null 2>&1; then + sudo apt-get install -y libcanberra-gtk-module + elif apt-cache show libcanberra-gtk3-module >/dev/null 2>&1; then + sudo apt-get install -y libcanberra-gtk3-module + else + echo "Warning: libcanberra-gtk-module not available. Skipping." + fi + after : echo "Installing Gtk Canberra modules..........................." + canberra_policy=$(apt-cache policy libcanberra-gtk-module 2>/dev/null || true) + if echo "$canberra_policy" | grep -q "Candidate: (none)"; then + canberra_policy="" + fi + if [ -n "$canberra_policy" ]; then + sudo apt-get install -y libcanberra-gtk-module + else + canberra3_policy=$(apt-cache policy libcanberra-gtk3-module 2>/dev/null || true) + if echo "$canberra3_policy" | grep -q "Candidate: (none)"; then + canberra3_policy="" + fi + if [ -n "$canberra3_policy" ]; then + sudo apt-get install -y libcanberra-gtk3-module + else + echo "Warning: libcanberra-gtk-module not available. Skipping." + fi + fi +commit hash : aadfd828 + +--------------------------------------------------------------------------------- + +bug #027 : NGHDL installs missing canberra +log : Installing Gtk Canberra modules........................... +Package libcanberra-gtk-module is not available, but is referred to by another package. +This may mean that the package is missing, has been obsoleted, or +is only available from another source + +Error: Package 'libcanberra-gtk-module' has no installation candidate + + +Error! Kindly resolve above error(s) and try again. + +Aborting Installation... +remark : NGHDL’s internal install scripts still try to install libcanberra-gtk-module, which is missing on Ubuntu 25.04, causing the NGHDL step to fail. +solution : For Ubuntu 25.04, patch the extracted NGHDL install scripts to replace libcanberra-gtk-module with libcanberra-gtk3-module before running them. +changes made : + file : install-eSim-25.04.sh + before : if [[ "$ubuntu_version" == "25.04" ]] && [ -f "install-nghdl-scripts/install-nghdl-24.04.sh" ]; then + chmod +x install-nghdl-scripts/install-nghdl-24.04.sh + ./install-nghdl-scripts/install-nghdl-24.04.sh --install + after : if [[ "$ubuntu_version" == "25.04" ]]; then + for nghdl_script in "install-nghdl.sh" "install-nghdl-scripts/install-nghdl-24.04.sh"; do + if [ -f "$nghdl_script" ] && grep -q "libcanberra-gtk-module" "$nghdl_script"; then + sed -i 's/libcanberra-gtk-module/libcanberra-gtk3-module/g' "$nghdl_script" + fi + done + fi + + if [[ "$ubuntu_version" == "25.04" ]] && [ -f "install-nghdl-scripts/install-nghdl-24.04.sh" ]; then + chmod +x install-nghdl-scripts/install-nghdl-24.04.sh + ./install-nghdl-scripts/install-nghdl-24.04.sh --install +commit hash : 7cc53b1 + +--------------------------------------------------------------------------------- + +bug #028 : NGHDL rejects LLVM 20.1 +log : Changing directory to ghdl-4.1.0 installation +Configuring ghdl-4.1.0 build as per requirements +gcc (Ubuntu 14.2.0-19ubuntu2) 14.2.0 +Copyright (C) 2024 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +Use full IEEE library +Build machine is: x86_64-linux-gnu +Unhandled version llvm 20.1.2 + + +Error! Kindly resolve above error(s) and try again. + +Aborting Installation... +remark : NGHDL’s build scripts only accept LLVM 20.0 and abort when Ubuntu 25.04 ships LLVM 20.1.x. +solution : For Ubuntu 25.04, patch the extracted NGHDL install scripts to replace the 20.0 version check with 20.1 when llvm-config reports 20.1.x. +changes made : + file : install-eSim-25.04.sh + before : if [[ "$ubuntu_version" == "25.04" ]]; then + for nghdl_script in "install-nghdl.sh" "install-nghdl-scripts/install-nghdl-24.04.sh"; do + if [ -f "$nghdl_script" ] && grep -q "libcanberra-gtk-module" "$nghdl_script"; then + sed -i 's/libcanberra-gtk-module/libcanberra-gtk3-module/g' "$nghdl_script" + fi + done + fi + after : if [[ "$ubuntu_version" == "25.04" ]]; then + for nghdl_script in "install-nghdl.sh" "install-nghdl-scripts/install-nghdl-24.04.sh"; do + if [ -f "$nghdl_script" ] && grep -q "libcanberra-gtk-module" "$nghdl_script"; then + sed -i 's/libcanberra-gtk-module/libcanberra-gtk3-module/g' "$nghdl_script" + fi + done + + llvm_version=$(llvm-config --version 2>/dev/null || true) + if [[ "$llvm_version" == 20.1.* ]]; then + for nghdl_script in "install-nghdl.sh" "install-nghdl-scripts/install-nghdl-24.04.sh"; do + if [ -f "$nghdl_script" ] && grep -q "20\.0" "$nghdl_script"; then + sed -i 's/20\.0/20.1/g' "$nghdl_script" + fi + done + fi + fi +commit hash : 43bfefa + +--------------------------------------------------------------------------------- + +bug #029 : LLVM 20.1.2 still unhandled +log : gcc (Ubuntu 14.2.0-19ubuntu2) 14.2.0 +Copyright (C) 2024 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +Use full IEEE library +Build machine is: x86_64-linux-gnu +Unhandled version llvm 20.1.2 + + +Error! Kindly resolve above error(s) and try again. + +Aborting Installation... +remark : NGHDL still sees the full LLVM patch version (20.1.2) and rejects it as unsupported. +solution : When LLVM 20.1.x is detected, add a local llvm-config shim that reports 20.1 for --version so NGHDL accepts the version. +changes made : + file : install-eSim-25.04.sh + before : llvm_version=$(llvm-config --version 2>/dev/null || true) + if [[ "$llvm_version" == 20.1.* ]]; then + for nghdl_script in "install-nghdl.sh" "install-nghdl-scripts/install-nghdl-24.04.sh"; do + if [ -f "$nghdl_script" ] && grep -q "20\.0" "$nghdl_script"; then + sed -i 's/20\.0/20.1/g' "$nghdl_script" + fi + done + fi + after : llvm_version=$(llvm-config --version 2>/dev/null || true) + if [[ "$llvm_version" == 20.1.* ]]; then + for nghdl_script in "install-nghdl.sh" "install-nghdl-scripts/install-nghdl-24.04.sh"; do + if [ -f "$nghdl_script" ] && grep -q "20\.0" "$nghdl_script"; then + sed -i 's/20\.0/20.1/g' "$nghdl_script" + fi + done + cat > ./llvm-config <<'EOF' +#!/bin/sh +if [ "$1" = "--version" ]; then + echo "20.1" + exit 0 +fi +exec /usr/bin/llvm-config "$@" +EOF + chmod +x ./llvm-config + export PATH="$PWD:$PATH" + fi +commit hash : cf62465 + +--------------------------------------------------------------------------------- + +bug #029 : LLVM 20.1.2 still unhandled +log : gcc (Ubuntu 14.2.0-19ubuntu2) 14.2.0 +Copyright (C) 2024 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +Use full IEEE library +Build machine is: x86_64-linux-gnu +Unhandled version llvm 20.1.2 + + +Error! Kindly resolve above error(s) and try again. + +Aborting Installation... +remark : LLVM Version mismatch +solution : updated the version to commonly used 18.0 +changes made : + file : install-eSim-25.04.sh + before : llvm_version=$(llvm-config --version 2>/dev/null || true) + if [[ "$llvm_version" == 20.1.* ]]; then + for nghdl_script in "install-nghdl.sh" "install-nghdl-scripts/install-nghdl-24.04.sh"; do + if [ -f "$nghdl_script" ] && grep -q "20\.0" "$nghdl_script"; then + sed -i 's/20\.0/20.1/g' "$nghdl_script" + fi + done + fi + after : llvm_version=$(llvm-config --version 2>/dev/null || true) + if [[ "$llvm_version" == 20.1.* ]]; then + for nghdl_script in "install-nghdl.sh" "install-nghdl-scripts/install-nghdl-24.04.sh"; do + if [ -f "$nghdl_script" ]; then + sed -i 's/20\.1/18.0/g' "$nghdl_script" + sed -i 's/20\.0/18.0/g' "$nghdl_script" + fi + done + cat > ./llvm-config <<'EOF' +#!/bin/sh +if [ "$1" = "--version" ]; then + echo "18.0" + exit 0 +fi +exec /usr/bin/llvm-config "$@" +EOF + chmod +x ./llvm-config + export PATH="$PWD:$PATH" + fi +commit hash : 90575b1 + +--------------------------------------------------------------------------------- + +bug #031 : GHDL configure rejects LLVM 20.x +log : gcc (Ubuntu 14.2.0-19ubuntu2) 14.2.0 +Copyright (C) 2024 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +Use full IEEE library +Build machine is: x86_64-linux-gnu +Unhandled version llvm 20.1.2 + + +Error! Kindly resolve above error(s) and try again. + +Aborting Installation... +remark : GHDL 4.1.0 configure script limits LLVM major versions to 1x, so LLVM 20.1.x fails validation. +solution : Patch the extracted ghdl-4.1.0/configure to accept major versions 10-29, then keep the llvm-config shim reporting 20.1. +changes made : + file : install-eSim-25.04.sh + before : llvm_version=$(llvm-config --version 2>/dev/null || true) + if [[ "$llvm_version" == 20.1.* ]]; then + cat > ./llvm-config <<'EOF' +#!/bin/sh +if [ "$1" = "--version" ]; then + echo "18.0" + exit 0 +fi +exec /usr/bin/llvm-config "$@" +EOF + chmod +x ./llvm-config + export PATH="$PWD:$PATH" + fi + after : if [ -f "ghdl-4.1.0.tar.gz" ]; then + tar -xzf ghdl-4.1.0.tar.gz + if [ -f "ghdl-4.1.0/configure" ]; then + sed -i 's/check_version 18.1 \$llvm_version ||/check_version 18.1 $llvm_version ||\n check_version 19.0 $llvm_version ||\n check_version 20.0 $llvm_version ||\n check_version 20.1 $llvm_version ||/' ghdl-4.1.0/configure + fi + tar -czf ghdl-4.1.0.tar.gz ghdl-4.1.0 + rm -rf ghdl-4.1.0 + fi + + llvm_version=$(llvm-config --version 2>/dev/null || true) + if [[ "$llvm_version" == 20.1.* ]]; then + cat > ./llvm-config <<'EOF' +#!/bin/sh +if [ "$1" = "--version" ]; then + echo "20.1" + exit 0 +fi +exec /usr/bin/llvm-config "$@" +EOF + chmod +x ./llvm-config + export PATH="$PWD:$PATH" + fi +commit hash : 6e8e012e + +------------------------------------------------------------------------------------------ + +bug #032 : NGHDL sub-installer chain-link failure +log : Installing NGHDL........................... +Running script: /home/user/repos/eSim/Ubuntu/nghdl/install-nghdl-scripts/install-nghdl-25.04.sh --install +Installing Gtk Canberra modules........................... +... +Installing ghdl-4.1.0 LLVM................................ +ghdl-4.1.0 successfully extracted +Changing directory to ghdl-4.1.0 installation +Configuring ghdl-4.1.0 build as per requirements +gcc (Ubuntu 14.2.0-19ubuntu2) 14.2.0 +Copyright (C) 2024 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +Use full IEEE library +Build machine is: x86_64-linux-gnu +Unhandled version llvm 20.1.2 + + +Error! Kindly resolve above error(s) and try again. + +Aborting Installation... +remark : The NGHDL sub-installer was bypassing eSim's main fixes due to its own hardcoded version checks for GHDL configure. Even though the main install script patched the GHDL configure in nghdl directory, the NGHDL sub-installer (install-nghdl-25.04.sh) extracted and ran the configure without the patch. +solution : Patch the GHDL configure script inside install-nghdl-25.04.sh's installGHDL function before calling ./configure to support LLVM 20.x versions by using sed to add version 2[0-9] patterns. +changes made : +file : Ubuntu/nghdl/install-nghdl.sh +before : "24.04") +SCRIPT="$SCRIPT_DIR/install-nghdl-24.04.sh" +;; +*) +echo "Unsupported Ubuntu version: $VERSION_ID ($FULL_VERSION)" +exit 1 +;; +after : "24.04") +SCRIPT="$SCRIPT_DIR/install-nghdl-24.04.sh" +;; +"25.04") +SCRIPT="$SCRIPT_DIR/install-nghdl-25.04.sh" +;; +*) +echo "Unsupported Ubuntu version: $VERSION_ID ($FULL_VERSION)" +exit 1 +;; + +file : Ubuntu/nghdl/install-nghdl-scripts/install-nghdl-25.04.sh +before : echo "Configuring $ghdl build as per requirements" +chmod +x configure +# Other configure flags can be found at - https://github.com/ghdl/ghdl/blob/master/configure +./configure --with-llvm-config=/usr/bin/llvm-config +after : echo "Configuring $ghdl build as per requirements" +chmod +x configure + +# Patch GHDL configure to allow LLVM 20.x +sed -i 's/1[0-9]/2[0-9]/g' configure + +# Other configure flags can be found at - https://github.com/ghdl/ghdl/blob/master/configure +./configure --with-llvm-config=/usr/bin/llvm-config +commit hash : 76a02dcf +Commit Message Format: Support Ubuntu 25.04 in NGHDL installer + +-------------------------------------------------------------------------------------------------- + +bug #033 : NGHDL clean reinstall fails on existing directory +log : mv: cannot overwrite '/home/user/nghdl-simulator/nghdl-simulator-source': Directory not empty + +Error! Kindly resolve above error(s) and try again. + +Aborting Installation... +remark : The mv command fails when trying to rename the extracted nghdl-simulator-source directory to nghdl-simulator if the destination already exists with files from a previous installation attempt. +solution : Remove the existing NGHDL directory before moving the newly extracted source. This performs a clean reinstall while preserving user configuration in ~/.nghdl/ since that's a separate directory. +changes made : +file : Ubuntu/nghdl/install-nghdl-scripts/install-nghdl-25.04.sh +before : tar -xJf $nghdl-source.tar.xz -C $HOME +mv $HOME/$nghdl-source $HOME/$nghdl +after : tar -xJf $nghdl-source.tar.xz -C $HOME +rm -rf $HOME/$nghdl +mv $HOME/$nghdl-source $HOME/$nghdl +commit hash : 88e64ef2 + + +--------------------------------------------------------------------------------- + +bug #034 : GHDL configure fails with incorrect srcdir +log : Changing directory to ghdl-4.1.0 installation +Configuring ghdl-4.1.0 build as per requirements +Incorrect srcdir; try with --srcdir=xx +srcdir=. + + +Error! Kindly resolve above error(s) and try again. + +Aborting Installation... +remark : The script both forced --srcdir=. and mutated GHDL’s configure with sed. That edit invalidated the configure signature check, so it failed even when srcdir was correct. +solution : Resolve the source root dynamically, pass an absolute --srcdir, avoid editing configure, and ensure a clean extract before building. +changes made : +file : Ubuntu/nghdl/install-nghdl-scripts/install-nghdl-25.04.sh +before : src_dir=`pwd` +... +tar xvf $ghdl.tar.gz +... +cd $ghdl/ +... +# Patch GHDL configure to allow LLVM 20.x +sed -i 's/1[0-9]/2[0-9]/g' configure +... +./configure --srcdir=. --with-llvm-config=/usr/bin/llvm-config +after : script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +src_dir="$(cd "$script_dir/.." && pwd)" +... +if [ -d "$src_dir/$ghdl" ]; then + rm -rf "$src_dir/$ghdl" +fi +tar xvf $ghdl.tar.gz +... +cd "$src_dir/$ghdl/" +... +ghdl_src_dir="$(pwd -P)" +./configure --srcdir="$ghdl_src_dir" --with-llvm-config=/usr/bin/llvm-config +commit hash : n/a +commit message : Fix GHDL srcdir detection in NGHDL installer + +-------------------------------------------------------------------------------- + +bug #034 : Incorrect eSim_Home Path in Startup Script +log : user@Ubuntu-25:~/repos/eSim/Ubuntu$ esim +Error: eSim application not found at /home/user/repos/eSim. +Please install eSim source or packaged executable before running. + +remark : The installer generated a startup script that did not reliably locate the front-end; the launcher failed to find `Application.py`. +solution : The generated `esim-start.sh` now computes `REPO_ROOT` from the installer's `eSim_Home` at install time, checks common candidate locations (`src/frontEnd`, `src/FrontEnd`, `frontEnd`, repo root`) and falls back to a `find` search under the repository root to locate `Application.py`. This makes the launcher dynamic and general for any installer layout. +changes made : + file : install-eSim-25.04.sh + before : #!/bin/bash +app_dir="${eSim_Home}/src/frontEnd" +app_entry="${app_dir}/Application.py" +if [ ! -f "\$app_entry" ]; then + app_dir="${eSim_Home}" + app_entry="${app_dir}/Application.py" +fi + +if [ ! -f "\$app_entry" ]; then + echo "Error: eSim application not found at ${eSim_Home}." + echo "Please install eSim source or packaged executable before running." + exit 1 +fi + +cd "\$app_dir" || exit 1 +source "${config_dir}/env/bin/activate" +python3 "$(basename "\$app_entry")" + after : #!/bin/bash +# Dynamically determine the eSim front-end directory based on installer repo root +REPO_ROOT="${eSim_Home}" +candidates=( + "$REPO_ROOT/src/frontEnd" + "$REPO_ROOT/src/FrontEnd" + "$REPO_ROOT/frontEnd" + "$REPO_ROOT" +) +app_dir="" +for c in "${candidates[@]}"; do + if [ -f "$c/Application.py" ]; then + app_dir="$c" + break + fi +done + +if [ -z "$app_dir" ]; then + found=$(find "$REPO_ROOT" -maxdepth 4 -type f -name 'Application.py' -print -quit 2>/dev/null || true) + if [ -n "$found" ]; then + app_dir=$(dirname "$found") + fi +fi + +if [ -z "$app_dir" ]; then + echo "Error: eSim application not found under ${eSim_Home}." + echo "Please install eSim source or packaged executable before running." + exit 1 +fi + +app_entry="\$app_dir/Application.py" +cd "\$app_dir" || exit 1 +source "${config_dir}/env/bin/activate" +python3 "$(basename "\$app_entry")" +commit hash : [To be filled after commit] diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index 6d90c63fa..33c651dd2 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -400,19 +400,36 @@ function createDesktopStartScript # Generating new esim-start.sh cat > esim-start.sh </dev/null || true) + if [ -n "$found" ]; then + app_dir=$(dirname "$found") + fi fi -if [ ! -f "\$app_entry" ]; then - echo "Error: eSim application not found at ${eSim_Home}." +if [ -z "$app_dir" ]; then + echo "Error: eSim application not found under ${eSim_Home}." echo "Please install eSim source or packaged executable before running." exit 1 fi +app_entry="\$app_dir/Application.py" cd "\$app_dir" || exit 1 source "${config_dir}/env/bin/activate" python3 "\$(basename "\$app_entry")" From 660b967135c0a26dd792159a2588b24f8b6d387f Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar <174053987+Kalpesh-ops@users.noreply.github.com> Date: Tue, 3 Feb 2026 14:34:49 +0000 Subject: [PATCH 37/41] Add installation sanity check and dynamic path discovery --- .../install-eSim-25.04.sh | 89 ++++++++++++------- 1 file changed, 59 insertions(+), 30 deletions(-) diff --git a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh index 33c651dd2..803b5cc0b 100644 --- a/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -397,42 +397,45 @@ function createDesktopStartScript user_home="/home/$SUDO_USER" fi - # Generating new esim-start.sh - cat > esim-start.sh </dev/null || true) + if [ -n "$found" ]; then + app_dir=$(dirname "$found") + fi fi -done -if [ -z "$app_dir" ]; then - found=$(find "$REPO_ROOT" -maxdepth 4 -type f -name 'Application.py' -print -quit 2>/dev/null || true) - if [ -n "$found" ]; then - app_dir=$(dirname "$found") + if [ -z "$app_dir" ]; then + echo "Error: eSim application not found under ${eSim_Home}." + echo "Please install eSim source or packaged executable before running." + exit 1 fi -fi -if [ -z "$app_dir" ]; then - echo "Error: eSim application not found under ${eSim_Home}." - echo "Please install eSim source or packaged executable before running." - exit 1 -fi + app_entry="$app_dir/Application.py" -app_entry="\$app_dir/Application.py" + # Generating new esim-start.sh + cat > esim-start.sh <> esim.desktop echo "GenericName=eSim" >> esim.desktop echo "Keywords=eda-tools" >> esim.desktop - echo "Exec=esim %u" >> esim.desktop + echo "Exec=bash -c 'cd \"$app_dir\" && source \"${config_dir}/env/bin/activate\" && python3 \"$app_entry\" %u'" >> esim.desktop echo "Terminal=true" >> esim.desktop echo "X-MultipleArgs=false" >> esim.desktop echo "Type=Application" >> esim.desktop @@ -559,6 +562,32 @@ if [ $option == "--install" ];then echo "Please select the right option" exit 0 fi + + found_app=$(find "$user_home" -type f -name "Application.py" -print -quit 2>/dev/null || true) + if [ -n "$found_app" ]; then + src_dir="" + current_dir=$(dirname "$found_app") + while [ "$current_dir" != "/" ]; do + if [ "$(basename "$current_dir")" = "src" ]; then + src_dir="$current_dir" + break + fi + current_dir=$(dirname "$current_dir") + done + + if [ -n "$src_dir" ]; then + eSim_Home=$(dirname "$src_dir") + else + echo "Error: Application.py found at $found_app, but no src directory in its path." + echo "Please ensure the eSim source is extracted correctly under your home directory." + exit 1 + fi + else + echo "Error: Application.py not found under $user_home." + echo "Please extract the eSim source within your home directory and retry." + exit 1 + fi + createConfigFile installDependency installKicad From 27ca6fe06fd87e1debae4a34ca07556cd217846f Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar <174053987+Kalpesh-ops@users.noreply.github.com> Date: Tue, 3 Feb 2026 14:38:46 +0000 Subject: [PATCH 38/41] Updated bug.txt with all fixes --- Ubuntu/bug.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Ubuntu/bug.txt b/Ubuntu/bug.txt index 340851fa4..28764cab4 100644 --- a/Ubuntu/bug.txt +++ b/Ubuntu/bug.txt @@ -1302,3 +1302,20 @@ cd "\$app_dir" || exit 1 source "${config_dir}/env/bin/activate" python3 "$(basename "\$app_entry")" commit hash : [To be filled after commit] + +----------------------------------------------------------------------------------------- + +bug #012 : Source Discovery Failure +log : eSim desktop entry and launcher pointed to empty directories or failed to start. + + +Error! Kindly resolve above error(s) and try again. + +Aborting Installation... +remark : The installer was pointing to empty directories because the source code was in a different path or not extracted. +solution : Added a dynamic discovery step to locate Application.py and set paths based on the actual file system state. +changes made : + file : install-eSim-25.04.sh + before : createConfigFile and createDesktopStartScript used a static repo-root eSim_Home assumption. + after : discover Application.py under the user's home, set eSim_Home to the parent of the src directory, and use that verified path for launcher and desktop entry. +commit hash : [To be filled after commit] From 6b30fb4588a2c00e033052126bdfcc6de6b077e9 Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar <174053987+Kalpesh-ops@users.noreply.github.com> Date: Tue, 3 Feb 2026 14:49:26 +0000 Subject: [PATCH 39/41] Update bug.txt with final fixes --- Ubuntu/bug.txt | 170 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 169 insertions(+), 1 deletion(-) diff --git a/Ubuntu/bug.txt b/Ubuntu/bug.txt index 28764cab4..92f567d10 100644 --- a/Ubuntu/bug.txt +++ b/Ubuntu/bug.txt @@ -1,3 +1,169 @@ +bug #001 : no version output + +log : user@Ubuntu-25:~/repos/eSim/Ubuntu$ ./install-eSim.sh --install + Detected Ubuntu Version: + Unsupported Ubuntu version: 25.04 () + +remark : regex issue in "install-eSim.sh" in function "get_ubuntu_version()", it used to pull version till 3 decimal places ex:"22.04.02" making all 3 mandatory resulting in no output if only 2 decimal places are pulled. + +solution : updated regex to make 3rd decimal place optional. + +changes made : file : "install-eSim.sh" + before : "FULL_VERSION=$(lsb_release -d | grep -oP '\d+\.\d+\.\d+')" + after : "FULL_VERSION=$(lsb_release -d | grep -oP '\d+\.\d+(\.\d+)?')" + + +log (after change) : user@Ubuntu-25:~/repos/eSim/Ubuntu$ ./install-eSim.sh --install + Detected Ubuntu Version: 25.04 + Unsupported Ubuntu version: 25.04 (25.04) + +commit hash : 6c023bce474449a5247918d7385c4ca5ec3822b2 + +---------------------------------------- + +bug #002 : 25.04 unsupported version + +log : user@Ubuntu-25:~/repos/eSim/Ubuntu$ ./install-eSim.sh --install + Detected Ubuntu Version: 25.04 + Unsupported Ubuntu version: 25.04 (25.04) + +remark : the script "install-eSim.sh" doesn't support 25.04, support only for 22.04, 23.04 and 24.04. + +solution : added support for 25.04 with if statement addition in "install-eSim.sh" to run install-eSim-25.04.sh script for 25.04 version. + +changes made : file : "install-eSim.sh" + + before : case $VERSION_ID in + "22.04") + if [[ "$FULL_VERSION" == "22.04.4" ]]; then + SCRIPT="$SCRIPT_DIR/install-eSim-22.04.sh" + else + SCRIPT="$SCRIPT_DIR/install-eSim-23.04.sh" + fi + ;; + "23.04") + SCRIPT="$SCRIPT_DIR/install-eSim-23.04.sh" + ;; + "24.04") + SCRIPT="$SCRIPT_DIR/install-eSim-24.04.sh" + ;; + *) + echo "Unsupported Ubuntu version: $VERSION_ID ($FULL_VERSION)" + exit 1 + ;; + esac + + after : case $VERSION_ID in + "22.04") + if [[ "$FULL_VERSION" == "22.04.4" ]]; then + SCRIPT="$SCRIPT_DIR/install-eSim-22.04.sh" + else + SCRIPT="$SCRIPT_DIR/install-eSim-23.04.sh" + fi + ;; + "23.04") + SCRIPT="$SCRIPT_DIR/install-eSim-23.04.sh" + ;; + "24.04") + 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 + +log (after change) : user@Ubuntu-25:~/repos/eSim/Ubuntu$ ./install-eSim.sh --install + Detected Ubuntu Version: 25.04 + Installation script not found: /home/user/repos/eSim/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh + +commit hash : 297f89f9e29d18b69b20276dcac5cc7baaac16f0 + +----------------------------------------- + +bug #003 : no script for 25.04 + +log : user@Ubuntu-25:~/repos/eSim/Ubuntu$ ./install-eSim.sh --install + Detected Ubuntu Version: 25.04 + Installation script not found: /home/user/repos/eSim/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh + +remark : no installation script for Ubuntu version 25.04 + +solution : copying script of 24.04 for 25.04 by renaming the file to install-eSim-25.04.sh and updated the version check in if statement from 24.04 to 25.04 whereever applicable + +changes made : file : (newFile)install-eSim-25.04.sh + + before : if [[ "$ubuntu_version" == "24.04" ]]; then + echo "Ubuntu 24.04 detected." + + after : if [[ "$ubuntu_version" == "25.04" ]]; then + echo "Ubuntu 25.04 detected." + +commit hash : c68082b841cfdce940b6a3254b3f3fa45d9ec9b7 + +-------------------------------------------- + +bug #004 : xz-utils installation failed, aborted installation + +log : E: Invalid operation xz-utils + + + Error! Kindly resolve above error(s) and try again. + + Aborting Installation... + +remark : invalid command for xz-utils installation + +solution : updating the sudo apt-get command for instllation of xz-utils + +changes made : file : "install-eSim-25.04.sh" + before : echo "Installing volare" + sudo apt-get xz-utils + pip3 install volare + + after : echo "Installing volare" + sudo apt-get install xz-utils -y xz-utils + pip3 install volare + +commit hash : ed1daffcf65cdab9474c7c1ee13028990b9f0e0e + +---------------------------------------------- + +bug #005 : stale CD-ROM repo reference, abort installation + +log : Err:2 file:/cdrom plucky Release + File not found - /cdrom/dists/plucky/Release (2: No such file or directory) + E: The repository 'file:/cdrom plucky Release' no longer has a Release file. + N: Updating from such a repository can't be done securely, and is therefore disabled by default. + N: See apt-secure(8) manpage for repository creation and user configuration details. + N: Some sources can be modernized. Run 'apt modernize-sources' to do so. + + Error! Kindly resolve above error(s) and try again. + + Aborting Installation... + +remark : stale CD-ROM repo reference which doesn't exist and installation abort on non critical errors + +solution : suppress "apt-get update" error while installation on non critical errors + +changes made : file : "install-eSim-25.04.sh" + before : 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 + + after : 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 || true + +commit hash : dbcb25b84a2c8e8b17b1fbbeb522888b9c78d9df + +--------------------------------------------------------- + bug #006 : KiCad libgit2 dependency mismatch log : Solving dependencies... Error! Some packages could not be installed. This may mean that you have @@ -397,6 +563,8 @@ changes made : sudo apt-get update commit hash : 5c7b88a1 +------------------------------------------------------------------------------- + bug #016 : file:///cdrom entry not disabled log : Updating apt index files................... Ign:1 file:/cdrom plucky InRelease @@ -1305,7 +1473,7 @@ commit hash : [To be filled after commit] ----------------------------------------------------------------------------------------- -bug #012 : Source Discovery Failure +bug #035 : Source Discovery Failure log : eSim desktop entry and launcher pointed to empty directories or failed to start. From 359557e9d2e966fef683a28ccbc70a14855cfbff Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar <174053987+Kalpesh-ops@users.noreply.github.com> Date: Tue, 3 Feb 2026 15:44:12 +0000 Subject: [PATCH 40/41] Fixed indexing in bug-report.txt --- Ubuntu/{bug.txt => bug-report.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Ubuntu/{bug.txt => bug-report.txt} (100%) diff --git a/Ubuntu/bug.txt b/Ubuntu/bug-report.txt similarity index 100% rename from Ubuntu/bug.txt rename to Ubuntu/bug-report.txt From 6bbb72af67744af5b61a6a9626da97a1a52c637c Mon Sep 17 00:00:00 2001 From: Kalpesh Parashar <174053987+Kalpesh-ops@users.noreply.github.com> Date: Tue, 3 Feb 2026 15:57:35 +0000 Subject: [PATCH 41/41] fixed indexing --- Ubuntu/bug-report.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Ubuntu/bug-report.txt b/Ubuntu/bug-report.txt index 92f567d10..9099bf766 100644 --- a/Ubuntu/bug-report.txt +++ b/Ubuntu/bug-report.txt @@ -1180,7 +1180,7 @@ commit hash : cf62465 --------------------------------------------------------------------------------- -bug #029 : LLVM 20.1.2 still unhandled +bug #030 : LLVM 20.1.2 still unhandled log : gcc (Ubuntu 14.2.0-19ubuntu2) 14.2.0 Copyright (C) 2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -1409,7 +1409,7 @@ commit message : Fix GHDL srcdir detection in NGHDL installer -------------------------------------------------------------------------------- -bug #034 : Incorrect eSim_Home Path in Startup Script +bug #035 : Incorrect eSim_Home Path in Startup Script log : user@Ubuntu-25:~/repos/eSim/Ubuntu$ esim Error: eSim application not found at /home/user/repos/eSim. Please install eSim source or packaged executable before running. @@ -1473,7 +1473,7 @@ commit hash : [To be filled after commit] ----------------------------------------------------------------------------------------- -bug #035 : Source Discovery Failure +bug #036 : Source Discovery Failure log : eSim desktop entry and launcher pointed to empty directories or failed to start.