Skip to content

Instantly share code, notes, and snippets.

@plut0nium
Last active August 29, 2025 13:14
Show Gist options
  • Save plut0nium/f2bba3fcc3aac3ab7a257272424401ab to your computer and use it in GitHub Desktop.
Save plut0nium/f2bba3fcc3aac3ab7a257272424401ab to your computer and use it in GitHub Desktop.
PKGBUILD to build an Archlinux package for QCAD Professional Edition

QCAD Professional for Archlinux

This PKGBUILD can be used to create an Archlinux package for the Professional Edition of QCAD. This allows the system package manager to be aware of the installation, and avoids conflicts with a potential parallel installation of the Community Edition.

It also ensures that everything is removed when uninstalling, using the distribution package manager (pacman).

Usage

Requires the user to purchase a QCAD Professional License and manually download the .tar.gz archive. It should be placed in the same folder as the PKGBUILD before running makepkg.

# Maintainer: Charles Fourneau <[email protected]>
pkgname=qcad-professional
pkgver=3.32.3.1
pkgrel=1
pkgdesc="A 2D CAD package based upon Qt - Professional Edition"
arch=('x86_64')
url="https://qcad.org"
license=('GPL-3.0-or-later')
provides=('qcad')
conflicts=('qcad')
depends=('xdg-utils')
source=("qcad-3.32.3.1-pro-linux-qt6-x86_64.tar.gz")
sha256sums=('814050a8a6e64abda2e95d5dde79adf373ec059b7a211459bddf30bf908e3db3')
package() {
# Copy the pre-extracted files from $srcdir to $pkgdir
install -dm755 "${pkgdir}/opt/${pkgname}"
local srcfolder=${source[0]%.tar.gz}
cp -a "${srcdir}/${srcfolder}"/* "${pkgdir}/opt/${pkgname}"
# remove bundled xdg utils - we have them as deps
rm -rf "${pkgdir}/opt/${pkgname}/xdg"
# Create a symlink for the main binary
install -dm755 "${pkgdir}/usr/bin"
ln -s "/opt/${pkgname}/qcad" "${pkgdir}/usr/bin/qcad"
cd "${pkgdir}/opt/${pkgname}"
# taken from QCAD postinstall.sh
cat > "${pkgname}.desktop" <<EOF
[Desktop Entry]
Encoding=UTF-8
Name=QCAD
GenericName=CAD Software
GenericName[da]=Computerhjulpet design (CAD)
GenericName[de]=System für computerunterstütztes Zeichnen (CAD)
GenericName[it]=Sistema CAD
GenericName[ja]=コンピュータ支援設計 (CAD) システム
GenericName[ru]=Система автоматизированного проектирования
GenericName[sk]=CAD systém
GenericName[uk]=Система автоматизованого проектування
Comment=A professional 2D CAD System
Comment[es]=Un sistema 2D CAD profesional
Comment[ru]=Профессиональная 2D CAD система
Comment[sq]=Një sistem profesional 2D CAD
Comment[be]=Прафэсійная 2D CAD-сыстэма
Comment[ast]=Un sistema 2D CAD profesional
Comment[bn]=পেশাদারী CAD পদ্ধতি
Comment[bs]=Profesionalni sistem 2D CAD
Comment[pt_BR]=Um sistema 2D CAD profissional
Comment[bg]=Професионална 2D CAD система
Comment[ca]=Un sistema 2D CAD professional
Comment[ca@valencia]=Un sistema 2D CAD professional
Comment[zh_HK]=專業 2D CAD 系統
Comment[da]=Et professionelt 2D CAD-system
Comment[cs]=Profesionální 2D CAD systém
Comment[crh]=Profesyonel 2D CAD Sistemi
Comment[zh_TW]=專業 2D CAD 系統
Comment[zh_CN]=一个专业的 2D CAD 系统
Comment[nl]=Een professioneel 2D CAD-systeem
Comment[fi]=Ammattimainen 2D CAD-järjestelmä
Comment[fr]=Un système de 2D CAO professionnel
Comment[gl]=Un sistema de 2D CAD profesional
Comment[de]=Ein professionelles 2D CAD-System
Comment[el]=Ένα επαγγελματικό σύστημα σχεδίασης 2D CAD
Comment[is]=Hágæða teiknikerfi (2D CAD)
Comment[hu]=Professzionális 2D CAD-rendszer
Comment[it]=Un sistema 2D CAD professionale
Comment[ja]=プロフェッショナル 2D CAD システム
Comment[ky]=Кесиптик 2D CAD - тутуму
Comment[ms]=Sistem 2D CAD profesional
Comment[nb]=Et profesjonelt 2D CAD-system
Comment[pt]=Um sistema 2D CAD profissional
Comment[pl]=Profesjonalny system 2D CAD
Comment[oc]=Un sistèma de CAO professional
Comment[ro]=Un sistem profesional 2D CAD
Comment[tg]=Системаи касбии 2D CAD
Comment[sv]=Professionellt 2D CAD-system
Comment[sl]=Profesionalni sistem 2D CAD
Comment[uk]=Професійна 2D САПР
Comment[tr]=Profesyonel 2D CAD Sistemi
Exec=qcad %F
Terminal=false
X-MultipleArgs=true
Type=Application
Icon=${pkgname}
Categories=Graphics;VectorGraphics;Engineering;Construction;2DGraphics;Science;
MimeType=application/dxf;application/dwg;image/vnd.dxf;image/vnd.dwg;image/x-dwg
EOF
cat > "qcad-mimetypes.xml" <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="image/vnd.dxf">
<comment xml:lang="en">Drawing Exchange Format</comment>
<glob pattern="*.dxf"/>
</mime-type>
<mime-type type="application/dxf">
<comment xml:lang="en">CAD Drawing</comment>
<glob pattern="*.dxf"/>
</mime-type>
<mime-type type="application/dwg">
<comment xml:lang="en">CAD Drawing</comment>
<glob pattern="*.dwg"/>
</mime-type>
<mime-type type="image/vnd.dwg">
<comment xml:lang="en">CAD Drawing</comment>
<glob pattern="*.dwg"/>
</mime-type>
<mime-type type="image/x-dwg">
<comment xml:lang="en">CAD Drawing</comment>
<glob pattern="*.dwg"/>
</mime-type>
</mime-info>
EOF
# desktop file
install -Dm644 ${pkgname}.desktop "${pkgdir}/usr/share/applications/${pkgname}.desktop"
# mimetypes
install -Dm644 qcad-mimetypes.xml "${pkgdir}/usr/share/mime/packages/qcad-mimetypes.xml"
# Install the icon
if [ -f "qcad_icon.png" ]; then
install -dm755 "${pkgdir}/usr/share/icons/hicolor/256x256/apps"
ln -s "/opt/${pkgname}/qcad_icon.png" "${pkgdir}/usr/share/icons/hicolor/256x256/apps/${pkgname}.png"
fi
# man page
if [ -f "qcad.1" ]; then
install -Dm644 qcad.1 "${pkgdir}/usr/share/man/man1/qcad.1"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment