Linux HOWTOs

About | Home | Search

HOWTO: qcad
Description: GPL 2D Computer Aided Drafting software
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything

# QCad (Community Edition)
# ==============
test -f installed/qcad/qcad- &&
 mv installed/qcad/qcad- .
test ! -f qcad- &&

# Become root to install and build it
# (because it's going into /usr/local)

test -L /usr/local/qcad && rm -f /usr/local/qcad
find /usr/local -maxdepth 1 -type d -name "qcad-*-community.src" \
 -exec rm -r {} \;
tar xzvf qcad- -C /usr/local
chown -R root:root /usr/local/qcad-
ln -s /usr/local/qcad- /usr/local/qcad

# If you want to install the Part Library (of 4,500 parts and symbols):
test -f installed/qcad/ &&
 mv installed/qcad/ .
test ! -f &&
chown $USER
cp -a partlibrary-* /usr/local/qcad/qcad/library/
rm -r ./partlibrary-

# ** Keep in mind that these environment variables below may exist as your
# non-root user or when you su with a login shell (su -), but you're running
# su right now and it's not a login shell, so you'll probably have to set
# these.

# If you have a /etc/profile.d/, source it so we have QTDIR, and the
# updated PATH:
test -f /etc/profile.d/ && . /etc/profile.d/

# Make sure the QTDIR environment variable is set, if not, run something
# like this (replacing /usr/lib/qt with where it actually is):
test -z "$QTDIR" &&
 ( test -d /usr/lib/qt && export QTDIR=/usr/lib/qt
   test -d /opt/qt && export QTDIR=/opt/qt )   

# Set QMAKESPEC to the appropriate spec for your platform.  This is what I
# used:
export QMAKESPEC=$QTDIR/mkspecs/linux-g++

# Make sure 'qmake' is in your PATH:
which qmake

# If it wasn't found, make sure QT's bin directory is in your PATH:
# (this should already be set via /etc/profile.d/, /etc/profile,
# ~/.profile, etc.)
echo $PATH | grep -q "$QTDIR/bin" || export PATH="$PATH:$QTDIR/bin"

# Now actually build it.  I add the "notrans" option because I don't need
# them, but also because the is missing.

cd /usr/local/qcad-
sh ./ notrans

# If you downloaded the Part Library, install it:
test "$USER" != "root" &&
 ( NRHD=`finger $USER | egrep "^Directory: " | awk '{ print $2 }'`
   test -f ${NRHD}/ &&
      unzip ${NRHD}/ \
       -d /usr/local/qcad/qcad/library
   unset NRHD )

### If you want to install the docs (accessible as Help -> Manual in Qcad):

# Become yourself again

mkdir -p -m 0700 installed/qcad
rm -f installed/qcad/qcad-*-community.src.tar.*
mv -f qcad- \

# /usr/local/qcad/qcad/src/xpm/qcad.xpm can be used as a desktop icon

## To run it:
# cd /usr/local/qcad/qcad
# ./qcad

# The documentation is here:

Back to the list

Last updated: Wed, 29 Apr 2020 22:04:50 -0400
Jason Englander <jason at englanders dot us>