-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
304 lines (212 loc) · 9.67 KB
/
README
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
298
299
300
301
302
303
304
Prerequisites
=============
Packages for building RPMs (rpm-build, rpm-devel, rpmlint and rpmdevtools)
should already be installed on your workstation by ansible.
Building Packages
=================
A list of the available packages can be obtained using:
$ invoke list-packages
When building a package for the first time, it is necessary to install the build
dependencies:
$ invoke install-build-deps <package>
Next, the package can be build:
$ invoke build-package <package>
$ invoke build-package <package> --bundle-name=<bundle_name>
For example:
$ invoke build-package vortex-python3 --bundle-name=stable
$ invoke build-package vortex-qt5 --bundle-name=test
To build and install all packages, the following command can be used:
$ invoke build-all-packages # requires sudo
To build all packages without sudo, mock can be used:
$ invoke mock-build-packages
Naming Conventions
==================
- Packages always have a bundle name (e.g. stable) associated with them.
- Package names start with the prefix "vortex-<bundle_name>-" (e.g. vortex-stable-).
This helps to distinguish them from other packages provided by CentOS and
vortex packages from other bundles.
- Packages are installed to the "/vortex/<target_triplet>/<bundle_name>" directory.
- See https://wiki.osdev.org/Target_Triplet for more information about the target
triplet. Currently, the output of "gcc -dumpmachine" is used.
LD_LIBRARY_PATH
===============
Since packages are not installed to default locations, it is necessary to set the
LD_LIBRARY_PATH environment variable to make sure the correct libraries are used.
The dynamic libraries are always located in the
"/vortex/<target_triplet>/<bundle_name>/lib" directory.
Example:
$ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/vortex/x86_64-redhat-linux/stable/lib"
$ ...
Dependencies Between Packages
=============================
PACKAGE DEPENDS ON
vortex-openssl -
vortex-qt5 -
vortex-python3 vortex-openssl
vortex-sip vortex-openssl, vortex-python3, vortex-qt5
vortex-pyqt5 vortex-openssl, vortex-python3, vortex-qt5, vortex-sip
Setting the Bundle Name
=======================
If no bundle name is specified, a default name is used (currently stable).
To set the bundle name, the VORTEX_BUNDLE environment variable should be set when
building a package.
For example:
$ VORTEX_BUNDLE=feature-freeze invoke build-package vortex-python3
Updating the RPM Repository repodata
====================================
The packages are distributed using RPM repositories. The actual RPM binary files
are hosted on github as files associated with a specific release. To update a
package in the RPM repository, a new release for the rpm-packages github
repository should be made. The RPM files can be attached to this release as
downloadable assets.
Next, the RPM repository metadata should be updated.
$ cd rpm-repository/vortex
Here, we assume that the rpm packages uploaded to github are placed in the
current (rpm-repository/vortex) directory. When running the createrepo command,
a baseurl pointing to the github release should be used:
$ createrepo --baseurl https://github.com/v-finance/rpm-packages/releases/download/<github_release>/ .
Replace <github_release> with the name used for the release on github and commit
the changes overwritting the previous repodata. You will now be able to install
the new version using yum/dnf.
MinGW Packages for Cross-Compilation
====================================
In order to build recent versions of Qt, a recent version of MinGW is required.
The version provided by CentOS 8 is too old. The version provided by Fedora 32
can be used but the packages need to be rebuild for CentOS 8.
Step 1: Download Fedora Source Packages
---------------------------------------
The source packages can be downloaded from:
https://download.fedoraproject.org/pub/fedora/linux/releases/32/Everything/source/tree/Packages/m/
The following fedora packages are needed to bootstrap GCC:
- mingw-filesystem
- mingw-binutils
- mingw-headers
- mingw-gcc
- mingw-crt
- mingw-winpthreads
- cloog
Next, additional packages provide the libraries:
- mingw-win-iconv
- mingw-termcap
- mingw-gettext
- mingw-pkg-config
- mingw-zlib
- mingw-openssl
The commands below assume all the source packages are in the present working
directory.
Step 2: Bootstrap GCC
---------------------
Most packages can be rebuild for CentOS using one command:
$ rpmbuild --rebuild <fedora_source_rpm>
However, due to a cyclic dependency between gcc, headers and winpthreads,
bootstrapping gcc is a bit more complicated. The steps below give an overview of
this process.
- build & install filesystem
- build & install binutils
- build & install headers with "%global bundle_dummy_pthread_headers 1"
- build & install cloog (build dependency of gcc)
- build & install gcc with "%global bootstrap 1" and "%global libgomp 0"
- build & install crt
- build winpthreads
- uninstall gcc
- uninstall headers
- install winpthreads
- build & install headers
- build & install gcc
Step 2.1: mingw-filesystem and mingw-binutils
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ rpmbuild --rebuild mingw-filesystem-<version>.fc32.src.rpm
$ sudo rpm -i ~/rpmbuild/RPMS/noarch/mingw-filesystem-base-<version>.el8.noarch.rpm
$ sudo rpm -i ~/rpmbuild/RPMS/noarch/mingw32-filesystem-base-<version>.el8.noarch.rpm
$ sudo rpm -i ~/rpmbuild/RPMS/noarch/mingw64-filesystem-base-<version>.el8.noarch.rpm
$ rpmbuild --rebuild mingw-binutils-<version>.fc32.src.rpm
$ sudo rpm -i ~/rpmbuild/RPMS/x86_64/mingw-binutils-generic-<version>.el8.x86_64.rpm
$ sudo rpm -i ~/rpmbuild/RPMS/x86_64/mingw32-binutils-<version>.el8.x86_64.rpm
$ sudo rpm -i ~/rpmbuild/RPMS/x86_64/mingw64-binutils-<version>.el8.x86_64.rpm
Step 2.2: Building mingw-headers for the First Time
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ # unpack source rpm
$ mkdir mingw-headers
$ cd mingw-headers
$ rpm2cpio ../mingw-headers-<version>.fc32.src.rpm | cpio -idmv
Edit the mingw-headers.spec file and replace:
%if 0%{?fedora} >= 20 || 0%{?rhel} >= 7
%global bundle_dummy_pthread_headers 0
%else
%global bundle_dummy_pthread_headers 1
%endif
with:
%global bundle_dummy_pthread_headers 1
$ cp *.patch ~/rpmbuild/SOURCES
$ cp *.tar.bz2 ~/rpmbuild/SOURCES
$ rpmbuild -bb mingw-headers.spec
$ sudo rpm -i ~/rpmbuild/RPMS/x86_64/mingw32-headers-<version>.el8.x86_64.rpm
$ sudo rpm -i ~/rpmbuild/RPMS/x86_64/mingw64-headers-<version>.el8.x86_64.rpm
Step 2.3: mingw-gcc Build Dependency cloog
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ rpmbuild --rebuild cloog-<version>.fc32.src.rpm
$ sudo rpm -i ~/rpmbuild/RPMS/x86_64/cloog-<version>.el8.x86_64.rpm
$ sudo rpm -i ~/rpmbuild/RPMS/x86_64/cloog-devel-<version>.el8.x86_64.rpm
Step 2.4: Building mingw-gcc for the First Time
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ # unpack source rpm
$ mkdir mingw-gcc
$ cd mingw-gcc
$ rpm2cpio ../mingw-gcc-<version>.fc32.src.rpm | cpio -idmv
Edit the mingw-gcc.spec file and replace:
%global bootstrap 0
%global enable_libgomp 1
with:
%global bootstrap 1
%global enable_libgomp 0
$ cp *.tar.xz ~/rpmbuild/SOURCES
$ rpmbuild -bb mingw-gcc.spec
$ sudo rpm -i /home/timvdm/rpmbuild/RPMS/x86_64/mingw32-cpp-<version>.el8.x86_64.rpm
$ sudo rpm -i /home/timvdm/rpmbuild/RPMS/x86_64/mingw32-gcc-<version>.el8.x86_64.rpm
$ sudo rpm -i /home/timvdm/rpmbuild/RPMS/x86_64/mingw32-gcc-c++-<version>.el8.x86_64.rpm
$ sudo rpm -i /home/timvdm/rpmbuild/RPMS/x86_64/mingw64-cpp-<version>.el8.x86_64.rpm
$ sudo rpm -i /home/timvdm/rpmbuild/RPMS/x86_64/mingw64-gcc-<version>.el8.x86_64.rpm
$ sudo rpm -i /home/timvdm/rpmbuild/RPMS/x86_64/mingw64-gcc-c++-<version>.el8.x86_64.rpm
Step 2.5: Building mingw-crt and mingw-winpthreads
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ rpmbuild --rebuild mingw-crt-<version>.fc32.src.rpm
$ sudo rpm -i RPMS/mingw32-crt-<version>.el8.noarch.rpm
$ sudo rpm -i RPMS/mingw64-crt-<version>.el8.noarch.rpm
$ rpmbuild --rebuild mingw-winpthreads-<version>.fc32.src.rpm
Do not install mingw-winpthreads yet, it will conflict with the currently
installed mingw-headers.
Step 2.6: Uninstalling mingw-gcc and mingw-headers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ sudo rpm -e mingw32-gcc-c++
$ sudo rpm -e mingw32-gcc
$ sudo rpm -e mingw32-cpp
$ sudo rpm -e mingw64-gcc-c++
$ sudo rpm -e mingw64-gcc
$ sudo rpm -e mingw64-cpp
$ sudo rpm -e mingw32-headers
$ sudo rpm -e mingw64-headers
Step 2.7: Installing mingw-winpthreads
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ sudo rpm -i RPMS/mingw32-winpthreads-<version>.el8.noarch.rpm
$ sudo rpm -i RPMS/mingw64-winpthreads-<version>.el8.noarch.rpm
Step 2.8: Building final mingw-headers and mingw-gcc
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ rpmbuild --rebuild mingw-headers-<version>.fc32.src.rpm
$ sudo rpm -i /home/timvdm/rpmbuild/RPMS/noarch/mingw32-headers-<version>.el8.noarch.rpm
$ sudo rpm -i /home/timvdm/rpmbuild/RPMS/noarch/mingw64-headers-<version>.el8.noarch.rpm
$ rpmbuild --rebuild mingw-gcc-<version>.fc32.src.rpm
$ sudo rpm -i /home/timvdm/rpmbuild/RPMS/x86_64/mingw32-cpp-<version>.el8.x86_64.rpm
$ sudo rpm -i /home/timvdm/rpmbuild/RPMS/x86_64/mingw32-gcc-<version>.el8.x86_64.rpm
$ sudo rpm -i /home/timvdm/rpmbuild/RPMS/x86_64/mingw32-gcc-c++-<version>.el8.x86_64.rpm
$ sudo rpm -i /home/timvdm/rpmbuild/RPMS/x86_64/mingw64-cpp-<version>.el8.x86_64.rpm
$ sudo rpm -i /home/timvdm/rpmbuild/RPMS/x86_64/mingw64-gcc-<version>.el8.x86_64.rpm
$ sudo rpm -i /home/timvdm/rpmbuild/RPMS/x86_64/mingw64-gcc-c++-<version>.el8.x86_64.rpm
Step 3: Continue Building Packages
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Continue building/installing packages in this order:
- mingw-win-iconv
- mingw-termcap
- mingw-gettext
- mingw-pkg-config
- mingw-zlib
- mingw-openssl