desktop/librecad/PKGBUILD
2018-10-25 05:24:01 +02:00

70 lines
2.5 KiB
Bash

pkgname=librecad
pkgver=2.1.3
pkgrel=1
pkgdesc="A 2D CAD drawing tool based on the community edition of QCad"
arch=('x86_64')
url="http://www.librecad.org/"
license=('GPL')
depends=('qt5-base' 'qt5-svg' 'libxcb' 'muparser')
makedepends=('qt5-tools' 'boost' 'imagemagick' 'librsvg')
conflicts=('librecad-git')
replaces=('librecad-svn' 'caduntu' 'caduntu-svn')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/LibreCAD/LibreCAD/archive/${pkgver}.tar.gz"
librecad-qt-5.11.patch)
sha256sums=('74c4ede409b13d0365c65c0cd52dba04f1049530f6df706dc905443d5e60db06'
'85f246a1f44f1d6bf9c1b8625a9b6a1949faee0eaedee2c90661d153ef9a0f77')
prepare() {
cd "${srcdir}/LibreCAD-${pkgver}"
# fix version string
sed -i "/^SCMREVISION/c SCMREVISION=\"${pkgver}\"" librecad/src/src.pro
# Qt 5.11 build fix
patch -p1 ../librecad-qt-5.11.patch
}
build() {
cd "${srcdir}/LibreCAD-${pkgver}"
qmake-qt5 librecad.pro
# fix include path... this is an issue with gcc 6.1.1 and qmake-qt5...
make qmake_all
sed -i '/INCPATH/s|-isystem /usr/include ||' librecad/src/Makefile
make
}
package() {
cd "${srcdir}/LibreCAD-${pkgver}"
# executables
install -D -m0755 unix/librecad "${pkgdir}/usr/bin/librecad"
install -D -m0755 unix/ttf2lff "${pkgdir}/usr/bin/ttf2lff"
# desktop file and man pages
install -D -m0644 desktop/librecad.desktop "${pkgdir}/usr/share/applications/librecad.desktop"
install -D -m0644 desktop/librecad.1 "${pkgdir}/usr/share/man/man1/librecad.1"
# documentation
install -D -m0644 librecad/support/doc/README "${pkgdir}/usr/share/doc/librecad/index.README"
install -D -m0644 librecad/support/doc/index.html "${pkgdir}/usr/share/doc/librecad/index.html"
install -D -m0644 librecad/support/doc/style.css "${pkgdir}/usr/share/doc/librecad/style.css"
install -D -m0644 librecad/support/doc/img/librecadlogo.png "${pkgdir}/usr/share/doc/librecad/img/librecadlogo.png"
# icons
for SIZE in 16 24 32 48 64 96 128; do
# set modify/create for reproducible builds
convert -scale ${SIZE} +set date:create +set date:modify \
desktop/graphics_icons_and_splash/Icon\ LibreCAD/Icon_Librecad.svg \
${srcdir}/librecad.png
install -D -m0644 ${srcdir}/librecad.png "${pkgdir}/usr/share/icons/hicolor/${SIZE}x${SIZE}/apps/librecad.png"
done
install -D -m0644 desktop/graphics_icons_and_splash/Icon\ LibreCAD/Icon_Librecad.svg "${pkgdir}/usr/share/icons/hicolor/scalable/apps/librecad.svg"
# resources
mkdir -p "${pkgdir}/usr/share/librecad/"
cp -r unix/resources/{library,patterns,fonts,qm} "${pkgdir}/usr/share/librecad/"
}