# Note: depends on cmake
# Note: depends on python-uranium
# Note: depends on qtquickcontrols2 at runtime
# Note: depends on qtsvg at runtime for icons
# Note: depends on libsavitar at runtime for 3mf format support
# Note: depends on libcharon at runtime for ufp format support
# Note: depends on libarcus at runtime for curaengine support
wget -c https://github.com/Ultimaker/Cura/archive/3.4.1/Cura-3.4.1.tar.gz
tar -xzf Cura-3.4.1.tar.gz
cd Cura-3.4.1
# Fix some bad defaults
sed -i -e '/addPreference("info\/send_slice_info"/s/True/False/' plugins/SliceInfoPlugin/SliceInfo.py
sed -i -e '/addPreference("info\/asked_send_slice_info"/s/False/True/' plugins/SliceInfoPlugin/SliceInfo.py
sed -i -e '/addPreference("general\/accepted_user_agreement"/s/False/True/' plugins/UserAgreement/UserAgreement.py
rm -rf plugins/FirmwareUpdateChecker
# Don't crash on custom machines
sed -i -e '/"machine_extruder_trains"/,/},/d' resources/definitions/custom.def.json
mkdir -p build
cd build
cmake -DCMAKE_INSTALL_PREFIX="/usr" ..
make
make install