Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
412 changes: 206 additions & 206 deletions library/kicadLibrary/template/sym-lib-table

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions patches/0001-src-ngspice-ghdl-Use-non-native-file-browser.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
From 482bf8451ec913e8dd88851c0e6907abe0f5a9b8 Mon Sep 17 00:00:00 2001
From: Aishwarya Sinha <[email protected]>
Date: Sun, 10 Aug 2025 14:23:34 +0530
Subject: [PATCH] src: ngspice-ghdl: Use non-native file browser

Native file browser is not working properly
with snap app. So temporarily we can use qt-based
file browser

Signed-off-by: Aishwarya Sinha <[email protected]>
---
src/ngspice_ghdl.py | 2 ++
1 file changed, 2 insertions(+)

diff --git a/src/ngspice_ghdl.py b/src/ngspice_ghdl.py
index 663c491..6e350ed 100755
--- a/src/ngspice_ghdl.py
+++ b/src/ngspice_ghdl.py
@@ -431,6 +431,8 @@ class FileRemover(QtWidgets.QWidget):


def main():
+ # Set non-native dialogs globally
+ QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_DontUseNativeDialogs, True)
app = QtWidgets.QApplication(sys.argv)
if len(sys.argv) > 1:
if sys.argv[1] == '-e':
--
2.50.1

2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cycler==0.12.1
entrypoints==0.3
flake8==3.7.7
fonttools==4.57.0
hdlparse==1.0.4
https://github.com/aishw31/hdlparse/tarball/python3compat
importlib_resources==6.4.5
kiwisolver==1.4.7
matplotlib==3.7.5
Expand Down
13 changes: 13 additions & 0 deletions scripts/launcher-esim.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
# Launcher script for testapp, ensuring proper Python and Qt environment
export PYTHONPATH=$HOME/eSim/src:$SNAP/usr/lib/python3/dist-packages:$SNAP/lib/python3.10/site-packages:$PYTHONPATH
export QT_LOGGING_RULES="qt5.*=false" # Suppress Qt debug output (optional, remove for debugging)
# Force Qt to use non-native dialogs
# export QT_QPA_PLATFORMTHEME: "" # Disable platform theme integration
# export QT_FILE_DIALOG_NON_NATIVE: "1" # Force non-native dialogs
# export QT_QPA_MENUBAR_NO_NATIVE: "1" # Disable native menu bar
# export QT_SYSTEM_TRAY_DISABLED: "1" # Disable system tray integration
$SNAP/usr/bin/setup-esim.sh
cd $SNAP/eSim/src/frontEnd
# Run the Python application
exec python3 ./Application.py "$@"
25 changes: 25 additions & 0 deletions scripts/launcher.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh

# Versions 7.90.x and later seems to not work correctly under Wayland.
# That's why we force X11 backend with this script.
# GDK_BACKEND=x11 $1
# Setup KiCad 6.0 eSim libraries — only once per user
TARGET="$HOME/.local/kicad/6.0"
FLAG="$TARGET/.esim_kicad_setup_done"

if [ ! -f "$FLAG" ]; then
echo "Setting up eSim libraries for the first time..."

# install -d "$TARGET/symbols"
install -d "$TARGET/template"

# cp -r "$SNAP/3rdparty/symbols/." "$TARGET/symbols/"
cp "$SNAP/3rdparty/template/sym-lib-table" "$TARGET/template/"

touch "$FLAG"
echo "eSim libraries setup completed."
else
echo "eSim libraries already set up."
fi
# we are using version 6
exec "$1" "$2"
7 changes: 7 additions & 0 deletions scripts/nghdl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

# Set PYTHONPATH so relative imports in ngspice_ghdl.py work
export PYTHONPATH=$SNAP/nghdl/src:$PYTHONPATH

# Execute the main script with Python
exec python3 $SNAP/nghdl/src/ngspice_ghdl.py "$@"
62 changes: 62 additions & 0 deletions scripts/setup-esim.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/usr/bin/bash
config_dir_esim="$HOME/.esim"
config_dir_nghdl="$HOME/.nghdl"

config_file="config.ini"
eSim_HOME="$SNAP/eSim"
NGHDL_HOME="$SNAP/nghdl-simulator"

# Setup KiCad 6.0 eSim libraries
TARGET="$HOME/.local/kicad/6.0"
FLAG="$TARGET/.esim_kicad_setup_done"


# eSim Configuration

if [ ! -d "$config_dir_esim/.setup_done" ]; then
mkdir -p $config_dir_esim

echo "[eSim]" > $config_dir_esim/$config_file
echo "eSim_HOME = $eSim_Home" >> $config_dir_esim/$config_file
echo "LICENSE = %(eSim_HOME)s/LICENSE" >> $config_dir_esim/$config_file
echo "KicadLib = %(eSim_HOME)s/library/kicadLibrary.tar.xz" >> $config_dir_esim/$config_file
echo "IMAGES = %(eSim_HOME)s/images" >> $config_dir_esim/$config_file
echo "VERSION = %(eSim_HOME)s/VERSION" >> $config_dir_esim/$config_file
echo "MODELICA_MAP_JSON = %(eSim_HOME)s/library/ngspicetoModelica/Mapping.json" >> $config_dir_esim/$config_file

touch "$config_dir_esim/.setup_done"

fi


# nghdl configuration

if [ ! -d $config_dir_nghdl/.setup_done ]; then
mkdir -p $config_dir_nghdl

echo "[NGHDL]" > $config_dir_nghdl/$config_file
echo "NGHDL_HOME = $NGHDL_HOME" >> $config_dir_nghdl/$config_file
echo "DIGITAL_MODEL = %(NGHDL_HOME)s/src/xspice/icm" >> $config_dir_nghdl/$config_file
echo "RELEASE = %(NGHDL_HOME)s/release" >> $config_dir_nghdl/$config_file
echo "[SRC]" >> $config_dir_nghdl/$config_file
echo "SRC_HOME = $NGHDL_HOME" >> $config_dir_nghdl/$config_file
echo "LICENSE = %(SRC_HOME)s/LICENSE" >> $config_dir_nghdl/$config_file

touch $config_dir_nghdl/.setup_done

fi

if [ ! -f "$FLAG" ]; then
echo "Setting up eSim libraries for the first time..."

# install -d "$TARGET/symbols"
install -d "$TARGET/template"

# cp -r "$SNAP/3rdparty/symbols/." "$TARGET/symbols/"
cp "$SNAP/3rdparty/template/sym-lib-table" "$TARGET/template/"

touch "$FLAG"
echo "eSim libraries setup completed."
else
echo "eSim libraries already set up."
fi
Loading