forked from wolfi-dev/os
-
Notifications
You must be signed in to change notification settings - Fork 0
/
boost.yaml
230 lines (210 loc) · 6.18 KB
/
boost.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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
package:
name: boost
version: 1.87.0
epoch: 0
description: "Free peer-reviewed portable C++ source libraries"
copyright:
- license: "BSL-1.0"
resources:
cpu: 33
memory: 16Gi
environment:
contents:
packages:
- build-base
- busybox
- ca-certificates-bundle
- openssf-compiler-options
- patch
- python3
- python3-dev
- wolfi-base
data:
- name: libs
items:
atomic: atomic
chrono: chrono
container: container
context: context
contract: contract
coroutine: coroutine
date_time: date_time
fiber: fiber
filesystem: filesystem
graph: graph
iostreams: iostreams
math: math
prg_exec_monitor: prg_exec_monitor
program_options: program_options
python3: python3
random: random
regex: regex
serialization: serialization
system: system
thread: thread
unit_test_framework: unit_test_framework
wave: wave
wserialization: wserialization
# transform melange version 1.81.0 => 1_81_0
var-transforms:
- from: ${{package.version}}
match: \.
replace: _
to: mangled-package-version
pipeline:
- uses: fetch
with:
uri: https://boostorg.jfrog.io/artifactory/main/release/${{package.version}}/source/boost_${{vars.mangled-package-version}}.tar.gz
expected-sha256: f55c340aa49763b1925ccf02b2e83f35fdcf634c9d5164a2acb87540173c741d
- runs: |
abiflags="$(python3-config --abiflags)"
# create user-config.jam
PY3_VERSION=$(python3 -c 'import sys; print("%i.%i" % (sys.version_info.major, sys.version_info.minor))')
cat > user-config.jam <<-__EOF__
using gcc : : $CC : <cxxflags>"${CXXFLAGS}" <linkflags>"${LDFLAGS}" ;
using python : ${PY3_VERSION:+$PY3_VERSION }: /usr/bin/python3 : ${PY3_VERSION:+/usr/include/python${PY3_VERSION}${abiflags} }: : : : ${abiflags:+$abiflags };
__EOF__
cd tools/build/src/engine
./build.sh cc gcc
cd ../../../../
cd tools/bcp
../build/src/engine/b2 -j $(nproc)
cd ../../
./tools/build/src/engine/b2 \
--user-config=user-config.jam \
--prefix="${{targets.destdir}}/usr" \
release \
toolset=gcc \
debug-symbols=off \
threading=single,multi \
runtime-link=shared \
link=shared,static \
cflags=-fno-strict-aliasing \
--layout=tagged \
-q \
-j $(nproc)
mkdir -p "${{targets.destdir}}"/usr/bin
install -Dm755 tools/build/src/engine/b2 "${{targets.destdir}}"/usr/bin/b2
install -Dm755 dist/bin/bcp "${{targets.destdir}}"/usr/bin/bcp
install -Dm644 LICENSE_1_0.txt \
"${{targets.destdir}}"/usr/share/licenses/${{package.name}}/LICENSE_1_0.txt
"${{targets.destdir}}"/usr/bin/b2 \
--includedir="${{targets.destdir}}"/usr/include \
--libdir="${{targets.destdir}}"/usr/lib \
install
- uses: strip
subpackages:
- name: boost-dev
pipeline:
- uses: split/dev
- name: boost-static
pipeline:
- uses: split/static
- name: boost-docs
pipeline:
- uses: split/manpages
- range: libs
name: boost-${{range.key}}
description: "${{range.key}} boost library"
pipeline:
- runs: |
mkdir -p "${{targets.subpkgdir}}"/usr/lib
mv "${{targets.destdir}}"/usr/lib/libboost_${{range.key}}* "${{targets.subpkgdir}}"/usr/lib/
update:
enabled: true
github:
identifier: boostorg/boost
strip-prefix: boost-
use-tag: true
test:
environment:
contents:
packages:
- build-base
- gcc
- python3
- boost-dev
pipeline:
- name: "Verify core tools installation"
runs: |
b2 -v
bcp --version
- name: "Test basic header compilation"
runs: |
cat > test.cpp << 'EOF'
#include <boost/version.hpp>
#include <iostream>
int main() {
std::cout << BOOST_VERSION << std::endl;
return 0;
}
EOF
g++ test.cpp -o version_test
./version_test
- name: "Test filesystem library"
runs: |
cat > fs_test.cpp << 'EOF'
#include <boost/filesystem.hpp>
#include <iostream>
int main() {
boost::filesystem::path p("/tmp");
return !boost::filesystem::exists(p);
}
EOF
g++ fs_test.cpp -o fs_test -lboost_filesystem
./fs_test
- name: "Test thread library"
runs: |
cat > thread_test.cpp << 'EOF'
#include <boost/thread.hpp>
#include <iostream>
void thread_func() {
std::cout << "Thread executed" << std::endl;
}
int main() {
boost::thread t(thread_func);
t.join();
return 0;
}
EOF
g++ thread_test.cpp -o thread_test -lboost_thread -lboost_system -pthread
./thread_test
- name: "Test program options library"
runs: |
cat > options_test.cpp << 'EOF'
#include <boost/program_options.hpp>
namespace po = boost::program_options;
int main() {
po::options_description desc("Test options");
desc.add_options()
("help", "produce help message");
po::variables_map vm;
return 0;
}
EOF
g++ options_test.cpp -o options_test -lboost_program_options
./options_test
- name: "Test serialization library"
runs: |
cat > serial_test.cpp << 'EOF'
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <sstream>
int main() {
std::stringstream ss;
boost::archive::text_oarchive oa(ss);
int x = 42;
oa << x;
return 0;
}
EOF
g++ serial_test.cpp -o serial_test -lboost_serialization
./serial_test
- name: "Test Python bindings"
runs: |
# TODO(joshrwolf): This is broken potentially for a real reason
# cat > py_test.py << 'EOF'
# import boost.python
# print("Python bindings loaded successfully")
# EOF
# python3 py_test.py: "Test thread library"