Commit d965b0f8 authored by Tom Pillot's avatar Tom Pillot
Browse files

Fix #1

parent 56f1f4a6
......@@ -16,15 +16,19 @@ wget -P /tmp https://github.com/koendv/qt5-opengl-raspberrypi/releases/download/
apt-get install -y /tmp/qt5-opengl-dev_5.12.5_armhf.deb
EOF
# Download and build aseba
# Download and build aseba, scratch and blockly
on_chroot << EOF
cd /home/${FIRST_USER_NAME}
git clone --recursive --depth 1 --branch game https://gitlab.laas.fr/tpillot/aseba.git
cd aseba
git submodule update --init
wget https://github.com/Mobsya/scratch-gui/releases/download/v20200505.1/scratch-gui.tar.gz
tar -zxvf scratch-gui.tar.gz
wget https://github.com/Mobsya/thymio-blockly-standalone/releases/download/v20200506.1/thymio-blockly.tar.gz
tar -zxvf thymio-blockly.tar.gz
mkdir build && cd build
export CMAKE_PREFIX_PATH=/usr/lib/qt5.12
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF ..
cmake -DMOBSYA_WEBAPPS_ROOT_DIR=share/ -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF ..
make -j4
make install
cd ../..
......
#!/bin/bash -e
# Download and build Blockly
on_chroot << EOF
cd /opt
git clone https://github.com/Mobsya/thymio-blockly-standalone.git
chmod -R 777 thymio-blockly-standalone/
cd thymio-blockly-standalone/
npm i
npm run build
EOF
# Script to run Blockly, thymio-device-manager needs to be launched before Blockly
cat > "${ROOTFS_DIR}/opt/thymio-blockly-standalone/run-blockly.sh" << EOF
#!/bin/bash
pgrep -f thymio-device-manager
if [ \$? -eq 0 ]; then
echo "thymio-device-manager is already running."
else
echo "Running thymio-device-manager ..."
thymio-device-manager& > /dev/null
fi
chromium-browser /opt/thymio-blockly-standalone/thymio_blockly/thymio_blockly.fr.html &> /dev/null
EOF
chmod +x "${ROOTFS_DIR}/opt/thymio-blockly-standalone/run-blockly.sh"
# Add a desktop shortcut
cat > "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/Desktop/blockly.desktop" << EOF
[Desktop Entry]
Type=Link
Name=Blockly
Icon=thymio-blockly-icon
URL=/usr/local/share/applications/blockly.desktop
EOF
cat > "${ROOTFS_DIR}/usr/local/share/applications/blockly.desktop" << EOF
[Desktop Entry]
Type=Application
Name=Blockly
Icon=thymio-blockly-icon
Exec=/opt/thymio-blockly-standalone/run-blockly.sh
Categories=Education;Science;
EOF
# Allow user to edit and run desktop entries
chmod -R 777 "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/Desktop/"
# Add an icon for Blockly
cp "${ROOTFS_DIR}/opt/thymio-blockly-standalone/thymio_blockly/media/thymio-blockly-icon.png" "${ROOTFS_DIR}/usr/share/pixmaps/"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment