diff --git a/Ubuntu/bug-report.txt b/Ubuntu/bug-report.txt new file mode 100644 index 000000000..9099bf766 --- /dev/null +++ b/Ubuntu/bug-report.txt @@ -0,0 +1,1489 @@ +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 +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 #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 +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 #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. + +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] + +----------------------------------------------------------------------------------------- + +bug #036 : 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] 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..803b5cc0b --- /dev/null +++ b/Ubuntu/install-eSim-scripts/install-eSim-25.04.sh @@ -0,0 +1,653 @@ +#!/bin/bash +#============================================================================= +# FILE: install-eSim.sh +# +# USAGE: ./install-eSim.sh --install +# OR +# ./install-eSim.sh --uninstall +# +# DESCRIPTION: Installation script for eSim EDA Suite +# +# OPTIONS: --- +# REQUIREMENTS: --- +# BUGS: --- +# NOTES: --- +# AUTHORS: Fahim Khan, Rahul Paknikar, Saurabh Bansode, +# Sumanto Kar, Partha Singha Roy, Harsha Narayana P, +# Jayanth Tatineni, Anshul Verma +# ORGANIZATION: eSim Team, FOSSEE, IIT Bombay +# CREATED: Wednesday 15 July 2015 15:26 +# REVISION: Sunday 25 May 2025 17:40 +#============================================================================= + +# All variables goes here +script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +eSim_Home=$(cd "$script_dir/../.." && pwd) +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" +config_file="config.ini" +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..........................." + 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. + trap "" ERR + + 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" ]]; then + 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 + 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 + 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 + + 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 + + # 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" + use_kicad_ppa=true + + # 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 + + # 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." + return 0 + fi + fi + + else + kicadppa="kicad/kicad-6.0-releases" + fi + + # Check if the PPA is already added + 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 -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 + + # 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..................." + 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 + 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 " + 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 + + echo "Upgrading Pip.............................." + pip install --upgrade pip + + 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 + + echo "Installing Xterm..........................." + sudo apt-get install -y xterm + + echo "Installing Psutil.........................." + sudo apt-get install -y python3-psutil + + echo "Installing PyQt5..........................." + sudo apt-get install -y python3-pyqt5 + + echo "Installing Matplotlib......................" + sudo apt-get install -y python3-matplotlib + + echo "Installing Setuptools..................." + sudo apt-get install -y python3-setuptools + + # Install NgVeri Depedencies + echo "Installing Pip3............................" + sudo apt install -y python3-pip + + echo "Installing Watchdog........................" + pip3 install watchdog + + echo "Installing Hdlparse........................" + pip3 install --upgrade https://github.com/hdl/pyhdlparser/tarball/master + + echo "Installing Makerchip......................." + pip3 install makerchip-app + + echo "Installing SandPiper Saas.................." + pip3 install sandpiper-saas + + + echo "Installing Hdlparse......................" + pip3 install hdlparse + + echo "Installing matplotlib................" + pip3 install matplotlib + + echo "Installing PyQt5............." + pip3 install PyQt5 + + echo "Installing volare" + sudo apt-get install xz-utils -y xz-utils + pip3 install volare +} + + +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 + + 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 "$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 "$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 + if [ "$cleanup_tmp" = true ]; then + rm -rf kicadLibrary + fi + + 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 +{ + + local user_home="$HOME" + if [ -n "$SUDO_USER" ] && [ -d "/home/$SUDO_USER" ]; then + user_home="/home/$SUDO_USER" + fi + + local app_dir="" + local app_entry="" + local candidates=( + "$eSim_Home/src/frontEnd" + "$eSim_Home/src/FrontEnd" + "$eSim_Home/frontEnd" + "$eSim_Home" + ) + + for c in "${candidates[@]}"; do + if [ -f "$c/Application.py" ]; then + app_dir="$c" + break + fi + done + + if [ -z "$app_dir" ]; then + found=$(find "$eSim_Home" -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" + + # Generating new esim-start.sh + cat > esim-start.sh < 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=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 + 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 + mkdir -p "$user_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 (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" + + # 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 + 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 + +} + + +#################################################################### +# 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 + + 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 + copyKicadLibrary + installNghdl + createDesktopStartScript + if [ $? -ne 0 ];then + echo -e "\n\n\nERROR: Unable to install required packages. Please check your internet connection.\n\n" + exit 0 + fi + + echo "-----------------eSim Installed Successfully-----------------" + echo "Type \"esim\" in Terminal to launch it" + echo "or double click on \"eSim\" icon placed on Desktop" + + +elif [ $option == "--uninstall" ];then + echo -n "Are you sure? It will remove eSim completely including KiCad, Makerchip, NGHDL and SKY130 PDK along with their models and libraries (y/n):" + read getConfirmation + if [ $getConfirmation == "y" -o $getConfirmation == "Y" ];then + echo "Removing eSim............................" + sudo rm -rf $HOME/.esim $HOME/Desktop/esim.desktop /usr/bin/esim /usr/share/applications/esim.desktop + echo "Removing KiCad..........................." + sudo apt purge -y kicad kicad-footprints kicad-libraries kicad-symbols kicad-templates + sudo rm -rf /usr/share/kicad + sudo rm /etc/apt/sources.list.d/kicad* + rm -rf $HOME/.config/kicad/6.0 + + echo "Removing Virtual env......................." + sudo rm -r $config_dir/env + + echo "Removing SKY130 PDK......................" + sudo rm -R /usr/share/local/sky130_fd_pr + + echo "Removing NGHDL..........................." + rm -rf library/modelParamXML/Nghdl/* + rm -rf library/modelParamXML/Ngveri/* + cd nghdl/ + if [ $? -eq 0 ];then + chmod +x install-nghdl.sh + ./install-nghdl.sh --uninstall + cd ../ + rm -rf nghdl + if [ $? -eq 0 ];then + echo -e "----------------eSim Uninstalled Successfully----------------" + else + echo -e "\nError while removing some files/directories in \"nghdl\". Please remove it manually" + fi + else + echo -e "\nCannot find \"nghdl\" directory. Please remove it manually" + fi + elif [ $getConfirmation == "n" -o $getConfirmation == "N" ];then + exit 0 + else + echo "Please select the right option." + exit 0 + fi + +else + echo "Please select the proper operation." + echo "--install" + echo "--uninstall" +fi diff --git a/Ubuntu/install-eSim.sh b/Ubuntu/install-eSim.sh index ab8e90082..73cb3470d 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" } @@ -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 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 100755 index 000000000..51081f302 --- /dev/null +++ b/Ubuntu/nghdl/install-nghdl-scripts/install-nghdl-25.04.sh @@ -0,0 +1,327 @@ +#!/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" +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)" +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-gtk3-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................................." + 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 "$src_dir/$ghdl/" + 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 + 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 + + # 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 +{ + + 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 + 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 100755 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