summaryrefslogtreecommitdiff
path: root/community/qcad/PKGBUILD
blob: 50db0697bc8a68242fb678ed8c6db36925526b16 (plain)
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
62
63
64
65
66
67
# $Id: PKGBUILD 116102 2014-07-22 13:25:23Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Stefan Husmann <stefan-husmann@t-online.de>
# Contributor: Giovanni Scafora <linuxmania@gmail.com>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>

pkgname=qcad
pkgver=3.6.2.0
pkgrel=1
pkgdesc="A 2D CAD package based upon Qt"
arch=('i686' 'x86_64')
url="http://www.qcad.org"
license=('GPL3')
depends=('qtwebkit')
makedepends=('glu')
options=('libtool')
source=($pkgname-$pkgver.tar.gz::https://github.com/qcad/qcad/archive/v${pkgver}.tar.gz
        QCad.desktop)
md5sums=('498bc7e98b29889eedb7ecd72dc12010'
         '84f189dd152e7614a1265659dac6222d')

prepare() {
  cd ${srcdir}/qcad-$pkgver
  sed -i '1,1i#include <stdint.h>' src/core/RThread.cpp
#  (cd src/3rdparty && cp -a qt-labs-qtscriptgenerator-4.8.5 qt-labs-qtscriptgenerator-4.8.6)
#  (cd src/3rdparty/qt-labs-qtscriptgenerator-4.8.6/ && mv qt-labs-qtscriptgenerator-4.8.5.pro qt-labs-qtscriptgenerator-4.8.6.pro)
}

build() {
  cd ${srcdir}/qcad-$pkgver
  qmake-qt4 -r
  make all -j1
}

package() {
  cd ${srcdir}/qcad-$pkgver

  # remove project files
  find . \( -name '*.pri' -or -name '.pro' -or -name '*.ts' \) -delete
  find . \( -name 'Makefile' -name '.gitignore' \) -delete

  install -dm755 ${pkgdir}/usr/share/{qcad,pixmaps,applications}
  cp -r examples fonts libraries patterns plugins scripts ts ${pkgdir}/usr/share/qcad
  cp debug/* ${pkgdir}/usr/share/qcad

  install -m755 readme.txt ${pkgdir}/usr/share/qcad/readme.txt

  # qtwebkit
  ln -sf /usr/lib/qt4/plugins/designer/libqwebview.so ${pkgdir}/usr/share/qcad/plugins/designer/libqwebview.so
  # qt
  for sofiles in /usr/lib/qt4/plugins/imageformats/*.so
  do
    ln -sf ${sofiles} ${pkgdir}/usr/share/qcad/plugins/imageformats/${sofiles##/*/}
  done
  for sofiles in /usr/lib/qt4/plugins/sqldrivers/*.so
  do
    ln -sf ${sofiles} ${pkgdir}/usr/share/qcad/plugins/sqldrivers/${sofiles##/*/}
  done

  install -Dm644 scripts/qcad_icon.png ${pkgdir}/usr/share/pixmaps/qcad_icon.png
  install -Dm644 $srcdir/QCad.desktop ${pkgdir}/usr/share/applications/QCad.desktop

  install -dm0755 $pkgdir/usr/bin
  echo -e '#!/bin/sh\nLD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}"/usr/share/qcad" exec /usr/share/qcad/qcad-bin "$@"' >$pkgdir/usr/bin/qcad

  chmod 0755 $pkgdir/usr/bin/qcad
}