summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a32b79540792afa9a6e4e3cd71d43eb4114354f1 (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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
# Maintainer: Zhirui Dai <daizhirui at hotmail dot com>
# Contributor: JunYoung Gwak <aur@jgwak.com>
# Contributor: Dylon Edwards <deltaecho at archlinux dot us>

pkgbase=open3d
pkgname=( {,python-}open3d python-py3d )
pkgver=0.18.0
pkgrel=11
epoch=1
pkgdesc="A Modern Library for 3D Data Processing"
arch=('x86_64')
url="http://www.open3d.org"
license=('MIT')
depends=(
    libc++abi
    libc++
    curl
    embree
    assimp
    eigen
    flann
    fmt
    glew
    glfw-x11
    gtest
    libjpeg-turbo
    jsoncpp
    liblzf
    libpng
    mesa
    python
    python-plotly
    python-dash
    pybind11
    xorg-server-devel
    nanoflann
    openssl
    pybind11
    qhull
    vtk
    unzip
    utf8cpp
    openxr
    openvr
    asciidoc
    python-mpi4py
    postgresql
    mysql
    onetbb
    zeromq
    cppzmq
    intel-oneapi-basekit
)
optdepends=(
    'openmp: Multiprocess support'
    'jupyter-notebook: Jupyter notebook support'
)
makedepends=(
    cmake
    git
    python-setuptools
)
source=(
    "${pkgbase}::git+https://github.com/isl-org/Open3D.git#commit=dbb3c7d58b7af5819540dacd8ea4e0a11ab605dc"
    "no_werror.patch"
    "fmt-v11.patch::https://github.com/daizhirui/Open3D/commit/3773d816260c5912581397a0dadf08da4c943d68.patch"
    "archlinux.patch::https://github.com/daizhirui/Open3D/commit/9745817370d1d504d45344959a000189bb9213cb.patch"
)
sha256sums=(
    'SKIP'
    'e58dacd86497e4d8a61fe00e4e41a4b8748e1dcca8d3172918d1bc5a1e7390cc'
    '7477f6ac021bf11804b19f4005bcbc1032789346e75efee3eca1c979024ae476'
    'd652b06bd4bc10f4eed18a69cd42cc07d10a58728ff6adddb45fb2a7c488dd9e')

function prepare() {
    cd "${srcdir}/${pkgbase}"
    patch -Np1 -i "${srcdir}/no_werror.patch"
    patch -Np1 -i "${srcdir}/fmt-v11.patch"
    patch -Np1 -i "${srcdir}/archlinux.patch"
    # find . -name "CMakeLists.txt" -exec sed -i 's/-Werror//g' {} \;
    # grep --files-with-matches -r "_FORTIFY_SOURCE" | xargs -I {} sed -i 's/_FORTIFY_SOURCE=[0-9]/""/g' {}
    mkdir -p build
}

function build() {
    cd "${srcdir}/${pkgbase}/build"
    if [[ -f CMakeCache.txt ]]; then
        rm CMakeCache.txt
    fi
    
    # default makepkg.conf set flags to "-O2"
    export CFLAGS=""
    export CXXFLAGS=""
    cmake .. \
          -G "Unix Makefiles" \
          -DCMAKE_INSTALL_PREFIX=/usr \
          -DBUILD_SHARED_LIBS=ON \
          -DCMAKE_VERBOSE_MAKEFILE=ON \
          -DCMAKE_BUILD_TYPE=Release \
          -DCMAKE_MODULE_PATH=/usr/lib/cmake/OpenVDB \
          -DCMAKE_FIND_ROOT_PATH=/opt/intel/oneapi/tbb/latest/lib/cmake/tbb \
          -DUSE_SYSTEM_ASSIMP=ON \
          -DUSE_SYSTEM_CURL=ON \
          -DUSE_SYSTEM_BLAS=OFF \
          -DBUILD_SYCL_MODULE=OFF \
          -DUSE_SYSTEM_EIGEN3=ON \
          -DUSE_SYSTEM_EMBREE=ON \
          -DUSE_SYSTEM_TBB=ON \
          -DOPEN3D_USE_ONEAPI_PACKAGES=ON \
          -DoneDPL_DIR=/opt/intel/oneapi/dpl/latest/lib/cmake/oneDPL \
          -DMKL_DIR=/opt/intel/oneapi/mkl/latest/lib/cmake/mkl \
          -DUSE_SYSTEM_FMT=ON \
          -DUSE_SYSTEM_GLEW=ON \
          -DUSE_SYSTEM_GLFW=ON \
          -DUSE_SYSTEM_GOOGLETEST=ON \
          -DUSE_SYSTEM_JPEG=ON \
          -DUSE_SYSTEM_NANOFLANN=ON \
          -DUSE_SYSTEM_OPENSSL=ON \
          -DUSE_SYSTEM_PNG=ON \
          -DUSE_SYSTEM_PYBIND11=ON \
          -DUSE_SYSTEM_QHULLCPP=ON \
          -DUSE_SYSTEM_VTK=ON \
          -DUSE_SYSTEM_ZEROMQ=ON \
          -DUSE_SYSTEM_JSONCPP=ON \
          -DUSE_SYSTEM_LZF=ON \
          -DBUILD_LIBREALSENSE=ON \
          -DWITH_MINIZIP=ON

    make -j$(nproc)
}

function package_open3d() {
    depends=(
        libc++abi
        libc++
        curl
        embree
        assimp
        eigen
        flann
        fmt
        glew
        glfw-x11
        gtest
        libjpeg-turbo
        jsoncpp
        liblzf
        libpng
        mesa
        python
        python-plotly
        python-dash
        pybind11
        xorg-server-devel
        nanoflann
        openssl
        pybind11
        qhull
        vtk
        unzip
        utf8cpp
        openxr
        openvr
        asciidoc
        python-mpi4py
        postgresql
        mysql
        onetbb
        zeromq
        cppzmq
        intel-oneapi-basekit
    )
    optdepends=(
        'openmp: Multiprocess support'
    )
    conflicts=(
        open3d-git
    )
    cd "${srcdir}/${pkgbase}/build"
    make DESTDIR="${pkgdir}" install
}

function package_python-open3d() {
    depends=(
        libc++abi
        libc++
        curl
        embree
        assimp
        eigen
        flann
        fmt
        glew
        glfw-x11
        gtest
        libjpeg-turbo
        jsoncpp
        liblzf
        libpng
        mesa
        python
        python-plotly
        python-dash
        pybind11
        xorg-server-devel
        nanoflann
        openssl
        pybind11
        qhull
        vtk
        unzip
        utf8cpp
        openxr
        openvr
        asciidoc
        python-mpi4py
        postgresql
        mysql
        onetbb
        zeromq
        cppzmq
        intel-oneapi-basekit
    )
    optdepends=(
        'jupyter-notebook: Jupyter notebook support'
        'openmp: Multiprocess support'
    )
    provides=(
        python-py3d
    )
    conflicts=(
        python-open3d-git
        python-py3d{,-git}
    )
    cd "${srcdir}/${pkgbase}/build"
    make python-package
    cd "${srcdir}/${pkgbase}/build/lib/python_package"
    python setup.py install --root="$pkgdir/" --optimize=1
}

function package_python-py3d() {
    depends=(
        libc++abi
        libc++
        curl
        embree
        assimp
        eigen
        flann
        fmt
        glew
        glfw-x11
        gtest
        libjpeg-turbo
        jsoncpp
        liblzf
        libpng
        mesa
        python
        python-plotly
        python-dash
        pybind11
        xorg-server-devel
        nanoflann
        openssl
        pybind11
        qhull
        vtk
        unzip
        utf8cpp
        openxr
        openvr
        asciidoc
        python-mpi4py
        postgresql
        mysql
        onetbb
        zeromq
        cppzmq
        intel-oneapi-basekit
    )
    optdepends=(
        'jupyter-notebook: Jupyter notebook support'
        'openmp: Multiprocess support'
    )
    provides=(
        python-open3d
    )
    conflicts=(
        python-py3d-git
        python-open3d{,-git}
    )
    cd "${srcdir}/${pkgbase}/build"
    make python-package
    cd "${srcdir}/${pkgbase}/build/lib/python_package"
    python setup.py install --root="$pkgdir/" --optimize=1
}