From 3be08e41ac75ef07bd2e1869afc51d0831069163 Mon Sep 17 00:00:00 2001 From: Bladen Martin Date: Fri, 17 Jul 2020 00:20:44 +0530 Subject: include NGHDL --- Windows/esim-setup-script.nsi | 73 +++++++++++++++++++++++++++++-------------- 1 file changed, 50 insertions(+), 23 deletions(-) diff --git a/Windows/esim-setup-script.nsi b/Windows/esim-setup-script.nsi index 87f54bee..fe79c1c5 100644 --- a/Windows/esim-setup-script.nsi +++ b/Windows/esim-setup-script.nsi @@ -8,7 +8,6 @@ !include "MUI2.nsh" !include "ZipDLL.nsh" - !include "EnvVarUpdate.nsh" !include "x64.nsh" ;-------------------------------- @@ -169,18 +168,14 @@ Section -NgspiceSim SetOutPath "$EXEDIR" - File "spice.zip" File "eSim.zip" File "logo.ico" SetOutPath "$INSTDIR" ;ADD YOUR OWN FILES HERE... - ZipDLL::extractall "$EXEDIR\spice.zip" "$INSTDIR\" ZipDLL::extractall "$EXEDIR\eSim.zip" "$INSTDIR\" - ;Setting Env Variable for Ngspice - ${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$INSTDIR\spice\bin" ;Copying Folder to install directory SetOutPath "$INSTDIR\eSim" @@ -208,19 +203,20 @@ Section -NgspiceSim ;create desktop shortcut CreateShortCut "$PROFILE\..\Public\Desktop\eSim.lnk" "$INSTDIR\eSim\eSim" "" "$PROFILE\.esim\logo.ico" "" SW_SHOWMINIMIZED + !insertmacro MUI_STARTMENU_WRITE_END + ;Remove not required files - Delete "$EXEDIR\spice.zip" Delete "$EXEDIR\eSim.zip" Delete "$EXEDIR\logo.ico" - !insertmacro MUI_STARTMENU_WRITE_END + SectionEnd Section -InstallKiCad - SetOutPath "$EXEDIR" + ; SetOutPath "$EXEDIR" File "kicad-4.0.7-i686.exe" SetOutPath "$INSTDIR" @@ -233,15 +229,18 @@ Section -InstallKiCad Goto endActiveSync endActiveSync: - ;Remove not required files - Delete "$EXEDIR\kicad-4.0.7-i686.exe" - Delete "$PROFILE\..\Public\Desktop\KiCad.lnk" + ;Remove not required files + Delete "$EXEDIR\kicad-4.0.7-i686.exe" + Delete "$PROFILE\..\Public\Desktop\KiCad.lnk" - ${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$INSTDIR\KiCad\bin" + EnVar::SetHKLM + EnVar::AddValue "Path" "$INSTDIR\KiCad\bin" + Pop $0 + DetailPrint "EnVar::AddValue returned=|$0|" ZipDLL::extractall "$INSTDIR\eSim\library\kicadLibrary.zip" "$INSTDIR\eSim\library\" - ;CopyFiles "$INSTDIR\eSim\library\kicadLibrary\library\*" "$INSTDIR\KiCad\share\kicad\library\" + CopyFiles "$INSTDIR\eSim\library\kicadLibrary\library\*" "$INSTDIR\KiCad\share\kicad\library\" ;Copy KiCad library made for eSim CopyFiles "$INSTDIR\eSim\library\kicadLibrary\kicad_eSim-Library\*" "$INSTDIR\KiCad\share\kicad\library\" @@ -266,7 +265,7 @@ Section -InstallKiCad RMDir /r "$INSTDIR\eSim\library\kicadLibrary" SectionEnd - + Section -AdditionalIcons @@ -276,6 +275,7 @@ Section -AdditionalIcons SectionEnd +!include "installnghdl.nsi" Section -Post @@ -300,14 +300,48 @@ FunctionEnd Section Uninstall + ; Set to HKLM + EnVar::SetHKLM + + GetFullPathName $1 $INSTDIR\..\eSim\nghdl\src + EnVar::DeleteValue "Path" $1 + Pop $0 + DetailPrint "EnVar::AddValue returned=|$0|" + + GetFullPathName $1 $INSTDIR\..\mingw64\bin + EnVar::DeleteValue "Path" $1 + Pop $0 + DetailPrint "EnVar::AddValue returned=|$0|" + + GetFullPathName $1 $INSTDIR\..\mingw64\msys\bin + EnVar::DeleteValue "Path" $1 + Pop $0 + DetailPrint "EnVar::AddValue returned=|$0|" + + GetFullPathName $1 $INSTDIR\..\mingw64\GHDL\bin + EnVar::DeleteValue "Path" $1 + Pop $0 + DetailPrint "EnVar::AddValue returned=|$0|" + + GetFullPathName $1 $INSTDIR\..\ngspice-nghdl\install_dir\bin + EnVar::DeleteValue "Path" $1 + Pop $0 + DetailPrint "EnVar::AddValue returned=|$0|" + + RMDir /r "$INSTDIR\..\mingw64" + RMDir /r "$INSTDIR\..\ngspice-nghdl" + RMDir /r "$INSTDIR\..\eSim\nghdl" + ;Note that in uninstaller code, $INSTDIR contains the directory where the uninstaller lies Delete "$INSTDIR\uninst-eSim.exe" Delete "$SMPROGRAMS\eSim\Uninstall.lnk" ;Removing Env Variable for KiCad - GetFullPathName $0 $INSTDIR\..\KiCad\bin - ${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" $0 + GetFullPathName $1 $INSTDIR\..\KiCad\bin + EnVar::DeleteValue "Path" $1 + Pop $0 + DetailPrint "EnVar::AddValue returned=|$0|" ;Remove KiCad config RMDir /r "$PROFILE\AppData\Roaming\kicad" @@ -318,13 +352,6 @@ Section Uninstall Goto endActiveSync endActiveSync: - ;Removing Env Variable for Ngspice - GetFullPathName $0 $INSTDIR\..\spice\bin - ${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" $0 - - ;Removing Ngspice - RMDir /r "$INSTDIR\..\spice" - ;Removing eSim RMDir /r "$PROFILE\.esim" RMDir "$SMPROGRAMS\eSim" -- cgit From 76cbadc71587f8047e118f5e7a932221f083cb73 Mon Sep 17 00:00:00 2001 From: Bladen Martin Date: Mon, 20 Jul 2020 15:17:30 +0530 Subject: added NGHDL and reduced KiCad --- Windows/esim-setup-script.nsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Windows/esim-setup-script.nsi b/Windows/esim-setup-script.nsi index fe79c1c5..15203e31 100644 --- a/Windows/esim-setup-script.nsi +++ b/Windows/esim-setup-script.nsi @@ -216,7 +216,7 @@ SectionEnd Section -InstallKiCad - ; SetOutPath "$EXEDIR" + SetOutPath "$EXEDIR" File "kicad-4.0.7-i686.exe" SetOutPath "$INSTDIR" @@ -240,7 +240,7 @@ Section -InstallKiCad ZipDLL::extractall "$INSTDIR\eSim\library\kicadLibrary.zip" "$INSTDIR\eSim\library\" - CopyFiles "$INSTDIR\eSim\library\kicadLibrary\library\*" "$INSTDIR\KiCad\share\kicad\library\" + ;CopyFiles "$INSTDIR\eSim\library\kicadLibrary\library\*" "$INSTDIR\KiCad\share\kicad\library\" ;Copy KiCad library made for eSim CopyFiles "$INSTDIR\eSim\library\kicadLibrary\kicad_eSim-Library\*" "$INSTDIR\KiCad\share\kicad\library\" @@ -339,7 +339,7 @@ Section Uninstall ;Removing Env Variable for KiCad GetFullPathName $1 $INSTDIR\..\KiCad\bin - EnVar::DeleteValue "Path" $1 + EnVar::DeleteValue "Path" $1 Pop $0 DetailPrint "EnVar::AddValue returned=|$0|" @@ -374,4 +374,4 @@ SectionEnd ;!insertmacro MUI_DESCRIPTION_TEXT ${NgspiceSim} $(DESC_NgspiceSim) ;!insertmacro MUI_FUNCTION_DESCRIPTION_END -;-------------------------------- \ No newline at end of file +;-------------------------------- -- cgit From bde6b19ddd3a508947b6ff93c2fa1f4afb63a0b1 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Wed, 22 Jul 2020 00:56:00 +0530 Subject: added exit on error option --- Debian/install-eSim.sh | 93 +++++++++++++++++++++++++++----------------------- 1 file changed, 50 insertions(+), 43 deletions(-) diff --git a/Debian/install-eSim.sh b/Debian/install-eSim.sh index 53a265c1..f00e519e 100755 --- a/Debian/install-eSim.sh +++ b/Debian/install-eSim.sh @@ -1,22 +1,37 @@ -# !/bin/bash -# =============================================================================== +#!/bin/bash +#=============================================================================== # FILE: install-eSim.sh # # USAGE: ./install-eSim.sh --install # OR # ./install-eSim.sh --uninstall # -# DESCRIPTION: This is installation/uninstallation script for eSim +# DESCRIPTION: Installation script for eSim EDA Suite # # OPTIONS: --- # REQUIREMENTS: --- # BUGS: --- # NOTES: --- # AUTHOR: Fahim Khan, Rahul Paknikar, Saurabh Bansode -# ORGANIZATION: FOSSEE at IIT Bombay. -# CREATED: Wednesday 01 April 2020 16:14 -# REVISION: --- -# =============================================================================== +# ORGANIZATION: eSim Team, FOSSEE, IIT Bombay +# CREATED: Wednesday 15 July 2015 15:26 +# REVISION: Monday 20 July 2020 23:26 +#=============================================================================== + +set -e # Set exit option immediately on error + +error_exit() { + echo -e "\n\nError! Kindly resolve above errors and try again." + echo -e "\nAborting Installation......\n" +} + +error_skip() { + echo -e "\n\nWarning! Skipping over this error......\n" +} + +# Trap on function error_exit before exiting on error +trap error_exit ERR + # All variables goes here config_dir="$HOME/.esim" @@ -56,15 +71,17 @@ function installNghdl mv nghdl-master nghdl cd nghdl/ chmod +x install-nghdl.sh - ./install-nghdl.sh --install + + # Do not trap to any function on errors. Let NGHDL script handle its own errors. + trap "" ERR + + ./install-nghdl.sh --install # Install NGHDL - if [ $? -ne 0 ];then - echo -e "\n\nERROR: cannot install NGHDL\n\n" - exit 0 - else - ngspiceFlag=1 - cd .. - fi + # Set trap again to error_exit function to exit on errors + trap error_exit ERR + + ngspiceFlag=1 + cd .. } @@ -95,38 +112,15 @@ function installDependency echo "Installing Xterm..........................." sudo apt-get install -y xterm - if [ $? -ne 0 ]; then - echo -e "\n\n\"Xterm\" dependency couldn't be installed.\nKindly resolve above errors and try again." - exit 1 - fi echo "Installing PyQt4..........................." sudo apt-get install -y python3-pyqt4 - if [ $? -ne 0 ]; then - echo -e "\n\n\"PyQt4\" dependency couldn't be installed.\nKindly resolve above errors and try again." - exit 1 - fi echo "Installing Matplotlib......................" sudo apt-get install -y python3-matplotlib - if [ $? -ne 0 ]; then - echo -e "\n\n\"Matplotlib\" dependency couldn't be installed.\nKindly resolve above errors and try again." - exit 1 - fi - - echo "Installing Xpdf............................" - sudo apt-get install -y xpdf - if [ $? -ne 0 ]; then - echo -e "\n\n\"Xpdf\" dependency couldn't be installed.\nKindly resolve above errors and try again." - exit 1 - fi echo "Installing KiCad..........................." sudo apt install -y --no-install-recommends kicad - if [ $? -ne 0 ]; then - echo -e "\n\n\"KiCad\" dependency couldn't be installed.\nKindly resolve above errors and try again." - exit 1 - fi } @@ -135,10 +129,10 @@ function copyKicadLibrary { if [ -f ~/.config/kicad ];then - echo "kicad folder already exists" + echo "kicad folder already exists" else - echo ".config/kicad does not exist" - mkdir ~/.config/kicad + echo ".config/kicad does not exist" + mkdir ~/.config/kicad fi # Dump KiCad config path @@ -175,9 +169,15 @@ function copyKicadLibrary sudo cp -rv kicadLibrary/template/kicad.pro ${KICAD_PRO} fi - #remove extracted KiCad Library - not needed anymore + set +e # Temporary disable exit on error + trap error_skip ERR + + # 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/library/ @@ -222,8 +222,11 @@ function createDesktopStartScript # Copy desktop icon file to Desktop cp -vp esim.desktop $HOME/Desktop/ + set +e # Temporary disable exit on error + trap error_skip ERR + # Check if the target OS is Ubuntu 18 or not - if [[ $(lsb_release -rs) == 18.* ]]; then + if [[ $(lsb_release -rs) == [[18.*] || [20.*]] ]]; then # Make esim.desktop file as trusted application gio set $HOME/Desktop/esim.desktop "metadata::trusted" yes # Restart nautilus-desktop, so that the changes take effect @@ -232,6 +235,10 @@ function createDesktopStartScript # 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 -- cgit From 207fa5ba56613331d605700b9bab9e87bf6bb94f Mon Sep 17 00:00:00 2001 From: Bladen Martin Date: Fri, 31 Jul 2020 11:13:03 +0530 Subject: Changes to be made when eSim version changes --- eSimVersionChange.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 eSimVersionChange.md diff --git a/eSimVersionChange.md b/eSimVersionChange.md new file mode 100644 index 00000000..cd43d36b --- /dev/null +++ b/eSimVersionChange.md @@ -0,0 +1,39 @@ +# Changes when eSim version is updated + +1. master/VERSION\ +- Change the version number + +2. master/conf.py\ +- Update `release` variable + +3. master/setup.py\ +- Update `version` field in `setup` function + +4. User manual +- Update user manual filename as `eSim_Manual_y.x.pdf` where y.x is the updated version. +- Update path in the following line at `master/src/browser/UserManual.py` with the updated manual name +```python + file = os.path.realpath('library/browser/User-Manual/eSim_Manual_2.0.pdf') +``` + +5. master/src/configuration/Appconfig.py\ +- In function `def __init__ (self)` , update the variable `sel._VERSION` + +6. master/INSTALL\ +- Update the installer file names according to the latest version + +7. installers/Windows/esim-setup-script.nsi\ +- Update the following lines in the script +```nsi +- !define PRODUCT_VERSION "y.x" +- !define VERSION "a.b.c.d" + +- OutFile "eSim-y.x_install.exe" +``` + +8. master/README.md +- Update new features, OS support and other chnages that were made in the new version. + + + + -- cgit From b4f6a50446bd7e75fdbe11af6f934618b35d495e Mon Sep 17 00:00:00 2001 From: Bladen Martin Date: Fri, 31 Jul 2020 23:30:10 +0530 Subject: 7z for increased compression --- Windows/esim-setup-script.nsi | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Windows/esim-setup-script.nsi b/Windows/esim-setup-script.nsi index 15203e31..daaf4cc1 100644 --- a/Windows/esim-setup-script.nsi +++ b/Windows/esim-setup-script.nsi @@ -168,13 +168,13 @@ Section -NgspiceSim SetOutPath "$EXEDIR" - File "eSim.zip" + File "eSim.7z" File "logo.ico" SetOutPath "$INSTDIR" - ;ADD YOUR OWN FILES HERE... - ZipDLL::extractall "$EXEDIR\eSim.zip" "$INSTDIR\" + ;ADD YOUR OWN FILES HERE... + Nsis7z::ExtractWithDetails "$EXEDIR\eSim.7z" "Extracting eSim %s..." ;Copying Folder to install directory @@ -206,7 +206,7 @@ Section -NgspiceSim !insertmacro MUI_STARTMENU_WRITE_END ;Remove not required files - Delete "$EXEDIR\eSim.zip" + Delete "$EXEDIR\eSim.7z" Delete "$EXEDIR\logo.ico" @@ -339,7 +339,7 @@ Section Uninstall ;Removing Env Variable for KiCad GetFullPathName $1 $INSTDIR\..\KiCad\bin - EnVar::DeleteValue "Path" $1 + EnVar::DeleteValue "Path" $1 Pop $0 DetailPrint "EnVar::AddValue returned=|$0|" @@ -356,6 +356,7 @@ Section Uninstall RMDir /r "$PROFILE\.esim" RMDir "$SMPROGRAMS\eSim" RMDir /r "$INSTDIR\..\eSim" + RMDir /r "$INSTDIR\..\KiCad" Delete "$PROFILE\..\Public\Desktop\eSim.lnk" DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" @@ -374,4 +375,4 @@ SectionEnd ;!insertmacro MUI_DESCRIPTION_TEXT ${NgspiceSim} $(DESC_NgspiceSim) ;!insertmacro MUI_FUNCTION_DESCRIPTION_END -;-------------------------------- +;-------------------------------- \ No newline at end of file -- cgit From 3efe3ade5c88e5c84174a92ff1e328de7bdfa979 Mon Sep 17 00:00:00 2001 From: Bladen Martin Date: Sat, 1 Aug 2020 11:33:09 +0530 Subject: Update eSimVersionChange.md --- eSimVersionChange.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eSimVersionChange.md b/eSimVersionChange.md index cd43d36b..bb7c1b86 100644 --- a/eSimVersionChange.md +++ b/eSimVersionChange.md @@ -1,4 +1,4 @@ -# Changes when eSim version is updated +# Changes to be made when eSim version is updated 1. master/VERSION\ - Change the version number -- cgit From 23e13dcfb7d8654f5d274c6a9c51b6529d58b057 Mon Sep 17 00:00:00 2001 From: Bladen Martin Date: Sat, 1 Aug 2020 11:33:48 +0530 Subject: Update eSimVersionChange.md --- eSimVersionChange.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eSimVersionChange.md b/eSimVersionChange.md index bb7c1b86..3c119663 100644 --- a/eSimVersionChange.md +++ b/eSimVersionChange.md @@ -32,7 +32,7 @@ ``` 8. master/README.md -- Update new features, OS support and other chnages that were made in the new version. +- Update new features, OS support and other changes that were made in the new version. -- cgit From c02e53ae257d289f535ab11217d7b774d89f385d Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Mon, 3 Aug 2020 17:24:13 +0530 Subject: resolved issue with grep error flag; replaced pyqt4 installation with pyqt5 --- Debian/install-eSim.sh | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/Debian/install-eSim.sh b/Debian/install-eSim.sh index f00e519e..811e2d19 100755 --- a/Debian/install-eSim.sh +++ b/Debian/install-eSim.sh @@ -15,18 +15,15 @@ # AUTHOR: Fahim Khan, Rahul Paknikar, Saurabh Bansode # ORGANIZATION: eSim Team, FOSSEE, IIT Bombay # CREATED: Wednesday 15 July 2015 15:26 -# REVISION: Monday 20 July 2020 23:26 +# REVISION: Sunday 02 August 2020 01:26 #=============================================================================== set -e # Set exit option immediately on error +set -E # inherit ERR trap by shell functions error_exit() { - echo -e "\n\nError! Kindly resolve above errors and try again." - echo -e "\nAborting Installation......\n" -} - -error_skip() { - echo -e "\n\nWarning! Skipping over this error......\n" + echo -e "\n\nError! Kindly resolve above error(s) and try again." + echo -e "\nAborting Installation...\n" } # Trap on function error_exit before exiting on error @@ -72,8 +69,8 @@ function installNghdl cd nghdl/ chmod +x install-nghdl.sh - # Do not trap to any function on errors. Let NGHDL script handle its own errors. - trap "" ERR + # Do not trap on error of any command. Let NGHDL script handle its own errors. + trap "" ERR ./install-nghdl.sh --install # Install NGHDL @@ -91,9 +88,8 @@ function addKicadPPA #sudo add-apt-repository ppa:js-reynaud/ppa-kicad kicadppa="reynaud/kicad-4" - grep -h "^deb.*$kicadppa*" /etc/apt/sources.list.d/* > /dev/null 2>&1 - if [ $? -ne 0 ] - then + findppa=$(grep -h -r "^deb.*$kicadppa*" /etc/apt/sources.list* > /dev/null 2>&1 || test $? = 1) + if [ -z "$findppa" ]; then echo "Adding KiCad-4 PPA to local apt-repository" sudo add-apt-repository --yes ppa:js-reynaud/kicad-4 else @@ -113,8 +109,8 @@ function installDependency echo "Installing Xterm..........................." sudo apt-get install -y xterm - echo "Installing PyQt4..........................." - sudo apt-get install -y python3-pyqt4 + echo "Installing PyQt5..........................." + sudo apt-get install -y python3-pyqt5 echo "Installing Matplotlib......................" sudo apt-get install -y python3-matplotlib @@ -128,7 +124,7 @@ function installDependency function copyKicadLibrary { - if [ -f ~/.config/kicad ];then + if [ -d ~/.config/kicad ];then echo "kicad folder already exists" else echo ".config/kicad does not exist" @@ -170,7 +166,7 @@ function copyKicadLibrary fi set +e # Temporary disable exit on error - trap error_skip ERR + trap "" ERR # Do not trap on error of any command # Remove extracted KiCad Library - not needed anymore rm -rf kicadLibrary @@ -223,7 +219,7 @@ function createDesktopStartScript cp -vp esim.desktop $HOME/Desktop/ set +e # Temporary disable exit on error - trap error_skip ERR + trap "" ERR # Do not trap on error of any command # Check if the target OS is Ubuntu 18 or not if [[ $(lsb_release -rs) == [[18.*] || [20.*]] ]]; then @@ -331,7 +327,7 @@ if [ $option == "--install" ];then elif [ $option == "--uninstall" ];then - echo -n "Are you sure? It will remove complete eSim including KiCad, Ngspice and NGHDL models and libraries (y/n):" + echo -n "Are you sure? It will remove eSim completely including KiCad, Ngspice and NGHDL along with their models and libraries (y/n):" read getConfirmation if [ $getConfirmation == "y" -o $getConfirmation == "Y" ];then echo "Removing eSim............................" @@ -360,7 +356,7 @@ elif [ $option == "--uninstall" ];then elif [ $getConfirmation == "n" -o $getConfirmation == "N" ];then exit 0 else - echo "Please select the right option" + echo "Please select the right option." exit 0 fi -- cgit From c883e34d1943ed6b354757a36a601c2dce591d85 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Mon, 3 Aug 2020 17:26:35 +0530 Subject: added support for Ubuntu 20.04 --- Debian/install-eSim.sh | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/Debian/install-eSim.sh b/Debian/install-eSim.sh index 811e2d19..3fabb61f 100755 --- a/Debian/install-eSim.sh +++ b/Debian/install-eSim.sh @@ -64,8 +64,7 @@ function installNghdl { echo "Installing NGHDL..........................." - unzip nghdl-master.zip - mv nghdl-master nghdl + unzip -o nghdl.zip cd nghdl/ chmod +x install-nghdl.sh @@ -91,7 +90,16 @@ function addKicadPPA findppa=$(grep -h -r "^deb.*$kicadppa*" /etc/apt/sources.list* > /dev/null 2>&1 || test $? = 1) if [ -z "$findppa" ]; then echo "Adding KiCad-4 PPA to local apt-repository" - sudo add-apt-repository --yes ppa:js-reynaud/kicad-4 + if [[ $(lsb_release -rs) == 20.* ]]; then + sudo add-apt-repository --yes "deb http://ppa.launchpad.net/js-reynaud/kicad-4/ubuntu bionic main" + sudo touch /etc/apt/preferences.d/preferences + echo "Package: kicad" | sudo tee -a /etc/apt/preferences.d/preferences > /dev/null + echo "Pin: version 4.0.7*" | sudo tee -a /etc/apt/preferences.d/preferences > /dev/null + echo "Pin-Priority: 501" | sudo tee -a /etc/apt/preferences.d/preferences > /dev/null + sudo add-apt-repository --yes "deb http://in.archive.ubuntu.com/ubuntu/ bionic main universe" + else + sudo add-apt-repository --yes ppa:js-reynaud/kicad-4 + fi else echo "KiCad-4 is available in synaptic" fi @@ -115,8 +123,16 @@ function installDependency echo "Installing Matplotlib......................" sudo apt-get install -y python3-matplotlib + if [[ $(lsb_release -rs) != 16.* ]]; then + echo "Installing Distutils......................." + sudo apt-get install python3-distutils + fi + echo "Installing KiCad..........................." - sudo apt install -y --no-install-recommends kicad + sudo apt-get install -y --no-install-recommends kicad + if [[ $(lsb_release -rs) == 20.* ]]; then + sudo add-apt-repository -r "deb http://in.archive.ubuntu.com/ubuntu/ bionic main universe" + fi } @@ -222,7 +238,7 @@ function createDesktopStartScript trap "" ERR # Do not trap on error of any command # Check if the target OS is Ubuntu 18 or not - if [[ $(lsb_release -rs) == [[18.*] || [20.*]] ]]; then + if [[ $(lsb_release -rs) == 18.* || $(lsb_release -rs) == 20.* ]]; then # Make esim.desktop file as trusted application gio set $HOME/Desktop/esim.desktop "metadata::trusted" yes # Restart nautilus-desktop, so that the changes take effect @@ -336,7 +352,12 @@ elif [ $option == "--uninstall" ];then sudo apt purge -y kicad sudo rm -rf /usr/share/kicad sudo rm -rf $HOME/.config/kicad - rm -f $eSim_Home/library/supportFiles/kicad_config_path.txt + rm -f $eSim_Home/library/supportFiles/kicad_config_path.txt + + if [[ $(lsb_release -rs) == 20.* ]]; then + sudo sed -i '/Package: kicad/{:label;N;/Pin-Priority: 501/!blabel};/Pin: version 4.0.7*/d' /etc/apt/preferences.d/preferences + fi + echo "Removing NGHDL..........................." rm -rf library/modelParamXML/Nghdl/* cd nghdl/ -- cgit From aae467621d6a9ff255235cd50710d793363f7faa Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Mon, 3 Aug 2020 17:29:40 +0530 Subject: esim desktop file as share application with auto permission and excute file modes --- Debian/install-eSim.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Debian/install-eSim.sh b/Debian/install-eSim.sh index 3fabb61f..74d59992 100755 --- a/Debian/install-eSim.sh +++ b/Debian/install-eSim.sh @@ -212,10 +212,9 @@ function createDesktopStartScript # Generating esim.desktop file echo "[Desktop Entry]" > esim.desktop - getVersion=`tail -1 VERSION` - echo "Version=$getVersion" >> esim.desktop + echo "Version=1.0" >> esim.desktop echo "Name=eSim" >> esim.desktop - echo "Comment=EDA Tools" >> 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 @@ -227,10 +226,11 @@ function createDesktopStartScript 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 - echo "Actions=NewWindow;NewPrivateWindow;" >> 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/ @@ -240,9 +240,9 @@ function createDesktopStartScript # Check if the target OS is Ubuntu 18 or not if [[ $(lsb_release -rs) == 18.* || $(lsb_release -rs) == 20.* ]]; then # Make esim.desktop file as trusted application - gio set $HOME/Desktop/esim.desktop "metadata::trusted" yes - # Restart nautilus-desktop, so that the changes take effect - killall nautilus-desktop && nautilus-desktop & + gio set $HOME/Desktop/esim.desktop "metadata::trusted" true + # Set Permission and Execution bit + chmod a+x $HOME/Desktop/esim.desktop fi # Remove local copy of esim.desktop file @@ -347,7 +347,7 @@ elif [ $option == "--uninstall" ];then read getConfirmation if [ $getConfirmation == "y" -o $getConfirmation == "Y" ];then echo "Removing eSim............................" - sudo rm -rf $HOME/.esim $HOME/Desktop/esim.desktop /usr/bin/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 sudo rm -rf /usr/share/kicad -- cgit From 6d8e4e44cd76b849ccea4b77bc0b9ffbea8be3e7 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Mon, 3 Aug 2020 17:33:20 +0530 Subject: initial commit --- Debian/eSim.spec | 34 ----- Debian/install-eSim.sh | 388 ------------------------------------------------- Debian/readme.md | 146 ------------------- README.md | 17 +++ Ubuntu/README.md | 32 ++++ Ubuntu/eSim.spec | 34 +++++ Ubuntu/executable.md | 101 +++++++++++++ Ubuntu/install-eSim.sh | 388 +++++++++++++++++++++++++++++++++++++++++++++++++ Version_Change.md | 35 +++++ Windows/README.md | 132 +++++++++++++++++ Windows/readme.md | 137 ----------------- eSimVersionChange.md | 39 ----- 12 files changed, 739 insertions(+), 744 deletions(-) delete mode 100644 Debian/eSim.spec delete mode 100755 Debian/install-eSim.sh delete mode 100755 Debian/readme.md create mode 100644 README.md create mode 100755 Ubuntu/README.md create mode 100644 Ubuntu/eSim.spec create mode 100644 Ubuntu/executable.md create mode 100755 Ubuntu/install-eSim.sh create mode 100644 Version_Change.md create mode 100644 Windows/README.md delete mode 100644 Windows/readme.md delete mode 100644 eSimVersionChange.md diff --git a/Debian/eSim.spec b/Debian/eSim.spec deleted file mode 100644 index 15061f6b..00000000 --- a/Debian/eSim.spec +++ /dev/null @@ -1,34 +0,0 @@ -# -*- mode: python ; coding: utf-8 -*- - -block_cipher = None - -a = Analysis(['eSim-2.0/src/frontEnd/Application.py'], - pathex=['/home/rahul/Music'], - binaries=[], - datas=[], - hiddenimports=['PyQt4.sip'], - hookspath=[], - runtime_hooks=[], - excludes=[], - win_no_prefer_redirects=False, - win_private_assemblies=False, - cipher=block_cipher, - noarchive=False) -pyz = PYZ(a.pure, a.zipped_data, - cipher=block_cipher) -exe = EXE(pyz, - a.scripts, - a.binaries, - a.zipfiles, - a.datas, - [], - name='eSim', - debug=False, - bootloader_ignore_signals=False, - strip=False, - upx=True, - upx_exclude=[], - runtime_tmpdir=None, - console=True, - version='eSim-2.0/VERSION', - icon='eSim-2.0/images/logo.png') diff --git a/Debian/install-eSim.sh b/Debian/install-eSim.sh deleted file mode 100755 index 74d59992..00000000 --- a/Debian/install-eSim.sh +++ /dev/null @@ -1,388 +0,0 @@ -#!/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: --- -# AUTHOR: Fahim Khan, Rahul Paknikar, Saurabh Bansode -# ORGANIZATION: eSim Team, FOSSEE, IIT Bombay -# CREATED: Wednesday 15 July 2015 15:26 -# REVISION: Sunday 02 August 2020 01:26 -#=============================================================================== - -set -e # Set exit option immediately on error -set -E # inherit ERR trap by shell functions - -error_exit() { - echo -e "\n\nError! Kindly resolve above error(s) and try again." - echo -e "\nAborting Installation...\n" -} - -# Trap on function error_exit before exiting on error -trap error_exit ERR - - -# All variables goes here -config_dir="$HOME/.esim" -config_file="config.ini" -eSim_Home=`pwd` -ngspiceFlag=0 - -## All Functions goes here - -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 addKicadPPA -{ - - #sudo add-apt-repository ppa:js-reynaud/ppa-kicad - kicadppa="reynaud/kicad-4" - findppa=$(grep -h -r "^deb.*$kicadppa*" /etc/apt/sources.list* > /dev/null 2>&1 || test $? = 1) - if [ -z "$findppa" ]; then - echo "Adding KiCad-4 PPA to local apt-repository" - if [[ $(lsb_release -rs) == 20.* ]]; then - sudo add-apt-repository --yes "deb http://ppa.launchpad.net/js-reynaud/kicad-4/ubuntu bionic main" - sudo touch /etc/apt/preferences.d/preferences - echo "Package: kicad" | sudo tee -a /etc/apt/preferences.d/preferences > /dev/null - echo "Pin: version 4.0.7*" | sudo tee -a /etc/apt/preferences.d/preferences > /dev/null - echo "Pin-Priority: 501" | sudo tee -a /etc/apt/preferences.d/preferences > /dev/null - sudo add-apt-repository --yes "deb http://in.archive.ubuntu.com/ubuntu/ bionic main universe" - else - sudo add-apt-repository --yes ppa:js-reynaud/kicad-4 - fi - else - echo "KiCad-4 is available in synaptic" - fi - -} - - -function installDependency -{ - - #Update apt repository - echo "Updating apt index files..................." - sudo apt-get update - - echo "Installing Xterm..........................." - sudo apt-get install -y xterm - - echo "Installing PyQt5..........................." - sudo apt-get install -y python3-pyqt5 - - echo "Installing Matplotlib......................" - sudo apt-get install -y python3-matplotlib - - if [[ $(lsb_release -rs) != 16.* ]]; then - echo "Installing Distutils......................." - sudo apt-get install python3-distutils - fi - - echo "Installing KiCad..........................." - sudo apt-get install -y --no-install-recommends kicad - if [[ $(lsb_release -rs) == 20.* ]]; then - sudo add-apt-repository -r "deb http://in.archive.ubuntu.com/ubuntu/ bionic main universe" - fi - -} - - -function copyKicadLibrary -{ - - if [ -d ~/.config/kicad ];then - echo "kicad folder already exists" - else - echo ".config/kicad does not exist" - mkdir ~/.config/kicad - fi - - # Dump KiCad config path - echo "$HOME/.config/kicad" > $eSim_Home/library/supportFiles/kicad_config_path.txt - - #Copy fp-lib-table for switching modes - cp -r library/supportFiles/fp-lib-table ~/.config/kicad/ - cp -r library/supportFiles/fp-lib-table-online ~/.config/kicad/ - echo "fp-lib-table copied in the directory" - - #Extract custom KiCad Library - tar -xJf library/kicadLibrary.tar.xz - - #Copy KiCad libraries - echo "Copying KiCad libraries...................." - - sudo cp -r kicadLibrary/library /usr/share/kicad/ - sudo cp -r kicadLibrary/modules /usr/share/kicad/ - sudo cp -r kicadLibrary/template/* /usr/share/kicad/template/ - - #Copy KiCad library made for eSim - sudo cp -r kicadLibrary/kicad_eSim-Library/* /usr/share/kicad/library/ - - # Full path of 'kicad.pro file' - KICAD_PRO="/usr/share/kicad/template/kicad.pro" - KICAD_ORIGINAL="/usr/share/kicad/template/kicad.pro.original" - - if [ -f "$KICAD_ORIGINAL" ];then - echo "kicad.pro.original file found" - sudo cp -rv kicadLibrary/template/kicad.pro ${KICAD_PRO} - else - echo "Making copy of original file" - sudo cp -rv ${KICAD_PRO}{,.original} - sudo cp -rv kicadLibrary/template/kicad.pro ${KICAD_PRO} - fi - - 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/library/ - -} - - -function createDesktopStartScript -{ - # Generating new esim-start.sh - echo '#!/bin/bash' > esim-start.sh - echo "cd $eSim_Home/src/frontEnd" >> 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 - - # Check if the target OS is Ubuntu 18 or not - if [[ $(lsb_release -rs) == 18.* || $(lsb_release -rs) == 20.* ]]; then - # 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 - fi - - # 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 - 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" - # Calling functions - createConfigFile - addKicadPPA - installDependency - copyKicadLibrary - installNghdl - createDesktopStartScript - - elif [ $getProxy == "n" -o $getProxy == "N" ];then - echo "Install without proxy" - - # Calling functions - createConfigFile - addKicadPPA - installDependency - copyKicadLibrary - installNghdl - createDesktopStartScript - - if [ $? -ne 0 ];then - echo -e "\n\n\nFreeEDA ERROR: 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" - - else - echo "Please select the right option" - exit 0 - fi - - -elif [ $option == "--uninstall" ];then - echo -n "Are you sure? It will remove eSim completely including KiCad, Ngspice and NGHDL 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 - sudo rm -rf /usr/share/kicad - sudo rm -rf $HOME/.config/kicad - rm -f $eSim_Home/library/supportFiles/kicad_config_path.txt - - if [[ $(lsb_release -rs) == 20.* ]]; then - sudo sed -i '/Package: kicad/{:label;N;/Pin-Priority: 501/!blabel};/Pin: version 4.0.7*/d' /etc/apt/preferences.d/preferences - fi - - echo "Removing NGHDL..........................." - rm -rf library/modelParamXML/Nghdl/* - 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/Debian/readme.md b/Debian/readme.md deleted file mode 100755 index 8b635e4a..00000000 --- a/Debian/readme.md +++ /dev/null @@ -1,146 +0,0 @@ -eSim Installer (Ubuntu OS) -==== - - -It contains all the documenation for making eSim executable (using PyInstaller), eSim Installation Script and packaging eSim with and without eSim executable (through source) on Ubuntu 16.04 and above. - - -## eSim Executable: - -> Note: pip tool corresponds to Python-3.5.2 on Ubuntu 16.04 and Python-3.6.9 on Ubuntu 18.04 - -1. Download `virtualenv` package and create virtual environment as: - - $ pip install virtualenv - $ virtualenv -p /usr/bin/python3 eSim - - OR - - $ sudo apt install -y python3-venv - $ python3 -m venv eSim - -2. Activate the virtual environment as: - - $ source eSim/bin/activate - -3. Install all Python dependencies for eSim within the virtual environment as: - - $ pip install wheel - $ pip install pyinstaller - $ pip install --upgrade 'matplotlib==3.0.3' - $ pip install tornado - $ pip install --upgrade 'setuptools<45.0.0' - $ sudo apt install build-essential python3-dev libqt4-dev qt4-dev-tools - $ mkdir eSim/build - $ cd eSim/build/ - $ wget http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.12.3/PyQt4_gpl_x11-4.12.3.tar.gz - $ wget https://www.riverbankcomputing.com/static/Downloads/sip/4.19.21/sip-4.19.21.tar.gz - $ tar -xzvf sip-4.19.21.tar.gz - $ tar -xvzf PyQt4_gpl_x11-4.12.3.tar.gz - $ cd sip-4.19.21/ - $ python configure.py --sip-module PyQt4.sip - $ make - $ make install - $ cd ../PyQt4_gpl_x11-4.12.3/ - $ python configure.py - $ make - $ make install - -4. Test whether only eSim dependencies are available or not: - - $ pip freeze - -> Note : Following dependencies should be available - -> - PyQt4 -> - matplotlib -> - numpy -> - dateutil -> - pyparsing -> - six -> - cycler.py - -5. Download eSim Manual from eSim website, add it to `library/browser/User-Manual/` and update the file name of Manual in `src/browser/UserManual.py` accordingly. - -6. Create spec file as: - - $ pyi-makespec --onefile -n eSim /src/frontEnd/Application.py - -7. Add `PyQt4.sip` as hiddenimports in the generated spec file. - -8. Create onefile executable using pyinstaller as: - - $ pyinstaller -F --clean eSim.spec - -9. Verify whether all eSim `src` files (`*.py`) have been included in `Analysis-00.toc` file under the build folder generated by PyInstaller. - - -## Fully-Static Bundling of eSim Executable: - -1. To create a [fully-static bundled version](https://github.com/pyinstaller/pyinstaller/wiki/FAQ#GNULinux) of eSim (through PyInstaller), use a tool like [StaticX](https://github.com/JonathonReinhart/staticx/). - -2. To create fully-static eSim : - - - Activate the virtual environment as: - - $ source eSim/bin/activate - - - Install StaticX as: - - $ pip install staticx - $ pip install patchelf-wrapper - - - Create static eSim as: - - $ staticx /path/to/executable/eSim /path/to/output/executable/eSim - -3. To verify if all dynamic libraries are removed : - - - Type following command in a terminal : - - $ ldd path/to/output/executable/eSim - - - Output of above command should be similar to ` not a dynamic executable` - - -## Without eSim Executable (through source): - -Update following files by changing the relative paths before packaging the `src` folder with the release. - - - `browser\UserManual.py` --> path to manual - - `browser\Welcome.py` --> path to library - - `configuration\Appconfig.py` --> path to library - - `frontEnd\Application.py` --> path to library, pathmagic and images - - `frontEnd\ProjectExplorer.py` --> path to images - - `frontEnd\Workspace.py` --> path to images - - `kicadtoNgspice\DeviceModel.py` --> path to library - - `kicadtoNgspice\Processing.py` --> path to library - - `kicadtoNgspice\SubcircuitTab.py` --> path to library - - `modelEditor\ModelEditor.py` --> path to library - - `subcircuit\newSub.py` --> path to library - - `subcircuit\openSub.py` --> path to library - - `subcircuit\uploadSub.py` --> path to library - - -## How to package eSim? - -1. Update `VERSION` file to this release number. - -2. Add the installer file in `eSim-` folder. - -3. Add the eSim executable file in `eSim-` folder (only if it is made available). Also, remove following files from the folder: - - `.git` folder - - `code` folder - - `src` folder (Applicable only if eSim executable is made) - - conf.py - - setup.py - - index.rst - - requirement.txt - - .gitignore - - .travis.yml - -4. Add the zip file of `NGHDL` (`nghdl-master.zip`) in the eSim folder. - -5. Compress `kicadLibrary` folder to a `tar.xz` format. - -6. Compress `eSim-` to a zip format for distribution. - diff --git a/README.md b/README.md new file mode 100644 index 00000000..8d49b116 --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +eSim Packaging +==== + +It contains all the documentation for packaging eSim for distribution. + + +# Packaging eSim for Distribution: + +1. eSim is currently packaged and distributed for Ubuntu OS (Linux) and MS Windows OS. + +2. Refer the [documentation](Version_Change.md) for the changes to be done when a new release is to be made. + +> Note: These changes have to be made `first` before proceeding with the packaging on either platform. + +3. Refer the [documentation](Ubuntu/README.md) to package eSim for Ubuntu OS. + +4. Refer the [documentation](Windows/README.md) to package eSim for Windows OS. diff --git a/Ubuntu/README.md b/Ubuntu/README.md new file mode 100755 index 00000000..b4a6cb8b --- /dev/null +++ b/Ubuntu/README.md @@ -0,0 +1,32 @@ +eSim Installer (Ubuntu OS) +==== + +It contains the documentation to packaging eSim and making binaries for distribution. + +> Note: If planning to freeze the eSim source code for a target platform (Ubuntu OS), then refer this [documentation](executable.md). + + +## How to package eSim for Ubuntu OS? + +1. Take the `master` branch containing the source code. Rename the folder to `eSim-`. + +2. Add the installer script `install-eSim.sh` in `eSim-` folder. + +3. Add the eSim executable (if available) in `eSim-` folder. Also, remove following files from the folder: + - `.git` folder + - `code` folder + - `src` folder (Applicable only if eSim executable is used) + - conf.py + - setup.py + - index.rst + - requirement.txt + - .gitignore + - .travis.yml + +4. Add the zip file of `NGHDL` (`nghdl.zip`) in the eSim folder. + +> Note: Refer this [documentation](https://github.com/fossee/nghdl/tree/installers/Ubuntu/README.md) on packaging of NGHDL for Ubuntu OS. + +5. Compress `kicadLibrary` folder to a `tar.xz` format. + +6. Compress `eSim-` to a zip format for distribution. diff --git a/Ubuntu/eSim.spec b/Ubuntu/eSim.spec new file mode 100644 index 00000000..15061f6b --- /dev/null +++ b/Ubuntu/eSim.spec @@ -0,0 +1,34 @@ +# -*- mode: python ; coding: utf-8 -*- + +block_cipher = None + +a = Analysis(['eSim-2.0/src/frontEnd/Application.py'], + pathex=['/home/rahul/Music'], + binaries=[], + datas=[], + hiddenimports=['PyQt4.sip'], + hookspath=[], + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False) +pyz = PYZ(a.pure, a.zipped_data, + cipher=block_cipher) +exe = EXE(pyz, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, + [], + name='eSim', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=True, + version='eSim-2.0/VERSION', + icon='eSim-2.0/images/logo.png') diff --git a/Ubuntu/executable.md b/Ubuntu/executable.md new file mode 100644 index 00000000..435ed88a --- /dev/null +++ b/Ubuntu/executable.md @@ -0,0 +1,101 @@ +eSim Executable (Ubuntu OS) +==== + +> Note: It is not updated for the recently ported GUI to PyQt5 and Ubuntu 20.04 LTS. Currently, packaging for Ubuntu OS is done directly with the source code and not the executable. + +It contains the documentation for making eSim executable using PyInstaller on Ubuntu 16.04 and above. + + +## Freeze eSim source code: + +> Note: pip tool corresponds to Python-3.5.2 on Ubuntu 16.04 and Python-3.6.9 on Ubuntu 18.04 + +1. Download `virtualenv` package and create virtual environment as: + + $ pip install virtualenv + $ virtualenv -p /usr/bin/python3 eSim + + OR + + $ sudo apt install -y python3-venv + $ python3 -m venv eSim + +2. Activate the virtual environment as: + + $ source eSim/bin/activate + +3. Install all Python dependencies for eSim within the virtual environment as: + + $ pip install wheel + $ pip install pyinstaller + $ pip install --upgrade 'matplotlib==3.0.3' + $ pip install tornado + $ pip install --upgrade 'setuptools<45.0.0' + $ sudo apt install build-essential python3-dev libqt4-dev qt4-dev-tools + $ mkdir eSim/build + $ cd eSim/build/ + $ wget http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.12.3/PyQt4_gpl_x11-4.12.3.tar.gz + $ wget https://www.riverbankcomputing.com/static/Downloads/sip/4.19.21/sip-4.19.21.tar.gz + $ tar -xzvf sip-4.19.21.tar.gz + $ tar -xvzf PyQt4_gpl_x11-4.12.3.tar.gz + $ cd sip-4.19.21/ + $ python configure.py --sip-module PyQt4.sip + $ make + $ make install + $ cd ../PyQt4_gpl_x11-4.12.3/ + $ python configure.py + $ make + $ make install + +4. Test whether only eSim dependencies are available or not: + + $ pip freeze + +> Note : Following dependencies should be available - +> - PyQt4 +> - matplotlib +> - numpy +> - dateutil +> - pyparsing +> - six +> - cycler.py + +5. Create spec file as: + + $ pyi-makespec --onefile -n eSim /src/frontEnd/Application.py + +6. Add `PyQt4.sip` as hiddenimports in the generated spec file. + +7. Create onefile executable using pyinstaller as: + + $ pyinstaller -F --clean eSim.spec + +8. Verify whether all eSim `src` files (`*.py`) have been included in `Analysis-00.toc` file under the build folder generated by PyInstaller. + + +## Fully-Static Bundling of eSim Executable: + +1. To create a [fully-static bundled version](https://github.com/pyinstaller/pyinstaller/wiki/FAQ#GNULinux) of eSim (through PyInstaller), use a tool like [StaticX](https://github.com/JonathonReinhart/staticx/). + +2. To create fully-static eSim : + + - Activate the virtual environment as: + + $ source eSim/bin/activate + + - Install StaticX as: + + $ pip install staticx + $ pip install patchelf-wrapper + + - Create static eSim as: + + $ staticx /path/to/executable/eSim /path/to/output/executable/eSim + +3. To verify if all dynamic libraries are removed : + + - Type following command in a terminal : + + $ ldd path/to/output/executable/eSim + + - Output of above command should be similar to ` not a dynamic executable` diff --git a/Ubuntu/install-eSim.sh b/Ubuntu/install-eSim.sh new file mode 100755 index 00000000..74d59992 --- /dev/null +++ b/Ubuntu/install-eSim.sh @@ -0,0 +1,388 @@ +#!/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: --- +# AUTHOR: Fahim Khan, Rahul Paknikar, Saurabh Bansode +# ORGANIZATION: eSim Team, FOSSEE, IIT Bombay +# CREATED: Wednesday 15 July 2015 15:26 +# REVISION: Sunday 02 August 2020 01:26 +#=============================================================================== + +set -e # Set exit option immediately on error +set -E # inherit ERR trap by shell functions + +error_exit() { + echo -e "\n\nError! Kindly resolve above error(s) and try again." + echo -e "\nAborting Installation...\n" +} + +# Trap on function error_exit before exiting on error +trap error_exit ERR + + +# All variables goes here +config_dir="$HOME/.esim" +config_file="config.ini" +eSim_Home=`pwd` +ngspiceFlag=0 + +## All Functions goes here + +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 addKicadPPA +{ + + #sudo add-apt-repository ppa:js-reynaud/ppa-kicad + kicadppa="reynaud/kicad-4" + findppa=$(grep -h -r "^deb.*$kicadppa*" /etc/apt/sources.list* > /dev/null 2>&1 || test $? = 1) + if [ -z "$findppa" ]; then + echo "Adding KiCad-4 PPA to local apt-repository" + if [[ $(lsb_release -rs) == 20.* ]]; then + sudo add-apt-repository --yes "deb http://ppa.launchpad.net/js-reynaud/kicad-4/ubuntu bionic main" + sudo touch /etc/apt/preferences.d/preferences + echo "Package: kicad" | sudo tee -a /etc/apt/preferences.d/preferences > /dev/null + echo "Pin: version 4.0.7*" | sudo tee -a /etc/apt/preferences.d/preferences > /dev/null + echo "Pin-Priority: 501" | sudo tee -a /etc/apt/preferences.d/preferences > /dev/null + sudo add-apt-repository --yes "deb http://in.archive.ubuntu.com/ubuntu/ bionic main universe" + else + sudo add-apt-repository --yes ppa:js-reynaud/kicad-4 + fi + else + echo "KiCad-4 is available in synaptic" + fi + +} + + +function installDependency +{ + + #Update apt repository + echo "Updating apt index files..................." + sudo apt-get update + + echo "Installing Xterm..........................." + sudo apt-get install -y xterm + + echo "Installing PyQt5..........................." + sudo apt-get install -y python3-pyqt5 + + echo "Installing Matplotlib......................" + sudo apt-get install -y python3-matplotlib + + if [[ $(lsb_release -rs) != 16.* ]]; then + echo "Installing Distutils......................." + sudo apt-get install python3-distutils + fi + + echo "Installing KiCad..........................." + sudo apt-get install -y --no-install-recommends kicad + if [[ $(lsb_release -rs) == 20.* ]]; then + sudo add-apt-repository -r "deb http://in.archive.ubuntu.com/ubuntu/ bionic main universe" + fi + +} + + +function copyKicadLibrary +{ + + if [ -d ~/.config/kicad ];then + echo "kicad folder already exists" + else + echo ".config/kicad does not exist" + mkdir ~/.config/kicad + fi + + # Dump KiCad config path + echo "$HOME/.config/kicad" > $eSim_Home/library/supportFiles/kicad_config_path.txt + + #Copy fp-lib-table for switching modes + cp -r library/supportFiles/fp-lib-table ~/.config/kicad/ + cp -r library/supportFiles/fp-lib-table-online ~/.config/kicad/ + echo "fp-lib-table copied in the directory" + + #Extract custom KiCad Library + tar -xJf library/kicadLibrary.tar.xz + + #Copy KiCad libraries + echo "Copying KiCad libraries...................." + + sudo cp -r kicadLibrary/library /usr/share/kicad/ + sudo cp -r kicadLibrary/modules /usr/share/kicad/ + sudo cp -r kicadLibrary/template/* /usr/share/kicad/template/ + + #Copy KiCad library made for eSim + sudo cp -r kicadLibrary/kicad_eSim-Library/* /usr/share/kicad/library/ + + # Full path of 'kicad.pro file' + KICAD_PRO="/usr/share/kicad/template/kicad.pro" + KICAD_ORIGINAL="/usr/share/kicad/template/kicad.pro.original" + + if [ -f "$KICAD_ORIGINAL" ];then + echo "kicad.pro.original file found" + sudo cp -rv kicadLibrary/template/kicad.pro ${KICAD_PRO} + else + echo "Making copy of original file" + sudo cp -rv ${KICAD_PRO}{,.original} + sudo cp -rv kicadLibrary/template/kicad.pro ${KICAD_PRO} + fi + + 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/library/ + +} + + +function createDesktopStartScript +{ + # Generating new esim-start.sh + echo '#!/bin/bash' > esim-start.sh + echo "cd $eSim_Home/src/frontEnd" >> 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 + + # Check if the target OS is Ubuntu 18 or not + if [[ $(lsb_release -rs) == 18.* || $(lsb_release -rs) == 20.* ]]; then + # 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 + fi + + # 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 + 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" + # Calling functions + createConfigFile + addKicadPPA + installDependency + copyKicadLibrary + installNghdl + createDesktopStartScript + + elif [ $getProxy == "n" -o $getProxy == "N" ];then + echo "Install without proxy" + + # Calling functions + createConfigFile + addKicadPPA + installDependency + copyKicadLibrary + installNghdl + createDesktopStartScript + + if [ $? -ne 0 ];then + echo -e "\n\n\nFreeEDA ERROR: 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" + + else + echo "Please select the right option" + exit 0 + fi + + +elif [ $option == "--uninstall" ];then + echo -n "Are you sure? It will remove eSim completely including KiCad, Ngspice and NGHDL 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 + sudo rm -rf /usr/share/kicad + sudo rm -rf $HOME/.config/kicad + rm -f $eSim_Home/library/supportFiles/kicad_config_path.txt + + if [[ $(lsb_release -rs) == 20.* ]]; then + sudo sed -i '/Package: kicad/{:label;N;/Pin-Priority: 501/!blabel};/Pin: version 4.0.7*/d' /etc/apt/preferences.d/preferences + fi + + echo "Removing NGHDL..........................." + rm -rf library/modelParamXML/Nghdl/* + 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/Version_Change.md b/Version_Change.md new file mode 100644 index 00000000..7469ce84 --- /dev/null +++ b/Version_Change.md @@ -0,0 +1,35 @@ +eSim Version Change +==== + +It contains the documentation for the changes to be done when a new release is to be made. + + +# Changes for eSim version Update: + +1. `master/VERSION` - Change the version number + +2. `master/conf.py` - Update `release` variable + +3. `master/setup.py` - Update `version` field in `setup` function + +4. User Manual + - Download eSim Manual from eSim website and add it to `library/browser/User-Manual/`. + - Update user manual filename as `eSim_Manual_y.x.pdf` where y.x is the updated version. + - Update path in the following line at `master/src/browser/UserManual.py` with the updated manual name: + ```python + file = os.path.realpath('library/browser/User-Manual/eSim_Manual_2.0.pdf') + ``` + +5. `master/src/configuration/Appconfig.py` - In function `def __init__ (self)` , update the variable `self._VERSION` + +6. `master/INSTALL` - Update the installer file names according to the latest version. + +7. `installers/Windows/esim-setup-script.nsi` - Update the following lines in this script: + ```nsi + !define PRODUCT_VERSION "y.x" + !define VERSION "a.b.c.d" + + OutFile "eSim-y.x_install.exe" + ``` + +8. `master/README.md` - Update new features, OS support and other changes that were made in the new version. diff --git a/Windows/README.md b/Windows/README.md new file mode 100644 index 00000000..8dae6dc1 --- /dev/null +++ b/Windows/README.md @@ -0,0 +1,132 @@ +eSim Installer (Windows OS) +==== + + +It contains all the documenation for making eSim executable (using PyInstaller) and eSim Installation Script on Windows 7 and above. + +> Note : Do not develop eSim on Windows OS. Work only with `installers` branch on Windows OS and do development on Linux OS. +> Reference : https://stackoverflow.com/questions/37672886/cannot-get-rid-of-unstaged-files-in-git-on-my-local + + +## eSim Executable: + +1. Download and install "Python-3.5.2", "Git For Windows". Use "Git Bash" for all following shell commands. + + Reference - https://gitforwindows.org/ + +2. Add alias to python.exe in Git shell: + + $ alias python='winpty python.exe' #Need to be done for each new shell created + +3. Download `virtualenv` package as: + + $ pip install virtualenv + +4. Create a virtual environment as: + + $ virtualenv eSim + +5. Activate the virtual environment as: + + $ source eSim/Scripts/activate + +6. Install all Python dependencies for eSim within the virtual environment as: + + - Install PyInstaller, Matplotlib, tornado, SetupTools through pip : + + $ pip install pyinstaller + $ pip install matplotlib + $ pip install tornado + $ pip install --upgrade 'setuptools<45.0.0' + + - Install PyQt4 through pip (Reference - https://stackoverflow.com/questions/22640640/how-to-install-pyqt4-on-windows-using-pip) : + + $ pip install --upgrade 'sip<5.0.0' + $ pip install + + > Note : + - If there are any issues regarding loading of DLL files, refer : https://stackoverflow.com/questions/2738879/cannot-import-pyqt4-qtgui + - If above step works, then goto step 7. + + - Install PyQt4 from source : + + - Add following Linux packages to MINGW64 of Git : + + - `make` (get the version without guile) + - `wget` + + Reference - https://gist.github.com/evanwill/0207876c3243bbb6863e65ec5dc3f058 + + - Install MINGW64 on your system and merge all the files from `mingw-w64` to `Git\mingw-w64` (do not replace or copy blindly). + + - Now open Git-Bash and run following commands : + + $ mkdir eSim/build + $ cd eSim/build/ + $ wget http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.12.3/PyQt4_gpl_x11-4.12.3.tar.gz + $ wget https://www.riverbankcomputing.com/static/Downloads/sip/4.19.21/sip-4.19.21.tar.gz + $ tar -xzvf sip-4.19.21.tar.gz + $ tar -xvzf PyQt4_gpl_x11-4.12.3.tar.gz + $ cd sip-4.19.21/ + $ python configure.py --sip-module PyQt4.sip --platform win32-g++ + $ make + $ make install + $ cd ../PyQt4_gpl_x11-4.12.3/ + $ python configure.py + $ make + $ make install + +7. Test whether only eSim dependencies are available or not: + + $ pip freeze + +> Note : Following dependencies should be available - +> - PyQt4 +> - matplotlib +> - numpy +> - dateutil +> - pyparsing +> - six +> - cycler.py + +8. Create spec file as: + + $ pyi-makespec --onefile -n eSim /src/frontEnd/Application.py --icon= + +9. Create onefile executable using pyinstaller as: + + $ pyinstaller -F --clean eSim.spec + +10. Verify whether all eSim `src` files (`*.py`) have been included in `Analysis-00.toc` file under the build folder generated by PyInstaller. + + +## How to package eSim? + +1. Take the `master` branch of eSim. Rename the folder to `eSim`. + +2. Compress `spice` folder in zip format (Make sure that there is folder named `spice` inside this compressed file). + +3. Add eSim executable to the `eSim` folder. Also, remove following files from that folder: + - `.git` folder + - `code` folder + - `src` folder + - conf.py + - setup.py + - index.rst + - requirement.txt + - .gitignore + - .travis.yml + +4. Now, compress `eSim\library\kicadLibrary` in zip format, place it at `eSim\library` and delete that folder. + +5. Compress `eSim` folder in zip format (Make sure that there is folder named `eSim` inside this compressed file). + +6. Add following files/folder to the installer folder: + - KiCad installer. + - License file (`rtf` format). + - Logo (`ico` format). + - Spice (compressed file in `zip` format) containing spice folder. + - eSim (compressed file in `zip` format) containing eSim folder. + - `esim-setup-script` file. + +7. Compile the NSI script (`esim-setup-script` file). Now only use the generated installer for distribution. diff --git a/Windows/readme.md b/Windows/readme.md deleted file mode 100644 index cd8ff979..00000000 --- a/Windows/readme.md +++ /dev/null @@ -1,137 +0,0 @@ -eSim Installer (Windows OS) -==== - - -It contains all the documenation for making eSim executable (using PyInstaller) and eSim Installation Script on Windows 7 and above. - -> Note : Do not develop eSim on Windows OS. Work only with `installers` branch on Windows OS and do development on Linux OS. -> Reference : https://stackoverflow.com/questions/37672886/cannot-get-rid-of-unstaged-files-in-git-on-my-local - -## eSim Executable: - -1. Download and install "Python-3.5.2", "Git For Windows". Use "Git Bash" for all following shell commands. - - Reference - https://gitforwindows.org/ - -2. Add alias to python.exe in Git shell: - - $ alias python='winpty python.exe' #Need to be done for each new shell created - -3. Download `virtualenv` package as: - - $ pip install virtualenv - -4. Create a virtual environment as: - - $ virtualenv eSim - -5. Activate the virtual environment as: - - $ source eSim/Scripts/activate - -6. Install all Python dependencies for eSim within the virtual environment as: - - - Install PyInstaller, Matplotlib, tornado, SetupTools through pip : - - $ pip install pyinstaller - $ pip install matplotlib - $ pip install tornado - $ pip install --upgrade 'setuptools<45.0.0' - - - Install PyQt4 through pip (Reference - https://stackoverflow.com/questions/22640640/how-to-install-pyqt4-on-windows-using-pip) : - - $ pip install --upgrade 'sip<5.0.0' - $ pip install - - > Note : - - If there are any issues regarding loading of DLL files, refer : https://stackoverflow.com/questions/2738879/cannot-import-pyqt4-qtgui - - If above step works, then goto step 7. - - - Install PyQt4 from source : - - - Add following Linux packages to MINGW64 of Git : - - - `make` (get the version without guile) - - `wget` - - Reference - https://gist.github.com/evanwill/0207876c3243bbb6863e65ec5dc3f058 - - - Install MINGW64 on your system and merge all the files from `mingw-w64` to `Git\mingw-w64` (do not replace or copy blindly). - - - Now open Git-Bash and run following commands : - - $ mkdir eSim/build - $ cd eSim/build/ - $ wget http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.12.3/PyQt4_gpl_x11-4.12.3.tar.gz - $ wget https://www.riverbankcomputing.com/static/Downloads/sip/4.19.21/sip-4.19.21.tar.gz - $ tar -xzvf sip-4.19.21.tar.gz - $ tar -xvzf PyQt4_gpl_x11-4.12.3.tar.gz - $ cd sip-4.19.21/ - $ python configure.py --sip-module PyQt4.sip --platform win32-g++ - $ make - $ make install - $ cd ../PyQt4_gpl_x11-4.12.3/ - $ python configure.py - $ make - $ make install - -7. Test whether only eSim dependencies are available or not: - - $ pip freeze - -> Note : Following dependencies should be available - -> - PyQt4 -> - matplotlib -> - numpy -> - dateutil -> - pyparsing -> - six -> - cycler.py - -8. Download eSim Manual from eSim website, add it to `library/browser/User-Manual/` and update the file name of Manual in `src/browser/UserManual.py` accordingly. - -9. Create spec file as: - - $ pyi-makespec --onefile -n eSim /src/frontEnd/Application.py --icon= - -10. Create onefile executable using pyinstaller as: - - $ pyinstaller -F --clean eSim.spec - -11. Verify whether all eSim `src` files (`*.py`) have been included in `Analysis-00.toc` file under the build folder generated by PyInstaller. - - - -## How to package eSim? - -1. Update `VERSION` file to this release number. Also, update version number in NSI script and `Installation.txt` file. - -2. Compress `spice` folder in zip format (Make sure that there is folder named `spice` inside this compressed file). - -3. Add eSim executable file to the eSim source folder. Also, remove following files from the eSim source folder: - - `.git` folder - - `code` folder - - `src` folder - - conf.py - - setup.py - - index.rst - - requirement.txt - - .gitignore - - .travis.yml - - `Examples\NGHDL_Examples\` folder - -4. Remove `eSim_Nghdl.lib` file from `eSim\library\kicadLibrary\kicad_eSim-Library\`. Also, remove `library` folder, duplicate files from `template` and `modules` folders under `eSim\library\kicadLibary\`. - -5. Now, compress `eSim\library\kicadLibrary` in zip format, place it at `eSim\library` and delete that folder. - -6. Compress `eSim` folder in zip format (Make sure that there is folder named `eSim` inside this compressed file). - -7. Add following files/folder to the installer folder: - - KiCad installer. - - License file (`rtf` format). - - Logo (`ico` format). - - Spice (compressed file in `zip` format) containing spice folder. - - eSim (compressed file in `zip` format) containing eSim folder. - - `esim-setup-script` file. - -8. Compile the NSI script (`esim-setup-script` file). Now only use the generated installer for distribution. diff --git a/eSimVersionChange.md b/eSimVersionChange.md deleted file mode 100644 index 3c119663..00000000 --- a/eSimVersionChange.md +++ /dev/null @@ -1,39 +0,0 @@ -# Changes to be made when eSim version is updated - -1. master/VERSION\ -- Change the version number - -2. master/conf.py\ -- Update `release` variable - -3. master/setup.py\ -- Update `version` field in `setup` function - -4. User manual -- Update user manual filename as `eSim_Manual_y.x.pdf` where y.x is the updated version. -- Update path in the following line at `master/src/browser/UserManual.py` with the updated manual name -```python - file = os.path.realpath('library/browser/User-Manual/eSim_Manual_2.0.pdf') -``` - -5. master/src/configuration/Appconfig.py\ -- In function `def __init__ (self)` , update the variable `sel._VERSION` - -6. master/INSTALL\ -- Update the installer file names according to the latest version - -7. installers/Windows/esim-setup-script.nsi\ -- Update the following lines in the script -```nsi -- !define PRODUCT_VERSION "y.x" -- !define VERSION "a.b.c.d" - -- OutFile "eSim-y.x_install.exe" -``` - -8. master/README.md -- Update new features, OS support and other changes that were made in the new version. - - - - -- cgit From 2e2d0167d642d7c53fb8bd1cc5954cb05df43430 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Mon, 3 Aug 2020 17:41:09 +0530 Subject: documented removal of figures from User-Manual folder --- Version_Change.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Version_Change.md b/Version_Change.md index 7469ce84..bd308cb6 100644 --- a/Version_Change.md +++ b/Version_Change.md @@ -14,6 +14,7 @@ It contains the documentation for the changes to be done when a new release is t 4. User Manual - Download eSim Manual from eSim website and add it to `library/browser/User-Manual/`. + - Remove `figures` folder and `eSim.html` file from `library/browser/User-Manual/`. - Update user manual filename as `eSim_Manual_y.x.pdf` where y.x is the updated version. - Update path in the following line at `master/src/browser/UserManual.py` with the updated manual name: ```python -- cgit From c3832418ddb492148886055611a78459673c05bf Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Fri, 7 Aug 2020 18:21:38 +0530 Subject: update readme --- Ubuntu/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Ubuntu/README.md b/Ubuntu/README.md index b4a6cb8b..5c7c65d4 100755 --- a/Ubuntu/README.md +++ b/Ubuntu/README.md @@ -1,9 +1,9 @@ eSim Installer (Ubuntu OS) ==== -It contains the documentation to packaging eSim and making binaries for distribution. +It contains the documentation to package eSim for Ubuntu OS. -> Note: If planning to freeze the eSim source code for a target platform (Ubuntu OS), then refer this [documentation](executable.md). +> Note: If planning to freeze the eSim source code for a target platform (Ubuntu OS), then refer this [documentation](executable.md). Remember to update the installer script to work with this executable! ## How to package eSim for Ubuntu OS? @@ -12,7 +12,7 @@ It contains the documentation to packaging eSim and making binaries for distribu 2. Add the installer script `install-eSim.sh` in `eSim-` folder. -3. Add the eSim executable (if available) in `eSim-` folder. Also, remove following files from the folder: +3. Add the eSim executable (if available) in `eSim-` folder. Also, remove following files from this folder: - `.git` folder - `code` folder - `src` folder (Applicable only if eSim executable is used) -- cgit