summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0fbb3f1103f9afc4ca9b66effbf2e2a725dc3f73 (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
# Maintainer: Michael Yang <ohmyarchlinux@gmail.com>

pkgname=ctk-widgets-git
pkgver=0.1.0.r5270.cfbb46a7
pkgrel=1
pkgdesc='A collection of Qt Widgets for usage in biomedical imaging applications'
arch=('i686' 'x86_64')
url="https://github.com/commontk/CTK/"
license=('APACHE')
depends=('qt5-tools')
makedepends=('git' 'cmake>=2.8.12')
conflicts=('ctk')
source=('git://github.com/commontk/CTK.git')
sha512sums=('SKIP')

pkgver() {
  cd CTK
  echo "$(grep "set(CTK_MAJOR_VERSION" CMakeLists.txt | cut -d ' ' -f2 | cut -d ')' -f1).$(grep "set(CTK_MINOR_VERSION" CMakeLists.txt | cut -d ' ' -f2 | cut -d ')' -f1).$(grep "set(CTK_PATCH_VERSION" CMakeLists.txt | cut -d ' ' -f2 | cut -d ')' -f1).r$(git rev-list --count HEAD).$(git rev-parse --short HEAD)"
}

prepare() {
  mkdir -p build
}

build() {
  cd build
  cmake ../CTK \
    -DCTK_SUPERBUILD=OFF \
    -DCTK_QT_VERSION=5 \
    -DCTK_LIB_Widgets=ON \
    -DBUILD_TESTING=OFF \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr
  make
}

package() {
  make -C build DESTDIR="${pkgdir}" install
  cd CTK
  cp \
    CMake/ctkFunctionGeneratePluginUseFile.cmake \
    CMake/ctkFunctionExtractPluginTargets.cmake \
    CMake/ctkFunctionGetAllPluginTargets.cmake \
    CMake/ctkFunctionGetTargetDependencies.cmake \
    CMake/ctkFunctionGetPluginDependencies.cmake \
    CMake/ctkMacroSetupPlugins.cmake \
    ${pkgdir}/usr/lib/ctk-*/CMake
  install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/ctk-widgets-git/LICENSE
}