Skip to content

Commit b41454d

Browse files
move all Conan files from the VCMI repo
1 parent c7c6956 commit b41454d

23 files changed

+555
-35
lines changed

.github/workflows/rebuildDependencies.yml

Lines changed: 19 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
conan_system_libs: bzip2 libiconv sqlite3 zlib
4848
- platform: android-armeabi-v7a
4949
os: ubuntu-latest
50-
before_install: android.sh
50+
before_install: android-32.sh
5151
conan_profile: android-32-ndk
5252
conan_system_libs: zlib
5353
- platform: android-arm64-v8a
@@ -67,42 +67,33 @@ jobs:
6767
run:
6868
shell: bash
6969
steps:
70-
- name: Checkout VCMI
70+
- name: Checkout current
7171
uses: actions/checkout@v4
72-
# TODO
73-
with:
74-
repository: 'kambala-decapitator/vcmi'
75-
ref: 'conan-v2'
72+
73+
- name: Prepare CI
74+
run: |
75+
echo CUSTOM_PATCHES_PATH="$(pwd)/conan_patches" >> $GITHUB_ENV
76+
echo DEPS_FILE="dependencies-${{ matrix.platform }}.tgz" >> $GITHUB_ENV
77+
[ '${{ matrix.before_install }}' ] && 'ci/${{ matrix.before_install }}'
7678
7779
- uses: actions/setup-java@v4
7880
if: ${{ startsWith(matrix.platform, 'android') }}
7981
with:
8082
distribution: 'temurin'
8183
java-version: '17'
8284

83-
- name: Prepare CI
84-
if: ${{ matrix.before_install }}
85-
run: source '${{github.workspace}}/CI/before_install/${{matrix.before_install}}'
86-
8785
- name: Setup Conan Client
8886
run: |
8987
pipx install conan
9088
conan profile detect
9189
9290
# CMake/Ninja version should be synced with runners
9391
# https://github.com/actions/runner-images/tree/main/images
94-
# using CMake from Android SDK because some runners already have CMake v4
9592
- name: Prepare platform tools
9693
run: |
97-
cmakeVersion=3.31.6
98-
99-
# newPathFile=$(mktemp)
100-
# echo "$ANDROID_HOME/cmake/$cmakeVersion/bin" | cat - "$GITHUB_PATH" > "$newPathFile"
101-
# mv -f "$newPathFile" "$GITHUB_PATH"
102-
10394
echo "
10495
[platform_tool_requires]
105-
cmake/$cmakeVersion
96+
cmake/3.31.6
10697
ninja/1.12.1
10798
10899
[conf]
@@ -121,17 +112,11 @@ jobs:
121112
conan create "$p" --user system
122113
done
123114
124-
- name: Checkout current
125-
uses: actions/checkout@v4
126-
with:
127-
path: deps
128-
129115
- name: Build recipes with our patches
130116
run: |
131117
cciRepo='conan-center-index'
132118
branchName='master'
133119
recipePathQt='recipes/qt'
134-
custom_patches_path="$(pwd)/deps/conan_patches"
135120
136121
git clone "https://github.com/conan-io/$cciRepo.git" \
137122
--branch "$branchName" \
@@ -163,10 +148,10 @@ jobs:
163148
164149
conan create $packagePath \
165150
--version=$version \
166-
--profile=../CI/conan/${{ matrix.conan_profile }} \
151+
--profile=../conan_profiles/${{ matrix.conan_profile }} \
167152
--build=missing \
168153
--test-folder= \
169-
--core-conf core.sources.patch:extra_path=$custom_patches_path
154+
--core-conf core.sources.patch:extra_path=$CUSTOM_PATCHES_PATH
170155
done
171156
172157
# TODO: remove LuaJIT when https://github.com/conan-io/conan-center-index/pull/26577 is merged
@@ -175,7 +160,6 @@ jobs:
175160
cciForkRepo='cci-fork'
176161
branchName='vcmi'
177162
recipePathQt='recipes/qt'
178-
custom_patches_path="$(pwd)/deps/conan_patches"
179163
180164
git clone "https://github.com/kambala-decapitator/conan-center-index.git" "$cciForkRepo" \
181165
--branch "$branchName" \
@@ -206,10 +190,10 @@ jobs:
206190
# Windows workaround for https://bugreports.qt.io/browse/QTBUG-84543
207191
PATH="/c/Strawberry/perl/bin:$PATH" conan create $packagePath \
208192
--version=$version \
209-
--profile=../CI/conan/${{ matrix.conan_profile }} \
193+
--profile=../conan_profiles/${{ matrix.conan_profile }} \
210194
--build=missing \
211195
--test-folder= \
212-
--core-conf core.sources.patch:extra_path=$custom_patches_path \
196+
--core-conf core.sources.patch:extra_path=$CUSTOM_PATCHES_PATH \
213197
${{ startsWith(matrix.platform, 'android') && '-o "qt/*:android_sdk=$ANDROID_HOME"' || '' }}
214198
done
215199
@@ -218,8 +202,8 @@ jobs:
218202
conan install . \
219203
--output-folder=conan-generated \
220204
--build=missing \
221-
--profile=CI/conan/${{ matrix.conan_profile }} \
222-
${{ matrix.conan_options }} || true
205+
--profile=conan_profiles/${{ matrix.conan_profile }} \
206+
${{ matrix.conan_options }}
223207
224208
- name: Remove builds and source code
225209
run: conan cache clean
@@ -242,7 +226,7 @@ jobs:
242226
packageListFile='pkglist.json'
243227
244228
conan graph info . \
245-
--profile=CI/conan/${{ matrix.conan_profile }} \
229+
--profile=conan_profiles/${{ matrix.conan_profile }} \
246230
--format=json \
247231
--build=never \
248232
--no-remote \
@@ -262,20 +246,20 @@ jobs:
262246
EOF" >> $GITHUB_ENV
263247
264248
- name: Create dependencies archive
265-
run: conan cache save --file dependencies-${{matrix.platform}}.tgz "*:*"
249+
run: conan cache save --file "$DEPS_FILE" "*:*"
266250

