1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
| #!/bin/sh
# installqcad, installeur de qcad
# Copyright (C) 2023 Mathieu SERPA
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
if test ${UID:-$(id -u)} -gt 0; then echo "must be root"; exit 1; fi
apt update
apt install qtbase5-dev #pour qmake
version="$(qmake --version | tail -1 | cut -d ' ' -f4)"
dirinstall=/tmp/qcad
aujourdhui="$(date|cut -d\ -f2,3,4)"
apt install gcc make libx11-dev libxext-dev libxrender-dev libglu1-mesa-dev libfreetype6-dev libfontconfig1-dev libssl-dev libdbus-1-dev libsm-dev gcc make libx11-dev libxext-dev libxrender-dev libglu1-mesa-dev libfreetype6-dev libfontconfig1-dev libssl-dev libdbus-1-dev libsm-dev qt5-qmake libqt5svg5-dev libqt5script5 libqt5help5 libqt5designer5 libqt5scripttools5 qtscript5-dev qtxmlpatterns5-dev-tools libqt5xmlpatterns5 libqt5xmlpatterns5-dev libqt5designer5 python3-pyside2.qtuitools libqscintilla2-qt5-designer libqt5designer5 qttools5-dev qt5-image-formats-plugins qtwayland5 qtwayland5-dev-tools libqt5waylandclient5 qtscript5-dev qttools5-dev libqt5xmlpatterns5-dev
if [ -d $dirinstall ];then
mv $dirinstall $dirinstall-"$aujourdhui"
fi
mkdir -p $dirinstall
git clone git@github.com:qcad/qcad.git $dirinstall
if [ ! -d $dirinstall/src/3rdparty/qt-labs-qtscriptgenerator-"$version" ] ;then
mkdir -p $dirinstall/src/3rdparty/qt-labs-qtscriptgenerator-"$version"
cd $dirinstall/src/3rdparty/qt-labs-qtscriptgenerator-"$version"
cat > qt-labs-qtscriptgenerator-"$version".pro <<FIN
include( ../../../shared.pri )
SUBDIRS = ../qt-labs-qtscriptgenerator-5.5.0/qtbindings
TEMPLATE = subdirs
FIN
fi
cd $dirinstall
qmake -r CONFIG+=ractivated
make release
cp -r $dirinstall /opt
cat > /usr/local/bin/qcad <<FIN
XDG_SESSION_TYPE=x11
LD_LIBRARY_PATH=/opt/qcad/release /opt/qcad/release/qcad-bin
FIN
chmod 755 /usr/local/bin/qcad
cp /opt/qcad/qcad.desktop /usr/share/applications
if [ ! -d /usr/local/share/icons/hicolor/256x256/apps ];then
mkdir -p /usr/local/share/icons/hicolor/256x256/apps
fi
cp /opt/qcad/scripts/qcad_icon.png /usr/local/share/icons/hicolor/256x256/apps
rm -rf $dirinstall
mv $dirinstall$-$aujourdhui $dirinstall |