summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 05476d10c8ab5459459c41798d4fffb903fcffc0 (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
# Maintainer: Nico <d3sox at protonmail dot com>
# Contributor Michael Yang <ohmyarchlinux@gmail.com>

pkgname=qmlfmt-git
_gitname=${pkgname%-git}
pkgver=r41.ae27bff
pkgrel=1
pkgdesc="Command line application that formats QML files"
arch=('i686' 'x86_64')
url="https://github.com/jesperhh/qmlfmt"
license=('unknown')
depends=('qt5-base')
makedepends=('git' 'cmake>=3.0' 'qt5-script' 'qt5-declarative')
conflicts=('qmlfmt')
provides=('qmlfmt')
source=("git+https://github.com/jesperhh/${_gitname}.git")
sha512sums=('SKIP')

pkgver() {
  cd "${_gitname}"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd "${_gitname}"
  git submodule update --init qt-creator
  mkdir -p build
}

build() {
  cd "${_gitname}/build"
  cmake .. \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr
  make
}

package() {
  cd "${_gitname}"
  mkdir -p "${pkgdir}/usr/bin"
  install -Dm 755 build/qmlfmt "${pkgdir}/usr/bin"
}