rbe-tebako 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.clang-format +4 -0
- data/Brewfile +23 -0
- data/CMakeLists.txt +464 -0
- data/CODE_OF_CONDUCT.adoc +128 -0
- data/CONTRIBUTING.adoc +294 -0
- data/Gemfile +31 -0
- data/INSTALLATION.adoc +233 -0
- data/LICENSE.md +33 -0
- data/README.adoc +1363 -0
- data/Rakefile +35 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/cmake/copy_dir.cmake +29 -0
- data/common.env +5 -0
- data/exe/rbe-tebako +32 -0
- data/exe/rbe-tebako-packager +77 -0
- data/include/tebako/tebako-fs.h +43 -0
- data/include/tebako/tebako-main.h +42 -0
- data/include/tebako/tebako-prism.h +51 -0
- data/lib/rbe-tebako.rb +6 -0
- data/lib/tebako/build_helpers.rb +77 -0
- data/lib/tebako/cache_manager.rb +112 -0
- data/lib/tebako/cli.rb +220 -0
- data/lib/tebako/cli_helpers.rb +165 -0
- data/lib/tebako/codegen.rb +252 -0
- data/lib/tebako/deploy_helper.rb +258 -0
- data/lib/tebako/error.rb +70 -0
- data/lib/tebako/options_manager.rb +338 -0
- data/lib/tebako/package_descriptor.rb +143 -0
- data/lib/tebako/packager/pass1_patch.rb +266 -0
- data/lib/tebako/packager/pass1a_patch.rb +55 -0
- data/lib/tebako/packager/pass2_patch.rb +140 -0
- data/lib/tebako/packager/pass2_patch_crt.rb +46 -0
- data/lib/tebako/packager/pass2msys_patch.rb +190 -0
- data/lib/tebako/packager/patch.rb +54 -0
- data/lib/tebako/packager/patch_buildsystem.rb +124 -0
- data/lib/tebako/packager/patch_helpers.rb +109 -0
- data/lib/tebako/packager/patch_libraries.rb +188 -0
- data/lib/tebako/packager/patch_literals.rb +275 -0
- data/lib/tebako/packager/patch_main.rb +93 -0
- data/lib/tebako/packager/rubygems_patch.rb +83 -0
- data/lib/tebako/packager.rb +210 -0
- data/lib/tebako/packager_lite.rb +78 -0
- data/lib/tebako/ruby_builder.rb +71 -0
- data/lib/tebako/ruby_version.rb +206 -0
- data/lib/tebako/scenario_manager.rb +251 -0
- data/lib/tebako/stripper.rb +135 -0
- data/lib/tebako/version.rb +30 -0
- data/lib/tebako.rb +34 -0
- data/src/tebako-main.cpp +168 -0
- data/tools/.gitattributes +4 -0
- data/tools/.github/workflows/build-containers.yml +190 -0
- data/tools/.github/workflows/lint.yml +41 -0
- data/tools/.github/workflows/test.yml +331 -0
- data/tools/.gitignore +1 -0
- data/tools/README.md +49 -0
- data/tools/ci-scripts/arm-brew-install.sh +43 -0
- data/tools/ci-scripts/arm-brew-setup.sh +33 -0
- data/tools/ci-scripts/level-up.sh +35 -0
- data/tools/ci-scripts/patch-fbthrift.sh +94 -0
- data/tools/ci-scripts/patch-folly.sh +551 -0
- data/tools/ci-scripts/patch-glog.sh +57 -0
- data/tools/ci-scripts/patch-zstd.sh +57 -0
- data/tools/ci-scripts/tools.sh +63 -0
- data/tools/ci-scripts/x86-brew-install.sh +43 -0
- data/tools/ci-scripts/x86-brew-setup.sh +33 -0
- data/tools/cmake-scripts/def-external-project.cmake +96 -0
- data/tools/cmake-scripts/macos-environment.cmake +91 -0
- data/tools/cmake-scripts/msys-environment.cmake +78 -0
- data/tools/cmake-scripts/setup-libarchive.cmake +93 -0
- data/tools/cmake-scripts/setup-libfmt.cmake +61 -0
- data/tools/cmake-scripts/setup-libhowardhinnerdate.cmake +55 -0
- data/tools/cmake-scripts/setup-libutfcpp.cmake +56 -0
- data/tools/cmake-scripts/version.cmake +162 -0
- data/tools/docker/alpine-3.17-dev.Dockerfile +49 -0
- data/tools/docker/tools/tools.sh +66 -0
- data/tools/docker/ubuntu-20.04-dev.Dockerfile +51 -0
- data/tools/dwarfs-test-helper/CMakeLists.txt +34 -0
- data/tools/include/pro-statvfs.h +57 -0
- data/tools/tests/cmake/CMakeLists.txt +81 -0
- data/tools/tests/setup-libfmt/CMakeLists.txt +35 -0
- data/tools/tests/setup-libhowardhinnerdate/CMakeLists.txt +35 -0
- data/tools/tests/setup-librachive/CMakeLists.txt +35 -0
- data/tools/tests/setup-libutfcpp/CMakeLists.txt +36 -0
- data/tools/tests/setup-openssl/CMakeLists.txt +36 -0
- metadata +312 -0
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
# Copyright (c) 2024-2025 [Ribose Inc](https://www.ribose.com).
|
|
2
|
+
# All rights reserved.
|
|
3
|
+
# This file is a part of the Tebako project.
|
|
4
|
+
#
|
|
5
|
+
# Redistribution and use in source and binary forms, with or without
|
|
6
|
+
# modification, are permitted provided that the following conditions
|
|
7
|
+
# are met:
|
|
8
|
+
# 1. Redistributions of source code must retain the above copyright
|
|
9
|
+
# notice, this list of conditions and the following disclaimer.
|
|
10
|
+
# 2. Redistributions in binary form must reproduce the above copyright
|
|
11
|
+
# notice, this list of conditions and the following disclaimer in the
|
|
12
|
+
# documentation and/or other materials provided with the distribution.
|
|
13
|
+
#
|
|
14
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
15
|
+
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
16
|
+
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
17
|
+
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
|
|
18
|
+
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
19
|
+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
20
|
+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
21
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
22
|
+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
23
|
+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
24
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
|
25
|
+
|
|
26
|
+
name: test
|
|
27
|
+
|
|
28
|
+
on:
|
|
29
|
+
push:
|
|
30
|
+
branches: [ master, main ]
|
|
31
|
+
paths-ignore:
|
|
32
|
+
- 'docker/**'
|
|
33
|
+
- '.github/workflows/build-containers.yml'
|
|
34
|
+
pull_request:
|
|
35
|
+
paths-ignore:
|
|
36
|
+
- 'docker/**'
|
|
37
|
+
- '.github/workflows/build-containers.yml'
|
|
38
|
+
workflow_dispatch:
|
|
39
|
+
|
|
40
|
+
concurrency:
|
|
41
|
+
group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}'
|
|
42
|
+
cancel-in-progress: true
|
|
43
|
+
|
|
44
|
+
jobs:
|
|
45
|
+
test-setup-libfmt:
|
|
46
|
+
name: test setup-libfmt on ${{ matrix.os }}
|
|
47
|
+
runs-on: ${{ matrix.os }}
|
|
48
|
+
strategy:
|
|
49
|
+
fail-fast: false
|
|
50
|
+
matrix:
|
|
51
|
+
os: [ macos-13, macos-14 ]
|
|
52
|
+
steps:
|
|
53
|
+
- name: Checkout
|
|
54
|
+
uses: actions/checkout@v4
|
|
55
|
+
|
|
56
|
+
- name: Run cmake script
|
|
57
|
+
run: |
|
|
58
|
+
cmake -B build/setup-libfmt -DROOT=$PWD tests/setup-libfmt
|
|
59
|
+
cmake --build build/setup-libfmt
|
|
60
|
+
|
|
61
|
+
- name: Test setup-libfmt
|
|
62
|
+
run: |
|
|
63
|
+
set -o errexit -o pipefail -o noclobber -o nounset
|
|
64
|
+
test -f build/setup-libfmt/deps/lib/libfmt.a
|
|
65
|
+
test -f build/setup-libfmt/deps/include/fmt/args.h
|
|
66
|
+
test -f build/setup-libfmt/deps/include/fmt/chrono.h
|
|
67
|
+
test -f build/setup-libfmt/deps/include/fmt/color.h
|
|
68
|
+
test -f build/setup-libfmt/deps/include/fmt/compile.h
|
|
69
|
+
test -f build/setup-libfmt/deps/include/fmt/core.h
|
|
70
|
+
test -f build/setup-libfmt/deps/include/fmt/format.h
|
|
71
|
+
test -f build/setup-libfmt/deps/include/fmt/format-inl.h
|
|
72
|
+
test -f build/setup-libfmt/deps/include/fmt/os.h
|
|
73
|
+
test -f build/setup-libfmt/deps/include/fmt/ostream.h
|
|
74
|
+
test -f build/setup-libfmt/deps/include/fmt/printf.h
|
|
75
|
+
test -f build/setup-libfmt/deps/include/fmt/ranges.h
|
|
76
|
+
test -f build/setup-libfmt/deps/include/fmt/std.h
|
|
77
|
+
test -f build/setup-libfmt/deps/include/fmt/xchar.h
|
|
78
|
+
test -f build/setup-libfmt/deps/lib/cmake/fmt/fmt-config.cmake
|
|
79
|
+
test -f build/setup-libfmt/deps/lib/cmake/fmt/fmt-config-version.cmake
|
|
80
|
+
test -f build/setup-libfmt/deps/lib/cmake/fmt/fmt-targets.cmake
|
|
81
|
+
test -f build/setup-libfmt/deps/lib/cmake/fmt/fmt-targets-release.cmake
|
|
82
|
+
test -f build/setup-libfmt/deps/lib/pkgconfig/fmt.pc
|
|
83
|
+
|
|
84
|
+
test-setup-libfmt-co:
|
|
85
|
+
name: test setup-libfmt on ${{ matrix.architecture.platform }}/${{ matrix.container }}
|
|
86
|
+
runs-on: ${{ matrix.architecture.host }}
|
|
87
|
+
container:
|
|
88
|
+
image: 'ghcr.io/${{ github.repository_owner }}/tebako-${{ matrix.container }}'
|
|
89
|
+
defaults:
|
|
90
|
+
run:
|
|
91
|
+
shell: bash
|
|
92
|
+
strategy:
|
|
93
|
+
fail-fast: false
|
|
94
|
+
matrix:
|
|
95
|
+
container: [ 'ubuntu-20.04-dev', 'alpine-3.17-dev' ]
|
|
96
|
+
architecture:
|
|
97
|
+
- { host: 'ubuntu-22.04', platform: linux/amd64 }
|
|
98
|
+
- { host: 'ubuntu-22.04-arm', platform: linux/arm64 }
|
|
99
|
+
|
|
100
|
+
steps:
|
|
101
|
+
# JavaScript Actions in Alpine containers are only supported on x64 Linux runners. Doing Linux Arm64
|
|
102
|
+
- name: Checkout
|
|
103
|
+
uses: actions/checkout@v1
|
|
104
|
+
|
|
105
|
+
- name: Run cmake script
|
|
106
|
+
run: |
|
|
107
|
+
cmake -B build/setup-libfmt -DROOT=$PWD -S tests/setup-libfmt
|
|
108
|
+
cmake --build build/setup-libfmt
|
|
109
|
+
|
|
110
|
+
- name: Test setup-libfmt
|
|
111
|
+
run: |
|
|
112
|
+
set -o errexit -o pipefail -o noclobber -o nounset
|
|
113
|
+
test -f build/setup-libfmt/deps/lib/libfmt.a
|
|
114
|
+
test -f build/setup-libfmt/deps/include/fmt/args.h
|
|
115
|
+
test -f build/setup-libfmt/deps/include/fmt/chrono.h
|
|
116
|
+
test -f build/setup-libfmt/deps/include/fmt/color.h
|
|
117
|
+
test -f build/setup-libfmt/deps/include/fmt/compile.h
|
|
118
|
+
test -f build/setup-libfmt/deps/include/fmt/core.h
|
|
119
|
+
test -f build/setup-libfmt/deps/include/fmt/format.h
|
|
120
|
+
test -f build/setup-libfmt/deps/include/fmt/format-inl.h
|
|
121
|
+
test -f build/setup-libfmt/deps/include/fmt/os.h
|
|
122
|
+
test -f build/setup-libfmt/deps/include/fmt/ostream.h
|
|
123
|
+
test -f build/setup-libfmt/deps/include/fmt/printf.h
|
|
124
|
+
test -f build/setup-libfmt/deps/include/fmt/ranges.h
|
|
125
|
+
test -f build/setup-libfmt/deps/include/fmt/std.h
|
|
126
|
+
test -f build/setup-libfmt/deps/include/fmt/xchar.h
|
|
127
|
+
test -f build/setup-libfmt/deps/lib/cmake/fmt/fmt-config.cmake
|
|
128
|
+
test -f build/setup-libfmt/deps/lib/cmake/fmt/fmt-config-version.cmake
|
|
129
|
+
test -f build/setup-libfmt/deps/lib/cmake/fmt/fmt-targets.cmake
|
|
130
|
+
test -f build/setup-libfmt/deps/lib/cmake/fmt/fmt-targets-release.cmake
|
|
131
|
+
test -f build/setup-libfmt/deps/lib/pkgconfig/fmt.pc
|
|
132
|
+
|
|
133
|
+
test-setup-librachive:
|
|
134
|
+
name: test setup-librachive on ${{ matrix.os }}
|
|
135
|
+
runs-on: ${{ matrix.os }}
|
|
136
|
+
strategy:
|
|
137
|
+
fail-fast: false
|
|
138
|
+
matrix:
|
|
139
|
+
os: [ macos-13, macos-14 ]
|
|
140
|
+
steps:
|
|
141
|
+
- name: Checkout
|
|
142
|
+
uses: actions/checkout@v4
|
|
143
|
+
|
|
144
|
+
- name: Run cmake script
|
|
145
|
+
run: |
|
|
146
|
+
cmake -B build/setup-librachive -DROOT=$PWD tests/setup-librachive
|
|
147
|
+
cmake --build build/setup-librachive
|
|
148
|
+
|
|
149
|
+
- name: Test setup-librachive
|
|
150
|
+
run: |
|
|
151
|
+
set -o errexit -o pipefail -o noclobber -o nounset
|
|
152
|
+
test -f build/setup-librachive/deps/lib/pkgconfig/libarchive.pc
|
|
153
|
+
test -f build/setup-librachive/deps/lib/libarchive.a
|
|
154
|
+
test -f build/setup-librachive/deps/include/archive.h
|
|
155
|
+
test -f build/setup-librachive/deps/include/archive_entry.h
|
|
156
|
+
|
|
157
|
+
test-setup-librachive-co:
|
|
158
|
+
name: test setup-librachive on ${{ matrix.architecture.platform }}/${{ matrix.container }}
|
|
159
|
+
runs-on: ${{ matrix.architecture.host }}
|
|
160
|
+
container:
|
|
161
|
+
image: 'ghcr.io/${{ github.repository_owner }}/tebako-${{ matrix.container }}'
|
|
162
|
+
defaults:
|
|
163
|
+
run:
|
|
164
|
+
shell: bash
|
|
165
|
+
strategy:
|
|
166
|
+
fail-fast: false
|
|
167
|
+
matrix:
|
|
168
|
+
container: [ 'ubuntu-20.04-dev', 'alpine-3.17-dev' ]
|
|
169
|
+
architecture:
|
|
170
|
+
- { host: 'ubuntu-22.04', platform: linux/amd64 }
|
|
171
|
+
- { host: 'ubuntu-22.04-arm', platform: linux/arm64 }
|
|
172
|
+
|
|
173
|
+
steps:
|
|
174
|
+
- name: Checkout
|
|
175
|
+
uses: actions/checkout@v1
|
|
176
|
+
|
|
177
|
+
- name: Run cmake script
|
|
178
|
+
run: |
|
|
179
|
+
cmake -B build/setup-librachive -DROOT=$PWD tests/setup-librachive
|
|
180
|
+
cmake --build build/setup-librachive
|
|
181
|
+
|
|
182
|
+
- name: Test setup-librachive
|
|
183
|
+
run: |
|
|
184
|
+
set -o errexit -o pipefail -o noclobber -o nounset
|
|
185
|
+
test -f build/setup-librachive/deps/lib/pkgconfig/libarchive.pc
|
|
186
|
+
test -f build/setup-librachive/deps/lib/libarchive.a
|
|
187
|
+
test -f build/setup-librachive/deps/include/archive.h
|
|
188
|
+
test -f build/setup-librachive/deps/include/archive_entry.h
|
|
189
|
+
|
|
190
|
+
test-setup-libutfcpp:
|
|
191
|
+
name: test setup-libutfcpp on ${{ matrix.os }}
|
|
192
|
+
runs-on: ${{ matrix.os }}
|
|
193
|
+
strategy:
|
|
194
|
+
fail-fast: false
|
|
195
|
+
matrix:
|
|
196
|
+
os: [ macos-13, macos-14 ]
|
|
197
|
+
steps:
|
|
198
|
+
- name: Checkout
|
|
199
|
+
uses: actions/checkout@v4
|
|
200
|
+
|
|
201
|
+
- name: Run cmake script
|
|
202
|
+
run: |
|
|
203
|
+
cmake -B build/setup-libutfcpp -DROOT=$PWD tests/setup-libutfcpp
|
|
204
|
+
cmake --build build/setup-libutfcpp
|
|
205
|
+
|
|
206
|
+
- name: Test setup-libutfcpp
|
|
207
|
+
run: |
|
|
208
|
+
set -o errexit -o pipefail -o noclobber -o nounset
|
|
209
|
+
test -f build/setup-libutfcpp/deps/include/utf8.h
|
|
210
|
+
test -d build/setup-libutfcpp/deps/include/utf8
|
|
211
|
+
|
|
212
|
+
test-setup-libutfcpp-co:
|
|
213
|
+
name: test setup-libutfcpp on ${{ matrix.architecture.platform }}/${{ matrix.container }}
|
|
214
|
+
runs-on: ${{ matrix.architecture.host }}
|
|
215
|
+
container:
|
|
216
|
+
image: 'ghcr.io/${{ github.repository_owner }}/tebako-${{ matrix.container }}'
|
|
217
|
+
defaults:
|
|
218
|
+
run:
|
|
219
|
+
shell: bash
|
|
220
|
+
strategy:
|
|
221
|
+
fail-fast: false
|
|
222
|
+
matrix:
|
|
223
|
+
container: [ 'ubuntu-20.04-dev', 'alpine-3.17-dev' ]
|
|
224
|
+
architecture:
|
|
225
|
+
- { host: 'ubuntu-22.04', platform: linux/amd64 }
|
|
226
|
+
- { host: 'ubuntu-22.04-arm', platform: linux/arm64 }
|
|
227
|
+
steps:
|
|
228
|
+
- name: Checkout
|
|
229
|
+
uses: actions/checkout@v1
|
|
230
|
+
|
|
231
|
+
- name: Run cmake script
|
|
232
|
+
run: |
|
|
233
|
+
cmake -B build/setup-libutfcpp -DROOT=$PWD tests/setup-libutfcpp
|
|
234
|
+
cmake --build build/setup-libutfcpp
|
|
235
|
+
|
|
236
|
+
- name: Test setup-libutfcpp
|
|
237
|
+
run: |
|
|
238
|
+
set -o errexit -o pipefail -o noclobber -o nounset
|
|
239
|
+
test -f build/setup-libutfcpp/deps/include/utf8.h
|
|
240
|
+
test -d build/setup-libutfcpp/deps/include/utf8
|
|
241
|
+
|
|
242
|
+
test-setup-libhowardhinnerdate:
|
|
243
|
+
name: test setup-libhowardhinnerdate on ${{ matrix.os }}
|
|
244
|
+
runs-on: ${{ matrix.os }}
|
|
245
|
+
strategy:
|
|
246
|
+
fail-fast: false
|
|
247
|
+
matrix:
|
|
248
|
+
os: [ macos-13, macos-14 ]
|
|
249
|
+
steps:
|
|
250
|
+
- name: Checkout
|
|
251
|
+
uses: actions/checkout@v4
|
|
252
|
+
|
|
253
|
+
- name: Run cmake script
|
|
254
|
+
run: |
|
|
255
|
+
cmake -B build/setup-libhowardhinnerdate -DROOT=$PWD tests/setup-libhowardhinnerdate
|
|
256
|
+
cmake --build build/setup-libhowardhinnerdate
|
|
257
|
+
|
|
258
|
+
- name: Test setup-libhowardhinnerdate
|
|
259
|
+
run: |
|
|
260
|
+
set -o errexit -o pipefail -o noclobber -o nounset
|
|
261
|
+
test -f build/setup-libhowardhinnerdate/deps/include/date/date.h
|
|
262
|
+
|
|
263
|
+
test-setup-libhowardhinnerdate-co:
|
|
264
|
+
name: test setup-libhowardhinnerdate on ${{ matrix.architecture.platform }}/${{ matrix.container }}
|
|
265
|
+
runs-on: ${{ matrix.architecture.host }}
|
|
266
|
+
container:
|
|
267
|
+
image: 'ghcr.io/${{ github.repository_owner }}/tebako-${{ matrix.container }}'
|
|
268
|
+
defaults:
|
|
269
|
+
run:
|
|
270
|
+
shell: bash
|
|
271
|
+
strategy:
|
|
272
|
+
fail-fast: false
|
|
273
|
+
matrix:
|
|
274
|
+
container: [ 'ubuntu-20.04-dev', 'alpine-3.17-dev' ]
|
|
275
|
+
architecture:
|
|
276
|
+
- { host: 'ubuntu-22.04', platform: linux/amd64 }
|
|
277
|
+
- { host: 'ubuntu-22.04-arm', platform: linux/arm64 }
|
|
278
|
+
steps:
|
|
279
|
+
- name: Checkout
|
|
280
|
+
uses: actions/checkout@v1
|
|
281
|
+
|
|
282
|
+
- name: Run cmake script
|
|
283
|
+
run: |
|
|
284
|
+
cmake -B build/setup-libhowardhinnerdate -DROOT=$PWD tests/setup-libhowardhinnerdate
|
|
285
|
+
cmake --build build/setup-libhowardhinnerdate
|
|
286
|
+
|
|
287
|
+
- name: Test setup-libhowardhinnerdate
|
|
288
|
+
run: |
|
|
289
|
+
set -o errexit -o pipefail -o noclobber -o nounset
|
|
290
|
+
test -f build/setup-libhowardhinnerdate/deps/include/date/date.h
|
|
291
|
+
|
|
292
|
+
test-cross-brew-install:
|
|
293
|
+
name: test arm-brew-setup/install
|
|
294
|
+
runs-on: macos-13
|
|
295
|
+
continue-on-error: true
|
|
296
|
+
steps:
|
|
297
|
+
- name: Checkout
|
|
298
|
+
uses: actions/checkout@v4
|
|
299
|
+
|
|
300
|
+
- name: Run arm-brew-setup
|
|
301
|
+
run: ci-scripts/arm-brew-setup.sh $PWD
|
|
302
|
+
|
|
303
|
+
- name: Run arm-brew-install
|
|
304
|
+
run: ci-scripts/arm-brew-install.sh $PWD glog
|
|
305
|
+
|
|
306
|
+
- name: Test
|
|
307
|
+
run: |
|
|
308
|
+
set -o errexit -o pipefail -o noclobber -o nounset
|
|
309
|
+
test -f $PWD/arm-homebrew/lib/libgflags.dylib
|
|
310
|
+
test -f $PWD/arm-homebrew/lib/libglog.dylib
|
|
311
|
+
|
|
312
|
+
test-macos-environment-script:
|
|
313
|
+
name: test macos-environment.cmake on ${{ matrix.os }}
|
|
314
|
+
runs-on: ${{ matrix.os }}
|
|
315
|
+
strategy:
|
|
316
|
+
fail-fast: false
|
|
317
|
+
matrix:
|
|
318
|
+
os: [ macos-13, macos-14 ]
|
|
319
|
+
|
|
320
|
+
steps:
|
|
321
|
+
- name: Checkout
|
|
322
|
+
uses: actions/checkout@v4
|
|
323
|
+
|
|
324
|
+
- name: Checkout
|
|
325
|
+
uses: actions/checkout@v4
|
|
326
|
+
|
|
327
|
+
- name: Install packages
|
|
328
|
+
run: brew install flex bison bash
|
|
329
|
+
|
|
330
|
+
- name: Run CMake test
|
|
331
|
+
run: cmake -B test.build -S tests/cmake
|
data/tools/.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
build/
|
data/tools/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
[](https://github.com/tamatebako/macos-cross-compile/actions/workflows/lint.yml)
|
|
2
|
+
[](https://github.com/tamatebako/tebako-tools/actions/workflows/test.yml)
|
|
3
|
+
|
|
4
|
+
## Tebako portability tools ##
|
|
5
|
+
|
|
6
|
+
This repository contains cmake, shell scripts and include files aimed to support tebako builds on different platforms.
|
|
7
|
+
|
|
8
|
+
## Homebrew cross-installation scripts ##
|
|
9
|
+
|
|
10
|
+
Sometimes you need to build MacOS application in a foreign environment. For example, GitHub Actions provides x86 runners only, but you may need to build and package arm64 binary.
|
|
11
|
+
Most of the applications rely on external dependencies, so on MacOS you will require a method to use another instance of homebrew to support the target environment.
|
|
12
|
+
|
|
13
|
+
Among other tools this repository provides a set of simple scripts to cross install homebrew dependencies
|
|
14
|
+
|
|
15
|
+
### arm64 packages on x86_64 system
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
arm-brew-install <arm brew parent folder>
|
|
19
|
+
arm-brew-setup <arm brew folder> <formula to install 1> ... <formula to install 1>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
For example
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
arm-brew-install ~/test
|
|
26
|
+
arm-brew-setup ~/test glog gflags
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Will create arm brew environment in ~/test/arm-homebrew and install glog and gflags formulae there
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### x86_64 packages on arm system
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
x86_64-brew-install <x86_64 brew parent folder>
|
|
36
|
+
x86_64-brew-setup <x86_64 brew folder> <formula to install 1> ... <formula to install 1>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
For example
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
x86_64-brew-install ~/test
|
|
43
|
+
x86_64-brew-setup ~/test glog gflags
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Will create x86_64 brew environment in ~/test/x86_64-homebrew and install glog and gflags formulae there
|
|
47
|
+
|
|
48
|
+
There are related discussions at https://github.com/orgs/Homebrew/discussions/2843
|
|
49
|
+
and https://stackoverflow.com/questions/70821136/can-i-install-arm64-libraries-on-x86-64-with-homebrew/70822921#70822921
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#! /bin/bash
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2022-2025 [Ribose Inc](https://www.ribose.com).
|
|
4
|
+
# All rights reserved.
|
|
5
|
+
# This file is a part of the Tebako project.
|
|
6
|
+
#
|
|
7
|
+
# Redistribution and use in source and binary forms, with or without
|
|
8
|
+
# modification, are permitted provided that the following conditions
|
|
9
|
+
# are met:
|
|
10
|
+
# 1. Redistributions of source code must retain the above copyright
|
|
11
|
+
# notice, this list of conditions and the following disclaimer.
|
|
12
|
+
# 2. Redistributions in binary form must reproduce the above copyright
|
|
13
|
+
# notice, this list of conditions and the following disclaimer in the
|
|
14
|
+
# documentation and/or other materials provided with the distribution.
|
|
15
|
+
#
|
|
16
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
17
|
+
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
18
|
+
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
19
|
+
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
|
|
20
|
+
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
21
|
+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
22
|
+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
23
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
24
|
+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
25
|
+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
26
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
|
27
|
+
|
|
28
|
+
set -o errexit -o pipefail -o noclobber -o nounset
|
|
29
|
+
|
|
30
|
+
# for zsh
|
|
31
|
+
# https://stackoverflow.com/questions/6715388/variable-expansion-is-different-in-zsh-from-that-in-bash
|
|
32
|
+
# setopt sh_word_split
|
|
33
|
+
|
|
34
|
+
DIR0="$( cd "$1" && pwd )"
|
|
35
|
+
DIR1="$DIR0/arm-homebrew"
|
|
36
|
+
|
|
37
|
+
for bottle in "${@:2}"
|
|
38
|
+
do
|
|
39
|
+
echo "Installing $bottle"
|
|
40
|
+
response=$("$DIR1/bin/brew" fetch --force --bottle-tag=arm64_ventura "$bottle" | grep "bottle.tar.gz")
|
|
41
|
+
IFS=" " read -r -a parsed <<< "$response"
|
|
42
|
+
"$DIR1/bin/brew" install "${parsed[2]}"
|
|
43
|
+
done
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#! /bin/bash
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2022-2025 [Ribose Inc](https://www.ribose.com).
|
|
4
|
+
# All rights reserved.
|
|
5
|
+
# This file is a part of the Tebako project.
|
|
6
|
+
#
|
|
7
|
+
# Redistribution and use in source and binary forms, with or without
|
|
8
|
+
# modification, are permitted provided that the following conditions
|
|
9
|
+
# are met:
|
|
10
|
+
# 1. Redistributions of source code must retain the above copyright
|
|
11
|
+
# notice, this list of conditions and the following disclaimer.
|
|
12
|
+
# 2. Redistributions in binary form must reproduce the above copyright
|
|
13
|
+
# notice, this list of conditions and the following disclaimer in the
|
|
14
|
+
# documentation and/or other materials provided with the distribution.
|
|
15
|
+
#
|
|
16
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
17
|
+
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
18
|
+
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
19
|
+
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
|
|
20
|
+
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
21
|
+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
22
|
+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
23
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
24
|
+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
25
|
+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
26
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
|
27
|
+
|
|
28
|
+
set -o errexit -o pipefail -o noclobber -o nounset
|
|
29
|
+
|
|
30
|
+
DIR0="$( cd "$1" && pwd )"
|
|
31
|
+
DIR1="$DIR0/arm-homebrew"
|
|
32
|
+
mkdir "$DIR1"
|
|
33
|
+
curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C "$DIR1"
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#! /bin/bash
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2022-2025 [Ribose Inc](https://www.ribose.com).
|
|
4
|
+
# All rights reserved.
|
|
5
|
+
# This file is a part of the Tebako project.
|
|
6
|
+
#
|
|
7
|
+
# Redistribution and use in source and binary forms, with or without
|
|
8
|
+
# modification, are permitted provided that the following conditions
|
|
9
|
+
# are met:
|
|
10
|
+
# 1. Redistributions of source code must retain the above copyright
|
|
11
|
+
# notice, this list of conditions and the following disclaimer.
|
|
12
|
+
# 2. Redistributions in binary form must reproduce the above copyright
|
|
13
|
+
# notice, this list of conditions and the following disclaimer in the
|
|
14
|
+
# documentation and/or other materials provided with the distribution.
|
|
15
|
+
#
|
|
16
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
17
|
+
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
18
|
+
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
19
|
+
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
|
|
20
|
+
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
21
|
+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
22
|
+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
23
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
24
|
+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
25
|
+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
26
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
|
27
|
+
|
|
28
|
+
set -o errexit -o pipefail -o noclobber -o nounset
|
|
29
|
+
|
|
30
|
+
# for zsh
|
|
31
|
+
# https://stackoverflow.com/questions/6715388/variable-expansion-is-different-in-zsh-from-that-in-bash
|
|
32
|
+
# setopt sh_word_split
|
|
33
|
+
|
|
34
|
+
DIR0="$( cd "$1" && pwd )"
|
|
35
|
+
echo "$DIR0"
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
#! /bin/bash
|
|
2
|
+
# Copyright (c) 2022-2025 [Ribose Inc](https://www.ribose.com).
|
|
3
|
+
# All rights reserved.
|
|
4
|
+
# This file is a part of the Tebako project.
|
|
5
|
+
#
|
|
6
|
+
# Redistribution and use in source and binary forms, with or without
|
|
7
|
+
# modification, are permitted provided that the following conditions
|
|
8
|
+
# are met:
|
|
9
|
+
# 1. Redistributions of source code must retain the above copyright
|
|
10
|
+
# notice, this list of conditions and the following disclaimer.
|
|
11
|
+
# 2. Redistributions in binary form must reproduce the above copyright
|
|
12
|
+
# notice, this list of conditions and the following disclaimer in the
|
|
13
|
+
# documentation and/or other materials provided with the distribution.
|
|
14
|
+
#
|
|
15
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
16
|
+
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
17
|
+
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
18
|
+
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
|
|
19
|
+
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
20
|
+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
21
|
+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
22
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
23
|
+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
24
|
+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
25
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
|
26
|
+
|
|
27
|
+
set -o errexit -o pipefail -o noclobber -o nounset
|
|
28
|
+
|
|
29
|
+
# ....................................................
|
|
30
|
+
restore_and_save() {
|
|
31
|
+
echo "Patching $1"
|
|
32
|
+
test -e "$1.old" && cp -f "$1.old" "$1"
|
|
33
|
+
cp -f "$1" "$1.old"
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
do_patch() {
|
|
37
|
+
restore_and_save "$1"
|
|
38
|
+
"$gSed" -i "s/$2/$3/g" "$1"
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
do_patch_multiline() {
|
|
42
|
+
restore_and_save "$1"
|
|
43
|
+
"$gSed" -i "s/$re/${sbst//$'\n'/"\\n"}/g" "$1"
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if [[ "$OSTYPE" == "linux-gnu"* || "$OSTYPE" == "linux-musl"* || "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" ]]; then
|
|
47
|
+
gSed="sed"
|
|
48
|
+
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
|
49
|
+
gSed="gsed"
|
|
50
|
+
else
|
|
51
|
+
echo "Unknown OSTYPE=$OSTYPE"
|
|
52
|
+
exit 1
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
re="find_package(Boost REQUIRED filesystem)"
|
|
56
|
+
# shellcheck disable=SC2251
|
|
57
|
+
! IFS= read -r -d '' sbst << EOM
|
|
58
|
+
if (POLICY CMP0167)
|
|
59
|
+
cmake_policy(SET CMP0167 NEW)
|
|
60
|
+
endif()
|
|
61
|
+
|
|
62
|
+
find_package(Boost REQUIRED filesystem)
|
|
63
|
+
EOM
|
|
64
|
+
do_patch_multiline "$1/CMakeLists.txt" "$re" "$sbst"
|
|
65
|
+
|
|
66
|
+
re="cmake_minimum_required(VERSION 3.1.3 FATAL_ERROR)"
|
|
67
|
+
sbst="cmake_minimum_required(VERSION 3.24.0)"
|
|
68
|
+
"$gSed" -i "s/$re/$sbst/g" "$1/CMakeLists.txt"
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" ]]; then
|
|
72
|
+
re="ftruncate(file\.fd(), finalBufferSize),"
|
|
73
|
+
sbst="folly::portability::unistd::ftruncate(file.fd(), finalBufferSize), \/* tebako patched *\/"
|
|
74
|
+
do_patch "$1/thrift/lib/cpp2/frozen/FrozenUtil.h" "$re" "$sbst"
|
|
75
|
+
|
|
76
|
+
re="if (detail::platform_is_windows()) {"
|
|
77
|
+
sbst="if (false) { \/* tebako patched *\/"
|
|
78
|
+
do_patch "$1/thrift/compiler/source_location.cc" "$re" "$sbst"
|
|
79
|
+
|
|
80
|
+
re="#include <fmt\/fmt-format\.h>"
|
|
81
|
+
# shellcheck disable=SC2251
|
|
82
|
+
! IFS= read -r -d '' sbst << EOM
|
|
83
|
+
#include <fmt\/format.h>
|
|
84
|
+
|
|
85
|
+
\/* -- Start of tebako patch -- *\/
|
|
86
|
+
#include <fmt\/fmt-ranges.h>
|
|
87
|
+
\/* -- End of tebako patch -- *\/
|
|
88
|
+
EOM
|
|
89
|
+
|
|
90
|
+
do_patch_multiline "$1/thrift/compiler/lib/cpp2/util.h" "$re" "$sbst"
|
|
91
|
+
do_patch_multiline "$1/thrift/compiler/gen/cpp/namespace_resolver.cc" "$re" "$sbst"
|
|
92
|
+
do_patch_multiline "$1/thrift/compiler/ast/t_const_value.h" "$re" "$sbst"
|
|
93
|
+
|
|
94
|
+
fi
|