summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 904b5c01a0b8932aa0a4f2f3feafdfefd4923112 (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
# Maintainer: acxz <akashpatel2008 at yahoo dot com>
pkgname=libiges-git
pkgver=r225.efb93fd
pkgrel=2
pkgdesc="Implementation of the IGESv5.3 specification"
arch=('i686' 'x86_64')
url="http://cbernardo.github.io/libIGES"
license=('LGPL-2.1')
depends=('gcc')
optdepends=('sisl')
makedepends=('git' 'cmake')
_name=libIGES
provides=('libiges')
conflicts=('libiges')
source=("git+https://github.com/cbernardo/libIGES.git")
md5sums=('SKIP')

pkgver() {
  cd "$_name"

  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"

}

_buildtype="Release"

_cmake_options=()

check_optdepends() {
    # Check if sisl is installed
    if (pacman -Qqs sisl >/dev/null) ; then
        msg "Enabling sisl support"
        _cmake_options=(${_cmake_options[@]} -DUSE_SISL=ON)
    else
        msg "Disabling sisl support"
    fi
}

build() {

    # Check optional dependencies
    check_optdepends

    # Create a build directory
    mkdir -p "${srcdir}/${_name}/build"
    cd "${srcdir}/${_name}/build"

    msg "Starting CMake (build type: ${_buildtype})"

    cmake .. \
        -DCMAKE_BUILD_TYPE="${buildtype}" \
        -DCMAKE_INSTALL_PREFIX="/usr" \
        ${_cmake_options[@]}

    msg "Building the project"
    make
}

package() {
    cd "${srcdir}/${_name}/build"

    msg "Installing files"
    make DESTDIR="${pkgdir}/" install
}