-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
snapcraft.yaml
206 lines (190 loc) · 5.28 KB
/
snapcraft.yaml
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
name: opendronemap
adopt-info: odm
grade: stable
confinement: strict
base: core20
summary: Command line toolkit for processing aerial drone imagery
description: >
An open source command line toolkit for processing aerial drone imagery. ODM turns simple 2D images into:
* Classified Point Clouds
* 3D Textured Models
* Georeferenced Orthorectified Imagery
* Georeferenced Digital Elevation Models
The application is available for Windows, Mac and Linux and it works from the command line, making it ideal for power users, scripts and for integration with other software.
# The UbuntuGIS PPA only has i386 and amd64 packages so we can't build any
# other architectures. Therefore let's limit to those here.
architectures:
- build-on: i386
run-on: i386
- build-on: amd64
run-on: amd64
package-repositories:
- type: apt
ppa: ubuntugis/ubuntugis-unstable
parts:
prereqs:
source: .
plugin: nil
build-packages:
- build-essential
- cmake
- gdal-bin
- gfortran # to build scipy
- git
- libgdal-dev
- libgeotiff-dev
- libjsoncpp-dev
- libssl-dev
- libusb-1.0-0-dev
- ninja-build
- pkg-config
- python3-dev
- python3-gdal
- python3-pip
- python3-setuptools
- python3-wheel
- rsync
- swig3.0
stage-packages:
- gdal-bin
- libgdal26
- libgeotiff5
- libjsoncpp1
- libspqr2
- libssl1.1
- libusb-1.0-0
- proj-data
- procps
- python3
- python3-distutils
- python3-gdal
- python3-pkg-resources # required base package for core20
- python3-requests # required base package for core20
- python3-setuptools
stage:
# remove deb-based numpy because it conflicts with our pip-installed version
- -usr/lib/python3/dist-packages/numpy
opencv:
source: .
plugin: nil
build-packages:
- libavcodec-dev
- libavformat-dev
- libeigen3-dev
- libflann-dev
- libgtk2.0-dev
- libjpeg-dev
- liblapack-dev
- libopenjpip7
- libpng-dev
- libproj-dev
- libswscale-dev
- libtbb-dev
- libtiff-dev
- libxext-dev
- proj-bin
stage-packages:
- libavcodec58
- libavformat58
- libflann1.9
- libgtk2.0-0
- libjpeg-turbo8
- libopenjpip7
- liblapack3
- libpng16-16
- libproj19
- libswscale5
- libtbb2
- libtiff5
- libwebpdemux2
- libxext6
openmvs:
source: .
plugin: nil
build-packages:
- libcgal-dev
- libboost-program-options-dev
- libboost-iostreams-dev
- libboost-serialization-dev
- libboost-system-dev
stage-packages:
- libboost-program-options1.71.0
- libboost-iostreams1.71.0
- libboost-serialization1.71.0
- libboost-system1.71.0
opensfm:
source: .
plugin: nil
build-packages:
- libgoogle-glog-dev
- libsuitesparse-dev
stage-packages:
- libamd2
- libcamd2
- libccolamd2
- libcholmod3
- libcolamd2
- libcxsparse3
- libgoogle-glog0v5
- libsuitesparseconfig5
odm:
after:
- prereqs
- opencv
- opensfm
- openmvs
source: .
plugin: nil # We will script everything ourselves
build-environment:
# Set Python location to build host's system so that we can
# use system libraries while building the Snap Package
- PYTHONHOME: /usr
# Set the location for pip to install requirements into inside
# the Snap package
- PYTHONUSERBASE: $SNAPCRAFT_PART_INSTALL
override-build: |
snapcraftctl set-version $(cat VERSION)
# Portable build
test -f /usr/bin/gcc_real || mv -v /usr/bin/gcc /usr/bin/gcc_real
test -f /usr/bin/gcc || cp -v ./docker/gcc /usr/bin/gcc
test -f /usr/bin/g++_real || mv -v /usr/bin/g++ /usr/bin/g++_real
test -f /usr/bin/g++ || cp -v ./docker/g++ /usr/bin/g++
pip3 install --user -r requirements.txt
# Build the SuperBuild libraries
mkdir -p SuperBuild/build
cd SuperBuild/build
cmake -G Ninja ..
cmake --build . --parallel 1
rsync -av --exclude .git \
$SNAPCRAFT_PART_BUILD/ $SNAPCRAFT_PART_INSTALL/odm/
chmod -R u=rwX,go=rX $PYTHONUSERBASE/lib/python*
stage:
# strip the temporary build files and sources
- -odm/SuperBuild/build
- -odm/SuperBuild/download
- -odm/SuperBuild/src
prime:
# remove any static-libraries
- -**/*.a
# remove any header files
- -**/*.h
# remove any left-over temporary compiled 'object' files
- -**/*.o
build-snaps:
- cmake
plugs:
shared-memory:
private: true
apps:
opendronemap:
command: odm/run.sh
environment:
# Ensure libraries are found
LD_LIBRARY_PATH: $SNAP/odm/SuperBuild/install/lib:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/blas:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/lapack
PYTHONPATH: $SNAP/odm/SuperBuild/install/lib/python3.8/site-packages:$SNAP/lib/python3.8/site-packages:$SNAP/usr/lib/python3/dist-packages/:$SNAP/usr/lib/python3.8:$SNAP/odm/SuperBuild/install/bin/opensfm
PROJ_LIB: $SNAP/usr/share/proj
plugs:
- home
- network
- network-bind
- removable-media