summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f703f61730fd5a1915b189cd5250a3656f2b5f41 (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
# Maintainer:  Vitalii Kuzhdin <vitaliikuzhdin@gmail.com>

pkgname="mcut"
pkgver=1.3.0
pkgrel=1
pkgdesc="Library for detecting and resolving intersections between two surface meshes"
arch=('x86_64')
url="https://cutdigital.github.io/mcut.site/"
_url="https://github.com/cutdigital/${pkgname}"
license=('LGPL-3.0-or-later')
depends=('gcc-libs' 'glibc')
makedepends=('cmake>=3.13')
provides=("lib${pkgname}.so")
_pkgsrc="${pkgname}-${pkgver}"
source=("${_pkgsrc}.tar.gz::${_url}/archive/refs/tags/v${pkgver}.tar.gz")
b2sums=('35cbe68e36489b720fcfbee98d2b9d5f41cbf37313f170300c6ef27b3dc49f25370429a2517f01b6d605f4a46d9e809d7f8ec076f30756359b9941316ebea52d')

build() {
  local cmake_options=(
    -G 'Unix Makefiles'
    -B "${_pkgsrc}/build"
    -S "${_pkgsrc}"
    -Wno-dev
    -DCMAKE_BUILD_TYPE:STRING='None'
    -DCMAKE_INSTALL_PREFIX:PATH='/usr'
    -DMCUT_BUILD_AS_SHARED_LIB=ON
    -DMCUT_BUILD_DOCUMENTATION=OFF
    -DMCUT_BUILD_TESTS=OFF
    -DMCUT_BUILD_TUTORIALS=OFF
  )

  cd "${srcdir}"
  cmake "${cmake_options[@]}"
  cmake --build "${_pkgsrc}/build"
}

# check() {
#   local excluded_tests=""
#   local ctest_flags=(
#     --test-dir "${_pkgsrc}/build"
#     --output-on-failure
#     --parallel $(nproc)
#     --exclude-regex "${excluded_tests}"
#   )
# 
#   cd "${srcdir}"
#   ctest "${ctest_flags[@]}"
# 

package() {
  cd "${srcdir}"
  # DESTDIR="${pkgdir}" cmake --install "${_pkgsrc}/build"

  cd "${_pkgsrc}"
  find "include" -mindepth 1 -maxdepth 2 -type f -exec \
    install -vDm644 "{}" "${pkgdir}/usr/{}" \;

  install -vDm644 "README.md" "${pkgdir}/usr/share/doc/${pkgname}/README.md"
  install -vDm644 "LICENSE.txt" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  install -vDm644 "COPYING.LESSER" "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"

  cd "build/bin"
  install -vDm644 "lib${pkgname}.so".* -t "${pkgdir}/usr/lib/"

  cd "${pkgdir}/usr"
  # find . -mindepth 1 -maxdepth 1 -type f -delete

  cd "lib"
  for lib in *.so.*; do
    ln -vsf "${lib}" "${lib%.[0-9]*.[0-9]*.[0-9]*}"
    ln -vsf "${lib}" "${lib%.[0-9]*.[0-9]*}"
  done
}

# vim:set ts=2 sw=2 et: