# https://www.eclipse.org/downloads/packages/

apt install -y build-essential gdb

ECLIPSE_DEST=/opt
DOWNLOAD_URL=https://rhlx01.hs-esslingen.de/pub/Mirrors/eclipse/technology/epp/downloads/release/2021-09/R/eclipse-cpp-2021-09-R-linux-gtk-x86_64.tar.gz
DOWNLOAD_URL=https://rhlx01.hs-esslingen.de/pub/Mirrors/eclipse/technology/epp/downloads/release/2021-06/R/eclipse-cpp-2021-06-R-linux-gtk-x86_64.tar.gz

wget -c -O /var/tmp/${DOWNLOAD_URL##*/} ${DOWNLOAD_URL}

tar xzf /var/tmp/${DOWNLOAD_URL##*/} -C $ECLIPSE_DEST

# Desktop entry
cat > /usr/share/applications/eclipse_cdt.desktop <<'EOF'
[Desktop Entry]
Name=Eclipse CDT
Comment=C/C++ IDE
Type=Application
Categories=Development;IDE;
Exec=/opt/eclipse/eclipse
Terminal=false
StartupNotify=true
Icon=/opt/eclipse/icon.xpm
Name[en_US]=Eclipse CDT
EOF


## Plugins to install in addition to CDT
## Dark theme
#/opt/eclipse/eclipse \
#	-application org.eclipse.equinox.p2.director
#	-repository http://download.eclipse.org/releases/galileo/
#	-installIU org.eclipse.cdt.feature.group
#	-destination /opt/eclipse/
#	-profile SDKProfile
#
## LVGL simulator (embedded device graphics)
#
## Vi support
#
## ESP-IDF Esp32 api
#/opt/eclipse/eclipse \
#	-application org.eclipse.equinox.p2.director
#	-nosplash --launcher.suppressErrors -consoleLog -flavor tooling 
#	-repository http://download.eclipse.org/releases/galileo/
#	-installUI com.espressif.idf.feature.feature.group
#	-destination /opt/eclipse
#	-profile SDKProfile
