forked from LuxCoreRender/LuxCoreDeps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-conan.sh
executable file
·110 lines (90 loc) · 2.89 KB
/
install-conan.sh
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
# SPDX-FileCopyrightText: 2024 Howetuft
#
# SPDX-License-Identifier: Apache-2.0
CONAN_PROFILE=conan-profile-${RUNNER_OS}-${RUNNER_ARCH}
LUXCORE_VERSION="2.10.0"
function conan_local_install() {
name=$(echo "$1" | tr '[:upper:]' '[:lower:]') # Package name in lowercase
conan create \
--profile:all=$CONAN_PROFILE \
--build=missing \
-vnotice \
$WORKSPACE/local-conan-recipes/$name
conan install \
--profile:all=$CONAN_PROFILE \
--build=missing \
-vnotice \
$WORKSPACE/local-conan-recipes/$name
}
# Script starts here
set -o pipefail
if [[ $RUNNER_OS == "Linux" ]]; then
cache_dir=/conan-cache
else
cache_dir=$WORKSPACE/conan-cache
fi
echo "::group::CIBW_BEFORE_BUILD: pip"
pip install conan
pip install ninja
echo "::endgroup::"
if [[ $RUNNER_OS == "Linux" ]]; then
# ispc
echo "::group::CIBW_BEFORE_BUILD: ispc"
source /opt/intel/oneapi/ispc/latest/env/vars.sh
echo "::endgroup::"
fi
echo "::group::CIBW_BEFORE_BUILD: restore conan cache"
# Restore conan cache (add -vverbose to debug)
conan cache restore $cache_dir/conan-cache-save.tgz
echo "::endgroup::"
# Install profiles
echo "::group::CIBW_BEFORE_BUILD: profiles"
conan create $WORKSPACE/conan-profiles \
--profile:all=$WORKSPACE/conan-profiles/$CONAN_PROFILE
conan config install-pkg -vvv luxcoreconf/$LUXCORE_VERSION@luxcore/luxcore
echo "::endgroup::"
# Install local packages
echo "::group::CIBW_BEFORE_BUILD: nativefiledialog"
conan_local_install nativefiledialog
echo "::endgroup::"
echo "::group::CIBW_BEFORE_BUILD: fmt"
conan_local_install fmt
echo "::endgroup::"
echo "::group::CIBW_BEFORE_BUILD: opensubdiv"
conan_local_install opensubdiv
echo "::endgroup::"
echo "::group::CIBW_BEFORE_BUILD: OIDN"
conan_local_install oidn
echo "::endgroup::"
echo "::group::CIBW_BEFORE_BUILD: Blender types"
conan_local_install blender-types
echo "::endgroup::"
if [[ $RUNNER_OS == "Windows" ]]; then
DEPLOY_PATH=$(cygpath "C:\\Users\\runneradmin")
else
DEPLOY_PATH=$WORKSPACE
fi
echo "::group::CIBW_BEFORE_BUILD: LuxCore Deps"
cd $WORKSPACE
conan create $WORKSPACE \
--profile:all=$CONAN_PROFILE \
--build=missing
conan install \
--requires=luxcoredeps/$LUXCORE_VERSION@luxcore/luxcore \
--profile:all=$CONAN_PROFILE \
--no-remote \
--build=missing
echo "::endgroup::"
echo "::group::Saving dependencies in ${cache_dir}"
conan cache clean "*" # Clean non essential files
conan remove -c -vverbose "*/*#!latest" # Keep only latest version of each package
# Save only dependencies of current target (otherwise cache gets bloated)
conan graph info \
--requires=luxcoredeps/$LUXCORE_VERSION@luxcore/luxcore \
--requires=luxcoreconf/$LUXCORE_VERSION@luxcore/luxcore \
--format=json \
--profile:all=$CONAN_PROFILE \
> graph.json
conan list --graph=graph.json --format=json --graph-binaries=Cache > list.json
conan cache save -vverbose --file=$cache_dir/conan-cache-save.tgz --list=list.json
echo "::endgroup::"