This repository has been archived by the owner on May 29, 2022. It is now read-only.
/
snapcraft.yaml
188 lines (175 loc) · 5.04 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
name: qtcreator-ros
title: Qt Creator
base: core20
adopt-info: qtcreator
icon: snap/gui/qtcreator-ros.svg
summary: Qt Creator with ROS plugin
grade: stable
confinement: classic
architectures:
- build-on: amd64
- build-on: arm64
parts:
# the 'cmake' plugin manipulates the installation prefix in a non-standard way:
# https://forum.snapcraft.io/t/different-cmake-behaviour-for-snapcraft-part-install/28257
# we therefore call CMake + Ninja manually and have to install build dependencies manually too
build-deps:
plugin: nil
build-packages:
- cmake
- ninja-build
qt6:
after: [build-deps]
plugin: nil
build-packages:
- libegl-dev
- libgl-dev
- libharfbuzz-dev
- libjpeg-dev
- libpng-dev
- libvulkan-dev
- libwayland-dev
# xcb QPA (Qt Platform Abstraction) platform plugin
- libfontconfig1-dev
- libfreetype6-dev
- libx11-dev
- libx11-xcb-dev
- libxext-dev
- libxfixes-dev
- libxi-dev
- libxrender-dev
- libxcb1-dev
- libxcb-glx0-dev
- libxcb-keysyms1-dev
- libxcb-image0-dev
- libxcb-shm0-dev
- libxcb-icccm4-dev
- libxcb-sync-dev
- libxcb-xfixes0-dev
- libxcb-shape0-dev
- libxcb-randr0-dev
- libxcb-render-util0-dev
- libxkbcommon-dev
- libxkbcommon-x11-dev
override-pull: |
git clone git://code.qt.io/qt/qt5.git --depth 1 --shallow-submodules --branch v6.2.4
cd qt5
./init-repository --module-subset=qt5compat,qtbase,qtdeclarative,qtquick3d,qtserialport,qtshadertools,qtsvg,qttools,qtwayland
# run "make" and "make install" separately https://bugreports.qt.io/browse/QTBUG-60496
override-build: |
cd qt5
./configure -cmake-generator Ninja -xcb -egl -opengl desktop -prefix ${SNAPCRAFT_PART_INSTALL}
cmake --build .
cmake --install .
stage-packages:
- libegl1
- libfontconfig1
- libfreetype6
- libgl1
- libglvnd0
- libglx0
- libgraphite2-3
- libharfbuzz0b
- libicu66
- libjpeg-turbo8
- libpcre2-16-0
- libpng16-16
- libwayland-cursor0
- libwayland-egl1
- libx11-6
- libx11-xcb1
- libxau6
- libxcb-glx0
- libxcb-icccm4
- libxcb-image0
- libxcb-keysyms1
- libxcb-randr0
- libxcb-render-util0
- libxcb-render0
- libxcb-shape0
- libxcb-shm0
- libxcb-sync1
- libxcb-util1
- libxcb-xfixes0
- libxcb-xkb1
- libxcb1
- libxdmcp6
- libxkbcommon-x11-0
- libxkbcommon0
qtcreator:
after: [qt6]
source: git://code.qt.io/qt-creator/qt-creator.git
source-tag: v7.0.0
source-depth: 1
parse-info: [share/metainfo/org.qt-project.qtcreator.appdata.xml]
build-packages:
- libdw-dev
plugin: nil
override-build: |
cmake -B . -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${SNAPCRAFT_PART_INSTALL}
cmake --build .
cmake --install .
cmake --install . --component Devel
build-environment:
- LD_LIBRARY_PATH: ${SNAPCRAFT_STAGE}/lib/
stage-packages:
- libdw1
- libyaml-cpp0.6
plugin-ros:
after: [qtcreator]
source: https://github.com/ros-industrial/ros_qtc_plugin.git
source-tag: "0.6.0"
source-depth: 1
plugin: nil
override-build: |
cmake -B . -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${SNAPCRAFT_PART_INSTALL} -DCMAKE_PREFIX_PATH=${SNAPCRAFT_STAGE}
cmake --build .
cmake --install .
build-packages:
- libyaml-cpp-dev
stage-packages:
- libyaml-cpp0.6
# install mesa with 'no-patchelf' for DRI drivers
# https://forum.snapcraft.io/t/opengl-broken-in-classic-core20-snap-on-22-04/29401/2
mesa-patchelf:
plugin: nil
stage-packages:
- libgl1-mesa-dri
stage:
- -usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/dri
mesa-no-patchelf:
plugin: nil
stage-packages:
- libgl1-mesa-dri
build-attributes:
- no-patchelf
stage:
- usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/dri
launchers:
after: [qtcreator]
plugin: nil
override-prime: |
sed -i -e 's|Name=Qt Creator|Name=Qt Creator ROS|g' share/applications/org.qt-project.qtcreator.desktop
sed -i -e 's|Icon=QtProject-qtcreator|Icon=${SNAP}/meta/gui/qtcreator-ros.svg|g' share/applications/org.qt-project.qtcreator.desktop
cleanup:
after: [launchers]
plugin: nil
override-prime: |
shopt -s extglob
rm -f -v bin/!("qtcreator"|"qtcreator.sh")
rm -f -r doc etc include lib/{cmake,metatypes,objects-Release,qtcreator/objects-Release}
rm -f lib/*.prl
rm -f -v libexec/!("qtcreator")
rm -f -r mkspecs modules phrasebooks qml
rm -f -r share/qtcreator/{HACKING,LICENSE.GPL3-EXCEPT,README.md}
rm -f -r usr/share/{bug,doc,doc-base,drirc.d,lintian,man,pkgconfig}
shopt -u extglob
apps:
qtcreator-ros:
command: bin/qtcreator
common-id: org.qt-project.qtcreator.desktop
desktop: share/applications/org.qt-project.qtcreator.desktop
environment:
LD_LIBRARY_PATH: ${SNAP}/lib
LIBGL_DRIVERS_PATH: ${SNAP}/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/dri
QT_QPA_PLATFORM: wayland;xcb