fma
Hi!
 
I just wanted to share an install script for debian sid. It works fine when writing this message(2025-06-23), but can need a few adjustements in the future, as sid evolves quickly.
 
Hope this can help.
 
#!/bin/bash 

echo -e "\nInstalling OpenPLC Editor"
OPENPLC_DIR="$PWD"
VENV_DIR="$OPENPLC_DIR/.venv"

echo -e "\nInstalling system dependencies"
sudo apt update
sudo apt install build-essential bison flex autoconf \
                automake make git libgtk-3-dev


cd /usr/local/src
if [ ! -f "Python-3.9.16.tgz" ]
then
   echo -e "\nInstalling Python 3.9"
   wget https://www.python.org/ftp/python/3.9.16/Python-3.9.16.tgz
   tar xvf Python-3.9.16.tgz
   cd Python-*/
   ./configure --enable-optimizations
   make altinstall
fi

echo -e "\nInstalling Python 3.9 dependencies"
python3.9 -m venv "$VENV_DIR"
"$VENV_DIR/bin/python" -m pip install --upgrade pip
"$VENV_DIR/bin/python" -m pip install wheel jinja2 lxml==4.6.2 future matplotlib zeroconf pyserial pypubsub pyro5 attrdict3 pycountry
"$VENV_DIR/bin/python" -m pip install wxPython==4.2.0


echo -e "\nCompiling matiec"
cd $OPENPLC_DIR/matiec
autoreconf -i
./configure
make -s
cp ./iec2c ../editor/arduino/bin/
cd ..


echo -e "\nFinalizing"
WORKING_DIR=$(pwd)  # == $OPENPLC_DIR?!?
echo -e "#!/bin/bash\n\
cd $WORKING_DIR\n\
if [ -d \"./new_editor\" ]\n\
then\n\
   rm -Rf editor\n\
   rm -Rf ./matiec/lib\n\
   mv ./new_editor ./editor\n\
   mv ./new_lib ./matiec/lib\n\
fi\n\
./.venv/bin/python3 ./editor/Beremiz.py" > openplc_editor.sh
chmod +x ./openplc_editor.sh

mkdir -p ~/.local/share/applications
cd ~/.local/share/applications || exit
echo -e "[Desktop Entry]\n\
Name=OpenPLC Editor\n\
Categories=Development;\n\
Exec=\"$WORKING_DIR/openplc_editor.sh\"\n\
Icon=$WORKING_DIR/editor/images/brz.png\n\
Type=Application\n\
Terminal=false" > OpenPLC_Editor.desktop
 
Reply 1 0
Reply