267251
- name: Upload artifact
268252
uses: actions/upload-artifact@v4
269253
with:
270254
name: dependencies-${{ matrix.platform }}
271255
compression-level: 0
272-
path: 'dependencies-${{matrix.platform}}.tgz'
256+
path: ${{ env.DEPS_FILE }}
273257

274258
- name: Update release with artifact and text
275259
uses: softprops/action-gh-release@v2
276260
with:
277261
tag_name: ${{ needs.prepare.outputs.RELEASE_TAG }}
278-
files: 'dependencies-${{matrix.platform}}.tgz'
262+
files: ${{ env.DEPS_FILE }}
279263
append_body: true
280264
body: |
281265
<details><summary><b>${{ matrix.platform }}</b> packages</summary>

ci/android-32.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
3+
# for LuaJIT
4+
sudo apt install libc6-dev-i386

ci/macos.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
echo DEVELOPER_DIR=/Applications/Xcode_16.2.app >> $GITHUB_ENV

conan_profiles/android-32

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
include(base/android)
2+
3+
[settings]
4+
arch=armv7
5+
os.api_level=19
6+
7+
[conf]
8+
# remove after switching to API level >= 24
9+
{% set file_funcs_macros = ['fseeko=fseek', 'ftello=ftell'] %}
10+
flac/*:tools.build:defines={{ file_funcs_macros }}
11+
luajit/*:tools.build:defines={{ file_funcs_macros }}
12+
opusfile/*:tools.build:defines={{ file_funcs_macros }}

conan_profiles/android-32-ndk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include(android-32)
2+
include(base/android-ndk)

conan_profiles/android-64

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
include(base/android)
2+
3+
[settings]
4+
arch=armv8
5+
os.api_level=21

conan_profiles/android-64-ndk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include(android-64)
2+
include(base/android-ndk)

conan_profiles/base/android

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{% import 'vars.jinja' as vars %}
2+
3+
include(common)
4+
5+
[settings]
6+
compiler=clang
7+
compiler.cppstd={{ vars.cppstd }}
8+
compiler.libcxx=c++_shared
9+
compiler.version=14
10+
os=Android
11+
12+
[replace_requires]
13+
zlib/*: zlib/[*]@system
14+
15+
[conf]
16+
# https://github.com/conan-io/conan-center-index/issues/25342
17+
# https://github.com/conan-io/conan/issues/16468#issuecomment-2175877245
18+
tools.meson.mesontoolchain:extra_machine_files={{ [os.path.join(profile_dir, "meson_workaround.txt")] }}
19+
20+
[options]
21+
# TODO https://github.com/conan-io/conan-center-index/issues/26020
22+
# freetype/*:shared=True
23+
sdl/*:shared=False
24+
sdl_image/*:shared=False
25+
sdl_mixer/*:shared=False
26+
sdl_ttf/*:shared=False
27+
28+
qt/*:opengl=es2
29+
qt/*:qtandroidextras=True
30+
qt/*:with_freetype=True

conan_profiles/base/android-ndk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[tool_requires]
2+
android-ndk/r25c

conan_profiles/base/apple

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{% import 'vars.jinja' as vars %}
2+
3+
include(common)
4+
5+
[settings]
6+
compiler=apple-clang
7+
compiler.cppstd={{ vars.cppstd }}
8+
compiler.libcxx=libc++
9+
compiler.version=16
10+
11+
[replace_requires]
12+
bzip2/*: bzip2/[*]@system
13+
libiconv/*: libiconv/[*]@system
14+
sqlite3/*: sqlite3/[*]@system
15+
zlib/*: zlib/[*]@system
16+
17+
[conf]
18+
tools.apple:enable_bitcode=False
19+
20+
[options]
21+
qt/*:openssl=False
22+
sdl_image/*:imageio=True

0 commit comments

Comments
 (0)