summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3300e7b38751194a743265ce32c3d2372f9f61aa (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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# Maintainer:
# Contributor: Michael Migliore <mcmigliore+aur@gmail.com>
# Contributor: Mathieu Wespthal <mathieu.westphal+aur@gmail.com>

# prevent git-lfs error
export GIT_LFS_SKIP_SMUDGE=1

_pkgname="f3d"
pkgname="$_pkgname-git"
pkgver=2.5.0.r13.g0e0b9b0
pkgrel=1
pkgdesc='A fast and minimalist 3D viewer'
url="https://github.com/f3d-app/f3d"
license=('BSD-3-Clause')
arch=('x86_64')

depends=(
  alembic
  assimp
  boost-libs
  draco
  fmt
  glew
  hicolor-icon-theme
  libxcursor
  netcdf
  nlohmann-json
  onetbb
  opencascade
  openexr
  ospray
  pugixml
  python
  usd
  verdict
  vtk
)
makedepends=(
  boost
  cmake
  eigen
  fast_float
  git
  help2man
  jdk-openjdk
  ninja
  openmp
  pybind11
  python
  utf8cpp
)
optdepends=(
  java-runtime
)

provides=("$_pkgname=${pkgver%%.r*}")
conflicts=("$_pkgname")

_pkgsrc="$_pkgname"
source=("$_pkgname"::"git+$url.git")
sha256sums=('SKIP')

pkgver() {
  cd "$_pkgsrc"
  git describe --long --tags --abbrev=7 --exclude='*[a-zA-Z][a-zA-Z]*' \
    | sed -E 's/^[^0-9]*//;s/([^-]*-g)/r\1/;s/-/./g'

}

build() {
  local _cmake_options=(
    -B build
    -S "$_pkgsrc"
    -G Ninja
    -DCMAKE_BUILD_TYPE=None
    -DCMAKE_INSTALL_PREFIX='/usr'
    -DF3D_BINDINGS_JAVA=ON
    -DF3D_BINDINGS_PYTHON=ON
    -DF3D_LINUX_GENERATE_MAN=ON
    -DF3D_MODULE_EXTERNAL_RENDERING=ON
    -DF3D_MODULE_RAYTRACING=ON
    -DF3D_MODULE_EXR=ON
    -DF3D_PLUGINS_STATIC_BUILD=ON
    -DF3D_PLUGIN_BUILD_ALEMBIC=ON
    -DF3D_PLUGIN_BUILD_ASSIMP=ON
    -DF3D_PLUGIN_BUILD_DRACO=ON
    -DF3D_PLUGIN_BUILD_OCCT=ON
    -DF3D_PLUGIN_BUILD_USD=ON
    -DBUILD_TESTING=OFF
    -Wno-dev
  )

  cmake "${_cmake_options[@]}"
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
  DESTDIR="$pkgdir" cmake --install build --component mimetypes
  DESTDIR="$pkgdir" cmake --install build --component sdk
  DESTDIR="$pkgdir" cmake --install build --component configuration

  install -Dm644 "$_pkgsrc/LICENSE.md" -t "$pkgdir/usr/share/licenses/$pkgname/"
}