summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8b51d62655282641fb9198fd5e6353a60acb47a7 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Maintainer: Felix Barz <skycoder42.de@gmx.de>
pkgbase=qpmx
pkgname=(qpmx qpmx-gitsource qpmx-qpmsource)
group=qpmx-full
pkgver=1.6.0
pkgrel=2
pkgdesc="A frontend for qpm, to provide source and build caching"
arch=('i686' 'x86_64')
url="https://github.com/Skycoder42/$pkgname"
license=('BSD')
depends=('qt5-base' 'qt5-jsonserializer')
makedepends=('qt5-tools' 'git')
_pkgfqn=$pkgname-$pkgver
source=("$_pkgfqn::git+https://github.com/Skycoder42/$pkgname.git#tag=$pkgver"
        "$pkgname.rule"
        "plugin.rule")
sha256sums=('SKIP'
            '13f2e499671cb094ff244946b733a8e6898152fe60c77cb93bef1e1a19ffbd0e'
            'a7f6099680d692285332ae7db3cf1414f4d664ceccb701d45ac73ecaa08a65dc')

git_submod_rm() {
  submod=$1

  mv $submod $submod.tmp
  git submodule deinit -f -- $submod
  rm -rf .git/modules/$submod
  git rm -f $submod
}

prepare() {
  mkdir -p build

  cd "$_pkgfqn"

  git_submod_rm submodules/qpmx-sample-package

  git submodule update --init --recursive
}

build() {
  cd build

  qmake "PREFIX=/usr" "INSTALL_PLUGINS=$(qmake -query QT_INSTALL_PLUGINS)" "../$_pkgfqn/"
  make qmake_all
  make
}

package_qpmx() {
  optdepends=("qpmx-qpmsource: Adds support for cloning qpm packages"
              "qpmx-gitsource: Adds support for cloning git and github packages"
              "repkg: Automatically rebuild the package on dependency updates"
              "qbs: The qbs build system to use qpmx with qbs")
  install="${pkgname}.install"

  cd build/qpmx
  make INSTALL_ROOT="$pkgdir" install
  cd ../lib
  make INSTALL_ROOT="$pkgdir" install

  cd "../../$_pkgfqn"
  install -D -m644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  install -D -m644 "../${pkgname}.rule" "$pkgdir/etc/repkg/rules/system/${pkgname}.rule"
}

package_qpmx-qpmsource() {
  depends=('qpmx' 'qpm')

  cd build/plugins/qpmsource
  make INSTALL_ROOT="$pkgdir" install

  cd "../../../$_pkgfqn"
  install -D -m644 "../plugin.rule" "$pkgdir/etc/repkg/rules/${pkgname}.rule"
}

package_qpmx-gitsource() {
  depends=('qpmx' 'git')

  cd build/plugins/gitsource
  make INSTALL_ROOT="$pkgdir" install

  cd "../../../$_pkgfqn"
  install -D -m644 "../plugin.rule" "$pkgdir/etc/repkg/rules/${pkgname}.rule"
}