blob: 85ac03341908df6ddce17c4dbc9533e4ef5432cd (
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
#!/hint/bash
# Maintainer : bartus <arch-user-repoᘓbartus.33mail.com>
# Configuration.
_CMAKE_FLAGS+=(
-DCMAKE_INSTALL_PREFIX=/usr
-DCMAKE_INSTALL_LIBDIR=lib
-DEIGEN_INCLUDE_DIR_HINTS=/usr/include/eigen3
-DFLANN_INCLUDE_DIR_HINTS=/usr/include/flann
-D{COINUTILS,CLP,OSI}_INCLUDE_DIR_HINTS=/usr/include/coin
-DLEMON_INCLUDE_DIR_HINTS=/usr/include/lemon
-DCERES_DIR=/usr/include/ceres
-DALICEVISION_BUILD_DOC=OFF
)
# shellcheck disable=SC2206
[[ -v CUDA_ARCH ]] && _cc_list=(${CUDA_ARCH})
# Alow user to build without cuda
if ((DISABLE_CUDA)); then
_CMAKE_FLAGS+=('-DALICEVISION_USE_CUDA=OFF')
# Disable component that could yield cuda.
else
makedepends+=('cuda')
depends+=('popsift')
depends+=('magma') # uncertaintyTE deps.
source+=("ute_lib::git+https://github.com/alicevision/uncertaintyTE.git")
provides+=(uncertainty-framework)
conflicts+=(uncertainty-framework)
sha256sums+=("SKIP")
_CMAKE_FLAGS+=(
-DCUDA_HOST_COMPILER=/opt/cuda/bin/gcc
-D{MAGMA_ROOT,{UNCERTAINTYTE,PopSift}_DIR}=/usr
)
if [[ -v _cc_list ]]; then
_CMAKE_FLAGS+=( -DALICEVISION_CUDA_CC_LIST="$(IFS=';'; echo "${_cc_list[*]}";)" )
fi
fi
_name=alice-vision
_fragment="#branch=develop"
pkgname=${_name}-git
pkgver=2.3.1.r82.ge80604eaf
pkgrel=1
pkgdesc="Photogrammetric Computer Vision Framework which provides a 3D Reconstruction and Camera Tracking algorithms"
arch=('i686' 'x86_64')
url="https://alicevision.github.io/"
license=('MPL2' 'MIT')
groups=()
conflicts+=("${_name}" geogram)
provides+=("${_name}" geogram)
depends+=('alembic' 'boost-libs' 'ceres-solver' 'coin-or-clp' 'flann' 'google-glog' 'opencv' 'openimageio' 'opengv' )
depends+=('glu' 'glfw-x11') # geogram deps.
makedepends+=('ninja' 'boost' 'eigen' 'freetype2' 'gflags' 'doxygen' 'python-sphinx' 'coin-or-coinutils' 'coin-or-lemon' 'git' 'cmake')
source+=("${pkgname}::git+https://github.com/alicevision/AliceVision.git${_fragment}"
"geogram::git+https://github.com/alicevision/geogram.git"
"FindOpenGV.cmake.patch"
)
sha256sums+=('SKIP'
'SKIP'
'2740fc6890a62f74367df357e132dc95bcd276528d828d51d66c4689e183ceec')
pkgver() {
cd "${pkgname}"
git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
prepare() {
cd "${srcdir}/${pkgname}"
git submodule update --init
# git config submodule.src/dependencies/MeshSDFilter.url ${srcdir}/MeshSDFilter
# git config submodule.src/dependencies/nanoflann.url
# git config submodule.src/dependencies/osi_clp.url
# fix doc build
sed -i '/^ *install.*doc/s/doc/htmlDoc/' src/CMakeLists.txt
#patch FindOpenGV.cmake to use Eigen3 instear of Eigen
git apply -v "$srcdir"/FindOpenGV.cmake.patch
}
build() {
((!DISABLE_CUDA)) && {
msg2 "Build uncertaintyTE library"
cmake -DCMAKE_INSTALL_PREFIX=/ -DMAGMA_ROOT=/usr -G Ninja -S ute_lib -B ute_build
# shellcheck disable=SC2030,SC2031,SC2046 # ninja call won't work with shell substitution in quotes.
ninja $([ -v MAKEFLAGS ] || echo -j1) -C ute_build
DESTDIR="${srcdir}/ute_bin" ninja install -C ute_build install
}
msg2 "Build geogram library"
CFLAGS+=" -fcommon" cmake -DCMAKE_INSTALL_PREFIX=/ -DGEOGRAM_LIB_ONLY=ON -DGEOGRAM_USE_SYSTEM_GLFW3=ON -DCMAKE_BUILD_TYPE:STRING=Release -DVORPALINE_PLATFORM:STRING=Linux64-gcc-dynamic -G Ninja -S geogram -B geogram_build
# shellcheck disable=SC2030,SC2031,SC2046 # ninja call won't work with shell substitution in quotes.
ninja $([ -v MAKEFLAGS ] || echo -j1) -C geogram_build
DESTDIR="${srcdir}/geogram_bin" ninja -C geogram_build install
msg2 "Build AliceVision library"
cmake "${_CMAKE_FLAGS[@]}" -DGEOGRAM_INSTALL_PREFIX="${srcdir}/geogram_bin" -DUNCERTAINTYTE_DIR="${srcdir}/ute_bin" -G Ninja -S ${pkgname} -B build
# shellcheck disable=SC2030,SC2031,SC2046 # ninja call won't work with shell substitution in quotes.
ninja $([ -v MAKEFLAGS ] || echo -j1) -C build
}
package() {
((!DISABLE_CUDA)) && {
msg2 "Install uncertaintyTE"
DESTDIR="${pkgdir}/usr" ninja -C ute_build install
}
msg2 "Install geogram"
DESTDIR="${pkgdir}/usr" ninja -C geogram_build install
msg2 "Install Alice-Vision"
DESTDIR="${pkgdir}" ninja -C build install
# install custom licenses.
cd "${pkgdir}"/usr/share
install -dm755 licenses/${pkgname}/
mv aliceVision/LICENSE-{MPL2,MIT-libmv}.md licenses/${pkgname}
# prune empty dirs
find "${pkgdir}/usr" . -type d -print0 | xargs --null rmdir 2>/dev/null || true
}
# vim:set ts=2 sw=2 et:
|