Compare commits
568 Commits
tmp-buildb
...
temp-geome
Author | SHA1 | Date | |
---|---|---|---|
c8698e6657 | |||
b517b9f646 | |||
3d7021b4ec | |||
b129a0b397 | |||
5f27a5fff7 | |||
b801db1181 | |||
b5840f9b5b | |||
![]() |
beb6399ae5 | ||
![]() |
15868b1ff4 | ||
7b524d9b71 | |||
a13314a03f | |||
cbdddc5648 | |||
51568030e9 | |||
27da305a40 | |||
67b352f9c5 | |||
8cdb99d51c | |||
3a8347f823 | |||
6570159929 | |||
1f778dbefc | |||
4b9ff3cd42 | |||
2e99a74df9 | |||
879b89e967 | |||
0469f2392f | |||
55bffa82da | |||
de6c6501f0 | |||
de05e261ec | |||
379f116a2a | |||
f7fbb518c8 | |||
d6212f67a9 | |||
ef7fcaf8e6 | |||
6e4b9f5836 | |||
c9f12b21e2 | |||
35db01325f | |||
8f4d991594 | |||
a50a51eef0 | |||
276790cbfa | |||
7dd7849ddd | |||
7561e3dad0 | |||
354ecc2f1e | |||
157081069d | |||
befb9d99f8 | |||
b964f73e7d | |||
eed9ac5b6e | |||
e291432f5f | |||
635b4db162 | |||
![]() |
a6f275cad3 | ||
82c17082ba | |||
071799d4fc | |||
61b22d27c8 | |||
5cc8e7ab53 | |||
2c916c97ac | |||
0f427f4eb1 | |||
58e58310b7 | |||
a8f37763ca | |||
dbc054bb88 | |||
abb07a38b8 | |||
c88c331384 | |||
![]() |
187e217b5a | ||
fa1868ae97 | |||
c3b641613c | |||
0732a9f1b2 | |||
87833f8f95 | |||
b35ba22d84 | |||
c6e6a9046e | |||
ee8b284d11 | |||
![]() |
c317f111c1 | ||
2fcd3f0296 | |||
1917d0345e | |||
ebfad93039 | |||
3a48147b8a | |||
0b15353baa | |||
f3eecfe386 | |||
026de343e3 | |||
f8d219dfd4 | |||
6ff0d59967 | |||
feaf309de7 | |||
f4e3b1e573 | |||
e3bdb189a7 | |||
ab063db34d | |||
3f1111b2a8 | |||
ad9fd47d7b | |||
01234b430b | |||
956c539e59 | |||
d3a792431e | |||
53ba9f01e2 | |||
1725bfc3cb | |||
6a3bd04e42 | |||
8af2c87f7e | |||
cd39e3dec1 | |||
338be95874 | |||
9ac56bad4c | |||
67ee87a6e9 | |||
53e1442ac2 | |||
e1d6219731 | |||
dc3b7602ee | |||
d086570c7a | |||
4947aa29db | |||
d443dcc733 | |||
6f158f834d | |||
445d506ac9 | |||
![]() |
b11a463e4f | ||
b665ad8621 | |||
41af27c582 | |||
47473bee34 | |||
b9ccfb89ce | |||
ce64cfd6ed | |||
3cf39c09bf | |||
4246898ad3 | |||
2851602052 | |||
4968a0bdf9 | |||
![]() |
f383cad329 | ||
002d563bbb | |||
4d91808710 | |||
4044c29069 | |||
54d651c344 | |||
19df0e3cfd | |||
b2510b9e20 | |||
feb6fd632f | |||
a1c3e45100 | |||
b45cee1aaf | |||
5df6b4004c | |||
5f71b1edd5 | |||
80083ac773 | |||
0cd34967c0 | |||
6afafc46f6 | |||
2d75b39b64 | |||
eee3529eaf | |||
859b3ff346 | |||
bce482f476 | |||
d9b1592c88 | |||
3462b4c7ae | |||
2d60c496a2 | |||
513f566b40 | |||
b5e5fbcfc8 | |||
3da25dc625 | |||
f3c5a84bb9 | |||
033641aa74 | |||
f9aea19d98 | |||
d52b7dbe26 | |||
3e6f2c7a99 | |||
f7022fc73f | |||
8a048593ca | |||
b6030711a2 | |||
638c16f410 | |||
682a74e090 | |||
aee04d4960 | |||
4c19fe4707 | |||
4998ceebfc | |||
408726000a | |||
![]() |
e0f2f07d1e | ||
![]() |
6d73d98fb6 | ||
03a83b4eb5 | |||
![]() |
ea4309925f | ||
a9d5c8f97f | |||
847b66e81d | |||
b8cf8e0bc2 | |||
80bc819d50 | |||
adefdbc9df | |||
7c68147709 | |||
060d668ae6 | |||
6c1fdd52c1 | |||
3caafd24a9 | |||
c4958bc540 | |||
2e8d7fa7ee | |||
253c5d25f7 | |||
c290ac2ab1 | |||
af4167441b | |||
50a4b9d502 | |||
5f0d4fef91 | |||
68b06208d2 | |||
f3c88f8ba5 | |||
![]() |
e178a273fa | ||
94c4a9995e | |||
4b673ebb99 | |||
577d6d3f87 | |||
ed4222258e | |||
7c1bb239be | |||
56db09e2fd | |||
1388e9de8a | |||
a971409d5a | |||
ccd5f80550 | |||
8ff6322152 | |||
6db290641e | |||
286bd87445 | |||
eb85de027c | |||
78693d524c | |||
e7003bc965 | |||
c73be23e17 | |||
845f4cebad | |||
d03b26edbd | |||
a1cc7042a7 | |||
247abdbf41 | |||
b37093de7b | |||
45d59e0df5 | |||
0cebe554d1 | |||
af3d7123c9 | |||
3953b82030 | |||
88aa056d1a | |||
b66600b9f3 | |||
b406b6717f | |||
94084b2d3c | |||
00fc110d3f | |||
1c0a490d0e | |||
c3fa7b7e4f | |||
4b36c5b1a7 | |||
3385c04598 | |||
9fed00341e | |||
![]() |
ed4b2ba75a | ||
2209321f78 | |||
be8a201a16 | |||
0b0c7ca017 | |||
c8e331f450 | |||
4891da8ae2 | |||
1a5fa2b319 | |||
143a81ccce | |||
c29afa5156 | |||
732e8c723e | |||
![]() |
6bb980b0f4 | ||
8e84938dd0 | |||
a4f840e15b | |||
fcc844f8fb | |||
![]() |
b3f0dc2907 | ||
71997921c4 | |||
0c75a98561 | |||
![]() |
174ed69c1b | ||
7c8b9c7a9a | |||
62906cdbea | |||
7f570a7174 | |||
9cd2e80d5d | |||
462bd81399 | |||
819152527f | |||
89e2b441ed | |||
ae34808114 | |||
fdad77d73d | |||
0a361eb5ec | |||
2ba804d7b7 | |||
5dc0fd08a7 | |||
2053e1f533 | |||
4ae06b6123 | |||
013fc69ea8 | |||
3bf98d1cec | |||
9ce49af32e | |||
1f251b7a27 | |||
61fdc45034 | |||
bf7f918a0e | |||
fe0fa7cec6 | |||
![]() |
4a540b9b48 | ||
fcbb20286a | |||
d08e925ef1 | |||
bcff0ef9ca | |||
2e5671a959 | |||
aadd355028 | |||
3de6fe0b3e | |||
e9b4de43d8 | |||
90b0fb135f | |||
8a1860bd9a | |||
6bef255904 | |||
8083527f90 | |||
1d2eb461b5 | |||
![]() |
b84707df17 | ||
ada47c4772 | |||
748475b943 | |||
b21db5e698 | |||
![]() |
5add6f2ed9 | ||
c9dc55301c | |||
a19c9e9351 | |||
![]() |
2db09f67a4 | ||
03544ed54f | |||
54a03d4247 | |||
84adc23941 | |||
2b343c74d5 | |||
1e468f57b1 | |||
2ee7d5282d | |||
d9c3a223cc | |||
0f68e5c30a | |||
5181bc46b3 | |||
452590571c | |||
ab38223047 | |||
f731bce6cd | |||
4c3bb60d0f | |||
9ff4e0068f | |||
84e98ba182 | |||
8e58f93215 | |||
aab4794512 | |||
952d6663e0 | |||
7b0c8097a7 | |||
b313525c1b | |||
d75e45d10c | |||
bd87ba90e6 | |||
![]() |
7bc5246156 | ||
2f9dbe9e7c | |||
f6c5af3d47 | |||
c8fcea0c33 | |||
20ece8736f | |||
![]() |
b4adb85933 | ||
605ce623be | |||
![]() |
7b30a3e98d | ||
![]() |
7b76a160a4 | ||
0eb9351296 | |||
![]() |
2330cec2c6 | ||
fe22635bf6 | |||
c0367b19e2 | |||
4adbe31e2f | |||
1fb2eaf1c5 | |||
2f280d4b92 | |||
e9c8ae767a | |||
![]() |
7fc220517f | ||
![]() |
28617bb167 | ||
84f025c6fd | |||
![]() |
066f5a4469 | ||
![]() |
d07cc5e680 | ||
![]() |
162cf8e81d | ||
![]() |
fd5c94c48a | ||
![]() |
2724d08cf5 | ||
![]() |
461ba4438f | ||
d581c1b304 | |||
e8a4bddef4 | |||
fbd889ec28 | |||
509e0c5b76 | |||
45f32b43fc | |||
7b62a54230 | |||
![]() |
53c98e45cf | ||
bcefce33f2 | |||
9df1e0cad5 | |||
aa0bd29546 | |||
1a72ee4cbe | |||
e4ef8cbf7e | |||
5fa6cdb77a | |||
5304c6ed7d | |||
b669fd376a | |||
4d4608363c | |||
7141eb75ef | |||
12bf0af064 | |||
b282a065f1 | |||
![]() |
4f81b4b4ce | ||
9c393bab47 | |||
a3226bdf3e | |||
3ec74ee230 | |||
![]() |
d96e9de9de | ||
93fd07e19c | |||
5f19646d7e | |||
675677ec67 | |||
539095ca40 | |||
![]() |
df2a19eac7 | ||
2856f3b583 | |||
965bd53e02 | |||
05f15645ec | |||
cb0cab48ef | |||
029fb002dd | |||
4443c4082e | |||
bda8887e0c | |||
5575aba025 | |||
25d8ce16b5 | |||
59553d47c0 | |||
84af1eaa92 | |||
059f19d821 | |||
0f156a2436 | |||
f42a501c61 | |||
d8b8b4d7e2 | |||
14f3b2cdad | |||
f546b0800b | |||
92ae3ff84c | |||
5954b351f0 | |||
33c4eefabb | |||
![]() |
6e999e08ab | ||
ec98bb318b | |||
3a7ab62eac | |||
1f55e12206 | |||
ea3895558d | |||
![]() |
e4c6da29b2 | ||
4ced8900f5 | |||
f087a225dc | |||
dd98f6b55c | |||
b18a214ecb | |||
d7c812f15b | |||
3ba16afa1e | |||
8c3f4f7edf | |||
307f8c8e76 | |||
8bd09b1d77 | |||
21ac9d9cff | |||
f29a738e23 | |||
c18ff180e3 | |||
4aae988163 | |||
22ee056c3a | |||
f5a2d93224 | |||
a31bd2609f | |||
![]() |
2e19649bb9 | ||
7124c66340 | |||
![]() |
259b9c73d0 | ||
08b0de45f3 | |||
![]() |
2246d456aa | ||
9553ba1373 | |||
a2ebbeb836 | |||
5b014911a5 | |||
23fd576cf8 | |||
43464c94f4 | |||
322a614497 | |||
340c535dbf | |||
088ea59b7e | |||
cac9828ae3 | |||
9e9d45ae16 | |||
89d0cc3a0c | |||
e54a4b355e | |||
933c2cffd6 | |||
ed1fc9d96b | |||
496045fc30 | |||
f651cc6c4e | |||
0efb627bbd | |||
1b07b7a068 | |||
bd75d9f44c | |||
4602874a04 | |||
3a8c57afd5 | |||
0abce91940 | |||
2e46a8c864 | |||
ef5a362a5b | |||
a6715213c3 | |||
482465e18a | |||
b0ec1d2747 | |||
1ef33be2d4 | |||
d2aee304e8 | |||
6e56b42faa | |||
1c6e338d59 | |||
7313b243f2 | |||
1182c26978 | |||
8cbff7093d | |||
0fcc063fd9 | |||
1949643ee5 | |||
7bf9d2c580 | |||
4a9c5c60b7 | |||
0e285fa23c | |||
214a78a46f | |||
f87f8532c3 | |||
3da0b52c97 | |||
785a518ebe | |||
2bf56f7fbb | |||
93a865dde7 | |||
72d2355af5 | |||
dfac5a63bd | |||
c87327ddeb | |||
7ca5ba14b5 | |||
51bf1680bd | |||
91d3a54869 | |||
ee0000b8bb | |||
7f1d1b03ad | |||
abee9a85d4 | |||
![]() |
223016a408 | ||
6e6a1838ea | |||
1d3ffc93ec | |||
e517aaa136 | |||
8b8c3c34dd | |||
4f6cab176a | |||
98876d46ef | |||
7ef2b760dc | |||
c27b7df563 | |||
a496af8680 | |||
54ce344bc7 | |||
dbfde0fe70 | |||
8e43ef5f31 | |||
edaaa2afdd | |||
d2dc452333 | |||
2cd1bc3aa7 | |||
1a912462f4 | |||
bcf9c73cbc | |||
3c9c557580 | |||
c7fee64dea | |||
ca3891e83b | |||
a5114bfb85 | |||
022f8b552d | |||
14508ef100 | |||
bfaf09b5bc | |||
c2fa36999f | |||
5b8cd24863 | |||
![]() |
00073651d4 | ||
eb030204f1 | |||
![]() |
56005ef499 | ||
b6d6d8a1aa | |||
91ecc53994 | |||
0037e08b06 | |||
b6b20c4d92 | |||
![]() |
d486ee2dbd | ||
9ba6b64efa | |||
e4ca6b93ad | |||
77d7cae266 | |||
f4e0a19d4f | |||
053082e9d8 | |||
![]() |
ddd4b2b785 | ||
e5a1cadb2f | |||
c18675b12c | |||
64fc0e34e6 | |||
dba3fb9e09 | |||
3e695a27cd | |||
a1063fc6c2 | |||
b414322f26 | |||
899eefd1bb | |||
72607feb91 | |||
870bcf6e1a | |||
8b78510fc4 | |||
e0bc5c4087 | |||
1fd653dd82 | |||
d9aae38bc8 | |||
efad9bcdda | |||
b5d7fb813f | |||
bb16f96973 | |||
7197017ea9 | |||
ed6fd01ba9 | |||
826bed4349 | |||
797f6e1483 | |||
e011e4ce76 | |||
92f8a6ac21 | |||
7b8d812277 | |||
2ae4e860f6 | |||
2ef192a55b | |||
a51f8f94d5 | |||
17f72be3cb | |||
2a868d277e | |||
b60a72eaab | |||
2dcb6782e0 | |||
4d64de2853 | |||
5af7225816 | |||
925df8ef26 | |||
2ee575fc1f | |||
1f55786791 | |||
a9dfde7b49 | |||
0ea0ccc4ff | |||
81366b7d2c | |||
dc960a81d1 | |||
4f8edc8e7f | |||
b8ae30e9e3 | |||
ae28ceb9d8 | |||
05b685989b | |||
7654203cc8 | |||
2489f72d79 | |||
730a46e87d | |||
f944121700 | |||
21de669141 | |||
5b176b66da | |||
a55b73417f | |||
ea6d099082 | |||
34f99bc6be | |||
6cd64f8caa | |||
f92f5d1ac6 | |||
69e15eb1e4 | |||
facc62d0d5 | |||
46447594de | |||
507c19c0f7 | |||
3b3742c75f | |||
b5a883fef9 | |||
711ddea60e | |||
6b5bbd22d9 | |||
![]() |
464797078d | ||
3400ba329e | |||
17b09b509c | |||
5b6e0bad1b | |||
404b946ac0 | |||
83dab8bf98 | |||
6583fb67c6 | |||
![]() |
8a63466ca3 | ||
![]() |
ee54a8ace7 | ||
![]() |
ffe7a41540 | ||
![]() |
74c7e21f6c | ||
![]() |
fc2b56e68c | ||
![]() |
51bbdfbef3 | ||
![]() |
5baf1dddd5 | ||
4cc8f09843 | |||
3e2e8f437c | |||
7e5df11cac | |||
0d756bd4be | |||
dedf834884 |
@@ -265,4 +265,5 @@ ForEachMacros:
|
|||||||
- VECTOR_SET_SLOT_PROBING_BEGIN
|
- VECTOR_SET_SLOT_PROBING_BEGIN
|
||||||
|
|
||||||
StatementMacros:
|
StatementMacros:
|
||||||
|
- PyObject_HEAD
|
||||||
- PyObject_VAR_HEAD
|
- PyObject_VAR_HEAD
|
||||||
|
@@ -836,7 +836,7 @@ if(WITH_PYTHON)
|
|||||||
# because UNIX will search for the old Python paths which may not exist.
|
# because UNIX will search for the old Python paths which may not exist.
|
||||||
# giving errors about missing paths before this case is met.
|
# giving errors about missing paths before this case is met.
|
||||||
if(DEFINED PYTHON_VERSION AND "${PYTHON_VERSION}" VERSION_LESS "3.9")
|
if(DEFINED PYTHON_VERSION AND "${PYTHON_VERSION}" VERSION_LESS "3.9")
|
||||||
message(FATAL_ERROR "At least Python 3.9 is required to build")
|
message(FATAL_ERROR "At least Python 3.9 is required to build, but found Python ${PYTHON_VERSION}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
file(GLOB RESULT "${CMAKE_SOURCE_DIR}/release/scripts/addons")
|
file(GLOB RESULT "${CMAKE_SOURCE_DIR}/release/scripts/addons")
|
||||||
|
@@ -43,6 +43,12 @@ endif()
|
|||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(EMBREE_BUILD_DIR ${BUILD_MODE}/)
|
set(EMBREE_BUILD_DIR ${BUILD_MODE}/)
|
||||||
|
if(BUILD_MODE STREQUAL Debug)
|
||||||
|
list(APPEND EMBREE_EXTRA_ARGS
|
||||||
|
-DEMBREE_TBBMALLOC_LIBRARY_NAME=tbbmalloc_debug
|
||||||
|
-DEMBREE_TBB_LIBRARY_NAME=tbb_debug
|
||||||
|
)
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
set(EMBREE_BUILD_DIR)
|
set(EMBREE_BUILD_DIR)
|
||||||
endif()
|
endif()
|
||||||
|
@@ -22,6 +22,7 @@ if(WIN32)
|
|||||||
-DTBB_BUILD_TBBMALLOC_PROXY=On
|
-DTBB_BUILD_TBBMALLOC_PROXY=On
|
||||||
-DTBB_BUILD_STATIC=Off
|
-DTBB_BUILD_STATIC=Off
|
||||||
-DTBB_BUILD_TESTS=Off
|
-DTBB_BUILD_TESTS=Off
|
||||||
|
-DCMAKE_DEBUG_POSTFIX=_debug
|
||||||
)
|
)
|
||||||
set(TBB_LIBRARY tbb)
|
set(TBB_LIBRARY tbb)
|
||||||
set(TBB_STATIC_LIBRARY Off)
|
set(TBB_STATIC_LIBRARY Off)
|
||||||
@@ -55,17 +56,17 @@ if(WIN32)
|
|||||||
ExternalProject_Add_Step(external_tbb after_install
|
ExternalProject_Add_Step(external_tbb after_install
|
||||||
# findtbb.cmake in some deps *NEEDS* to find tbb_debug.lib even if they are not going to use it
|
# findtbb.cmake in some deps *NEEDS* to find tbb_debug.lib even if they are not going to use it
|
||||||
# to make that test pass, we place a copy with the right name in the lib folder.
|
# to make that test pass, we place a copy with the right name in the lib folder.
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb.lib ${HARVEST_TARGET}/tbb/lib/tbb_debug.lib
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb.lib ${LIBDIR}/tbb/lib/tbb_debug.lib
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc_debug.lib
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.lib ${LIBDIR}/tbb/lib/tbbmalloc_debug.lib
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb.dll ${HARVEST_TARGET}/tbb/lib/tbb_debug.dll
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/bin/tbb.dll ${LIBDIR}/tbb/bin/tbb_debug.dll
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.dll ${HARVEST_TARGET}/tbb/lib/tbbmalloc_debug.dll
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/bin/tbbmalloc.dll ${LIBDIR}/tbb/bin/tbbmalloc_debug.dll
|
||||||
# Normal collection of build artifacts
|
# Normal collection of build artifacts
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb.lib ${HARVEST_TARGET}/tbb/lib/tbb.lib
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb.lib ${HARVEST_TARGET}/tbb/lib/tbb.lib
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb.dll ${HARVEST_TARGET}/tbb/lib/tbb.dll
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/bin/tbb.dll ${HARVEST_TARGET}/tbb/bin/tbb.dll
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc.lib
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc.lib
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.dll ${HARVEST_TARGET}/tbb/lib/tbbmalloc.dll
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/bin/tbbmalloc.dll ${HARVEST_TARGET}/tbb/bin/tbbmalloc.dll
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc_proxy.lib
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc_proxy.lib
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy.dll ${HARVEST_TARGET}/tbb/lib/tbbmalloc_proxy.dll
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/bin/tbbmalloc_proxy.dll ${HARVEST_TARGET}/tbb/bin/tbbmalloc_proxy.dll
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tbb/include/ ${HARVEST_TARGET}/tbb/include/
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tbb/include/ ${HARVEST_TARGET}/tbb/include/
|
||||||
DEPENDEES install
|
DEPENDEES install
|
||||||
)
|
)
|
||||||
@@ -76,11 +77,12 @@ if(WIN32)
|
|||||||
# to make that test pass, we place a copy with the right name in the lib folder.
|
# to make that test pass, we place a copy with the right name in the lib folder.
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_debug.lib ${LIBDIR}/tbb/lib/tbb.lib
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_debug.lib ${LIBDIR}/tbb/lib/tbb.lib
|
||||||
# Normal collection of build artifacts
|
# Normal collection of build artifacts
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_debug.lib ${HARVEST_TARGET}/tbb/lib/debug/tbb_debug.lib
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_debug.lib ${HARVEST_TARGET}/tbb/lib/tbb_debug.lib
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_debug.dll ${HARVEST_TARGET}/tbb/lib/debug/tbb_debug.dll
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/bin/tbb_debug.dll ${HARVEST_TARGET}/tbb/bin/tbb_debug.dll
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc_proxy_debug.lib
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_debug.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc_debug.lib
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.dll ${HARVEST_TARGET}/tbb/lib/debug/tbbmalloc.dll
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy_debug.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc_proxy_debug.lib
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy.dll ${HARVEST_TARGET}/tbb/lib/debug/tbbmalloc_proxy.dll
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/bin/tbbmalloc_debug.dll ${HARVEST_TARGET}/tbb/bin/tbbmalloc_debug.dll
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/bin/tbbmalloc_proxy_debug.dll ${HARVEST_TARGET}/tbb/bin/tbbmalloc_proxy_debug.dll
|
||||||
DEPENDEES install
|
DEPENDEES install
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
@@ -432,9 +432,9 @@ set(USD_HASH 1dd1e2092d085ed393c1f7c450a4155a)
|
|||||||
set(USD_HASH_TYPE MD5)
|
set(USD_HASH_TYPE MD5)
|
||||||
set(USD_FILE usd-v${USD_VERSION}.tar.gz)
|
set(USD_FILE usd-v${USD_VERSION}.tar.gz)
|
||||||
|
|
||||||
set(OIDN_VERSION 1.3.0)
|
set(OIDN_VERSION 1.4.0)
|
||||||
set(OIDN_URI https://github.com/OpenImageDenoise/oidn/releases/download/v${OIDN_VERSION}/oidn-${OIDN_VERSION}.src.tar.gz)
|
set(OIDN_URI https://github.com/OpenImageDenoise/oidn/releases/download/v${OIDN_VERSION}/oidn-${OIDN_VERSION}.src.tar.gz)
|
||||||
set(OIDN_HASH 301a5a0958d375a942014df0679b9270)
|
set(OIDN_HASH 421824019becc5b664a22a2b98332bc5)
|
||||||
set(OIDN_HASH_TYPE MD5)
|
set(OIDN_HASH_TYPE MD5)
|
||||||
set(OIDN_FILE oidn-${OIDN_VERSION}.src.tar.gz)
|
set(OIDN_FILE oidn-${OIDN_VERSION}.src.tar.gz)
|
||||||
|
|
||||||
|
@@ -553,10 +553,10 @@ EMBREE_FORCE_BUILD=false
|
|||||||
EMBREE_FORCE_REBUILD=false
|
EMBREE_FORCE_REBUILD=false
|
||||||
EMBREE_SKIP=false
|
EMBREE_SKIP=false
|
||||||
|
|
||||||
OIDN_VERSION="1.3.0"
|
OIDN_VERSION="1.4.0"
|
||||||
OIDN_VERSION_SHORT="1.3"
|
OIDN_VERSION_SHORT="1.4"
|
||||||
OIDN_VERSION_MIN="1.3.0"
|
OIDN_VERSION_MIN="1.4.0"
|
||||||
OIDN_VERSION_MAX="1.4"
|
OIDN_VERSION_MAX="1.5"
|
||||||
OIDN_FORCE_BUILD=false
|
OIDN_FORCE_BUILD=false
|
||||||
OIDN_FORCE_REBUILD=false
|
OIDN_FORCE_REBUILD=false
|
||||||
OIDN_SKIP=false
|
OIDN_SKIP=false
|
||||||
@@ -565,7 +565,7 @@ ISPC_VERSION="1.14.1"
|
|||||||
|
|
||||||
FFMPEG_VERSION="4.4"
|
FFMPEG_VERSION="4.4"
|
||||||
FFMPEG_VERSION_SHORT="4.4"
|
FFMPEG_VERSION_SHORT="4.4"
|
||||||
FFMPEG_VERSION_MIN="4.4"
|
FFMPEG_VERSION_MIN="3.0"
|
||||||
FFMPEG_VERSION_MAX="5.0"
|
FFMPEG_VERSION_MAX="5.0"
|
||||||
FFMPEG_FORCE_BUILD=false
|
FFMPEG_FORCE_BUILD=false
|
||||||
FFMPEG_FORCE_REBUILD=false
|
FFMPEG_FORCE_REBUILD=false
|
||||||
|
@@ -1,33 +1,3 @@
|
|||||||
diff -Naur oidn-1.3.0/cmake/FindTBB.cmake external_openimagedenoise/cmake/FindTBB.cmake
|
|
||||||
--- oidn-1.3.0/cmake/FindTBB.cmake 2021-02-04 16:20:26 -0700
|
|
||||||
+++ external_openimagedenoise/cmake/FindTBB.cmake 2021-02-12 09:35:53 -0700
|
|
||||||
@@ -332,20 +332,22 @@
|
|
||||||
${TBB_ROOT}/lib/${TBB_ARCH}/${TBB_VCVER}
|
|
||||||
${TBB_ROOT}/lib
|
|
||||||
)
|
|
||||||
-
|
|
||||||
# On Windows, also search the DLL so that the client may install it.
|
|
||||||
file(GLOB DLL_NAMES
|
|
||||||
${TBB_ROOT}/bin/${TBB_ARCH}/${TBB_VCVER}/${LIB_NAME}.dll
|
|
||||||
${TBB_ROOT}/bin/${LIB_NAME}.dll
|
|
||||||
+ ${TBB_ROOT}/lib/${LIB_NAME}.dll
|
|
||||||
${TBB_ROOT}/redist/${TBB_ARCH}/${TBB_VCVER}/${LIB_NAME}.dll
|
|
||||||
${TBB_ROOT}/redist/${TBB_ARCH}/${TBB_VCVER}/${LIB_NAME_GLOB1}.dll
|
|
||||||
${TBB_ROOT}/redist/${TBB_ARCH}/${TBB_VCVER}/${LIB_NAME_GLOB2}.dll
|
|
||||||
${TBB_ROOT}/../redist/${TBB_ARCH}/tbb/${TBB_VCVER}/${LIB_NAME}.dll
|
|
||||||
${TBB_ROOT}/../redist/${TBB_ARCH}_win/tbb/${TBB_VCVER}/${LIB_NAME}.dll
|
|
||||||
)
|
|
||||||
- list(GET DLL_NAMES 0 DLL_NAME)
|
|
||||||
- get_filename_component(${BIN_DIR_VAR} "${DLL_NAME}" DIRECTORY)
|
|
||||||
- set(${DLL_VAR} "${DLL_NAME}" CACHE PATH "${COMPONENT_NAME} ${BUILD_CONFIG} dll path")
|
|
||||||
+ if (DLL_NAMES)
|
|
||||||
+ list(GET DLL_NAMES 0 DLL_NAME)
|
|
||||||
+ get_filename_component(${BIN_DIR_VAR} "${DLL_NAME}" DIRECTORY)
|
|
||||||
+ set(${DLL_VAR} "${DLL_NAME}" CACHE PATH "${COMPONENT_NAME} ${BUILD_CONFIG} dll path")
|
|
||||||
+ endif()
|
|
||||||
elseif(APPLE)
|
|
||||||
set(LIB_PATHS ${TBB_ROOT}/lib)
|
|
||||||
else()
|
|
||||||
--- external_openimagedenoise/cmake/oidn_ispc.cmake 2021-02-15 17:29:34.000000000 +0100
|
--- external_openimagedenoise/cmake/oidn_ispc.cmake 2021-02-15 17:29:34.000000000 +0100
|
||||||
+++ external_openimagedenoise/cmake/oidn_ispc.cmake2 2021-02-15 17:29:28.000000000 +0100
|
+++ external_openimagedenoise/cmake/oidn_ispc.cmake2 2021-02-15 17:29:28.000000000 +0100
|
||||||
@@ -98,7 +98,7 @@
|
@@ -98,7 +98,7 @@
|
||||||
|
@@ -1,70 +1,4 @@
|
|||||||
Blender Buildbot
|
Buildbot Configuration
|
||||||
================
|
=====================
|
||||||
|
|
||||||
Code signing
|
Files used by Buildbot's `compile-code` step.
|
||||||
------------
|
|
||||||
|
|
||||||
Code signing is done as part of INSTALL target, which makes it possible to sign
|
|
||||||
files which are aimed into a bundle and coming from a non-signed source (such as
|
|
||||||
libraries SVN).
|
|
||||||
|
|
||||||
This is achieved by specifying `worker_codesign.cmake` as a post-install script
|
|
||||||
run by CMake. This CMake script simply involves an utility script written in
|
|
||||||
Python which takes care of an actual signing.
|
|
||||||
|
|
||||||
### Configuration
|
|
||||||
|
|
||||||
Client configuration doesn't need anything special, other than variable
|
|
||||||
`SHARED_STORAGE_DIR` pointing to a location which is watched by a server.
|
|
||||||
This is done in `config_builder.py` file and is stored in Git (which makes it
|
|
||||||
possible to have almost zero-configuration buildbot machines).
|
|
||||||
|
|
||||||
Server configuration requires copying `config_server_template.py` under the
|
|
||||||
name of `config_server.py` and tweaking values, which are platform-specific.
|
|
||||||
|
|
||||||
#### Windows configuration
|
|
||||||
|
|
||||||
There are two things which are needed on Windows in order to have code signing
|
|
||||||
to work:
|
|
||||||
|
|
||||||
- `TIMESTAMP_AUTHORITY_URL` which is most likely set http://timestamp.digicert.com
|
|
||||||
- `CERTIFICATE_FILEPATH` which is a full file path to a PKCS #12 key (.pfx).
|
|
||||||
|
|
||||||
## Tips
|
|
||||||
|
|
||||||
### Self-signed certificate on Windows
|
|
||||||
|
|
||||||
It is easiest to test configuration using self-signed certificate.
|
|
||||||
|
|
||||||
The certificate manipulation utilities are coming with Windows SDK.
|
|
||||||
Unfortunately, they are not added to PATH. Here is an example of how to make
|
|
||||||
sure they are easily available:
|
|
||||||
|
|
||||||
```
|
|
||||||
set PATH=C:\Program Files (x86)\Windows Kits\10\App Certification Kit;%PATH%
|
|
||||||
set PATH=C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64;%PATH%
|
|
||||||
```
|
|
||||||
|
|
||||||
Generate CA:
|
|
||||||
|
|
||||||
```
|
|
||||||
makecert -r -pe -n "CN=Blender Test CA" -ss CA -sr CurrentUser -a sha256 ^
|
|
||||||
-cy authority -sky signature -sv BlenderTestCA.pvk BlenderTestCA.cer
|
|
||||||
```
|
|
||||||
|
|
||||||
Import the generated CA:
|
|
||||||
|
|
||||||
```
|
|
||||||
certutil -user -addstore Root BlenderTestCA.cer
|
|
||||||
```
|
|
||||||
|
|
||||||
Create self-signed certificate and pack it into PKCS #12:
|
|
||||||
|
|
||||||
```
|
|
||||||
makecert -pe -n "CN=Blender Test SPC" -a sha256 -cy end ^
|
|
||||||
-sky signature ^
|
|
||||||
-ic BlenderTestCA.cer -iv BlenderTestCA.pvk ^
|
|
||||||
-sv BlenderTestSPC.pvk BlenderTestSPC.cer
|
|
||||||
|
|
||||||
pvk2pfx -pvk BlenderTestSPC.pvk -spc BlenderTestSPC.cer -pfx BlenderTestSPC.pfx
|
|
||||||
```
|
|
||||||
|
@@ -1,127 +0,0 @@
|
|||||||
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
|
||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
#
|
|
||||||
# ##### END GPL LICENSE BLOCK #####
|
|
||||||
|
|
||||||
# <pep8 compliant>
|
|
||||||
|
|
||||||
import argparse
|
|
||||||
import os
|
|
||||||
import re
|
|
||||||
import subprocess
|
|
||||||
import sys
|
|
||||||
|
|
||||||
|
|
||||||
def is_tool(name):
|
|
||||||
"""Check whether `name` is on PATH and marked as executable."""
|
|
||||||
|
|
||||||
# from whichcraft import which
|
|
||||||
from shutil import which
|
|
||||||
|
|
||||||
return which(name) is not None
|
|
||||||
|
|
||||||
|
|
||||||
class Builder:
|
|
||||||
def __init__(self, name, branch, codesign):
|
|
||||||
self.name = name
|
|
||||||
self.branch = branch
|
|
||||||
self.is_release_branch = re.match("^blender-v(.*)-release$", branch) is not None
|
|
||||||
self.codesign = codesign
|
|
||||||
|
|
||||||
# Buildbot runs from build/ directory
|
|
||||||
self.blender_dir = os.path.abspath(os.path.join('..', 'blender.git'))
|
|
||||||
self.build_dir = os.path.abspath(os.path.join('..', 'build'))
|
|
||||||
self.install_dir = os.path.abspath(os.path.join('..', 'install'))
|
|
||||||
self.upload_dir = os.path.abspath(os.path.join('..', 'install'))
|
|
||||||
|
|
||||||
# Detect platform
|
|
||||||
if name.startswith('mac'):
|
|
||||||
self.platform = 'mac'
|
|
||||||
self.command_prefix = []
|
|
||||||
elif name.startswith('linux'):
|
|
||||||
self.platform = 'linux'
|
|
||||||
if is_tool('scl'):
|
|
||||||
self.command_prefix = ['scl', 'enable', 'devtoolset-9', '--']
|
|
||||||
else:
|
|
||||||
self.command_prefix = []
|
|
||||||
elif name.startswith('win'):
|
|
||||||
self.platform = 'win'
|
|
||||||
self.command_prefix = []
|
|
||||||
else:
|
|
||||||
raise ValueError('Unkonw platform for builder ' + self.platform)
|
|
||||||
|
|
||||||
# Always 64 bit now
|
|
||||||
self.bits = 64
|
|
||||||
|
|
||||||
|
|
||||||
def create_builder_from_arguments():
|
|
||||||
parser = argparse.ArgumentParser()
|
|
||||||
parser.add_argument('builder_name')
|
|
||||||
parser.add_argument('branch', default='master', nargs='?')
|
|
||||||
parser.add_argument("--codesign", action="store_true")
|
|
||||||
args = parser.parse_args()
|
|
||||||
return Builder(args.builder_name, args.branch, args.codesign)
|
|
||||||
|
|
||||||
|
|
||||||
class VersionInfo:
|
|
||||||
def __init__(self, builder):
|
|
||||||
# Get version information
|
|
||||||
buildinfo_h = os.path.join(builder.build_dir, "source", "creator", "buildinfo.h")
|
|
||||||
blender_h = os.path.join(builder.blender_dir, "source", "blender", "blenkernel", "BKE_blender_version.h")
|
|
||||||
|
|
||||||
version_number = int(self._parse_header_file(blender_h, 'BLENDER_VERSION'))
|
|
||||||
version_number_patch = int(self._parse_header_file(blender_h, 'BLENDER_VERSION_PATCH'))
|
|
||||||
version_numbers = (version_number // 100, version_number % 100, version_number_patch)
|
|
||||||
self.short_version = "%d.%d" % (version_numbers[0], version_numbers[1])
|
|
||||||
self.version = "%d.%d.%d" % version_numbers
|
|
||||||
self.version_cycle = self._parse_header_file(blender_h, 'BLENDER_VERSION_CYCLE')
|
|
||||||
self.hash = self._parse_header_file(buildinfo_h, 'BUILD_HASH')[1:-1]
|
|
||||||
|
|
||||||
if self.version_cycle == "release":
|
|
||||||
# Final release
|
|
||||||
self.full_version = self.version
|
|
||||||
self.is_development_build = False
|
|
||||||
elif self.version_cycle == "rc":
|
|
||||||
# Release candidate
|
|
||||||
self.full_version = self.version + self.version_cycle
|
|
||||||
self.is_development_build = False
|
|
||||||
else:
|
|
||||||
# Development build
|
|
||||||
self.full_version = self.version + '-' + self.hash
|
|
||||||
self.is_development_build = True
|
|
||||||
|
|
||||||
def _parse_header_file(self, filename, define):
|
|
||||||
import re
|
|
||||||
regex = re.compile(r"^#\s*define\s+%s\s+(.*)" % define)
|
|
||||||
with open(filename, "r") as file:
|
|
||||||
for l in file:
|
|
||||||
match = regex.match(l)
|
|
||||||
if match:
|
|
||||||
return match.group(1)
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def call(cmd, env=None, exit_on_error=True):
|
|
||||||
print(' '.join(cmd))
|
|
||||||
|
|
||||||
# Flush to ensure correct order output on Windows.
|
|
||||||
sys.stdout.flush()
|
|
||||||
sys.stderr.flush()
|
|
||||||
|
|
||||||
retcode = subprocess.call(cmd, env=env)
|
|
||||||
if exit_on_error and retcode != 0:
|
|
||||||
sys.exit(retcode)
|
|
||||||
return retcode
|
|
@@ -1,81 +0,0 @@
|
|||||||
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
|
||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
#
|
|
||||||
# ##### END GPL LICENSE BLOCK #####
|
|
||||||
|
|
||||||
# <pep8 compliant>
|
|
||||||
|
|
||||||
from dataclasses import dataclass
|
|
||||||
from pathlib import Path
|
|
||||||
from typing import List
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
|
||||||
class AbsoluteAndRelativeFileName:
|
|
||||||
"""
|
|
||||||
Helper class which keeps track of absolute file path for a direct access and
|
|
||||||
corresponding relative path against given base.
|
|
||||||
|
|
||||||
The relative part is used to construct a file name within an archive which
|
|
||||||
contains files which are to be signed or which has been signed already
|
|
||||||
(depending on whether the archive is addressed to signing server or back
|
|
||||||
to the buildbot worker).
|
|
||||||
"""
|
|
||||||
|
|
||||||
# Base directory which is where relative_filepath is relative to.
|
|
||||||
base_dir: Path
|
|
||||||
|
|
||||||
# Full absolute path of the corresponding file.
|
|
||||||
absolute_filepath: Path
|
|
||||||
|
|
||||||
# Derived from full file path, contains part of the path which is relative
|
|
||||||
# to a desired base path.
|
|
||||||
relative_filepath: Path
|
|
||||||
|
|
||||||
def __init__(self, base_dir: Path, filepath: Path):
|
|
||||||
self.base_dir = base_dir
|
|
||||||
self.absolute_filepath = filepath.resolve()
|
|
||||||
self.relative_filepath = self.absolute_filepath.relative_to(
|
|
||||||
self.base_dir)
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def from_path(cls, path: Path) -> 'AbsoluteAndRelativeFileName':
|
|
||||||
assert path.is_absolute()
|
|
||||||
assert path.is_file()
|
|
||||||
|
|
||||||
base_dir = path.parent
|
|
||||||
return AbsoluteAndRelativeFileName(base_dir, path)
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def recursively_from_directory(cls, base_dir: Path) \
|
|
||||||
-> List['AbsoluteAndRelativeFileName']:
|
|
||||||
"""
|
|
||||||
Create list of AbsoluteAndRelativeFileName for all the files in the
|
|
||||||
given directory.
|
|
||||||
|
|
||||||
NOTE: Result will be pointing to a resolved paths.
|
|
||||||
"""
|
|
||||||
assert base_dir.is_absolute()
|
|
||||||
assert base_dir.is_dir()
|
|
||||||
|
|
||||||
base_dir = base_dir.resolve()
|
|
||||||
|
|
||||||
result = []
|
|
||||||
for filename in base_dir.glob('**/*'):
|
|
||||||
if not filename.is_file():
|
|
||||||
continue
|
|
||||||
result.append(AbsoluteAndRelativeFileName(base_dir, filename))
|
|
||||||
return result
|
|
@@ -1,245 +0,0 @@
|
|||||||
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
|
||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
#
|
|
||||||
# ##### END GPL LICENSE BLOCK #####
|
|
||||||
|
|
||||||
# <pep8 compliant>
|
|
||||||
|
|
||||||
import dataclasses
|
|
||||||
import json
|
|
||||||
import os
|
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
from typing import Optional
|
|
||||||
|
|
||||||
import codesign.util as util
|
|
||||||
|
|
||||||
|
|
||||||
class ArchiveStateError(Exception):
|
|
||||||
message: str
|
|
||||||
|
|
||||||
def __init__(self, message):
|
|
||||||
self.message = message
|
|
||||||
super().__init__(self.message)
|
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass
|
|
||||||
class ArchiveState:
|
|
||||||
"""
|
|
||||||
Additional information (state) of the archive
|
|
||||||
|
|
||||||
Includes information like expected file size of the archive file in the case
|
|
||||||
the archive file is expected to be successfully created.
|
|
||||||
|
|
||||||
If the archive can not be created, this state will contain error message
|
|
||||||
indicating details of error.
|
|
||||||
"""
|
|
||||||
|
|
||||||
# Size in bytes of the corresponding archive.
|
|
||||||
file_size: Optional[int] = None
|
|
||||||
|
|
||||||
# Non-empty value indicates that error has happenned.
|
|
||||||
error_message: str = ''
|
|
||||||
|
|
||||||
def has_error(self) -> bool:
|
|
||||||
"""
|
|
||||||
Check whether the archive is at error state
|
|
||||||
"""
|
|
||||||
|
|
||||||
return self.error_message
|
|
||||||
|
|
||||||
def serialize_to_string(self) -> str:
|
|
||||||
payload = dataclasses.asdict(self)
|
|
||||||
return json.dumps(payload, sort_keys=True, indent=4)
|
|
||||||
|
|
||||||
def serialize_to_file(self, filepath: Path) -> None:
|
|
||||||
string = self.serialize_to_string()
|
|
||||||
filepath.write_text(string)
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def deserialize_from_string(cls, string: str) -> 'ArchiveState':
|
|
||||||
try:
|
|
||||||
object_as_dict = json.loads(string)
|
|
||||||
except json.decoder.JSONDecodeError:
|
|
||||||
raise ArchiveStateError('Error parsing JSON')
|
|
||||||
|
|
||||||
return cls(**object_as_dict)
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def deserialize_from_file(cls, filepath: Path):
|
|
||||||
string = filepath.read_text()
|
|
||||||
return cls.deserialize_from_string(string)
|
|
||||||
|
|
||||||
|
|
||||||
class ArchiveWithIndicator:
|
|
||||||
"""
|
|
||||||
The idea of this class is to wrap around logic which takes care of keeping
|
|
||||||
track of a name of an archive and synchronization routines between buildbot
|
|
||||||
worker and signing server.
|
|
||||||
|
|
||||||
The synchronization is done based on creating a special file after the
|
|
||||||
archive file is knowingly ready for access.
|
|
||||||
"""
|
|
||||||
|
|
||||||
# Base directory where the archive is stored (basically, a basename() of
|
|
||||||
# the absolute archive file name).
|
|
||||||
#
|
|
||||||
# For example, 'X:\\TEMP\\'.
|
|
||||||
base_dir: Path
|
|
||||||
|
|
||||||
# Absolute file name of the archive.
|
|
||||||
#
|
|
||||||
# For example, 'X:\\TEMP\\FOO.ZIP'.
|
|
||||||
archive_filepath: Path
|
|
||||||
|
|
||||||
# Absolute name of a file which acts as an indication of the fact that the
|
|
||||||
# archive is ready and is available for access.
|
|
||||||
#
|
|
||||||
# This is how synchronization between buildbot worker and signing server is
|
|
||||||
# done:
|
|
||||||
# - First, the archive is created under archive_filepath name.
|
|
||||||
# - Second, the indication file is created under ready_indicator_filepath
|
|
||||||
# name.
|
|
||||||
# - Third, the colleague of whoever created the indicator name watches for
|
|
||||||
# the indication file to appear, and once it's there it access the
|
|
||||||
# archive.
|
|
||||||
ready_indicator_filepath: Path
|
|
||||||
|
|
||||||
def __init__(
|
|
||||||
self, base_dir: Path, archive_name: str, ready_indicator_name: str):
|
|
||||||
"""
|
|
||||||
Construct the object from given base directory and name of the archive
|
|
||||||
file:
|
|
||||||
ArchiveWithIndicator(Path('X:\\TEMP'), 'FOO.ZIP', 'INPUT_READY')
|
|
||||||
"""
|
|
||||||
|
|
||||||
self.base_dir = base_dir
|
|
||||||
self.archive_filepath = self.base_dir / archive_name
|
|
||||||
self.ready_indicator_filepath = self.base_dir / ready_indicator_name
|
|
||||||
|
|
||||||
def is_ready_unsafe(self) -> bool:
|
|
||||||
"""
|
|
||||||
Check whether the archive is ready for access.
|
|
||||||
|
|
||||||
No guarding about possible network failres is done here.
|
|
||||||
"""
|
|
||||||
if not self.ready_indicator_filepath.exists():
|
|
||||||
return False
|
|
||||||
|
|
||||||
try:
|
|
||||||
archive_state = ArchiveState.deserialize_from_file(
|
|
||||||
self.ready_indicator_filepath)
|
|
||||||
except ArchiveStateError as error:
|
|
||||||
print(f'Error deserializing archive state: {error.message}')
|
|
||||||
return False
|
|
||||||
|
|
||||||
if archive_state.has_error():
|
|
||||||
# If the error did happen during codesign procedure there will be no
|
|
||||||
# corresponding archive file.
|
|
||||||
# The caller code will deal with the error check further.
|
|
||||||
return True
|
|
||||||
|
|
||||||
# Sometimes on macOS indicator file appears prior to the actual archive
|
|
||||||
# despite the order of creation and os.sync() used in tag_ready().
|
|
||||||
# So consider archive not ready if there is an indicator without an
|
|
||||||
# actual archive.
|
|
||||||
if not self.archive_filepath.exists():
|
|
||||||
print('Found indicator without actual archive, waiting for archive '
|
|
||||||
f'({self.archive_filepath}) to appear.')
|
|
||||||
return False
|
|
||||||
|
|
||||||
# Wait for until archive is fully stored.
|
|
||||||
actual_archive_size = self.archive_filepath.stat().st_size
|
|
||||||
if actual_archive_size != archive_state.file_size:
|
|
||||||
print('Partial/invalid archive size (expected '
|
|
||||||
f'{archive_state.file_size} got {actual_archive_size})')
|
|
||||||
return False
|
|
||||||
|
|
||||||
return True
|
|
||||||
|
|
||||||
def is_ready(self) -> bool:
|
|
||||||
"""
|
|
||||||
Check whether the archive is ready for access.
|
|
||||||
|
|
||||||
Will tolerate possible network failures: if there is a network failure
|
|
||||||
or if there is still no proper permission on a file False is returned.
|
|
||||||
"""
|
|
||||||
|
|
||||||
# There are some intermitten problem happening at a random which is
|
|
||||||
# translates to "OSError : [WinError 59] An unexpected network error occurred".
|
|
||||||
# Some reports suggests it might be due to lack of permissions to the file,
|
|
||||||
# which might be applicable in our case since it's possible that file is
|
|
||||||
# initially created with non-accessible permissions and gets chmod-ed
|
|
||||||
# after initial creation.
|
|
||||||
try:
|
|
||||||
return self.is_ready_unsafe()
|
|
||||||
except OSError as e:
|
|
||||||
print(f'Exception checking archive: {e}')
|
|
||||||
return False
|
|
||||||
|
|
||||||
def tag_ready(self, error_message='') -> None:
|
|
||||||
"""
|
|
||||||
Tag the archive as ready by creating the corresponding indication file.
|
|
||||||
|
|
||||||
NOTE: It is expected that the archive was never tagged as ready before
|
|
||||||
and that there are no subsequent tags of the same archive.
|
|
||||||
If it is violated, an assert will fail.
|
|
||||||
"""
|
|
||||||
assert not self.is_ready()
|
|
||||||
|
|
||||||
# Try the best to make sure everything is synced to the file system,
|
|
||||||
# to avoid any possibility of stamp appearing on a network share prior to
|
|
||||||
# an actual file.
|
|
||||||
if util.get_current_platform() != util.Platform.WINDOWS:
|
|
||||||
os.sync()
|
|
||||||
|
|
||||||
archive_size = -1
|
|
||||||
if self.archive_filepath.exists():
|
|
||||||
archive_size = self.archive_filepath.stat().st_size
|
|
||||||
|
|
||||||
archive_info = ArchiveState(
|
|
||||||
file_size=archive_size, error_message=error_message)
|
|
||||||
|
|
||||||
self.ready_indicator_filepath.write_text(
|
|
||||||
archive_info.serialize_to_string())
|
|
||||||
|
|
||||||
def get_state(self) -> ArchiveState:
|
|
||||||
"""
|
|
||||||
Get state object for this archive
|
|
||||||
|
|
||||||
The state is read from the corresponding state file.
|
|
||||||
"""
|
|
||||||
|
|
||||||
try:
|
|
||||||
return ArchiveState.deserialize_from_file(self.ready_indicator_filepath)
|
|
||||||
except ArchiveStateError as error:
|
|
||||||
return ArchiveState(error_message=f'Error in information format: {error}')
|
|
||||||
|
|
||||||
def clean(self) -> None:
|
|
||||||
"""
|
|
||||||
Remove both archive and the ready indication file.
|
|
||||||
"""
|
|
||||||
util.ensure_file_does_not_exist_or_die(self.ready_indicator_filepath)
|
|
||||||
util.ensure_file_does_not_exist_or_die(self.archive_filepath)
|
|
||||||
|
|
||||||
def is_fully_absent(self) -> bool:
|
|
||||||
"""
|
|
||||||
Check whether both archive and its ready indicator are absent.
|
|
||||||
Is used for a sanity check during code signing process by both
|
|
||||||
buildbot worker and signing server.
|
|
||||||
"""
|
|
||||||
return (not self.archive_filepath.exists() and
|
|
||||||
not self.ready_indicator_filepath.exists())
|
|
@@ -1,501 +0,0 @@
|
|||||||
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
|
||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
#
|
|
||||||
# ##### END GPL LICENSE BLOCK #####
|
|
||||||
|
|
||||||
# <pep8 compliant>
|
|
||||||
|
|
||||||
# Signing process overview.
|
|
||||||
#
|
|
||||||
# From buildbot worker side:
|
|
||||||
# - Files which needs to be signed are collected from either a directory to
|
|
||||||
# sign all signable files in there, or by filename of a single file to sign.
|
|
||||||
# - Those files gets packed into an archive and stored in a location location
|
|
||||||
# which is watched by the signing server.
|
|
||||||
# - A marker READY file is created which indicates the archive is ready for
|
|
||||||
# access.
|
|
||||||
# - Wait for the server to provide an archive with signed files.
|
|
||||||
# This is done by watching for the READY file which corresponds to an archive
|
|
||||||
# coming from the signing server.
|
|
||||||
# - Unpack the signed signed files from the archives and replace original ones.
|
|
||||||
#
|
|
||||||
# From code sign server:
|
|
||||||
# - Watch special location for a READY file which indicates the there is an
|
|
||||||
# archive with files which are to be signed.
|
|
||||||
# - Unpack the archive to a temporary location.
|
|
||||||
# - Run codesign tool and make sure all the files are signed.
|
|
||||||
# - Pack the signed files and store them in a location which is watched by
|
|
||||||
# the buildbot worker.
|
|
||||||
# - Create a READY file which indicates that the archive with signed files is
|
|
||||||
# ready.
|
|
||||||
|
|
||||||
import abc
|
|
||||||
import logging
|
|
||||||
import shutil
|
|
||||||
import subprocess
|
|
||||||
import time
|
|
||||||
import tarfile
|
|
||||||
import uuid
|
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
from tempfile import TemporaryDirectory
|
|
||||||
from typing import Iterable, List
|
|
||||||
|
|
||||||
import codesign.util as util
|
|
||||||
|
|
||||||
from codesign.absolute_and_relative_filename import AbsoluteAndRelativeFileName
|
|
||||||
from codesign.archive_with_indicator import ArchiveWithIndicator
|
|
||||||
from codesign.exception import CodeSignException
|
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
logger_builder = logger.getChild('builder')
|
|
||||||
logger_server = logger.getChild('server')
|
|
||||||
|
|
||||||
|
|
||||||
def pack_files(files: Iterable[AbsoluteAndRelativeFileName],
|
|
||||||
archive_filepath: Path) -> None:
|
|
||||||
"""
|
|
||||||
Create tar archive from given files for the signing pipeline.
|
|
||||||
Is used by buildbot worker to create an archive of files which are to be
|
|
||||||
signed, and by signing server to send signed files back to the worker.
|
|
||||||
"""
|
|
||||||
with tarfile.TarFile.open(archive_filepath, 'w') as tar_file_handle:
|
|
||||||
for file_info in files:
|
|
||||||
tar_file_handle.add(file_info.absolute_filepath,
|
|
||||||
arcname=file_info.relative_filepath)
|
|
||||||
|
|
||||||
|
|
||||||
def extract_files(archive_filepath: Path,
|
|
||||||
extraction_dir: Path) -> None:
|
|
||||||
"""
|
|
||||||
Extract all files form the given archive into the given direcotry.
|
|
||||||
"""
|
|
||||||
|
|
||||||
# TODO(sergey): Verify files in the archive have relative path.
|
|
||||||
|
|
||||||
with tarfile.TarFile.open(archive_filepath, mode='r') as tar_file_handle:
|
|
||||||
tar_file_handle.extractall(path=extraction_dir)
|
|
||||||
|
|
||||||
|
|
||||||
class BaseCodeSigner(metaclass=abc.ABCMeta):
|
|
||||||
"""
|
|
||||||
Base class for a platform-specific signer of binaries.
|
|
||||||
|
|
||||||
Contains all the logic shared across platform-specific implementations, such
|
|
||||||
as synchronization and notification logic.
|
|
||||||
|
|
||||||
Platform specific bits (such as actual command for signing the binary) are
|
|
||||||
to be implemented as a subclass.
|
|
||||||
|
|
||||||
Provides utilities code signing as a whole, including functionality needed
|
|
||||||
by a signing server and a buildbot worker.
|
|
||||||
|
|
||||||
The signer and builder may run on separate machines, the only requirement is
|
|
||||||
that they have access to a directory which is shared between them. For the
|
|
||||||
security concerns this is to be done as a separate machine (or as a Shared
|
|
||||||
Folder configuration in VirtualBox configuration). This directory might be
|
|
||||||
mounted under different base paths, but its underlying storage is to be
|
|
||||||
the same.
|
|
||||||
|
|
||||||
The code signer is short-lived on a buildbot worker side, and is living
|
|
||||||
forever on a code signing server side.
|
|
||||||
"""
|
|
||||||
|
|
||||||
# TODO(sergey): Find a neat way to have config annotated.
|
|
||||||
# config: Config
|
|
||||||
|
|
||||||
# Storage directory where builder puts files which are requested to be
|
|
||||||
# signed.
|
|
||||||
# Consider this an input of the code signing server.
|
|
||||||
unsigned_storage_dir: Path
|
|
||||||
|
|
||||||
# Storage where signed files are stored.
|
|
||||||
# Consider this an output of the code signer server.
|
|
||||||
signed_storage_dir: Path
|
|
||||||
|
|
||||||
# Platform the code is currently executing on.
|
|
||||||
platform: util.Platform
|
|
||||||
|
|
||||||
def __init__(self, config):
|
|
||||||
self.config = config
|
|
||||||
|
|
||||||
absolute_shared_storage_dir = config.SHARED_STORAGE_DIR.resolve()
|
|
||||||
|
|
||||||
# Unsigned (signing server input) configuration.
|
|
||||||
self.unsigned_storage_dir = absolute_shared_storage_dir / 'unsigned'
|
|
||||||
|
|
||||||
# Signed (signing server output) configuration.
|
|
||||||
self.signed_storage_dir = absolute_shared_storage_dir / 'signed'
|
|
||||||
|
|
||||||
self.platform = util.get_current_platform()
|
|
||||||
|
|
||||||
def cleanup_environment_for_builder(self) -> None:
|
|
||||||
# TODO(sergey): Revisit need of cleaning up the existing files.
|
|
||||||
# In practice it wasn't so helpful, and with multiple clients
|
|
||||||
# talking to the same server it becomes even more tricky.
|
|
||||||
pass
|
|
||||||
|
|
||||||
def cleanup_environment_for_signing_server(self) -> None:
|
|
||||||
# TODO(sergey): Revisit need of cleaning up the existing files.
|
|
||||||
# In practice it wasn't so helpful, and with multiple clients
|
|
||||||
# talking to the same server it becomes even more tricky.
|
|
||||||
pass
|
|
||||||
|
|
||||||
def generate_request_id(self) -> str:
|
|
||||||
"""
|
|
||||||
Generate an unique identifier for code signing request.
|
|
||||||
"""
|
|
||||||
return str(uuid.uuid4())
|
|
||||||
|
|
||||||
def archive_info_for_request_id(
|
|
||||||
self, path: Path, request_id: str) -> ArchiveWithIndicator:
|
|
||||||
return ArchiveWithIndicator(
|
|
||||||
path, f'{request_id}.tar', f'{request_id}.ready')
|
|
||||||
|
|
||||||
def signed_archive_info_for_request_id(
|
|
||||||
self, request_id: str) -> ArchiveWithIndicator:
|
|
||||||
return self.archive_info_for_request_id(
|
|
||||||
self.signed_storage_dir, request_id)
|
|
||||||
|
|
||||||
def unsigned_archive_info_for_request_id(
|
|
||||||
self, request_id: str) -> ArchiveWithIndicator:
|
|
||||||
return self.archive_info_for_request_id(
|
|
||||||
self.unsigned_storage_dir, request_id)
|
|
||||||
|
|
||||||
############################################################################
|
|
||||||
# Buildbot worker side helpers.
|
|
||||||
|
|
||||||
@abc.abstractmethod
|
|
||||||
def check_file_is_to_be_signed(
|
|
||||||
self, file: AbsoluteAndRelativeFileName) -> bool:
|
|
||||||
"""
|
|
||||||
Check whether file is to be signed.
|
|
||||||
|
|
||||||
Is used by both single file signing pipeline and recursive directory
|
|
||||||
signing pipeline.
|
|
||||||
|
|
||||||
This is where code signer is to check whether file is to be signed or
|
|
||||||
not. This check might be based on a simple extension test or on actual
|
|
||||||
test whether file have a digital signature already or not.
|
|
||||||
"""
|
|
||||||
|
|
||||||
def collect_files_to_sign(self, path: Path) \
|
|
||||||
-> List[AbsoluteAndRelativeFileName]:
|
|
||||||
"""
|
|
||||||
Get all files which need to be signed from the given path.
|
|
||||||
|
|
||||||
NOTE: The path might either be a file or directory.
|
|
||||||
|
|
||||||
This function is run from the buildbot worker side.
|
|
||||||
"""
|
|
||||||
|
|
||||||
# If there is a single file provided trust the buildbot worker that it
|
|
||||||
# is eligible for signing.
|
|
||||||
if path.is_file():
|
|
||||||
file = AbsoluteAndRelativeFileName.from_path(path)
|
|
||||||
if not self.check_file_is_to_be_signed(file):
|
|
||||||
return []
|
|
||||||
return [file]
|
|
||||||
|
|
||||||
all_files = AbsoluteAndRelativeFileName.recursively_from_directory(
|
|
||||||
path)
|
|
||||||
files_to_be_signed = [file for file in all_files
|
|
||||||
if self.check_file_is_to_be_signed(file)]
|
|
||||||
return files_to_be_signed
|
|
||||||
|
|
||||||
def wait_for_signed_archive_or_die(self, request_id) -> None:
|
|
||||||
"""
|
|
||||||
Wait until archive with signed files is available.
|
|
||||||
|
|
||||||
Will only return if the archive with signed files is available. If there
|
|
||||||
was an error during code sign procedure the SystemExit exception is
|
|
||||||
raised, with the message set to the error reported by the codesign
|
|
||||||
server.
|
|
||||||
|
|
||||||
Will only wait for the configured time. If that time exceeds and there
|
|
||||||
is still no responce from the signing server the application will exit
|
|
||||||
with a non-zero exit code.
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
signed_archive_info = self.signed_archive_info_for_request_id(
|
|
||||||
request_id)
|
|
||||||
unsigned_archive_info = self.unsigned_archive_info_for_request_id(
|
|
||||||
request_id)
|
|
||||||
|
|
||||||
timeout_in_seconds = self.config.TIMEOUT_IN_SECONDS
|
|
||||||
time_start = time.monotonic()
|
|
||||||
while not signed_archive_info.is_ready():
|
|
||||||
time.sleep(1)
|
|
||||||
time_slept_in_seconds = time.monotonic() - time_start
|
|
||||||
if time_slept_in_seconds > timeout_in_seconds:
|
|
||||||
signed_archive_info.clean()
|
|
||||||
unsigned_archive_info.clean()
|
|
||||||
raise SystemExit("Signing server didn't finish signing in "
|
|
||||||
f'{timeout_in_seconds} seconds, dying :(')
|
|
||||||
|
|
||||||
archive_state = signed_archive_info.get_state()
|
|
||||||
if archive_state.has_error():
|
|
||||||
signed_archive_info.clean()
|
|
||||||
unsigned_archive_info.clean()
|
|
||||||
raise SystemExit(
|
|
||||||
f'Error happenned during codesign procedure: {archive_state.error_message}')
|
|
||||||
|
|
||||||
def copy_signed_files_to_directory(
|
|
||||||
self, signed_dir: Path, destination_dir: Path) -> None:
|
|
||||||
"""
|
|
||||||
Copy all files from signed_dir to destination_dir.
|
|
||||||
|
|
||||||
This function will overwrite any existing file. Permissions are copied
|
|
||||||
from the source files, but other metadata, such as timestamps, are not.
|
|
||||||
"""
|
|
||||||
for signed_filepath in signed_dir.glob('**/*'):
|
|
||||||
if not signed_filepath.is_file():
|
|
||||||
continue
|
|
||||||
|
|
||||||
relative_filepath = signed_filepath.relative_to(signed_dir)
|
|
||||||
destination_filepath = destination_dir / relative_filepath
|
|
||||||
destination_filepath.parent.mkdir(parents=True, exist_ok=True)
|
|
||||||
|
|
||||||
shutil.copy(signed_filepath, destination_filepath)
|
|
||||||
|
|
||||||
def run_buildbot_path_sign_pipeline(self, path: Path) -> None:
|
|
||||||
"""
|
|
||||||
Run all steps needed to make given path signed.
|
|
||||||
|
|
||||||
Path points to an unsigned file or a directory which contains unsigned
|
|
||||||
files.
|
|
||||||
|
|
||||||
If the path points to a single file then this file will be signed.
|
|
||||||
This is used to sign a final bundle such as .msi on Windows or .dmg on
|
|
||||||
macOS.
|
|
||||||
|
|
||||||
NOTE: The code signed implementation might actually reject signing the
|
|
||||||
file, in which case the file will be left unsigned. This isn't anything
|
|
||||||
to be considered a failure situation, just might happen when buildbot
|
|
||||||
worker can not detect whether signing is really required in a specific
|
|
||||||
case or not.
|
|
||||||
|
|
||||||
If the path points to a directory then code signer will sign all
|
|
||||||
signable files from it (finding them recursively).
|
|
||||||
"""
|
|
||||||
|
|
||||||
self.cleanup_environment_for_builder()
|
|
||||||
|
|
||||||
# Make sure storage directory exists.
|
|
||||||
self.unsigned_storage_dir.mkdir(parents=True, exist_ok=True)
|
|
||||||
|
|
||||||
# Collect all files which needs to be signed and pack them into a single
|
|
||||||
# archive which will be sent to the signing server.
|
|
||||||
logger_builder.info('Collecting files which are to be signed...')
|
|
||||||
files = self.collect_files_to_sign(path)
|
|
||||||
if not files:
|
|
||||||
logger_builder.info('No files to be signed, ignoring.')
|
|
||||||
return
|
|
||||||
logger_builder.info('Found %d files to sign.', len(files))
|
|
||||||
|
|
||||||
request_id = self.generate_request_id()
|
|
||||||
signed_archive_info = self.signed_archive_info_for_request_id(
|
|
||||||
request_id)
|
|
||||||
unsigned_archive_info = self.unsigned_archive_info_for_request_id(
|
|
||||||
request_id)
|
|
||||||
|
|
||||||
pack_files(files=files,
|
|
||||||
archive_filepath=unsigned_archive_info.archive_filepath)
|
|
||||||
unsigned_archive_info.tag_ready()
|
|
||||||
|
|
||||||
# Wait for the signing server to finish signing.
|
|
||||||
logger_builder.info('Waiting signing server to sign the files...')
|
|
||||||
self.wait_for_signed_archive_or_die(request_id)
|
|
||||||
|
|
||||||
# Extract signed files from archive and move files to final location.
|
|
||||||
with TemporaryDirectory(prefix='blender-buildbot-') as temp_dir_str:
|
|
||||||
unpacked_signed_files_dir = Path(temp_dir_str)
|
|
||||||
|
|
||||||
logger_builder.info('Extracting signed files from archive...')
|
|
||||||
extract_files(
|
|
||||||
archive_filepath=signed_archive_info.archive_filepath,
|
|
||||||
extraction_dir=unpacked_signed_files_dir)
|
|
||||||
|
|
||||||
destination_dir = path
|
|
||||||
if destination_dir.is_file():
|
|
||||||
destination_dir = destination_dir.parent
|
|
||||||
self.copy_signed_files_to_directory(
|
|
||||||
unpacked_signed_files_dir, destination_dir)
|
|
||||||
|
|
||||||
logger_builder.info('Removing archive with signed files...')
|
|
||||||
signed_archive_info.clean()
|
|
||||||
|
|
||||||
############################################################################
|
|
||||||
# Signing server side helpers.
|
|
||||||
|
|
||||||
def wait_for_sign_request(self) -> str:
|
|
||||||
"""
|
|
||||||
Wait for the buildbot to request signing of an archive.
|
|
||||||
|
|
||||||
Returns an identifier of signing request.
|
|
||||||
"""
|
|
||||||
|
|
||||||
# TOOD(sergey): Support graceful shutdown on Ctrl-C.
|
|
||||||
|
|
||||||
logger_server.info(
|
|
||||||
f'Waiting for a request directory {self.unsigned_storage_dir} to appear.')
|
|
||||||
while not self.unsigned_storage_dir.exists():
|
|
||||||
time.sleep(1)
|
|
||||||
|
|
||||||
logger_server.info(
|
|
||||||
'Waiting for a READY indicator of any signing request.')
|
|
||||||
request_id = None
|
|
||||||
while request_id is None:
|
|
||||||
for file in self.unsigned_storage_dir.iterdir():
|
|
||||||
if file.suffix != '.ready':
|
|
||||||
continue
|
|
||||||
request_id = file.stem
|
|
||||||
logger_server.info(f'Found READY for request ID {request_id}.')
|
|
||||||
if request_id is None:
|
|
||||||
time.sleep(1)
|
|
||||||
|
|
||||||
unsigned_archive_info = self.unsigned_archive_info_for_request_id(
|
|
||||||
request_id)
|
|
||||||
while not unsigned_archive_info.is_ready():
|
|
||||||
time.sleep(1)
|
|
||||||
|
|
||||||
return request_id
|
|
||||||
|
|
||||||
@abc.abstractmethod
|
|
||||||
def sign_all_files(self, files: List[AbsoluteAndRelativeFileName]) -> None:
|
|
||||||
"""
|
|
||||||
Sign all files in the given directory.
|
|
||||||
|
|
||||||
NOTE: Signing should happen in-place.
|
|
||||||
"""
|
|
||||||
|
|
||||||
def run_signing_pipeline(self, request_id: str):
|
|
||||||
"""
|
|
||||||
Run the full signing pipeline starting from the point when buildbot
|
|
||||||
worker have requested signing.
|
|
||||||
"""
|
|
||||||
|
|
||||||
# Make sure storage directory exists.
|
|
||||||
self.signed_storage_dir.mkdir(parents=True, exist_ok=True)
|
|
||||||
|
|
||||||
with TemporaryDirectory(prefix='blender-codesign-') as temp_dir_str:
|
|
||||||
temp_dir = Path(temp_dir_str)
|
|
||||||
|
|
||||||
signed_archive_info = self.signed_archive_info_for_request_id(
|
|
||||||
request_id)
|
|
||||||
unsigned_archive_info = self.unsigned_archive_info_for_request_id(
|
|
||||||
request_id)
|
|
||||||
|
|
||||||
logger_server.info('Extracting unsigned files from archive...')
|
|
||||||
extract_files(
|
|
||||||
archive_filepath=unsigned_archive_info.archive_filepath,
|
|
||||||
extraction_dir=temp_dir)
|
|
||||||
|
|
||||||
logger_server.info('Collecting all files which needs signing...')
|
|
||||||
files = AbsoluteAndRelativeFileName.recursively_from_directory(
|
|
||||||
temp_dir)
|
|
||||||
|
|
||||||
logger_server.info('Signing all requested files...')
|
|
||||||
try:
|
|
||||||
self.sign_all_files(files)
|
|
||||||
except CodeSignException as error:
|
|
||||||
signed_archive_info.tag_ready(error_message=error.message)
|
|
||||||
unsigned_archive_info.clean()
|
|
||||||
logger_server.info('Signing is complete with errors.')
|
|
||||||
return
|
|
||||||
|
|
||||||
logger_server.info('Packing signed files...')
|
|
||||||
pack_files(files=files,
|
|
||||||
archive_filepath=signed_archive_info.archive_filepath)
|
|
||||||
signed_archive_info.tag_ready()
|
|
||||||
|
|
||||||
logger_server.info('Removing signing request...')
|
|
||||||
unsigned_archive_info.clean()
|
|
||||||
|
|
||||||
logger_server.info('Signing is complete.')
|
|
||||||
|
|
||||||
def run_signing_server(self):
|
|
||||||
logger_server.info('Starting new code signing server...')
|
|
||||||
self.cleanup_environment_for_signing_server()
|
|
||||||
logger_server.info('Code signing server is ready')
|
|
||||||
while True:
|
|
||||||
logger_server.info('Waiting for the signing request in %s...',
|
|
||||||
self.unsigned_storage_dir)
|
|
||||||
request_id = self.wait_for_sign_request()
|
|
||||||
|
|
||||||
logger_server.info(
|
|
||||||
f'Beging signign procedure for request ID {request_id}.')
|
|
||||||
self.run_signing_pipeline(request_id)
|
|
||||||
|
|
||||||
############################################################################
|
|
||||||
# Command executing.
|
|
||||||
#
|
|
||||||
# Abstracted to a degree that allows to run commands from a foreign
|
|
||||||
# platform.
|
|
||||||
# The goal with this is to allow performing dry-run tests of code signer
|
|
||||||
# server from other platforms (for example, to test that macOS code signer
|
|
||||||
# does what it is supposed to after doing a refactor on Linux).
|
|
||||||
|
|
||||||
# TODO(sergey): What is the type annotation for the command?
|
|
||||||
def run_command_or_mock(self, command, platform: util.Platform) -> None:
|
|
||||||
"""
|
|
||||||
Run given command if current platform matches given one
|
|
||||||
|
|
||||||
If the platform is different then it will only be printed allowing
|
|
||||||
to verify logic of the code signing process.
|
|
||||||
"""
|
|
||||||
|
|
||||||
if platform != self.platform:
|
|
||||||
logger_server.info(
|
|
||||||
f'Will run command for {platform}: {command}')
|
|
||||||
return
|
|
||||||
|
|
||||||
logger_server.info(f'Running command: {command}')
|
|
||||||
subprocess.run(command)
|
|
||||||
|
|
||||||
# TODO(sergey): What is the type annotation for the command?
|
|
||||||
def check_output_or_mock(self, command,
|
|
||||||
platform: util.Platform,
|
|
||||||
allow_nonzero_exit_code=False) -> str:
|
|
||||||
"""
|
|
||||||
Run given command if current platform matches given one
|
|
||||||
|
|
||||||
If the platform is different then it will only be printed allowing
|
|
||||||
to verify logic of the code signing process.
|
|
||||||
|
|
||||||
If allow_nonzero_exit_code is truth then the output will be returned
|
|
||||||
even if application quit with non-zero exit code.
|
|
||||||
Otherwise an subprocess.CalledProcessError exception will be raised
|
|
||||||
in such case.
|
|
||||||
"""
|
|
||||||
|
|
||||||
if platform != self.platform:
|
|
||||||
logger_server.info(
|
|
||||||
f'Will run command for {platform}: {command}')
|
|
||||||
return
|
|
||||||
|
|
||||||
if allow_nonzero_exit_code:
|
|
||||||
process = subprocess.Popen(command,
|
|
||||||
stdout=subprocess.PIPE,
|
|
||||||
stderr=subprocess.STDOUT)
|
|
||||||
output = process.communicate()[0]
|
|
||||||
return output.decode()
|
|
||||||
|
|
||||||
logger_server.info(f'Running command: {command}')
|
|
||||||
return subprocess.check_output(
|
|
||||||
command, stderr=subprocess.STDOUT).decode()
|
|
@@ -1,62 +0,0 @@
|
|||||||
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
|
||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
#
|
|
||||||
# ##### END GPL LICENSE BLOCK #####
|
|
||||||
|
|
||||||
# <pep8 compliant>
|
|
||||||
|
|
||||||
# Configuration of a code signer which is specific to the code running from
|
|
||||||
# buildbot's worker.
|
|
||||||
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
import codesign.util as util
|
|
||||||
|
|
||||||
from codesign.config_common import *
|
|
||||||
|
|
||||||
platform = util.get_current_platform()
|
|
||||||
if platform == util.Platform.LINUX:
|
|
||||||
SHARED_STORAGE_DIR = Path('/data/codesign')
|
|
||||||
elif platform == util.Platform.WINDOWS:
|
|
||||||
SHARED_STORAGE_DIR = Path('Z:\\codesign')
|
|
||||||
elif platform == util.Platform.MACOS:
|
|
||||||
SHARED_STORAGE_DIR = Path('/Volumes/codesign_macos/codesign')
|
|
||||||
|
|
||||||
# https://docs.python.org/3/library/logging.config.html#configuration-dictionary-schema
|
|
||||||
LOGGING = {
|
|
||||||
'version': 1,
|
|
||||||
'formatters': {
|
|
||||||
'default': {'format': '%(asctime)-15s %(levelname)8s %(name)s %(message)s'}
|
|
||||||
},
|
|
||||||
'handlers': {
|
|
||||||
'console': {
|
|
||||||
'class': 'logging.StreamHandler',
|
|
||||||
'formatter': 'default',
|
|
||||||
'stream': 'ext://sys.stderr',
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'loggers': {
|
|
||||||
'codesign': {'level': 'INFO'},
|
|
||||||
},
|
|
||||||
'root': {
|
|
||||||
'level': 'WARNING',
|
|
||||||
'handlers': [
|
|
||||||
'console',
|
|
||||||
],
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,36 +0,0 @@
|
|||||||
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
|
||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
#
|
|
||||||
# ##### END GPL LICENSE BLOCK #####
|
|
||||||
|
|
||||||
# <pep8 compliant>
|
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
# Timeout in seconds for the signing process.
|
|
||||||
#
|
|
||||||
# This is how long buildbot packing step will wait signing server to
|
|
||||||
# perform signing.
|
|
||||||
#
|
|
||||||
# NOTE: Notarization could take a long time, hence the rather high value
|
|
||||||
# here. Might consider using different timeout for different platforms.
|
|
||||||
TIMEOUT_IN_SECONDS = 45 * 60 * 60
|
|
||||||
|
|
||||||
# Directory which is shared across buildbot worker and signing server.
|
|
||||||
#
|
|
||||||
# This is where worker puts files requested for signing as well as where
|
|
||||||
# server puts signed files.
|
|
||||||
SHARED_STORAGE_DIR: Path
|
|
@@ -1,101 +0,0 @@
|
|||||||
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
|
||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
#
|
|
||||||
# ##### END GPL LICENSE BLOCK #####
|
|
||||||
|
|
||||||
# <pep8 compliant>
|
|
||||||
|
|
||||||
# Configuration of a code signer which is specific to the code signing server.
|
|
||||||
#
|
|
||||||
# NOTE: DO NOT put any sensitive information here, put it in an actual
|
|
||||||
# configuration on the signing machine.
|
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
from codesign.config_common import *
|
|
||||||
|
|
||||||
CODESIGN_DIRECTORY = Path(__file__).absolute().parent
|
|
||||||
BLENDER_GIT_ROOT_DIRECTORY = CODESIGN_DIRECTORY.parent.parent.parent
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# Common configuration.
|
|
||||||
|
|
||||||
# Directory where folders for codesign requests and signed result are stored.
|
|
||||||
# For example, /data/codesign
|
|
||||||
SHARED_STORAGE_DIR: Path
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# macOS-specific configuration.
|
|
||||||
|
|
||||||
MACOS_ENTITLEMENTS_FILE = \
|
|
||||||
BLENDER_GIT_ROOT_DIRECTORY / 'release' / 'darwin' / 'entitlements.plist'
|
|
||||||
|
|
||||||
# Identity of the Developer ID Application certificate which is to be used for
|
|
||||||
# codesign tool.
|
|
||||||
# Use `security find-identity -v -p codesigning` to find the identity.
|
|
||||||
#
|
|
||||||
# NOTE: This identity is just an example from release/darwin/README.txt.
|
|
||||||
MACOS_CODESIGN_IDENTITY = 'AE825E26F12D08B692F360133210AF46F4CF7B97'
|
|
||||||
|
|
||||||
# User name (Apple ID) which will be used to request notarization.
|
|
||||||
MACOS_XCRUN_USERNAME = 'me@example.com'
|
|
||||||
|
|
||||||
# One-time application password which will be used to request notarization.
|
|
||||||
MACOS_XCRUN_PASSWORD = '@keychain:altool-password'
|
|
||||||
|
|
||||||
# Timeout in seconds within which the notarial office is supposed to reply.
|
|
||||||
MACOS_NOTARIZE_TIMEOUT_IN_SECONDS = 60 * 60
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# Windows-specific configuration.
|
|
||||||
|
|
||||||
# URL to the timestamping authority.
|
|
||||||
WIN_TIMESTAMP_AUTHORITY_URL = 'http://timestamp.digicert.com'
|
|
||||||
|
|
||||||
# Full path to the certificate used for signing.
|
|
||||||
#
|
|
||||||
# The path and expected file format might vary depending on a platform.
|
|
||||||
#
|
|
||||||
# On Windows it is usually is a PKCS #12 key (.pfx), so the path will look
|
|
||||||
# like Path('C:\\Secret\\Blender.pfx').
|
|
||||||
WIN_CERTIFICATE_FILEPATH: Path
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# Logging configuration, common for all platforms.
|
|
||||||
|
|
||||||
# https://docs.python.org/3/library/logging.config.html#configuration-dictionary-schema
|
|
||||||
LOGGING = {
|
|
||||||
'version': 1,
|
|
||||||
'formatters': {
|
|
||||||
'default': {'format': '%(asctime)-15s %(levelname)8s %(name)s %(message)s'}
|
|
||||||
},
|
|
||||||
'handlers': {
|
|
||||||
'console': {
|
|
||||||
'class': 'logging.StreamHandler',
|
|
||||||
'formatter': 'default',
|
|
||||||
'stream': 'ext://sys.stderr',
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'loggers': {
|
|
||||||
'codesign': {'level': 'INFO'},
|
|
||||||
},
|
|
||||||
'root': {
|
|
||||||
'level': 'WARNING',
|
|
||||||
'handlers': [
|
|
||||||
'console',
|
|
||||||
],
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,26 +0,0 @@
|
|||||||
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
|
||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
#
|
|
||||||
# ##### END GPL LICENSE BLOCK #####
|
|
||||||
|
|
||||||
# <pep8 compliant>
|
|
||||||
|
|
||||||
class CodeSignException(Exception):
|
|
||||||
message: str
|
|
||||||
|
|
||||||
def __init__(self, message):
|
|
||||||
self.message = message
|
|
||||||
super().__init__(self.message)
|
|
@@ -1,72 +0,0 @@
|
|||||||
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
|
||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
#
|
|
||||||
# ##### END GPL LICENSE BLOCK #####
|
|
||||||
|
|
||||||
# <pep8 compliant>
|
|
||||||
|
|
||||||
# NOTE: This is a no-op signer (since there isn't really a procedure to sign
|
|
||||||
# Linux binaries yet). Used to debug and verify the code signing routines on
|
|
||||||
# a Linux environment.
|
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
from typing import List
|
|
||||||
|
|
||||||
from codesign.absolute_and_relative_filename import AbsoluteAndRelativeFileName
|
|
||||||
from codesign.base_code_signer import BaseCodeSigner
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
logger_server = logger.getChild('server')
|
|
||||||
|
|
||||||
|
|
||||||
class LinuxCodeSigner(BaseCodeSigner):
|
|
||||||
def is_active(self) -> bool:
|
|
||||||
"""
|
|
||||||
Check whether this signer is active.
|
|
||||||
|
|
||||||
if it is inactive, no files will be signed.
|
|
||||||
|
|
||||||
Is used to be able to debug code signing pipeline on Linux, where there
|
|
||||||
is no code signing happening in the actual buildbot and release
|
|
||||||
environment.
|
|
||||||
"""
|
|
||||||
return False
|
|
||||||
|
|
||||||
def check_file_is_to_be_signed(
|
|
||||||
self, file: AbsoluteAndRelativeFileName) -> bool:
|
|
||||||
if file.relative_filepath == Path('blender'):
|
|
||||||
return True
|
|
||||||
if (file.relative_filepath.parts[-3:-1] == ('python', 'bin') and
|
|
||||||
file.relative_filepath.name.startwith('python')):
|
|
||||||
return True
|
|
||||||
if file.relative_filepath.suffix == '.so':
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
def collect_files_to_sign(self, path: Path) \
|
|
||||||
-> List[AbsoluteAndRelativeFileName]:
|
|
||||||
if not self.is_active():
|
|
||||||
return []
|
|
||||||
|
|
||||||
return super().collect_files_to_sign(path)
|
|
||||||
|
|
||||||
def sign_all_files(self, files: List[AbsoluteAndRelativeFileName]) -> None:
|
|
||||||
num_files = len(files)
|
|
||||||
for file_index, file in enumerate(files):
|
|
||||||
logger.info('Server: Signed file [%d/%d] %s',
|
|
||||||
file_index + 1, num_files, file.relative_filepath)
|
|
@@ -1,456 +0,0 @@
|
|||||||
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
|
||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
#
|
|
||||||
# ##### END GPL LICENSE BLOCK #####
|
|
||||||
|
|
||||||
# <pep8 compliant>
|
|
||||||
|
|
||||||
import logging
|
|
||||||
import re
|
|
||||||
import stat
|
|
||||||
import subprocess
|
|
||||||
import time
|
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
from typing import List
|
|
||||||
|
|
||||||
import codesign.util as util
|
|
||||||
|
|
||||||
from buildbot_utils import Builder
|
|
||||||
|
|
||||||
from codesign.absolute_and_relative_filename import AbsoluteAndRelativeFileName
|
|
||||||
from codesign.base_code_signer import BaseCodeSigner
|
|
||||||
from codesign.exception import CodeSignException
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
logger_server = logger.getChild('server')
|
|
||||||
|
|
||||||
# NOTE: Check is done as filename.endswith(), so keep the dot
|
|
||||||
EXTENSIONS_TO_BE_SIGNED = {'.dylib', '.so', '.dmg'}
|
|
||||||
|
|
||||||
# Prefixes of a file (not directory) name which are to be signed.
|
|
||||||
# Used to sign extra executable files in Contents/Resources.
|
|
||||||
NAME_PREFIXES_TO_BE_SIGNED = {'python'}
|
|
||||||
|
|
||||||
|
|
||||||
class NotarizationException(CodeSignException):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
def is_file_from_bundle(file: AbsoluteAndRelativeFileName) -> bool:
|
|
||||||
"""
|
|
||||||
Check whether file is coming from an .app bundle
|
|
||||||
"""
|
|
||||||
parts = file.relative_filepath.parts
|
|
||||||
if not parts:
|
|
||||||
return False
|
|
||||||
if not parts[0].endswith('.app'):
|
|
||||||
return False
|
|
||||||
return True
|
|
||||||
|
|
||||||
|
|
||||||
def get_bundle_from_file(
|
|
||||||
file: AbsoluteAndRelativeFileName) -> AbsoluteAndRelativeFileName:
|
|
||||||
"""
|
|
||||||
Get AbsoluteAndRelativeFileName descriptor of bundle
|
|
||||||
"""
|
|
||||||
assert(is_file_from_bundle(file))
|
|
||||||
|
|
||||||
parts = file.relative_filepath.parts
|
|
||||||
bundle_name = parts[0]
|
|
||||||
|
|
||||||
base_dir = file.base_dir
|
|
||||||
bundle_filepath = file.base_dir / bundle_name
|
|
||||||
return AbsoluteAndRelativeFileName(base_dir, bundle_filepath)
|
|
||||||
|
|
||||||
|
|
||||||
def is_bundle_executable_file(file: AbsoluteAndRelativeFileName) -> bool:
|
|
||||||
"""
|
|
||||||
Check whether given file is an executable within an app bundle
|
|
||||||
"""
|
|
||||||
if not is_file_from_bundle(file):
|
|
||||||
return False
|
|
||||||
|
|
||||||
parts = file.relative_filepath.parts
|
|
||||||
num_parts = len(parts)
|
|
||||||
if num_parts < 3:
|
|
||||||
return False
|
|
||||||
|
|
||||||
if parts[1:3] != ('Contents', 'MacOS'):
|
|
||||||
return False
|
|
||||||
|
|
||||||
return True
|
|
||||||
|
|
||||||
|
|
||||||
def xcrun_field_value_from_output(field: str, output: str) -> str:
|
|
||||||
"""
|
|
||||||
Get value of a given field from xcrun output.
|
|
||||||
|
|
||||||
If field is not found empty string is returned.
|
|
||||||
"""
|
|
||||||
|
|
||||||
field_prefix = field + ': '
|
|
||||||
for line in output.splitlines():
|
|
||||||
line = line.strip()
|
|
||||||
if line.startswith(field_prefix):
|
|
||||||
return line[len(field_prefix):]
|
|
||||||
return ''
|
|
||||||
|
|
||||||
|
|
||||||
class MacOSCodeSigner(BaseCodeSigner):
|
|
||||||
def check_file_is_to_be_signed(
|
|
||||||
self, file: AbsoluteAndRelativeFileName) -> bool:
|
|
||||||
if file.relative_filepath.name.startswith('.'):
|
|
||||||
return False
|
|
||||||
|
|
||||||
if is_bundle_executable_file(file):
|
|
||||||
return True
|
|
||||||
|
|
||||||
base_name = file.relative_filepath.name
|
|
||||||
if any(base_name.startswith(prefix)
|
|
||||||
for prefix in NAME_PREFIXES_TO_BE_SIGNED):
|
|
||||||
return True
|
|
||||||
|
|
||||||
mode = file.absolute_filepath.lstat().st_mode
|
|
||||||
if mode & stat.S_IXUSR != 0:
|
|
||||||
file_output = subprocess.check_output(
|
|
||||||
("file", file.absolute_filepath)).decode()
|
|
||||||
if "64-bit executable" in file_output:
|
|
||||||
return True
|
|
||||||
|
|
||||||
return file.relative_filepath.suffix in EXTENSIONS_TO_BE_SIGNED
|
|
||||||
|
|
||||||
def collect_files_to_sign(self, path: Path) \
|
|
||||||
-> List[AbsoluteAndRelativeFileName]:
|
|
||||||
# Include all files when signing app or dmg bundle: all the files are
|
|
||||||
# needed to do valid signature of bundle.
|
|
||||||
if path.name.endswith('.app'):
|
|
||||||
return AbsoluteAndRelativeFileName.recursively_from_directory(path)
|
|
||||||
if path.is_dir():
|
|
||||||
files = []
|
|
||||||
for child in path.iterdir():
|
|
||||||
if child.name.endswith('.app'):
|
|
||||||
current_files = AbsoluteAndRelativeFileName.recursively_from_directory(
|
|
||||||
child)
|
|
||||||
else:
|
|
||||||
current_files = super().collect_files_to_sign(child)
|
|
||||||
for current_file in current_files:
|
|
||||||
files.append(AbsoluteAndRelativeFileName(
|
|
||||||
path, current_file.absolute_filepath))
|
|
||||||
return files
|
|
||||||
return super().collect_files_to_sign(path)
|
|
||||||
|
|
||||||
############################################################################
|
|
||||||
# Codesign.
|
|
||||||
|
|
||||||
def codesign_remove_signature(
|
|
||||||
self, file: AbsoluteAndRelativeFileName) -> None:
|
|
||||||
"""
|
|
||||||
Make sure given file does not have codesign signature
|
|
||||||
|
|
||||||
This is needed because codesigning is not possible for file which has
|
|
||||||
signature already.
|
|
||||||
"""
|
|
||||||
|
|
||||||
logger_server.info(
|
|
||||||
'Removing codesign signature from %s...', file.relative_filepath)
|
|
||||||
|
|
||||||
command = ['codesign', '--remove-signature', file.absolute_filepath]
|
|
||||||
self.run_command_or_mock(command, util.Platform.MACOS)
|
|
||||||
|
|
||||||
def codesign_file(
|
|
||||||
self, file: AbsoluteAndRelativeFileName) -> None:
|
|
||||||
"""
|
|
||||||
Sign given file
|
|
||||||
|
|
||||||
NOTE: File must not have any signatures.
|
|
||||||
"""
|
|
||||||
|
|
||||||
logger_server.info(
|
|
||||||
'Codesigning %s...', file.relative_filepath)
|
|
||||||
|
|
||||||
entitlements_file = self.config.MACOS_ENTITLEMENTS_FILE
|
|
||||||
command = ['codesign',
|
|
||||||
'--timestamp',
|
|
||||||
'--options', 'runtime',
|
|
||||||
f'--entitlements={entitlements_file}',
|
|
||||||
'--sign', self.config.MACOS_CODESIGN_IDENTITY,
|
|
||||||
file.absolute_filepath]
|
|
||||||
self.run_command_or_mock(command, util.Platform.MACOS)
|
|
||||||
|
|
||||||
def codesign_all_files(self, files: List[AbsoluteAndRelativeFileName]) -> None:
|
|
||||||
"""
|
|
||||||
Run codesign tool on all eligible files in the given list.
|
|
||||||
|
|
||||||
Will ignore all files which are not to be signed. For the rest will
|
|
||||||
remove possible existing signature and add a new signature.
|
|
||||||
"""
|
|
||||||
|
|
||||||
num_files = len(files)
|
|
||||||
have_ignored_files = False
|
|
||||||
signed_files = []
|
|
||||||
for file_index, file in enumerate(files):
|
|
||||||
# Ignore file if it is not to be signed.
|
|
||||||
# Allows to manually construct ZIP of a bundle and get it signed.
|
|
||||||
if not self.check_file_is_to_be_signed(file):
|
|
||||||
logger_server.info(
|
|
||||||
'Ignoring file [%d/%d] %s',
|
|
||||||
file_index + 1, num_files, file.relative_filepath)
|
|
||||||
have_ignored_files = True
|
|
||||||
continue
|
|
||||||
|
|
||||||
logger_server.info(
|
|
||||||
'Running codesigning routines for file [%d/%d] %s...',
|
|
||||||
file_index + 1, num_files, file.relative_filepath)
|
|
||||||
|
|
||||||
self.codesign_remove_signature(file)
|
|
||||||
self.codesign_file(file)
|
|
||||||
|
|
||||||
signed_files.append(file)
|
|
||||||
|
|
||||||
if have_ignored_files:
|
|
||||||
logger_server.info('Signed %d files:', len(signed_files))
|
|
||||||
num_signed_files = len(signed_files)
|
|
||||||
for file_index, signed_file in enumerate(signed_files):
|
|
||||||
logger_server.info(
|
|
||||||
'- [%d/%d] %s',
|
|
||||||
file_index + 1, num_signed_files,
|
|
||||||
signed_file.relative_filepath)
|
|
||||||
|
|
||||||
def codesign_bundles(
|
|
||||||
self, files: List[AbsoluteAndRelativeFileName]) -> None:
|
|
||||||
"""
|
|
||||||
Codesign all .app bundles in the given list of files.
|
|
||||||
|
|
||||||
Bundle is deducted from paths of the files, and every bundle is only
|
|
||||||
signed once.
|
|
||||||
"""
|
|
||||||
|
|
||||||
signed_bundles = set()
|
|
||||||
extra_files = []
|
|
||||||
|
|
||||||
for file in files:
|
|
||||||
if not is_file_from_bundle(file):
|
|
||||||
continue
|
|
||||||
bundle = get_bundle_from_file(file)
|
|
||||||
bundle_name = bundle.relative_filepath
|
|
||||||
if bundle_name in signed_bundles:
|
|
||||||
continue
|
|
||||||
|
|
||||||
logger_server.info('Running codesign routines on bundle %s',
|
|
||||||
bundle_name)
|
|
||||||
|
|
||||||
# It is not possible to remove signature from DMG.
|
|
||||||
if bundle.relative_filepath.name.endswith('.app'):
|
|
||||||
self.codesign_remove_signature(bundle)
|
|
||||||
self.codesign_file(bundle)
|
|
||||||
|
|
||||||
signed_bundles.add(bundle_name)
|
|
||||||
|
|
||||||
# Codesign on a bundle adds an extra folder with information.
|
|
||||||
# It needs to be compied to the source.
|
|
||||||
code_signature_directory = \
|
|
||||||
bundle.absolute_filepath / 'Contents' / '_CodeSignature'
|
|
||||||
code_signature_files = \
|
|
||||||
AbsoluteAndRelativeFileName.recursively_from_directory(
|
|
||||||
code_signature_directory)
|
|
||||||
for code_signature_file in code_signature_files:
|
|
||||||
bundle_relative_file = AbsoluteAndRelativeFileName(
|
|
||||||
bundle.base_dir,
|
|
||||||
code_signature_directory /
|
|
||||||
code_signature_file.relative_filepath)
|
|
||||||
extra_files.append(bundle_relative_file)
|
|
||||||
|
|
||||||
files.extend(extra_files)
|
|
||||||
|
|
||||||
############################################################################
|
|
||||||
# Notarization.
|
|
||||||
|
|
||||||
def notarize_get_bundle_id(self, file: AbsoluteAndRelativeFileName) -> str:
|
|
||||||
"""
|
|
||||||
Get bundle ID which will be used to notarize DMG
|
|
||||||
"""
|
|
||||||
name = file.relative_filepath.name
|
|
||||||
app_name = name.split('-', 2)[0].lower()
|
|
||||||
|
|
||||||
app_name_words = app_name.split()
|
|
||||||
if len(app_name_words) > 1:
|
|
||||||
app_name_id = ''.join(word.capitalize() for word in app_name_words)
|
|
||||||
else:
|
|
||||||
app_name_id = app_name_words[0]
|
|
||||||
|
|
||||||
# TODO(sergey): Consider using "alpha" for buildbot builds.
|
|
||||||
return f'org.blenderfoundation.{app_name_id}.release'
|
|
||||||
|
|
||||||
def notarize_request(self, file) -> str:
|
|
||||||
"""
|
|
||||||
Request notarization of the given file.
|
|
||||||
|
|
||||||
Returns UUID of the notarization request. If error occurred None is
|
|
||||||
returned instead of UUID.
|
|
||||||
"""
|
|
||||||
|
|
||||||
bundle_id = self.notarize_get_bundle_id(file)
|
|
||||||
logger_server.info('Bundle ID: %s', bundle_id)
|
|
||||||
|
|
||||||
logger_server.info('Submitting file to the notarial office.')
|
|
||||||
command = [
|
|
||||||
'xcrun', 'altool', '--notarize-app', '--verbose',
|
|
||||||
'-f', file.absolute_filepath,
|
|
||||||
'--primary-bundle-id', bundle_id,
|
|
||||||
'--username', self.config.MACOS_XCRUN_USERNAME,
|
|
||||||
'--password', self.config.MACOS_XCRUN_PASSWORD]
|
|
||||||
|
|
||||||
output = self.check_output_or_mock(
|
|
||||||
command, util.Platform.MACOS, allow_nonzero_exit_code=True)
|
|
||||||
|
|
||||||
for line in output.splitlines():
|
|
||||||
line = line.strip()
|
|
||||||
if line.startswith('RequestUUID = '):
|
|
||||||
request_uuid = line[14:]
|
|
||||||
return request_uuid
|
|
||||||
|
|
||||||
# Check whether the package has been already submitted.
|
|
||||||
if 'The software asset has already been uploaded.' in line:
|
|
||||||
request_uuid = re.sub(
|
|
||||||
'.*The upload ID is ([A-Fa-f0-9\-]+).*', '\\1', line)
|
|
||||||
logger_server.warning(
|
|
||||||
f'The package has been already submitted under UUID {request_uuid}')
|
|
||||||
return request_uuid
|
|
||||||
|
|
||||||
logger_server.error(output)
|
|
||||||
logger_server.error('xcrun command did not report RequestUUID')
|
|
||||||
return None
|
|
||||||
|
|
||||||
def notarize_review_status(self, xcrun_output: str) -> bool:
|
|
||||||
"""
|
|
||||||
Review status returned by xcrun's notarization info
|
|
||||||
|
|
||||||
Returns truth if the notarization process has finished.
|
|
||||||
If there are errors during notarization, a NotarizationException()
|
|
||||||
exception is thrown with status message from the notarial office.
|
|
||||||
"""
|
|
||||||
|
|
||||||
# Parse status and message
|
|
||||||
status = xcrun_field_value_from_output('Status', xcrun_output)
|
|
||||||
status_message = xcrun_field_value_from_output(
|
|
||||||
'Status Message', xcrun_output)
|
|
||||||
|
|
||||||
if status == 'success':
|
|
||||||
logger_server.info(
|
|
||||||
'Package successfully notarized: %s', status_message)
|
|
||||||
return True
|
|
||||||
|
|
||||||
if status == 'invalid':
|
|
||||||
logger_server.error(xcrun_output)
|
|
||||||
logger_server.error(
|
|
||||||
'Package notarization has failed: %s', status_message)
|
|
||||||
raise NotarizationException(status_message)
|
|
||||||
|
|
||||||
if status == 'in progress':
|
|
||||||
return False
|
|
||||||
|
|
||||||
logger_server.info(
|
|
||||||
'Unknown notarization status %s (%s)', status, status_message)
|
|
||||||
|
|
||||||
return False
|
|
||||||
|
|
||||||
def notarize_wait_result(self, request_uuid: str) -> None:
|
|
||||||
"""
|
|
||||||
Wait for until notarial office have a reply
|
|
||||||
"""
|
|
||||||
|
|
||||||
logger_server.info(
|
|
||||||
'Waiting for a result from the notarization office.')
|
|
||||||
|
|
||||||
command = ['xcrun', 'altool',
|
|
||||||
'--notarization-info', request_uuid,
|
|
||||||
'--username', self.config.MACOS_XCRUN_USERNAME,
|
|
||||||
'--password', self.config.MACOS_XCRUN_PASSWORD]
|
|
||||||
|
|
||||||
time_start = time.monotonic()
|
|
||||||
timeout_in_seconds = self.config.MACOS_NOTARIZE_TIMEOUT_IN_SECONDS
|
|
||||||
|
|
||||||
while True:
|
|
||||||
xcrun_output = self.check_output_or_mock(
|
|
||||||
command, util.Platform.MACOS, allow_nonzero_exit_code=True)
|
|
||||||
|
|
||||||
if self.notarize_review_status(xcrun_output):
|
|
||||||
break
|
|
||||||
|
|
||||||
logger_server.info('Keep waiting for notarization office.')
|
|
||||||
time.sleep(30)
|
|
||||||
|
|
||||||
time_slept_in_seconds = time.monotonic() - time_start
|
|
||||||
if time_slept_in_seconds > timeout_in_seconds:
|
|
||||||
logger_server.error(
|
|
||||||
"Notarial office didn't reply in %f seconds.",
|
|
||||||
timeout_in_seconds)
|
|
||||||
|
|
||||||
def notarize_staple(self, file: AbsoluteAndRelativeFileName) -> bool:
|
|
||||||
"""
|
|
||||||
Staple notarial label on the file
|
|
||||||
"""
|
|
||||||
|
|
||||||
logger_server.info('Stapling notarial stamp.')
|
|
||||||
|
|
||||||
command = ['xcrun', 'stapler', 'staple', '-v', file.absolute_filepath]
|
|
||||||
self.check_output_or_mock(command, util.Platform.MACOS)
|
|
||||||
|
|
||||||
def notarize_dmg(self, file: AbsoluteAndRelativeFileName) -> bool:
|
|
||||||
"""
|
|
||||||
Run entire pipeline to get DMG notarized.
|
|
||||||
"""
|
|
||||||
logger_server.info('Begin notarization routines on %s',
|
|
||||||
file.relative_filepath)
|
|
||||||
|
|
||||||
# Submit file for notarization.
|
|
||||||
request_uuid = self.notarize_request(file)
|
|
||||||
if not request_uuid:
|
|
||||||
return False
|
|
||||||
logger_server.info('Received Request UUID: %s', request_uuid)
|
|
||||||
|
|
||||||
# Wait for the status from the notarization office.
|
|
||||||
if not self.notarize_wait_result(request_uuid):
|
|
||||||
return False
|
|
||||||
|
|
||||||
# Staple.
|
|
||||||
self.notarize_staple(file)
|
|
||||||
|
|
||||||
def notarize_all_dmg(
|
|
||||||
self, files: List[AbsoluteAndRelativeFileName]) -> bool:
|
|
||||||
"""
|
|
||||||
Notarize all DMG images from the input.
|
|
||||||
|
|
||||||
Images are supposed to be codesigned already.
|
|
||||||
"""
|
|
||||||
for file in files:
|
|
||||||
if not file.relative_filepath.name.endswith('.dmg'):
|
|
||||||
continue
|
|
||||||
if not self.check_file_is_to_be_signed(file):
|
|
||||||
continue
|
|
||||||
|
|
||||||
self.notarize_dmg(file)
|
|
||||||
|
|
||||||
############################################################################
|
|
||||||
# Entry point.
|
|
||||||
|
|
||||||
def sign_all_files(self, files: List[AbsoluteAndRelativeFileName]) -> None:
|
|
||||||
# TODO(sergey): Handle errors somehow.
|
|
||||||
|
|
||||||
self.codesign_all_files(files)
|
|
||||||
self.codesign_bundles(files)
|
|
||||||
self.notarize_all_dmg(files)
|
|
@@ -1,52 +0,0 @@
|
|||||||
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
|
||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
#
|
|
||||||
# ##### END GPL LICENSE BLOCK #####
|
|
||||||
|
|
||||||
# <pep8 compliant>
|
|
||||||
|
|
||||||
|
|
||||||
import logging.config
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
from typing import Optional
|
|
||||||
|
|
||||||
import codesign.config_builder
|
|
||||||
import codesign.util as util
|
|
||||||
from codesign.base_code_signer import BaseCodeSigner
|
|
||||||
|
|
||||||
|
|
||||||
class SimpleCodeSigner:
|
|
||||||
code_signer: Optional[BaseCodeSigner]
|
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
platform = util.get_current_platform()
|
|
||||||
if platform == util.Platform.LINUX:
|
|
||||||
from codesign.linux_code_signer import LinuxCodeSigner
|
|
||||||
self.code_signer = LinuxCodeSigner(codesign.config_builder)
|
|
||||||
elif platform == util.Platform.MACOS:
|
|
||||||
from codesign.macos_code_signer import MacOSCodeSigner
|
|
||||||
self.code_signer = MacOSCodeSigner(codesign.config_builder)
|
|
||||||
elif platform == util.Platform.WINDOWS:
|
|
||||||
from codesign.windows_code_signer import WindowsCodeSigner
|
|
||||||
self.code_signer = WindowsCodeSigner(codesign.config_builder)
|
|
||||||
else:
|
|
||||||
self.code_signer = None
|
|
||||||
|
|
||||||
def sign_file_or_directory(self, path: Path) -> None:
|
|
||||||
logging.config.dictConfig(codesign.config_builder.LOGGING)
|
|
||||||
self.code_signer.run_buildbot_path_sign_pipeline(path)
|
|
@@ -1,54 +0,0 @@
|
|||||||
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
|
||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
#
|
|
||||||
# ##### END GPL LICENSE BLOCK #####
|
|
||||||
|
|
||||||
# <pep8 compliant>
|
|
||||||
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from enum import Enum
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
|
|
||||||
class Platform(Enum):
|
|
||||||
LINUX = 1
|
|
||||||
MACOS = 2
|
|
||||||
WINDOWS = 3
|
|
||||||
|
|
||||||
|
|
||||||
def get_current_platform() -> Platform:
|
|
||||||
if sys.platform == 'linux':
|
|
||||||
return Platform.LINUX
|
|
||||||
elif sys.platform == 'darwin':
|
|
||||||
return Platform.MACOS
|
|
||||||
elif sys.platform == 'win32':
|
|
||||||
return Platform.WINDOWS
|
|
||||||
raise Exception(f'Unknown platform {sys.platform}')
|
|
||||||
|
|
||||||
|
|
||||||
def ensure_file_does_not_exist_or_die(filepath: Path) -> None:
|
|
||||||
"""
|
|
||||||
If the file exists, unlink it.
|
|
||||||
If the file path exists and is not a file an assert will trigger.
|
|
||||||
If the file path does not exists nothing happens.
|
|
||||||
"""
|
|
||||||
if not filepath.exists():
|
|
||||||
return
|
|
||||||
if not filepath.is_file():
|
|
||||||
# TODO(sergey): Provide information about what the filepath actually is.
|
|
||||||
raise SystemExit(f'{filepath} is expected to be a file, but is not')
|
|
||||||
filepath.unlink()
|
|
@@ -1,117 +0,0 @@
|
|||||||
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
|
||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
#
|
|
||||||
# ##### END GPL LICENSE BLOCK #####
|
|
||||||
|
|
||||||
# <pep8 compliant>
|
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
from typing import List
|
|
||||||
|
|
||||||
import codesign.util as util
|
|
||||||
|
|
||||||
from buildbot_utils import Builder
|
|
||||||
|
|
||||||
from codesign.absolute_and_relative_filename import AbsoluteAndRelativeFileName
|
|
||||||
from codesign.base_code_signer import BaseCodeSigner
|
|
||||||
from codesign.exception import CodeSignException
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
logger_server = logger.getChild('server')
|
|
||||||
|
|
||||||
# NOTE: Check is done as filename.endswith(), so keep the dot
|
|
||||||
EXTENSIONS_TO_BE_SIGNED = {'.exe', '.dll', '.pyd', '.msi'}
|
|
||||||
|
|
||||||
BLACKLIST_FILE_PREFIXES = (
|
|
||||||
'api-ms-', 'concrt', 'msvcp', 'ucrtbase', 'vcomp', 'vcruntime')
|
|
||||||
|
|
||||||
|
|
||||||
class SigntoolException(CodeSignException):
|
|
||||||
pass
|
|
||||||
|
|
||||||
class WindowsCodeSigner(BaseCodeSigner):
|
|
||||||
def check_file_is_to_be_signed(
|
|
||||||
self, file: AbsoluteAndRelativeFileName) -> bool:
|
|
||||||
base_name = file.relative_filepath.name
|
|
||||||
if any(base_name.startswith(prefix)
|
|
||||||
for prefix in BLACKLIST_FILE_PREFIXES):
|
|
||||||
return False
|
|
||||||
|
|
||||||
return file.relative_filepath.suffix in EXTENSIONS_TO_BE_SIGNED
|
|
||||||
|
|
||||||
|
|
||||||
def get_sign_command_prefix(self) -> List[str]:
|
|
||||||
return [
|
|
||||||
'signtool', 'sign', '/v',
|
|
||||||
'/f', self.config.WIN_CERTIFICATE_FILEPATH,
|
|
||||||
'/tr', self.config.WIN_TIMESTAMP_AUTHORITY_URL]
|
|
||||||
|
|
||||||
|
|
||||||
def run_codesign_tool(self, filepath: Path) -> None:
|
|
||||||
command = self.get_sign_command_prefix() + [filepath]
|
|
||||||
|
|
||||||
try:
|
|
||||||
codesign_output = self.check_output_or_mock(command, util.Platform.WINDOWS)
|
|
||||||
except subprocess.CalledProcessError as e:
|
|
||||||
raise SigntoolException(f'Error running signtool {e}')
|
|
||||||
|
|
||||||
logger_server.info(f'signtool output:\n{codesign_output}')
|
|
||||||
|
|
||||||
got_number_of_success = False
|
|
||||||
|
|
||||||
for line in codesign_output.split('\n'):
|
|
||||||
line_clean = line.strip()
|
|
||||||
line_clean_lower = line_clean.lower()
|
|
||||||
|
|
||||||
if line_clean_lower.startswith('number of warnings') or \
|
|
||||||
line_clean_lower.startswith('number of errors'):
|
|
||||||
number = int(line_clean_lower.split(':')[1])
|
|
||||||
if number != 0:
|
|
||||||
raise SigntoolException('Non-clean success of signtool')
|
|
||||||
|
|
||||||
if line_clean_lower.startswith('number of files successfully signed'):
|
|
||||||
got_number_of_success = True
|
|
||||||
number = int(line_clean_lower.split(':')[1])
|
|
||||||
if number != 1:
|
|
||||||
raise SigntoolException('Signtool did not consider codesign a success')
|
|
||||||
|
|
||||||
if not got_number_of_success:
|
|
||||||
raise SigntoolException('Signtool did not report number of files signed')
|
|
||||||
|
|
||||||
|
|
||||||
def sign_all_files(self, files: List[AbsoluteAndRelativeFileName]) -> None:
|
|
||||||
# NOTE: Sign files one by one to avoid possible command line length
|
|
||||||
# overflow (which could happen if we ever decide to sign every binary
|
|
||||||
# in the install folder, for example).
|
|
||||||
#
|
|
||||||
# TODO(sergey): Consider doing batched signing of handful of files in
|
|
||||||
# one go (but only if this actually known to be much faster).
|
|
||||||
num_files = len(files)
|
|
||||||
for file_index, file in enumerate(files):
|
|
||||||
# Ignore file if it is not to be signed.
|
|
||||||
# Allows to manually construct ZIP of package and get it signed.
|
|
||||||
if not self.check_file_is_to_be_signed(file):
|
|
||||||
logger_server.info(
|
|
||||||
'Ignoring file [%d/%d] %s',
|
|
||||||
file_index + 1, num_files, file.relative_filepath)
|
|
||||||
continue
|
|
||||||
|
|
||||||
logger_server.info(
|
|
||||||
'Running signtool command for file [%d/%d] %s...',
|
|
||||||
file_index + 1, num_files, file.relative_filepath)
|
|
||||||
self.run_codesign_tool(file.absolute_filepath)
|
|
@@ -1,37 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
|
||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
#
|
|
||||||
# ##### END GPL LICENSE BLOCK #####
|
|
||||||
|
|
||||||
# <pep8 compliant>
|
|
||||||
|
|
||||||
# NOTE: This is a no-op signer (since there isn't really a procedure to sign
|
|
||||||
# Linux binaries yet). Used to debug and verify the code signing routines on
|
|
||||||
# a Linux environment.
|
|
||||||
|
|
||||||
import logging.config
|
|
||||||
from pathlib import Path
|
|
||||||
from typing import List
|
|
||||||
|
|
||||||
from codesign.linux_code_signer import LinuxCodeSigner
|
|
||||||
import codesign.config_server
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
logging.config.dictConfig(codesign.config_server.LOGGING)
|
|
||||||
code_signer = LinuxCodeSigner(codesign.config_server)
|
|
||||||
code_signer.run_signing_server()
|
|
@@ -1,41 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
|
||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
#
|
|
||||||
# ##### END GPL LICENSE BLOCK #####
|
|
||||||
|
|
||||||
# <pep8 compliant>
|
|
||||||
|
|
||||||
import logging.config
|
|
||||||
from pathlib import Path
|
|
||||||
from typing import List
|
|
||||||
|
|
||||||
from codesign.macos_code_signer import MacOSCodeSigner
|
|
||||||
import codesign.config_server
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
entitlements_file = codesign.config_server.MACOS_ENTITLEMENTS_FILE
|
|
||||||
if not entitlements_file.exists():
|
|
||||||
raise SystemExit(
|
|
||||||
'Entitlements file {entitlements_file} does not exist.')
|
|
||||||
if not entitlements_file.is_file():
|
|
||||||
raise SystemExit(
|
|
||||||
'Entitlements file {entitlements_file} is not a file.')
|
|
||||||
|
|
||||||
logging.config.dictConfig(codesign.config_server.LOGGING)
|
|
||||||
code_signer = MacOSCodeSigner(codesign.config_server)
|
|
||||||
code_signer.run_signing_server()
|
|
@@ -1,11 +0,0 @@
|
|||||||
@echo off
|
|
||||||
|
|
||||||
rem This is an entry point of the codesign server for Windows.
|
|
||||||
rem It makes sure that signtool.exe is within the current PATH and can be
|
|
||||||
rem used by the Python script.
|
|
||||||
|
|
||||||
SETLOCAL
|
|
||||||
|
|
||||||
set PATH=C:\Program Files (x86)\Windows Kits\10\App Certification Kit;%PATH%
|
|
||||||
|
|
||||||
codesign_server_windows.py
|
|
@@ -1,54 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
|
||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
#
|
|
||||||
# ##### END GPL LICENSE BLOCK #####
|
|
||||||
|
|
||||||
# <pep8 compliant>
|
|
||||||
|
|
||||||
# Implementation of codesign server for Windows.
|
|
||||||
#
|
|
||||||
# NOTE: If signtool.exe is not in the PATH use codesign_server_windows.bat
|
|
||||||
|
|
||||||
import logging.config
|
|
||||||
import shutil
|
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
from typing import List
|
|
||||||
|
|
||||||
import codesign.util as util
|
|
||||||
|
|
||||||
from codesign.windows_code_signer import WindowsCodeSigner
|
|
||||||
import codesign.config_server
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
logging.config.dictConfig(codesign.config_server.LOGGING)
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
logger_server = logger.getChild('server')
|
|
||||||
|
|
||||||
# TODO(sergey): Consider moving such sanity checks into
|
|
||||||
# CodeSigner.check_environment_or_die().
|
|
||||||
if not shutil.which('signtool.exe'):
|
|
||||||
if util.get_current_platform() == util.Platform.WINDOWS:
|
|
||||||
raise SystemExit("signtool.exe is not found in %PATH%")
|
|
||||||
logger_server.info(
|
|
||||||
'signtool.exe not found, '
|
|
||||||
'but will not be used on this foreign platform')
|
|
||||||
|
|
||||||
code_signer = WindowsCodeSigner(codesign.config_server)
|
|
||||||
code_signer.run_signing_server()
|
|
@@ -1,551 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
|
||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
#
|
|
||||||
# ##### END GPL LICENSE BLOCK #####
|
|
||||||
|
|
||||||
import argparse
|
|
||||||
import re
|
|
||||||
import shutil
|
|
||||||
import subprocess
|
|
||||||
import sys
|
|
||||||
import time
|
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
from tempfile import TemporaryDirectory, NamedTemporaryFile
|
|
||||||
from typing import List
|
|
||||||
|
|
||||||
BUILDBOT_DIRECTORY = Path(__file__).absolute().parent
|
|
||||||
CODESIGN_SCRIPT = BUILDBOT_DIRECTORY / 'worker_codesign.py'
|
|
||||||
BLENDER_GIT_ROOT_DIRECTORY = BUILDBOT_DIRECTORY.parent.parent
|
|
||||||
DARWIN_DIRECTORY = BLENDER_GIT_ROOT_DIRECTORY / 'release' / 'darwin'
|
|
||||||
|
|
||||||
|
|
||||||
# Extra size which is added on top of actual files size when estimating size
|
|
||||||
# of destination DNG.
|
|
||||||
EXTRA_DMG_SIZE_IN_BYTES = 800 * 1024 * 1024
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# Common utilities
|
|
||||||
|
|
||||||
|
|
||||||
def get_directory_size(root_directory: Path) -> int:
|
|
||||||
"""
|
|
||||||
Get size of directory on disk
|
|
||||||
"""
|
|
||||||
|
|
||||||
total_size = 0
|
|
||||||
for file in root_directory.glob('**/*'):
|
|
||||||
total_size += file.lstat().st_size
|
|
||||||
return total_size
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# DMG bundling specific logic
|
|
||||||
|
|
||||||
def create_argument_parser():
|
|
||||||
parser = argparse.ArgumentParser()
|
|
||||||
parser.add_argument(
|
|
||||||
'source_dir',
|
|
||||||
type=Path,
|
|
||||||
help='Source directory which points to either existing .app bundle'
|
|
||||||
'or to a directory with .app bundles.')
|
|
||||||
parser.add_argument(
|
|
||||||
'--background-image',
|
|
||||||
type=Path,
|
|
||||||
help="Optional background picture which will be set on the DMG."
|
|
||||||
"If not provided default Blender's one is used.")
|
|
||||||
parser.add_argument(
|
|
||||||
'--volume-name',
|
|
||||||
type=str,
|
|
||||||
help='Optional name of a volume which will be used for DMG.')
|
|
||||||
parser.add_argument(
|
|
||||||
'--dmg',
|
|
||||||
type=Path,
|
|
||||||
help='Optional argument which points to a final DMG file name.')
|
|
||||||
parser.add_argument(
|
|
||||||
'--applescript',
|
|
||||||
type=Path,
|
|
||||||
help="Optional path to applescript to set up folder looks of DMG."
|
|
||||||
"If not provided default Blender's one is used.")
|
|
||||||
parser.add_argument(
|
|
||||||
'--codesign',
|
|
||||||
action="store_true",
|
|
||||||
help="Code sign and notarize DMG contents.")
|
|
||||||
return parser
|
|
||||||
|
|
||||||
|
|
||||||
def collect_app_bundles(source_dir: Path) -> List[Path]:
|
|
||||||
"""
|
|
||||||
Collect all app bundles which are to be put into DMG
|
|
||||||
|
|
||||||
If the source directory points to FOO.app it will be the only app bundle
|
|
||||||
packed.
|
|
||||||
|
|
||||||
Otherwise all .app bundles from given directory are placed to a single
|
|
||||||
DMG.
|
|
||||||
"""
|
|
||||||
|
|
||||||
if source_dir.name.endswith('.app'):
|
|
||||||
return [source_dir]
|
|
||||||
|
|
||||||
app_bundles = []
|
|
||||||
for filename in source_dir.glob('*'):
|
|
||||||
if not filename.is_dir():
|
|
||||||
continue
|
|
||||||
if not filename.name.endswith('.app'):
|
|
||||||
continue
|
|
||||||
|
|
||||||
app_bundles.append(filename)
|
|
||||||
|
|
||||||
return app_bundles
|
|
||||||
|
|
||||||
|
|
||||||
def collect_and_log_app_bundles(source_dir: Path) -> List[Path]:
|
|
||||||
app_bundles = collect_app_bundles(source_dir)
|
|
||||||
|
|
||||||
if not app_bundles:
|
|
||||||
print('No app bundles found for packing')
|
|
||||||
return
|
|
||||||
|
|
||||||
print(f'Found {len(app_bundles)} to pack:')
|
|
||||||
for app_bundle in app_bundles:
|
|
||||||
print(f'- {app_bundle}')
|
|
||||||
|
|
||||||
return app_bundles
|
|
||||||
|
|
||||||
|
|
||||||
def estimate_dmg_size(app_bundles: List[Path]) -> int:
|
|
||||||
"""
|
|
||||||
Estimate size of DMG to hold requested app bundles
|
|
||||||
|
|
||||||
The size is based on actual size of all files in all bundles plus some
|
|
||||||
space to compensate for different size-on-disk plus some space to hold
|
|
||||||
codesign signatures.
|
|
||||||
|
|
||||||
Is better to be on a high side since the empty space is compressed, but
|
|
||||||
lack of space might cause silent failures later on.
|
|
||||||
"""
|
|
||||||
|
|
||||||
app_bundles_size = 0
|
|
||||||
for app_bundle in app_bundles:
|
|
||||||
app_bundles_size += get_directory_size(app_bundle)
|
|
||||||
|
|
||||||
return app_bundles_size + EXTRA_DMG_SIZE_IN_BYTES
|
|
||||||
|
|
||||||
|
|
||||||
def copy_app_bundles_to_directory(app_bundles: List[Path],
|
|
||||||
directory: Path) -> None:
|
|
||||||
"""
|
|
||||||
Copy all bundles to a given directory
|
|
||||||
|
|
||||||
This directory is what the DMG will be created from.
|
|
||||||
"""
|
|
||||||
for app_bundle in app_bundles:
|
|
||||||
print(f'Copying {app_bundle.name}...')
|
|
||||||
shutil.copytree(app_bundle, directory / app_bundle.name)
|
|
||||||
|
|
||||||
|
|
||||||
def get_main_app_bundle(app_bundles: List[Path]) -> Path:
|
|
||||||
"""
|
|
||||||
Get application bundle main for the installation
|
|
||||||
"""
|
|
||||||
return app_bundles[0]
|
|
||||||
|
|
||||||
|
|
||||||
def create_dmg_image(app_bundles: List[Path],
|
|
||||||
dmg_filepath: Path,
|
|
||||||
volume_name: str) -> None:
|
|
||||||
"""
|
|
||||||
Create DMG disk image and put app bundles in it
|
|
||||||
|
|
||||||
No DMG configuration or codesigning is happening here.
|
|
||||||
"""
|
|
||||||
|
|
||||||
if dmg_filepath.exists():
|
|
||||||
print(f'Removing existing writable DMG {dmg_filepath}...')
|
|
||||||
dmg_filepath.unlink()
|
|
||||||
|
|
||||||
print('Preparing directory with app bundles for the DMG...')
|
|
||||||
with TemporaryDirectory(prefix='blender-dmg-content-') as content_dir_str:
|
|
||||||
# Copy all bundles to a clean directory.
|
|
||||||
content_dir = Path(content_dir_str)
|
|
||||||
copy_app_bundles_to_directory(app_bundles, content_dir)
|
|
||||||
|
|
||||||
# Estimate size of the DMG.
|
|
||||||
dmg_size = estimate_dmg_size(app_bundles)
|
|
||||||
print(f'Estimated DMG size: {dmg_size:,} bytes.')
|
|
||||||
|
|
||||||
# Create the DMG.
|
|
||||||
print(f'Creating writable DMG {dmg_filepath}')
|
|
||||||
command = ('hdiutil',
|
|
||||||
'create',
|
|
||||||
'-size', str(dmg_size),
|
|
||||||
'-fs', 'HFS+',
|
|
||||||
'-srcfolder', content_dir,
|
|
||||||
'-volname', volume_name,
|
|
||||||
'-format', 'UDRW',
|
|
||||||
dmg_filepath)
|
|
||||||
subprocess.run(command)
|
|
||||||
|
|
||||||
|
|
||||||
def get_writable_dmg_filepath(dmg_filepath: Path):
|
|
||||||
"""
|
|
||||||
Get file path for writable DMG image
|
|
||||||
"""
|
|
||||||
parent = dmg_filepath.parent
|
|
||||||
return parent / (dmg_filepath.stem + '-temp.dmg')
|
|
||||||
|
|
||||||
|
|
||||||
def mount_readwrite_dmg(dmg_filepath: Path) -> None:
|
|
||||||
"""
|
|
||||||
Mount writable DMG
|
|
||||||
|
|
||||||
Mounting point would be /Volumes/<volume name>
|
|
||||||
"""
|
|
||||||
|
|
||||||
print(f'Mounting read-write DMG ${dmg_filepath}')
|
|
||||||
command = ('hdiutil',
|
|
||||||
'attach', '-readwrite',
|
|
||||||
'-noverify',
|
|
||||||
'-noautoopen',
|
|
||||||
dmg_filepath)
|
|
||||||
subprocess.run(command)
|
|
||||||
|
|
||||||
|
|
||||||
def get_mount_directory_for_volume_name(volume_name: str) -> Path:
|
|
||||||
"""
|
|
||||||
Get directory under which the volume will be mounted
|
|
||||||
"""
|
|
||||||
|
|
||||||
return Path('/Volumes') / volume_name
|
|
||||||
|
|
||||||
|
|
||||||
def eject_volume(volume_name: str) -> None:
|
|
||||||
"""
|
|
||||||
Eject given volume, if mounted
|
|
||||||
"""
|
|
||||||
mount_directory = get_mount_directory_for_volume_name(volume_name)
|
|
||||||
if not mount_directory.exists():
|
|
||||||
return
|
|
||||||
mount_directory_str = str(mount_directory)
|
|
||||||
|
|
||||||
print(f'Ejecting volume {volume_name}')
|
|
||||||
|
|
||||||
# Figure out which device to eject.
|
|
||||||
mount_output = subprocess.check_output(['mount']).decode()
|
|
||||||
device = ''
|
|
||||||
for line in mount_output.splitlines():
|
|
||||||
if f'on {mount_directory_str} (' not in line:
|
|
||||||
continue
|
|
||||||
tokens = line.split(' ', 3)
|
|
||||||
if len(tokens) < 3:
|
|
||||||
continue
|
|
||||||
if tokens[1] != 'on':
|
|
||||||
continue
|
|
||||||
if device:
|
|
||||||
raise Exception(
|
|
||||||
f'Multiple devices found for mounting point {mount_directory}')
|
|
||||||
device = tokens[0]
|
|
||||||
|
|
||||||
if not device:
|
|
||||||
raise Exception(
|
|
||||||
f'No device found for mounting point {mount_directory}')
|
|
||||||
|
|
||||||
print(f'{mount_directory} is mounted as device {device}, ejecting...')
|
|
||||||
subprocess.run(['diskutil', 'eject', device])
|
|
||||||
|
|
||||||
|
|
||||||
def copy_background_if_needed(background_image_filepath: Path,
|
|
||||||
mount_directory: Path) -> None:
|
|
||||||
"""
|
|
||||||
Copy background to the DMG
|
|
||||||
|
|
||||||
If the background image is not specified it will not be copied.
|
|
||||||
"""
|
|
||||||
|
|
||||||
if not background_image_filepath:
|
|
||||||
print('No background image provided.')
|
|
||||||
return
|
|
||||||
|
|
||||||
print(f'Copying background image {background_image_filepath}')
|
|
||||||
|
|
||||||
destination_dir = mount_directory / '.background'
|
|
||||||
destination_dir.mkdir(exist_ok=True)
|
|
||||||
|
|
||||||
destination_filepath = destination_dir / background_image_filepath.name
|
|
||||||
shutil.copy(background_image_filepath, destination_filepath)
|
|
||||||
|
|
||||||
|
|
||||||
def create_applications_link(mount_directory: Path) -> None:
|
|
||||||
"""
|
|
||||||
Create link to /Applications in the given location
|
|
||||||
"""
|
|
||||||
|
|
||||||
print('Creating link to /Applications')
|
|
||||||
|
|
||||||
command = ('ln', '-s', '/Applications', mount_directory / ' ')
|
|
||||||
subprocess.run(command)
|
|
||||||
|
|
||||||
|
|
||||||
def run_applescript(applescript: Path,
|
|
||||||
volume_name: str,
|
|
||||||
app_bundles: List[Path],
|
|
||||||
background_image_filepath: Path) -> None:
|
|
||||||
"""
|
|
||||||
Run given applescript to adjust look and feel of the DMG
|
|
||||||
"""
|
|
||||||
|
|
||||||
main_app_bundle = get_main_app_bundle(app_bundles)
|
|
||||||
|
|
||||||
with NamedTemporaryFile(
|
|
||||||
mode='w', suffix='.applescript') as temp_applescript:
|
|
||||||
print('Adjusting applescript for volume name...')
|
|
||||||
# Adjust script to the specific volume name.
|
|
||||||
with open(applescript, mode='r') as input:
|
|
||||||
for line in input.readlines():
|
|
||||||
stripped_line = line.strip()
|
|
||||||
if stripped_line.startswith('tell disk'):
|
|
||||||
line = re.sub('tell disk ".*"',
|
|
||||||
f'tell disk "{volume_name}"',
|
|
||||||
line)
|
|
||||||
elif stripped_line.startswith('set background picture'):
|
|
||||||
if not background_image_filepath:
|
|
||||||
continue
|
|
||||||
else:
|
|
||||||
background_image_short = \
|
|
||||||
'.background:' + background_image_filepath.name
|
|
||||||
line = re.sub('to file ".*"',
|
|
||||||
f'to file "{background_image_short}"',
|
|
||||||
line)
|
|
||||||
line = line.replace('blender.app', main_app_bundle.name)
|
|
||||||
temp_applescript.write(line)
|
|
||||||
|
|
||||||
temp_applescript.flush()
|
|
||||||
|
|
||||||
print('Running applescript...')
|
|
||||||
command = ('osascript', temp_applescript.name)
|
|
||||||
subprocess.run(command)
|
|
||||||
|
|
||||||
print('Waiting for applescript...')
|
|
||||||
|
|
||||||
# NOTE: This is copied from bundle.sh. The exact reason for sleep is
|
|
||||||
# still remained a mystery.
|
|
||||||
time.sleep(5)
|
|
||||||
|
|
||||||
|
|
||||||
def codesign(subject: Path):
|
|
||||||
"""
|
|
||||||
Codesign file or directory
|
|
||||||
|
|
||||||
NOTE: For DMG it will also notarize.
|
|
||||||
"""
|
|
||||||
|
|
||||||
command = (CODESIGN_SCRIPT, subject)
|
|
||||||
subprocess.run(command)
|
|
||||||
|
|
||||||
|
|
||||||
def codesign_app_bundles_in_dmg(mount_directory: str) -> None:
|
|
||||||
"""
|
|
||||||
Code sign all binaries and bundles in the mounted directory
|
|
||||||
"""
|
|
||||||
|
|
||||||
print(f'Codesigning all app bundles in {mount_directory}')
|
|
||||||
codesign(mount_directory)
|
|
||||||
|
|
||||||
|
|
||||||
def codesign_and_notarize_dmg(dmg_filepath: Path) -> None:
|
|
||||||
"""
|
|
||||||
Run codesign and notarization pipeline on the DMG
|
|
||||||
"""
|
|
||||||
|
|
||||||
print(f'Codesigning and notarizing DMG {dmg_filepath}')
|
|
||||||
codesign(dmg_filepath)
|
|
||||||
|
|
||||||
|
|
||||||
def compress_dmg(writable_dmg_filepath: Path,
|
|
||||||
final_dmg_filepath: Path) -> None:
|
|
||||||
"""
|
|
||||||
Compress temporary read-write DMG
|
|
||||||
"""
|
|
||||||
command = ('hdiutil', 'convert',
|
|
||||||
writable_dmg_filepath,
|
|
||||||
'-format', 'UDZO',
|
|
||||||
'-o', final_dmg_filepath)
|
|
||||||
|
|
||||||
if final_dmg_filepath.exists():
|
|
||||||
print(f'Removing old compressed DMG {final_dmg_filepath}')
|
|
||||||
final_dmg_filepath.unlink()
|
|
||||||
|
|
||||||
print('Compressing disk image...')
|
|
||||||
subprocess.run(command)
|
|
||||||
|
|
||||||
|
|
||||||
def create_final_dmg(app_bundles: List[Path],
|
|
||||||
dmg_filepath: Path,
|
|
||||||
background_image_filepath: Path,
|
|
||||||
volume_name: str,
|
|
||||||
applescript: Path,
|
|
||||||
codesign: bool) -> None:
|
|
||||||
"""
|
|
||||||
Create DMG with all app bundles
|
|
||||||
|
|
||||||
Will take care configuring background, signing all binaries and app bundles
|
|
||||||
and notarizing the DMG.
|
|
||||||
"""
|
|
||||||
|
|
||||||
print('Running all routines to create final DMG')
|
|
||||||
|
|
||||||
writable_dmg_filepath = get_writable_dmg_filepath(dmg_filepath)
|
|
||||||
mount_directory = get_mount_directory_for_volume_name(volume_name)
|
|
||||||
|
|
||||||
# Make sure volume is not mounted.
|
|
||||||
# If it is mounted it will prevent removing old DMG files and could make
|
|
||||||
# it so app bundles are copied to the wrong place.
|
|
||||||
eject_volume(volume_name)
|
|
||||||
|
|
||||||
create_dmg_image(app_bundles, writable_dmg_filepath, volume_name)
|
|
||||||
|
|
||||||
mount_readwrite_dmg(writable_dmg_filepath)
|
|
||||||
|
|
||||||
# Run codesign first, prior to copying amything else.
|
|
||||||
#
|
|
||||||
# This allows to recurs into the content of bundles without worrying about
|
|
||||||
# possible interfereice of Application symlink.
|
|
||||||
if codesign:
|
|
||||||
codesign_app_bundles_in_dmg(mount_directory)
|
|
||||||
|
|
||||||
copy_background_if_needed(background_image_filepath, mount_directory)
|
|
||||||
create_applications_link(mount_directory)
|
|
||||||
run_applescript(applescript, volume_name, app_bundles,
|
|
||||||
background_image_filepath)
|
|
||||||
|
|
||||||
print('Ejecting read-write DMG image...')
|
|
||||||
eject_volume(volume_name)
|
|
||||||
|
|
||||||
compress_dmg(writable_dmg_filepath, dmg_filepath)
|
|
||||||
writable_dmg_filepath.unlink()
|
|
||||||
|
|
||||||
if codesign:
|
|
||||||
codesign_and_notarize_dmg(dmg_filepath)
|
|
||||||
|
|
||||||
|
|
||||||
def ensure_dmg_extension(filepath: Path) -> Path:
|
|
||||||
"""
|
|
||||||
Make sure given file have .dmg extension
|
|
||||||
"""
|
|
||||||
|
|
||||||
if filepath.suffix != '.dmg':
|
|
||||||
return filepath.with_suffix(f'{filepath.suffix}.dmg')
|
|
||||||
return filepath
|
|
||||||
|
|
||||||
|
|
||||||
def get_dmg_filepath(requested_name: Path, app_bundles: List[Path]) -> Path:
|
|
||||||
"""
|
|
||||||
Get full file path for the final DMG image
|
|
||||||
|
|
||||||
Will use the provided one when possible, otherwise will deduct it from
|
|
||||||
app bundles.
|
|
||||||
|
|
||||||
If the name is deducted, the DMG is stored in the current directory.
|
|
||||||
"""
|
|
||||||
|
|
||||||
if requested_name:
|
|
||||||
return ensure_dmg_extension(requested_name.absolute())
|
|
||||||
|
|
||||||
# TODO(sergey): This is not necessarily the main one.
|
|
||||||
main_bundle = app_bundles[0]
|
|
||||||
# Strip .app from the name
|
|
||||||
return Path(main_bundle.name[:-4] + '.dmg').absolute()
|
|
||||||
|
|
||||||
|
|
||||||
def get_background_image(requested_background_image: Path) -> Path:
|
|
||||||
"""
|
|
||||||
Get effective filepath for the background image
|
|
||||||
"""
|
|
||||||
|
|
||||||
if requested_background_image:
|
|
||||||
return requested_background_image.absolute()
|
|
||||||
|
|
||||||
return DARWIN_DIRECTORY / 'background.tif'
|
|
||||||
|
|
||||||
|
|
||||||
def get_applescript(requested_applescript: Path) -> Path:
|
|
||||||
"""
|
|
||||||
Get effective filepath for the applescript
|
|
||||||
"""
|
|
||||||
|
|
||||||
if requested_applescript:
|
|
||||||
return requested_applescript.absolute()
|
|
||||||
|
|
||||||
return DARWIN_DIRECTORY / 'blender.applescript'
|
|
||||||
|
|
||||||
|
|
||||||
def get_volume_name_from_dmg_filepath(dmg_filepath: Path) -> str:
|
|
||||||
"""
|
|
||||||
Deduct volume name from the DMG path
|
|
||||||
|
|
||||||
Will use first part of the DMG file name prior to dash.
|
|
||||||
"""
|
|
||||||
|
|
||||||
tokens = dmg_filepath.stem.split('-')
|
|
||||||
words = tokens[0].split()
|
|
||||||
|
|
||||||
return ' '.join(word.capitalize() for word in words)
|
|
||||||
|
|
||||||
|
|
||||||
def get_volume_name(requested_volume_name: str,
|
|
||||||
dmg_filepath: Path) -> str:
|
|
||||||
"""
|
|
||||||
Get effective name for DMG volume
|
|
||||||
"""
|
|
||||||
|
|
||||||
if requested_volume_name:
|
|
||||||
return requested_volume_name
|
|
||||||
|
|
||||||
return get_volume_name_from_dmg_filepath(dmg_filepath)
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
parser = create_argument_parser()
|
|
||||||
args = parser.parse_args()
|
|
||||||
|
|
||||||
# Get normalized input parameters.
|
|
||||||
source_dir = args.source_dir.absolute()
|
|
||||||
background_image_filepath = get_background_image(args.background_image)
|
|
||||||
applescript = get_applescript(args.applescript)
|
|
||||||
codesign = args.codesign
|
|
||||||
|
|
||||||
app_bundles = collect_and_log_app_bundles(source_dir)
|
|
||||||
if not app_bundles:
|
|
||||||
return
|
|
||||||
|
|
||||||
dmg_filepath = get_dmg_filepath(args.dmg, app_bundles)
|
|
||||||
volume_name = get_volume_name(args.volume_name, dmg_filepath)
|
|
||||||
|
|
||||||
print(f'Will produce DMG "{dmg_filepath.name}" (without quotes)')
|
|
||||||
|
|
||||||
create_final_dmg(app_bundles,
|
|
||||||
dmg_filepath,
|
|
||||||
background_image_filepath,
|
|
||||||
volume_name,
|
|
||||||
applescript,
|
|
||||||
codesign)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
@@ -1,44 +0,0 @@
|
|||||||
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
|
||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
#
|
|
||||||
# ##### END GPL LICENSE BLOCK #####
|
|
||||||
|
|
||||||
# This is a script which is used as POST-INSTALL one for regular CMake's
|
|
||||||
# INSTALL target.
|
|
||||||
# It is used by buildbot workers to sign every binary which is going into
|
|
||||||
# the final buundle.
|
|
||||||
|
|
||||||
# On Windows Python 3 there only is python.exe, no python3.exe.
|
|
||||||
#
|
|
||||||
# On other platforms it is possible to have python2 and python3, and a
|
|
||||||
# symbolic link to python to either of them. So on those platforms use
|
|
||||||
# an explicit Python version.
|
|
||||||
if(WIN32)
|
|
||||||
set(PYTHON_EXECUTABLE python)
|
|
||||||
else()
|
|
||||||
set(PYTHON_EXECUTABLE python3)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
execute_process(
|
|
||||||
COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_LIST_DIR}/worker_codesign.py"
|
|
||||||
"${CMAKE_INSTALL_PREFIX}"
|
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
|
|
||||||
RESULT_VARIABLE exit_code
|
|
||||||
)
|
|
||||||
|
|
||||||
if(NOT exit_code EQUAL "0")
|
|
||||||
message(FATAL_ERROR "Non-zero exit code of codesign tool")
|
|
||||||
endif()
|
|
@@ -1,74 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
|
||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
#
|
|
||||||
# ##### END GPL LICENSE BLOCK #####
|
|
||||||
|
|
||||||
# Helper script which takes care of signing provided location.
|
|
||||||
#
|
|
||||||
# The location can either be a directory (in which case all eligible binaries
|
|
||||||
# will be signed) or a single file (in which case a single file will be signed).
|
|
||||||
#
|
|
||||||
# This script takes care of all the complexity of communicating between process
|
|
||||||
# which requests file to be signed and the code signing server.
|
|
||||||
#
|
|
||||||
# NOTE: Signing happens in-place.
|
|
||||||
|
|
||||||
import argparse
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
from codesign.simple_code_signer import SimpleCodeSigner
|
|
||||||
|
|
||||||
|
|
||||||
def create_argument_parser():
|
|
||||||
parser = argparse.ArgumentParser()
|
|
||||||
parser.add_argument('path_to_sign', type=Path)
|
|
||||||
return parser
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
parser = create_argument_parser()
|
|
||||||
args = parser.parse_args()
|
|
||||||
path_to_sign = args.path_to_sign.absolute()
|
|
||||||
|
|
||||||
if sys.platform == 'win32':
|
|
||||||
# When WIX packed is used to generate .msi on Windows the CPack will
|
|
||||||
# install two different projects and install them to different
|
|
||||||
# installation prefix:
|
|
||||||
#
|
|
||||||
# - C:\b\build\_CPack_Packages\WIX\Blender
|
|
||||||
# - C:\b\build\_CPack_Packages\WIX\Unspecified
|
|
||||||
#
|
|
||||||
# Annoying part is: CMake's post-install script will only be run
|
|
||||||
# once, with the install prefix which corresponds to a project which
|
|
||||||
# was installed last. But we want to sign binaries from all projects.
|
|
||||||
# So in order to do so we detect that we are running for a CPack's
|
|
||||||
# project used for WIX and force parent directory (which includes both
|
|
||||||
# projects) to be signed.
|
|
||||||
#
|
|
||||||
# Here we force both projects to be signed.
|
|
||||||
if path_to_sign.name == 'Unspecified' and 'WIX' in str(path_to_sign):
|
|
||||||
path_to_sign = path_to_sign.parent
|
|
||||||
|
|
||||||
code_signer = SimpleCodeSigner()
|
|
||||||
code_signer.sign_file_or_directory(path_to_sign)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
@@ -1,135 +0,0 @@
|
|||||||
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
|
||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
#
|
|
||||||
# ##### END GPL LICENSE BLOCK #####
|
|
||||||
|
|
||||||
# <pep8 compliant>
|
|
||||||
|
|
||||||
import os
|
|
||||||
import shutil
|
|
||||||
|
|
||||||
import buildbot_utils
|
|
||||||
|
|
||||||
|
|
||||||
def get_cmake_options(builder):
|
|
||||||
codesign_script = os.path.join(
|
|
||||||
builder.blender_dir, 'build_files', 'buildbot', 'worker_codesign.cmake')
|
|
||||||
|
|
||||||
config_file = "build_files/cmake/config/blender_release.cmake"
|
|
||||||
options = ['-DCMAKE_BUILD_TYPE:STRING=Release',
|
|
||||||
'-DWITH_GTESTS=ON']
|
|
||||||
|
|
||||||
if builder.platform == 'mac':
|
|
||||||
options.append('-DCMAKE_OSX_ARCHITECTURES:STRING=x86_64')
|
|
||||||
options.append('-DCMAKE_OSX_DEPLOYMENT_TARGET=10.9')
|
|
||||||
elif builder.platform == 'win':
|
|
||||||
options.extend(['-G', 'Visual Studio 16 2019', '-A', 'x64'])
|
|
||||||
if builder.codesign:
|
|
||||||
options.extend(['-DPOSTINSTALL_SCRIPT:PATH=' + codesign_script])
|
|
||||||
elif builder.platform == 'linux':
|
|
||||||
config_file = "build_files/buildbot/config/blender_linux.cmake"
|
|
||||||
|
|
||||||
optix_sdk_dir = os.path.join(builder.blender_dir, '..', '..', 'NVIDIA-Optix-SDK-7.1')
|
|
||||||
options.append('-DOPTIX_ROOT_DIR:PATH=' + optix_sdk_dir)
|
|
||||||
|
|
||||||
# Workaround to build sm_30 kernels with CUDA 10, since CUDA 11 no longer supports that architecture
|
|
||||||
if builder.platform == 'win':
|
|
||||||
options.append('-DCUDA10_TOOLKIT_ROOT_DIR:PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1')
|
|
||||||
options.append('-DCUDA10_NVCC_EXECUTABLE:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1/bin/nvcc.exe')
|
|
||||||
options.append('-DCUDA11_TOOLKIT_ROOT_DIR:PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.1')
|
|
||||||
options.append('-DCUDA11_NVCC_EXECUTABLE:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.1/bin/nvcc.exe')
|
|
||||||
elif builder.platform == 'linux':
|
|
||||||
options.append('-DCUDA10_TOOLKIT_ROOT_DIR:PATH=/usr/local/cuda-10.1')
|
|
||||||
options.append('-DCUDA10_NVCC_EXECUTABLE:FILEPATH=/usr/local/cuda-10.1/bin/nvcc')
|
|
||||||
options.append('-DCUDA11_TOOLKIT_ROOT_DIR:PATH=/usr/local/cuda-11.1')
|
|
||||||
options.append('-DCUDA11_NVCC_EXECUTABLE:FILEPATH=/usr/local/cuda-11.1/bin/nvcc')
|
|
||||||
|
|
||||||
options.append("-C" + os.path.join(builder.blender_dir, config_file))
|
|
||||||
options.append("-DCMAKE_INSTALL_PREFIX=%s" % (builder.install_dir))
|
|
||||||
|
|
||||||
return options
|
|
||||||
|
|
||||||
|
|
||||||
def update_git(builder):
|
|
||||||
# Do extra git fetch because not all platform/git/buildbot combinations
|
|
||||||
# update the origin remote, causing buildinfo to detect local changes.
|
|
||||||
os.chdir(builder.blender_dir)
|
|
||||||
|
|
||||||
print("Fetching remotes")
|
|
||||||
command = ['git', 'fetch', '--all']
|
|
||||||
buildbot_utils.call(builder.command_prefix + command)
|
|
||||||
|
|
||||||
|
|
||||||
def clean_directories(builder):
|
|
||||||
# Make sure no garbage remained from the previous run
|
|
||||||
if os.path.isdir(builder.install_dir):
|
|
||||||
shutil.rmtree(builder.install_dir)
|
|
||||||
|
|
||||||
# Make sure build directory exists and enter it
|
|
||||||
os.makedirs(builder.build_dir, exist_ok=True)
|
|
||||||
|
|
||||||
# Remove buildinfo files to force buildbot to re-generate them.
|
|
||||||
for buildinfo in ('buildinfo.h', 'buildinfo.h.txt', ):
|
|
||||||
full_path = os.path.join(builder.build_dir, 'source', 'creator', buildinfo)
|
|
||||||
if os.path.exists(full_path):
|
|
||||||
print("Removing {}" . format(buildinfo))
|
|
||||||
os.remove(full_path)
|
|
||||||
|
|
||||||
|
|
||||||
def cmake_configure(builder):
|
|
||||||
# CMake configuration
|
|
||||||
os.chdir(builder.build_dir)
|
|
||||||
|
|
||||||
cmake_cache = os.path.join(builder.build_dir, 'CMakeCache.txt')
|
|
||||||
if os.path.exists(cmake_cache):
|
|
||||||
print("Removing CMake cache")
|
|
||||||
os.remove(cmake_cache)
|
|
||||||
|
|
||||||
print("CMake configure:")
|
|
||||||
cmake_options = get_cmake_options(builder)
|
|
||||||
command = ['cmake', builder.blender_dir] + cmake_options
|
|
||||||
buildbot_utils.call(builder.command_prefix + command)
|
|
||||||
|
|
||||||
|
|
||||||
def cmake_build(builder):
|
|
||||||
# CMake build
|
|
||||||
os.chdir(builder.build_dir)
|
|
||||||
|
|
||||||
# NOTE: CPack will build an INSTALL target, which would mean that code
|
|
||||||
# signing will happen twice when using `make install` and CPack.
|
|
||||||
# The tricky bit here is that it is not possible to know whether INSTALL
|
|
||||||
# target is used by CPack or by a buildbot itaself. Extra level on top of
|
|
||||||
# this is that on Windows it is required to build INSTALL target in order
|
|
||||||
# to have unit test binaries to run.
|
|
||||||
# So on the one hand we do an extra unneeded code sign on Windows, but on
|
|
||||||
# a positive side we don't add complexity and don't make build process more
|
|
||||||
# fragile trying to avoid this. The signing process is way faster than just
|
|
||||||
# a clean build of buildbot, especially with regression tests enabled.
|
|
||||||
if builder.platform == 'win':
|
|
||||||
command = ['cmake', '--build', '.', '--target', 'install', '--config', 'Release']
|
|
||||||
else:
|
|
||||||
command = ['make', '-s', '-j16', 'install']
|
|
||||||
|
|
||||||
print("CMake build:")
|
|
||||||
buildbot_utils.call(builder.command_prefix + command)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
builder = buildbot_utils.create_builder_from_arguments()
|
|
||||||
update_git(builder)
|
|
||||||
clean_directories(builder)
|
|
||||||
cmake_configure(builder)
|
|
||||||
cmake_build(builder)
|
|
@@ -1,208 +0,0 @@
|
|||||||
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
|
||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
#
|
|
||||||
# ##### END GPL LICENSE BLOCK #####
|
|
||||||
|
|
||||||
# <pep8 compliant>
|
|
||||||
|
|
||||||
# Runs on buildbot worker, creating a release package using the build
|
|
||||||
# system and zipping it into buildbot_upload.zip. This is then uploaded
|
|
||||||
# to the master in the next buildbot step.
|
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
import buildbot_utils
|
|
||||||
|
|
||||||
|
|
||||||
def get_package_name(builder, platform=None):
|
|
||||||
info = buildbot_utils.VersionInfo(builder)
|
|
||||||
|
|
||||||
package_name = 'blender-' + info.full_version
|
|
||||||
if platform:
|
|
||||||
package_name += '-' + platform
|
|
||||||
if not (builder.branch == 'master' or builder.is_release_branch):
|
|
||||||
if info.is_development_build:
|
|
||||||
package_name = builder.branch + "-" + package_name
|
|
||||||
|
|
||||||
return package_name
|
|
||||||
|
|
||||||
|
|
||||||
def sign_file_or_directory(path):
|
|
||||||
from codesign.simple_code_signer import SimpleCodeSigner
|
|
||||||
code_signer = SimpleCodeSigner()
|
|
||||||
code_signer.sign_file_or_directory(Path(path))
|
|
||||||
|
|
||||||
|
|
||||||
def create_buildbot_upload_zip(builder, package_files):
|
|
||||||
import zipfile
|
|
||||||
|
|
||||||
buildbot_upload_zip = os.path.join(builder.upload_dir, "buildbot_upload.zip")
|
|
||||||
if os.path.exists(buildbot_upload_zip):
|
|
||||||
os.remove(buildbot_upload_zip)
|
|
||||||
|
|
||||||
try:
|
|
||||||
z = zipfile.ZipFile(buildbot_upload_zip, "w", compression=zipfile.ZIP_STORED)
|
|
||||||
for filepath, filename in package_files:
|
|
||||||
print("Packaged", filename)
|
|
||||||
z.write(filepath, arcname=filename)
|
|
||||||
z.close()
|
|
||||||
except Exception as ex:
|
|
||||||
sys.stderr.write('Create buildbot_upload.zip failed: ' + str(ex) + '\n')
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
|
|
||||||
def create_tar_xz(src, dest, package_name):
|
|
||||||
# One extra to remove leading os.sep when cleaning root for package_root
|
|
||||||
ln = len(src) + 1
|
|
||||||
flist = list()
|
|
||||||
|
|
||||||
# Create list of tuples containing file and archive name
|
|
||||||
for root, dirs, files in os.walk(src):
|
|
||||||
package_root = os.path.join(package_name, root[ln:])
|
|
||||||
flist.extend([(os.path.join(root, file), os.path.join(package_root, file)) for file in files])
|
|
||||||
|
|
||||||
import tarfile
|
|
||||||
|
|
||||||
# Set UID/GID of archived files to 0, otherwise they'd be owned by whatever
|
|
||||||
# user compiled the package. If root then unpacks it to /usr/local/ you get
|
|
||||||
# a security issue.
|
|
||||||
def _fakeroot(tarinfo):
|
|
||||||
tarinfo.gid = 0
|
|
||||||
tarinfo.gname = "root"
|
|
||||||
tarinfo.uid = 0
|
|
||||||
tarinfo.uname = "root"
|
|
||||||
return tarinfo
|
|
||||||
|
|
||||||
package = tarfile.open(dest, 'w:xz', preset=9)
|
|
||||||
for entry in flist:
|
|
||||||
package.add(entry[0], entry[1], recursive=False, filter=_fakeroot)
|
|
||||||
package.close()
|
|
||||||
|
|
||||||
|
|
||||||
def cleanup_files(dirpath, extension):
|
|
||||||
for f in os.listdir(dirpath):
|
|
||||||
filepath = os.path.join(dirpath, f)
|
|
||||||
if os.path.isfile(filepath) and f.endswith(extension):
|
|
||||||
os.remove(filepath)
|
|
||||||
|
|
||||||
|
|
||||||
def pack_mac(builder):
|
|
||||||
info = buildbot_utils.VersionInfo(builder)
|
|
||||||
|
|
||||||
os.chdir(builder.build_dir)
|
|
||||||
cleanup_files(builder.build_dir, '.dmg')
|
|
||||||
|
|
||||||
package_name = get_package_name(builder, 'macOS')
|
|
||||||
package_filename = package_name + '.dmg'
|
|
||||||
package_filepath = os.path.join(builder.build_dir, package_filename)
|
|
||||||
|
|
||||||
release_dir = os.path.join(builder.blender_dir, 'release', 'darwin')
|
|
||||||
buildbot_dir = os.path.join(builder.blender_dir, 'build_files', 'buildbot')
|
|
||||||
bundle_script = os.path.join(buildbot_dir, 'worker_bundle_dmg.py')
|
|
||||||
|
|
||||||
command = [bundle_script]
|
|
||||||
command += ['--dmg', package_filepath]
|
|
||||||
if info.is_development_build:
|
|
||||||
background_image = os.path.join(release_dir, 'buildbot', 'background.tif')
|
|
||||||
command += ['--background-image', background_image]
|
|
||||||
if builder.codesign:
|
|
||||||
command += ['--codesign']
|
|
||||||
command += [builder.install_dir]
|
|
||||||
buildbot_utils.call(command)
|
|
||||||
|
|
||||||
create_buildbot_upload_zip(builder, [(package_filepath, package_filename)])
|
|
||||||
|
|
||||||
|
|
||||||
def pack_win(builder):
|
|
||||||
info = buildbot_utils.VersionInfo(builder)
|
|
||||||
|
|
||||||
os.chdir(builder.build_dir)
|
|
||||||
cleanup_files(builder.build_dir, '.zip')
|
|
||||||
|
|
||||||
# CPack will add the platform name
|
|
||||||
cpack_name = get_package_name(builder, None)
|
|
||||||
package_name = get_package_name(builder, 'windows' + str(builder.bits))
|
|
||||||
|
|
||||||
command = ['cmake', '-DCPACK_OVERRIDE_PACKAGENAME:STRING=' + cpack_name, '.']
|
|
||||||
buildbot_utils.call(builder.command_prefix + command)
|
|
||||||
command = ['cpack', '-G', 'ZIP']
|
|
||||||
buildbot_utils.call(builder.command_prefix + command)
|
|
||||||
|
|
||||||
package_filename = package_name + '.zip'
|
|
||||||
package_filepath = os.path.join(builder.build_dir, package_filename)
|
|
||||||
package_files = [(package_filepath, package_filename)]
|
|
||||||
|
|
||||||
if info.version_cycle == 'release':
|
|
||||||
# Installer only for final release builds, otherwise will get
|
|
||||||
# 'this product is already installed' messages.
|
|
||||||
command = ['cpack', '-G', 'WIX']
|
|
||||||
buildbot_utils.call(builder.command_prefix + command)
|
|
||||||
|
|
||||||
package_filename = package_name + '.msi'
|
|
||||||
package_filepath = os.path.join(builder.build_dir, package_filename)
|
|
||||||
if builder.codesign:
|
|
||||||
sign_file_or_directory(package_filepath)
|
|
||||||
|
|
||||||
package_files += [(package_filepath, package_filename)]
|
|
||||||
|
|
||||||
create_buildbot_upload_zip(builder, package_files)
|
|
||||||
|
|
||||||
|
|
||||||
def pack_linux(builder):
|
|
||||||
blender_executable = os.path.join(builder.install_dir, 'blender')
|
|
||||||
|
|
||||||
info = buildbot_utils.VersionInfo(builder)
|
|
||||||
|
|
||||||
# Strip all unused symbols from the binaries
|
|
||||||
print("Stripping binaries...")
|
|
||||||
buildbot_utils.call(builder.command_prefix + ['strip', '--strip-all', blender_executable])
|
|
||||||
|
|
||||||
print("Stripping python...")
|
|
||||||
py_target = os.path.join(builder.install_dir, info.short_version)
|
|
||||||
buildbot_utils.call(
|
|
||||||
builder.command_prefix + [
|
|
||||||
'find', py_target, '-iname', '*.so', '-exec', 'strip', '-s', '{}', ';',
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
# Construct package name
|
|
||||||
platform_name = 'linux64'
|
|
||||||
package_name = get_package_name(builder, platform_name)
|
|
||||||
package_filename = package_name + ".tar.xz"
|
|
||||||
|
|
||||||
print("Creating .tar.xz archive")
|
|
||||||
package_filepath = builder.install_dir + '.tar.xz'
|
|
||||||
create_tar_xz(builder.install_dir, package_filepath, package_name)
|
|
||||||
|
|
||||||
# Create buildbot_upload.zip
|
|
||||||
create_buildbot_upload_zip(builder, [(package_filepath, package_filename)])
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
builder = buildbot_utils.create_builder_from_arguments()
|
|
||||||
|
|
||||||
# Make sure install directory always exists
|
|
||||||
os.makedirs(builder.install_dir, exist_ok=True)
|
|
||||||
|
|
||||||
if builder.platform == 'mac':
|
|
||||||
pack_mac(builder)
|
|
||||||
elif builder.platform == 'win':
|
|
||||||
pack_win(builder)
|
|
||||||
elif builder.platform == 'linux':
|
|
||||||
pack_linux(builder)
|
|
@@ -1,42 +0,0 @@
|
|||||||
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
|
||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
#
|
|
||||||
# ##### END GPL LICENSE BLOCK #####
|
|
||||||
|
|
||||||
# <pep8 compliant>
|
|
||||||
|
|
||||||
import buildbot_utils
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
|
|
||||||
|
|
||||||
def get_ctest_arguments(builder):
|
|
||||||
args = ['--output-on-failure']
|
|
||||||
if builder.platform == 'win':
|
|
||||||
args += ['-C', 'Release']
|
|
||||||
return args
|
|
||||||
|
|
||||||
|
|
||||||
def test(builder):
|
|
||||||
os.chdir(builder.build_dir)
|
|
||||||
|
|
||||||
command = builder.command_prefix + ['ctest'] + get_ctest_arguments(builder)
|
|
||||||
buildbot_utils.call(command)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
builder = buildbot_utils.create_builder_from_arguments()
|
|
||||||
test(builder)
|
|
@@ -1,31 +0,0 @@
|
|||||||
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
|
||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
#
|
|
||||||
# ##### END GPL LICENSE BLOCK #####
|
|
||||||
|
|
||||||
# <pep8 compliant>
|
|
||||||
|
|
||||||
import buildbot_utils
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
builder = buildbot_utils.create_builder_from_arguments()
|
|
||||||
os.chdir(builder.blender_dir)
|
|
||||||
|
|
||||||
# Run make update which handles all libraries and submodules.
|
|
||||||
make_update = os.path.join(builder.blender_dir, "build_files", "utils", "make_update.py")
|
|
||||||
buildbot_utils.call([sys.executable, make_update, '--no-blender', "--use-tests", "--use-centos-libraries"])
|
|
@@ -20,8 +20,24 @@ if(NOT CLANG_ROOT_DIR AND NOT $ENV{CLANG_ROOT_DIR} STREQUAL "")
|
|||||||
set(CLANG_ROOT_DIR $ENV{CLANG_ROOT_DIR})
|
set(CLANG_ROOT_DIR $ENV{CLANG_ROOT_DIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(NOT LLVM_ROOT_DIR)
|
||||||
|
if(DEFINED LLVM_VERSION)
|
||||||
|
message(running llvm-config-${LLVM_VERSION})
|
||||||
|
find_program(LLVM_CONFIG llvm-config-${LLVM_VERSION})
|
||||||
|
endif()
|
||||||
|
if(NOT LLVM_CONFIG)
|
||||||
|
find_program(LLVM_CONFIG llvm-config)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
execute_process(COMMAND ${LLVM_CONFIG} --prefix
|
||||||
|
OUTPUT_VARIABLE LLVM_ROOT_DIR
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
set(LLVM_ROOT_DIR ${LLVM_ROOT_DIR} CACHE PATH "Path to the LLVM installation")
|
||||||
|
endif()
|
||||||
|
|
||||||
set(_CLANG_SEARCH_DIRS
|
set(_CLANG_SEARCH_DIRS
|
||||||
${CLANG_ROOT_DIR}
|
${CLANG_ROOT_DIR}
|
||||||
|
${LLVM_ROOT_DIR}
|
||||||
/opt/lib/clang
|
/opt/lib/clang
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -472,8 +472,7 @@ if(NOT GFLAGS_FOUND)
|
|||||||
gflags_report_not_found(
|
gflags_report_not_found(
|
||||||
"Could not find gflags include directory, set GFLAGS_INCLUDE_DIR "
|
"Could not find gflags include directory, set GFLAGS_INCLUDE_DIR "
|
||||||
"to directory containing gflags/gflags.h")
|
"to directory containing gflags/gflags.h")
|
||||||
endif(NOT GFLAGS_INCLUDE_DIR OR
|
endif()
|
||||||
NOT EXISTS ${GFLAGS_INCLUDE_DIR})
|
|
||||||
|
|
||||||
find_library(GFLAGS_LIBRARY NAMES gflags
|
find_library(GFLAGS_LIBRARY NAMES gflags
|
||||||
PATHS ${GFLAGS_LIBRARY_DIR_HINTS}
|
PATHS ${GFLAGS_LIBRARY_DIR_HINTS}
|
||||||
@@ -484,8 +483,7 @@ if(NOT GFLAGS_FOUND)
|
|||||||
gflags_report_not_found(
|
gflags_report_not_found(
|
||||||
"Could not find gflags library, set GFLAGS_LIBRARY "
|
"Could not find gflags library, set GFLAGS_LIBRARY "
|
||||||
"to full path to libgflags.")
|
"to full path to libgflags.")
|
||||||
endif(NOT GFLAGS_LIBRARY OR
|
endif()
|
||||||
NOT EXISTS ${GFLAGS_LIBRARY})
|
|
||||||
|
|
||||||
# gflags typically requires a threading library (which is OS dependent), note
|
# gflags typically requires a threading library (which is OS dependent), note
|
||||||
# that this defines the CMAKE_THREAD_LIBS_INIT variable. If we are able to
|
# that this defines the CMAKE_THREAD_LIBS_INIT variable. If we are able to
|
||||||
@@ -560,8 +558,7 @@ if(NOT GFLAGS_FOUND)
|
|||||||
gflags_report_not_found(
|
gflags_report_not_found(
|
||||||
"Caller defined GFLAGS_INCLUDE_DIR:"
|
"Caller defined GFLAGS_INCLUDE_DIR:"
|
||||||
" ${GFLAGS_INCLUDE_DIR} does not contain gflags/gflags.h header.")
|
" ${GFLAGS_INCLUDE_DIR} does not contain gflags/gflags.h header.")
|
||||||
endif(GFLAGS_INCLUDE_DIR AND
|
endif()
|
||||||
NOT EXISTS ${GFLAGS_INCLUDE_DIR}/gflags/gflags.h)
|
|
||||||
# TODO: This regex for gflags library is pretty primitive, we use lowercase
|
# TODO: This regex for gflags library is pretty primitive, we use lowercase
|
||||||
# for comparison to handle Windows using CamelCase library names, could
|
# for comparison to handle Windows using CamelCase library names, could
|
||||||
# this check be better?
|
# this check be better?
|
||||||
@@ -571,8 +568,7 @@ if(NOT GFLAGS_FOUND)
|
|||||||
gflags_report_not_found(
|
gflags_report_not_found(
|
||||||
"Caller defined GFLAGS_LIBRARY: "
|
"Caller defined GFLAGS_LIBRARY: "
|
||||||
"${GFLAGS_LIBRARY} does not match gflags.")
|
"${GFLAGS_LIBRARY} does not match gflags.")
|
||||||
endif(GFLAGS_LIBRARY AND
|
endif()
|
||||||
NOT "${LOWERCASE_GFLAGS_LIBRARY}" MATCHES ".*gflags[^/]*")
|
|
||||||
|
|
||||||
gflags_reset_find_library_prefix()
|
gflags_reset_find_library_prefix()
|
||||||
|
|
||||||
|
@@ -40,7 +40,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(NanoVDB DEFAULT_MSG
|
|||||||
|
|
||||||
IF(NANOVDB_FOUND)
|
IF(NANOVDB_FOUND)
|
||||||
SET(NANOVDB_INCLUDE_DIRS ${NANOVDB_INCLUDE_DIR})
|
SET(NANOVDB_INCLUDE_DIRS ${NANOVDB_INCLUDE_DIR})
|
||||||
ENDIF(NANOVDB_FOUND)
|
ENDIF()
|
||||||
|
|
||||||
MARK_AS_ADVANCED(
|
MARK_AS_ADVANCED(
|
||||||
NANOVDB_INCLUDE_DIR
|
NANOVDB_INCLUDE_DIR
|
||||||
|
@@ -46,7 +46,7 @@ SET(_opencollada_FIND_COMPONENTS
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Fedora openCOLLADA package links these statically
|
# Fedora openCOLLADA package links these statically
|
||||||
# note that order is important here ot it wont link
|
# note that order is important here or it won't link
|
||||||
SET(_opencollada_FIND_STATIC_COMPONENTS
|
SET(_opencollada_FIND_STATIC_COMPONENTS
|
||||||
buffer
|
buffer
|
||||||
ftoa
|
ftoa
|
||||||
|
@@ -44,7 +44,7 @@ SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic" CACHE STRING "Linker flags for p
|
|||||||
MARK_AS_ADVANCED(PYTHON_LINKFLAGS)
|
MARK_AS_ADVANCED(PYTHON_LINKFLAGS)
|
||||||
|
|
||||||
|
|
||||||
# if the user passes these defines as args, we dont want to overwrite
|
# if the user passes these defines as args, we don't want to overwrite
|
||||||
SET(_IS_INC_DEF OFF)
|
SET(_IS_INC_DEF OFF)
|
||||||
SET(_IS_INC_CONF_DEF OFF)
|
SET(_IS_INC_CONF_DEF OFF)
|
||||||
SET(_IS_LIB_DEF OFF)
|
SET(_IS_LIB_DEF OFF)
|
||||||
@@ -143,7 +143,7 @@ IF((NOT _IS_INC_DEF) OR (NOT _IS_INC_CONF_DEF) OR (NOT _IS_LIB_DEF) OR (NOT _IS_
|
|||||||
SET(_PYTHON_ABI_FLAGS "${_CURRENT_ABI_FLAGS}")
|
SET(_PYTHON_ABI_FLAGS "${_CURRENT_ABI_FLAGS}")
|
||||||
break()
|
break()
|
||||||
ELSE()
|
ELSE()
|
||||||
# ensure we dont find values from 2 different ABI versions
|
# ensure we don't find values from 2 different ABI versions
|
||||||
IF(NOT _IS_INC_DEF)
|
IF(NOT _IS_INC_DEF)
|
||||||
UNSET(PYTHON_INCLUDE_DIR CACHE)
|
UNSET(PYTHON_INCLUDE_DIR CACHE)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
@@ -40,7 +40,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(sse2neon DEFAULT_MSG
|
|||||||
|
|
||||||
IF(SSE2NEON_FOUND)
|
IF(SSE2NEON_FOUND)
|
||||||
SET(SSE2NEON_INCLUDE_DIRS ${SSE2NEON_INCLUDE_DIR})
|
SET(SSE2NEON_INCLUDE_DIRS ${SSE2NEON_INCLUDE_DIR})
|
||||||
ENDIF(SSE2NEON_FOUND)
|
ENDIF()
|
||||||
|
|
||||||
MARK_AS_ADVANCED(
|
MARK_AS_ADVANCED(
|
||||||
SSE2NEON_INCLUDE_DIR
|
SSE2NEON_INCLUDE_DIR
|
||||||
|
@@ -305,7 +305,7 @@ def file_check_arg_sizes(tu):
|
|||||||
for i, node_child in enumerate(children):
|
for i, node_child in enumerate(children):
|
||||||
children = list(node_child.get_children())
|
children = list(node_child.get_children())
|
||||||
|
|
||||||
# skip if we dont have an index...
|
# skip if we don't have an index...
|
||||||
size_def = args_size_definition.get(i, -1)
|
size_def = args_size_definition.get(i, -1)
|
||||||
|
|
||||||
if size_def == -1:
|
if size_def == -1:
|
||||||
@@ -354,7 +354,7 @@ def file_check_arg_sizes(tu):
|
|||||||
filepath # always the same but useful when running threaded
|
filepath # always the same but useful when running threaded
|
||||||
))
|
))
|
||||||
|
|
||||||
# we dont really care what we are looking at, just scan entire file for
|
# we don't really care what we are looking at, just scan entire file for
|
||||||
# function calls.
|
# function calls.
|
||||||
|
|
||||||
def recursive_func_call_check(node):
|
def recursive_func_call_check(node):
|
||||||
|
@@ -596,14 +596,6 @@ function(SETUP_LIBDIRS)
|
|||||||
link_directories(${GMP_LIBPATH})
|
link_directories(${GMP_LIBPATH})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_GHOST_WAYLAND)
|
|
||||||
link_directories(
|
|
||||||
${wayland-client_LIBRARY_DIRS}
|
|
||||||
${wayland-egl_LIBRARY_DIRS}
|
|
||||||
${xkbcommon_LIBRARY_DIRS}
|
|
||||||
${wayland-cursor_LIBRARY_DIRS})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WIN32 AND NOT UNIX)
|
if(WIN32 AND NOT UNIX)
|
||||||
link_directories(${PTHREADS_LIBPATH})
|
link_directories(${PTHREADS_LIBPATH})
|
||||||
endif()
|
endif()
|
||||||
@@ -702,7 +694,7 @@ macro(message_first_run)
|
|||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
# when we have warnings as errors applied globally this
|
# when we have warnings as errors applied globally this
|
||||||
# needs to be removed for some external libs which we dont maintain.
|
# needs to be removed for some external libs which we don't maintain.
|
||||||
|
|
||||||
# utility macro
|
# utility macro
|
||||||
macro(remove_cc_flag
|
macro(remove_cc_flag
|
||||||
@@ -802,7 +794,7 @@ macro(remove_extra_strict_flags)
|
|||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
# note, we can only append flags on a single file so we need to negate the options.
|
# note, we can only append flags on a single file so we need to negate the options.
|
||||||
# at the moment we cant shut up ffmpeg deprecations, so use this, but will
|
# at the moment we can't shut up ffmpeg deprecations, so use this, but will
|
||||||
# probably add more removals here.
|
# probably add more removals here.
|
||||||
macro(remove_strict_c_flags_file
|
macro(remove_strict_c_flags_file
|
||||||
filenames)
|
filenames)
|
||||||
@@ -971,14 +963,6 @@ macro(blender_project_hack_post)
|
|||||||
unset(_reset_standard_cflags_rel)
|
unset(_reset_standard_cflags_rel)
|
||||||
unset(_reset_standard_cxxflags_rel)
|
unset(_reset_standard_cxxflags_rel)
|
||||||
|
|
||||||
# ------------------------------------------------------------------
|
|
||||||
# workaround for omission in cmake 2.8.4's GNU.cmake, fixed in 2.8.5
|
|
||||||
if(CMAKE_COMPILER_IS_GNUCC)
|
|
||||||
if(NOT DARWIN)
|
|
||||||
set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
# pair of macros to allow libraries to be specify files to install, but to
|
# pair of macros to allow libraries to be specify files to install, but to
|
||||||
|
@@ -388,6 +388,10 @@ endif()
|
|||||||
|
|
||||||
if(WITH_TBB)
|
if(WITH_TBB)
|
||||||
find_package(TBB)
|
find_package(TBB)
|
||||||
|
if(NOT TBB_FOUND)
|
||||||
|
message(WARNING "TBB not found, disabling WITH_TBB")
|
||||||
|
set(WITH_TBB OFF)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_POTRACE)
|
if(WITH_POTRACE)
|
||||||
|
@@ -457,6 +457,10 @@ endif()
|
|||||||
|
|
||||||
if(WITH_TBB)
|
if(WITH_TBB)
|
||||||
find_package_wrapper(TBB)
|
find_package_wrapper(TBB)
|
||||||
|
if(NOT TBB_FOUND)
|
||||||
|
message(WARNING "TBB not found, disabling WITH_TBB")
|
||||||
|
set(WITH_TBB OFF)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_XR_OPENXR)
|
if(WITH_XR_OPENXR)
|
||||||
@@ -575,17 +579,17 @@ if(WITH_GHOST_WAYLAND)
|
|||||||
pkg_check_modules(wayland-scanner REQUIRED wayland-scanner)
|
pkg_check_modules(wayland-scanner REQUIRED wayland-scanner)
|
||||||
pkg_check_modules(xkbcommon REQUIRED xkbcommon)
|
pkg_check_modules(xkbcommon REQUIRED xkbcommon)
|
||||||
pkg_check_modules(wayland-cursor REQUIRED wayland-cursor)
|
pkg_check_modules(wayland-cursor REQUIRED wayland-cursor)
|
||||||
|
pkg_check_modules(dbus REQUIRED dbus-1)
|
||||||
|
|
||||||
set(WITH_GL_EGL ON)
|
set(WITH_GL_EGL ON)
|
||||||
|
|
||||||
if(WITH_GHOST_WAYLAND)
|
list(APPEND PLATFORM_LINKLIBS
|
||||||
list(APPEND PLATFORM_LINKLIBS
|
${wayland-client_LINK_LIBRARIES}
|
||||||
${wayland-client_LIBRARIES}
|
${wayland-egl_LINK_LIBRARIES}
|
||||||
${wayland-egl_LIBRARIES}
|
${xkbcommon_LINK_LIBRARIES}
|
||||||
${xkbcommon_LIBRARIES}
|
${wayland-cursor_LINK_LIBRARIES}
|
||||||
${wayland-cursor_LIBRARIES}
|
${dbus_LINK_LIBRARIES}
|
||||||
)
|
)
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_GHOST_X11)
|
if(WITH_GHOST_X11)
|
||||||
|
@@ -261,8 +261,10 @@ if(NOT DEFINED LIBDIR)
|
|||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "32 bit compiler detected, blender no longer provides pre-build libraries for 32 bit windows, please set the LIBDIR cmake variable to your own library folder")
|
message(FATAL_ERROR "32 bit compiler detected, blender no longer provides pre-build libraries for 32 bit windows, please set the LIBDIR cmake variable to your own library folder")
|
||||||
endif()
|
endif()
|
||||||
# Can be 1910..1912
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.29.30130)
|
||||||
if(MSVC_VERSION GREATER 1919)
|
message(STATUS "Visual Studio 2022 detected.")
|
||||||
|
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc15)
|
||||||
|
elseif(MSVC_VERSION GREATER 1919)
|
||||||
message(STATUS "Visual Studio 2019 detected.")
|
message(STATUS "Visual Studio 2019 detected.")
|
||||||
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc15)
|
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc15)
|
||||||
elseif(MSVC_VERSION GREATER 1909)
|
elseif(MSVC_VERSION GREATER 1909)
|
||||||
@@ -548,7 +550,6 @@ if(WITH_OPENIMAGEIO)
|
|||||||
set(OPENIMAGEIO_LIBRARIES ${OIIO_OPTIMIZED} ${OIIO_DEBUG})
|
set(OPENIMAGEIO_LIBRARIES ${OIIO_OPTIMIZED} ${OIIO_DEBUG})
|
||||||
|
|
||||||
set(OPENIMAGEIO_DEFINITIONS "-DUSE_TBB=0")
|
set(OPENIMAGEIO_DEFINITIONS "-DUSE_TBB=0")
|
||||||
set(OPENCOLORIO_DEFINITIONS "-DDOpenColorIO_SKIP_IMPORTS")
|
|
||||||
set(OPENIMAGEIO_IDIFF "${OPENIMAGEIO}/bin/idiff.exe")
|
set(OPENIMAGEIO_IDIFF "${OPENIMAGEIO}/bin/idiff.exe")
|
||||||
add_definitions(-DOIIO_STATIC_DEFINE)
|
add_definitions(-DOIIO_STATIC_DEFINE)
|
||||||
add_definitions(-DOIIO_NO_SSE=1)
|
add_definitions(-DOIIO_NO_SSE=1)
|
||||||
@@ -594,7 +595,7 @@ if(WITH_OPENCOLORIO)
|
|||||||
debug ${OPENCOLORIO_LIBPATH}/libexpatdMD.lib
|
debug ${OPENCOLORIO_LIBPATH}/libexpatdMD.lib
|
||||||
debug ${OPENCOLORIO_LIBPATH}/pystring_d.lib
|
debug ${OPENCOLORIO_LIBPATH}/pystring_d.lib
|
||||||
)
|
)
|
||||||
set(OPENCOLORIO_DEFINITIONS)
|
set(OPENCOLORIO_DEFINITIONS "-DOpenColorIO_SKIP_IMPORTS")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_OPENVDB)
|
if(WITH_OPENVDB)
|
||||||
@@ -675,10 +676,11 @@ if(WITH_SYSTEM_AUDASPACE)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_TBB)
|
if(WITH_TBB)
|
||||||
set(TBB_LIBRARIES optimized ${LIBDIR}/tbb/lib/tbb.lib debug ${LIBDIR}/tbb/lib/debug/tbb_debug.lib)
|
set(TBB_LIBRARIES optimized ${LIBDIR}/tbb/lib/tbb.lib debug ${LIBDIR}/tbb/lib/tbb_debug.lib)
|
||||||
set(TBB_INCLUDE_DIR ${LIBDIR}/tbb/include)
|
set(TBB_INCLUDE_DIR ${LIBDIR}/tbb/include)
|
||||||
set(TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR})
|
set(TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR})
|
||||||
if(WITH_TBB_MALLOC_PROXY)
|
if(WITH_TBB_MALLOC_PROXY)
|
||||||
|
set(TBB_MALLOC_LIBRARIES optimized ${LIBDIR}/tbb/lib/tbbmalloc.lib debug ${LIBDIR}/tbb/lib/tbbmalloc_debug.lib)
|
||||||
add_definitions(-DWITH_TBB_MALLOC)
|
add_definitions(-DWITH_TBB_MALLOC)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
@@ -15,6 +15,15 @@ if(WITH_WINDOWS_BUNDLE_CRT)
|
|||||||
|
|
||||||
include(InstallRequiredSystemLibraries)
|
include(InstallRequiredSystemLibraries)
|
||||||
|
|
||||||
|
# ucrtbase(d).dll cannot be in the manifest, due to the way windows 10 handles
|
||||||
|
# redirects for this dll, for details see T88813.
|
||||||
|
foreach(lib ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
|
||||||
|
string(FIND ${lib} "ucrtbase" pos)
|
||||||
|
if(NOT pos EQUAL -1)
|
||||||
|
list(REMOVE_ITEM CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${lib})
|
||||||
|
install(FILES ${lib} DESTINATION . COMPONENT Libraries)
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
# Install the CRT to the blender.crt Sub folder.
|
# Install the CRT to the blender.crt Sub folder.
|
||||||
install(FILES ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION ./blender.crt COMPONENT Libraries)
|
install(FILES ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION ./blender.crt COMPONENT Libraries)
|
||||||
|
|
||||||
|
8
build_files/config/README.md
Normal file
8
build_files/config/README.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
Pipeline Config
|
||||||
|
===============
|
||||||
|
|
||||||
|
This configuration file is used by buildbot new pipeline for the `update-code` step.
|
||||||
|
|
||||||
|
It will soon be used by the ../utils/make_update.py script.
|
||||||
|
|
||||||
|
Both buildbot and developers will eventually use the same configuration file.
|
87
build_files/config/pipeline_config.json
Normal file
87
build_files/config/pipeline_config.json
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
{
|
||||||
|
"update-code":
|
||||||
|
{
|
||||||
|
"git" :
|
||||||
|
{
|
||||||
|
"submodules":
|
||||||
|
[
|
||||||
|
{ "path": "release/scripts/addons", "branch": "master", "commit_id": "HEAD" },
|
||||||
|
{ "path": "release/scripts/addons_contrib", "branch": "master", "commit_id": "HEAD" },
|
||||||
|
{ "path": "release/datafiles/locale", "branch": "master", "commit_id": "HEAD" },
|
||||||
|
{ "path": "source/tools", "branch": "master", "commit_id": "HEAD" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"svn":
|
||||||
|
{
|
||||||
|
"tests": { "path": "lib/tests", "branch": "trunk", "commit_id": "HEAD" },
|
||||||
|
"libraries":
|
||||||
|
{
|
||||||
|
"darwin-x86_64": { "path": "lib/darwin", "branch": "trunk", "commit_id": "HEAD" },
|
||||||
|
"darwin-arm64": { "path": "lib/darwin_arm64", "branch": "trunk", "commit_id": "HEAD" },
|
||||||
|
"linux-x86_64": { "path": "lib/linux_centos7_x86_64", "branch": "trunk", "commit_id": "HEAD" },
|
||||||
|
"windows-amd64": { "path": "lib/win64_vc15", "branch": "trunk", "commit_id": "HEAD" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"buildbot":
|
||||||
|
{
|
||||||
|
"gcc":
|
||||||
|
{
|
||||||
|
"version": "9.0"
|
||||||
|
},
|
||||||
|
"sdks":
|
||||||
|
{
|
||||||
|
"optix":
|
||||||
|
{
|
||||||
|
"version": "7.1.0"
|
||||||
|
},
|
||||||
|
"cuda10":
|
||||||
|
{
|
||||||
|
"version": "10.1"
|
||||||
|
},
|
||||||
|
"cuda11":
|
||||||
|
{
|
||||||
|
"version": "11.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"cmake":
|
||||||
|
{
|
||||||
|
"default":
|
||||||
|
{
|
||||||
|
"version": "any",
|
||||||
|
"overrides":
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"darwin-x86_64":
|
||||||
|
{
|
||||||
|
"overrides":
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"darwin-arm64":
|
||||||
|
{
|
||||||
|
"overrides":
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"linux-x86_64":
|
||||||
|
{
|
||||||
|
"overrides":
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"windows-amd64":
|
||||||
|
{
|
||||||
|
"overrides":
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
5
build_files/utils/README.md
Normal file
5
build_files/utils/README.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
Make Utility Scripts
|
||||||
|
====================
|
||||||
|
|
||||||
|
Scripts used only by developers for now
|
||||||
|
|
@@ -6,6 +6,9 @@ if %ERRORLEVEL% EQU 0 goto DetectionComplete
|
|||||||
call "%~dp0\detect_msvc2019.cmd"
|
call "%~dp0\detect_msvc2019.cmd"
|
||||||
if %ERRORLEVEL% EQU 0 goto DetectionComplete
|
if %ERRORLEVEL% EQU 0 goto DetectionComplete
|
||||||
|
|
||||||
|
call "%~dp0\detect_msvc2022.cmd"
|
||||||
|
if %ERRORLEVEL% EQU 0 goto DetectionComplete
|
||||||
|
|
||||||
echo Compiler Detection failed. Use verbose switch for more information.
|
echo Compiler Detection failed. Use verbose switch for more information.
|
||||||
exit /b 1
|
exit /b 1
|
||||||
|
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
if "%BUILD_VS_YEAR%"=="2017" set BUILD_VS_LIBDIRPOST=vc15
|
if "%BUILD_VS_YEAR%"=="2017" set BUILD_VS_LIBDIRPOST=vc15
|
||||||
if "%BUILD_VS_YEAR%"=="2019" set BUILD_VS_LIBDIRPOST=vc15
|
if "%BUILD_VS_YEAR%"=="2019" set BUILD_VS_LIBDIRPOST=vc15
|
||||||
|
if "%BUILD_VS_YEAR%"=="2022" set BUILD_VS_LIBDIRPOST=vc15
|
||||||
|
|
||||||
set BUILD_VS_SVNDIR=win64_%BUILD_VS_LIBDIRPOST%
|
set BUILD_VS_SVNDIR=win64_%BUILD_VS_LIBDIRPOST%
|
||||||
set BUILD_VS_LIBDIR="%BLENDER_DIR%..\lib\%BUILD_VS_SVNDIR%"
|
set BUILD_VS_LIBDIR="%BLENDER_DIR%..\lib\%BUILD_VS_SVNDIR%"
|
||||||
|
@@ -19,10 +19,10 @@ if "%WITH_PYDEBUG%"=="1" (
|
|||||||
set PYDEBUG_CMAKE_ARGS=-DWINDOWS_PYTHON_DEBUG=On
|
set PYDEBUG_CMAKE_ARGS=-DWINDOWS_PYTHON_DEBUG=On
|
||||||
)
|
)
|
||||||
|
|
||||||
if "%BUILD_VS_YEAR%"=="2019" (
|
if "%BUILD_VS_YEAR%"=="2017" (
|
||||||
set BUILD_PLATFORM_SELECT=-A %MSBUILD_PLATFORM%
|
|
||||||
) else (
|
|
||||||
set BUILD_GENERATOR_POST=%WINDOWS_ARCH%
|
set BUILD_GENERATOR_POST=%WINDOWS_ARCH%
|
||||||
|
) else (
|
||||||
|
set BUILD_PLATFORM_SELECT=-A %MSBUILD_PLATFORM%
|
||||||
)
|
)
|
||||||
|
|
||||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Visual Studio %BUILD_VS_VER% %BUILD_VS_YEAR%%BUILD_GENERATOR_POST%" %BUILD_PLATFORM_SELECT% %TESTS_CMAKE_ARGS% %CLANG_CMAKE_ARGS% %ASAN_CMAKE_ARGS% %PYDEBUG_CMAKE_ARGS%
|
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Visual Studio %BUILD_VS_VER% %BUILD_VS_YEAR%%BUILD_GENERATOR_POST%" %BUILD_PLATFORM_SELECT% %TESTS_CMAKE_ARGS% %CLANG_CMAKE_ARGS% %ASAN_CMAKE_ARGS% %PYDEBUG_CMAKE_ARGS%
|
||||||
|
3
build_files/windows/detect_msvc2022.cmd
Normal file
3
build_files/windows/detect_msvc2022.cmd
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
set BUILD_VS_VER=17
|
||||||
|
set BUILD_VS_YEAR=2022
|
||||||
|
call "%~dp0\detect_msvc_vswhere.cmd"
|
@@ -66,6 +66,14 @@ if NOT "%1" == "" (
|
|||||||
) else if "%1" == "2019b" (
|
) else if "%1" == "2019b" (
|
||||||
set BUILD_VS_YEAR=2019
|
set BUILD_VS_YEAR=2019
|
||||||
set VSWHERE_ARGS=-products Microsoft.VisualStudio.Product.BuildTools
|
set VSWHERE_ARGS=-products Microsoft.VisualStudio.Product.BuildTools
|
||||||
|
) else if "%1" == "2022" (
|
||||||
|
set BUILD_VS_YEAR=2022
|
||||||
|
) else if "%1" == "2022pre" (
|
||||||
|
set BUILD_VS_YEAR=2022
|
||||||
|
set VSWHERE_ARGS=-prerelease
|
||||||
|
) else if "%1" == "2022b" (
|
||||||
|
set BUILD_VS_YEAR=2022
|
||||||
|
set VSWHERE_ARGS=-products Microsoft.VisualStudio.Product.BuildTools
|
||||||
) else if "%1" == "packagename" (
|
) else if "%1" == "packagename" (
|
||||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DCPACK_OVERRIDE_PACKAGENAME="%2"
|
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DCPACK_OVERRIDE_PACKAGENAME="%2"
|
||||||
shift /1
|
shift /1
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# Doxyfile 1.8.16
|
# Doxyfile 1.9.1
|
||||||
|
|
||||||
# This file describes the settings to be used by the documentation system
|
# This file describes the settings to be used by the documentation system
|
||||||
# doxygen (www.doxygen.org) for a project.
|
# doxygen (www.doxygen.org) for a project.
|
||||||
@@ -38,7 +38,7 @@ PROJECT_NAME = Blender
|
|||||||
# could be handy for archiving the generated documentation or if some version
|
# could be handy for archiving the generated documentation or if some version
|
||||||
# control system is used.
|
# control system is used.
|
||||||
|
|
||||||
PROJECT_NUMBER = "V3.0"
|
PROJECT_NUMBER = V3.0
|
||||||
|
|
||||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||||
# for a project that appears at the top of each page and should give viewer a
|
# for a project that appears at the top of each page and should give viewer a
|
||||||
@@ -227,6 +227,14 @@ QT_AUTOBRIEF = NO
|
|||||||
|
|
||||||
MULTILINE_CPP_IS_BRIEF = NO
|
MULTILINE_CPP_IS_BRIEF = NO
|
||||||
|
|
||||||
|
# By default Python docstrings are displayed as preformatted text and doxygen's
|
||||||
|
# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the
|
||||||
|
# doxygen's special commands can be used and the contents of the docstring
|
||||||
|
# documentation blocks is shown as doxygen documentation.
|
||||||
|
# The default value is: YES.
|
||||||
|
|
||||||
|
PYTHON_DOCSTRING = YES
|
||||||
|
|
||||||
# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
|
# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
|
||||||
# documentation from any documented member that it re-implements.
|
# documentation from any documented member that it re-implements.
|
||||||
# The default value is: YES.
|
# The default value is: YES.
|
||||||
@@ -263,12 +271,6 @@ TAB_SIZE = 4
|
|||||||
|
|
||||||
ALIASES =
|
ALIASES =
|
||||||
|
|
||||||
# This tag can be used to specify a number of word-keyword mappings (TCL only).
|
|
||||||
# A mapping has the form "name=value". For example adding "class=itcl::class"
|
|
||||||
# will allow you to use the command class in the itcl::class meaning.
|
|
||||||
|
|
||||||
TCL_SUBST =
|
|
||||||
|
|
||||||
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
|
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
|
||||||
# only. Doxygen will then generate output that is more tailored for C. For
|
# only. Doxygen will then generate output that is more tailored for C. For
|
||||||
# instance, some of the names that are used will be different. The list of all
|
# instance, some of the names that are used will be different. The list of all
|
||||||
@@ -309,19 +311,22 @@ OPTIMIZE_OUTPUT_SLICE = NO
|
|||||||
# parses. With this tag you can assign which parser to use for a given
|
# parses. With this tag you can assign which parser to use for a given
|
||||||
# extension. Doxygen has a built-in mapping, but you can override or extend it
|
# extension. Doxygen has a built-in mapping, but you can override or extend it
|
||||||
# using this tag. The format is ext=language, where ext is a file extension, and
|
# using this tag. The format is ext=language, where ext is a file extension, and
|
||||||
# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
|
# language is one of the parsers supported by doxygen: IDL, Java, JavaScript,
|
||||||
# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice,
|
# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice, VHDL,
|
||||||
# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran:
|
# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran:
|
||||||
# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser
|
# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser
|
||||||
# tries to guess whether the code is fixed or free formatted code, this is the
|
# tries to guess whether the code is fixed or free formatted code, this is the
|
||||||
# default for Fortran type files), VHDL, tcl. For instance to make doxygen treat
|
# default for Fortran type files). For instance to make doxygen treat .inc files
|
||||||
# .inc files as Fortran files (default is PHP), and .f files as C (default is
|
# as Fortran files (default is PHP), and .f files as C (default is Fortran),
|
||||||
# Fortran), use: inc=Fortran f=C.
|
# use: inc=Fortran f=C.
|
||||||
#
|
#
|
||||||
# Note: For files without extension you can use no_extension as a placeholder.
|
# Note: For files without extension you can use no_extension as a placeholder.
|
||||||
#
|
#
|
||||||
# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
|
# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
|
||||||
# the files are not read by doxygen.
|
# the files are not read by doxygen. When specifying no_extension you should add
|
||||||
|
# * to the FILE_PATTERNS.
|
||||||
|
#
|
||||||
|
# Note see also the list of default file extension mappings.
|
||||||
|
|
||||||
EXTENSION_MAPPING =
|
EXTENSION_MAPPING =
|
||||||
|
|
||||||
@@ -455,6 +460,19 @@ TYPEDEF_HIDES_STRUCT = NO
|
|||||||
|
|
||||||
LOOKUP_CACHE_SIZE = 3
|
LOOKUP_CACHE_SIZE = 3
|
||||||
|
|
||||||
|
# The NUM_PROC_THREADS specifies the number threads doxygen is allowed to use
|
||||||
|
# during processing. When set to 0 doxygen will based this on the number of
|
||||||
|
# cores available in the system. You can set it explicitly to a value larger
|
||||||
|
# than 0 to get more control over the balance between CPU load and processing
|
||||||
|
# speed. At this moment only the input processing can be done using multiple
|
||||||
|
# threads. Since this is still an experimental feature the default is set to 1,
|
||||||
|
# which efficively disables parallel processing. Please report any issues you
|
||||||
|
# encounter. Generating dot graphs in parallel is controlled by the
|
||||||
|
# DOT_NUM_THREADS setting.
|
||||||
|
# Minimum value: 0, maximum value: 32, default value: 1.
|
||||||
|
|
||||||
|
NUM_PROC_THREADS = 1
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# Build related configuration options
|
# Build related configuration options
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
@@ -518,6 +536,13 @@ EXTRACT_LOCAL_METHODS = NO
|
|||||||
|
|
||||||
EXTRACT_ANON_NSPACES = NO
|
EXTRACT_ANON_NSPACES = NO
|
||||||
|
|
||||||
|
# If this flag is set to YES, the name of an unnamed parameter in a declaration
|
||||||
|
# will be determined by the corresponding definition. By default unnamed
|
||||||
|
# parameters remain unnamed in the output.
|
||||||
|
# The default value is: YES.
|
||||||
|
|
||||||
|
RESOLVE_UNNAMED_PARAMS = YES
|
||||||
|
|
||||||
# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
|
# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
|
||||||
# undocumented members inside documented classes or files. If set to NO these
|
# undocumented members inside documented classes or files. If set to NO these
|
||||||
# members will be included in the various overviews, but no documentation
|
# members will be included in the various overviews, but no documentation
|
||||||
@@ -535,8 +560,8 @@ HIDE_UNDOC_MEMBERS = NO
|
|||||||
HIDE_UNDOC_CLASSES = NO
|
HIDE_UNDOC_CLASSES = NO
|
||||||
|
|
||||||
# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
|
# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
|
||||||
# (class|struct|union) declarations. If set to NO, these declarations will be
|
# declarations. If set to NO, these declarations will be included in the
|
||||||
# included in the documentation.
|
# documentation.
|
||||||
# The default value is: NO.
|
# The default value is: NO.
|
||||||
|
|
||||||
HIDE_FRIEND_COMPOUNDS = NO
|
HIDE_FRIEND_COMPOUNDS = NO
|
||||||
@@ -555,11 +580,18 @@ HIDE_IN_BODY_DOCS = NO
|
|||||||
|
|
||||||
INTERNAL_DOCS = YES
|
INTERNAL_DOCS = YES
|
||||||
|
|
||||||
# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
|
# With the correct setting of option CASE_SENSE_NAMES doxygen will better be
|
||||||
# names in lower-case letters. If set to YES, upper-case letters are also
|
# able to match the capabilities of the underlying filesystem. In case the
|
||||||
# allowed. This is useful if you have classes or files whose names only differ
|
# filesystem is case sensitive (i.e. it supports files in the same directory
|
||||||
# in case and if your file system supports case sensitive file names. Windows
|
# whose names only differ in casing), the option must be set to YES to properly
|
||||||
# (including Cygwin) ands Mac users are advised to set this option to NO.
|
# deal with such files in case they appear in the input. For filesystems that
|
||||||
|
# are not case sensitive the option should be be set to NO to properly deal with
|
||||||
|
# output files written for symbols that only differ in casing, such as for two
|
||||||
|
# classes, one named CLASS and the other named Class, and to also support
|
||||||
|
# references to files without having to specify the exact matching casing. On
|
||||||
|
# Windows (including Cygwin) and MacOS, users should typically set this option
|
||||||
|
# to NO, whereas on Linux or other Unix flavors it should typically be set to
|
||||||
|
# YES.
|
||||||
# The default value is: system dependent.
|
# The default value is: system dependent.
|
||||||
|
|
||||||
CASE_SENSE_NAMES = YES
|
CASE_SENSE_NAMES = YES
|
||||||
@@ -798,7 +830,10 @@ WARN_IF_DOC_ERROR = YES
|
|||||||
WARN_NO_PARAMDOC = NO
|
WARN_NO_PARAMDOC = NO
|
||||||
|
|
||||||
# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
|
# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
|
||||||
# a warning is encountered.
|
# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS
|
||||||
|
# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but
|
||||||
|
# at the end of the doxygen process doxygen will return with a non-zero status.
|
||||||
|
# Possible values are: NO, YES and FAIL_ON_WARNINGS.
|
||||||
# The default value is: NO.
|
# The default value is: NO.
|
||||||
|
|
||||||
WARN_AS_ERROR = NO
|
WARN_AS_ERROR = NO
|
||||||
@@ -840,8 +875,8 @@ INPUT = doxygen.main.h \
|
|||||||
# This tag can be used to specify the character encoding of the source files
|
# This tag can be used to specify the character encoding of the source files
|
||||||
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
|
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
|
||||||
# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
|
# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
|
||||||
# documentation (see: https://www.gnu.org/software/libiconv/) for the list of
|
# documentation (see:
|
||||||
# possible encodings.
|
# https://www.gnu.org/software/libiconv/) for the list of possible encodings.
|
||||||
# The default value is: UTF-8.
|
# The default value is: UTF-8.
|
||||||
|
|
||||||
INPUT_ENCODING = UTF-8
|
INPUT_ENCODING = UTF-8
|
||||||
@@ -854,11 +889,15 @@ INPUT_ENCODING = UTF-8
|
|||||||
# need to set EXTENSION_MAPPING for the extension otherwise the files are not
|
# need to set EXTENSION_MAPPING for the extension otherwise the files are not
|
||||||
# read by doxygen.
|
# read by doxygen.
|
||||||
#
|
#
|
||||||
|
# Note the list of default checked file patterns might differ from the list of
|
||||||
|
# default file extension mappings.
|
||||||
|
#
|
||||||
# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
|
# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
|
||||||
# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
|
# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
|
||||||
# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
|
# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
|
||||||
# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,
|
# *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C comment),
|
||||||
# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice.
|
# *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, *.vhdl,
|
||||||
|
# *.ucf, *.qsf and *.ice.
|
||||||
|
|
||||||
FILE_PATTERNS =
|
FILE_PATTERNS =
|
||||||
|
|
||||||
@@ -1086,13 +1125,6 @@ VERBATIM_HEADERS = YES
|
|||||||
|
|
||||||
ALPHABETICAL_INDEX = YES
|
ALPHABETICAL_INDEX = YES
|
||||||
|
|
||||||
# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
|
|
||||||
# which the alphabetical index list will be split.
|
|
||||||
# Minimum value: 1, maximum value: 20, default value: 5.
|
|
||||||
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
|
|
||||||
|
|
||||||
COLS_IN_ALPHA_INDEX = 5
|
|
||||||
|
|
||||||
# In case all classes in a project start with a common prefix, all classes will
|
# In case all classes in a project start with a common prefix, all classes will
|
||||||
# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
|
# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
|
||||||
# can be used to specify a prefix (or a list of prefixes) that should be ignored
|
# can be used to specify a prefix (or a list of prefixes) that should be ignored
|
||||||
@@ -1231,9 +1263,9 @@ HTML_TIMESTAMP = YES
|
|||||||
|
|
||||||
# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML
|
# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML
|
||||||
# documentation will contain a main index with vertical navigation menus that
|
# documentation will contain a main index with vertical navigation menus that
|
||||||
# are dynamically created via Javascript. If disabled, the navigation index will
|
# are dynamically created via JavaScript. If disabled, the navigation index will
|
||||||
# consists of multiple levels of tabs that are statically embedded in every HTML
|
# consists of multiple levels of tabs that are statically embedded in every HTML
|
||||||
# page. Disable this option to support browsers that do not have Javascript,
|
# page. Disable this option to support browsers that do not have JavaScript,
|
||||||
# like the Qt help browser.
|
# like the Qt help browser.
|
||||||
# The default value is: YES.
|
# The default value is: YES.
|
||||||
# This tag requires that the tag GENERATE_HTML is set to YES.
|
# This tag requires that the tag GENERATE_HTML is set to YES.
|
||||||
@@ -1263,10 +1295,11 @@ HTML_INDEX_NUM_ENTRIES = 100
|
|||||||
|
|
||||||
# If the GENERATE_DOCSET tag is set to YES, additional index files will be
|
# If the GENERATE_DOCSET tag is set to YES, additional index files will be
|
||||||
# generated that can be used as input for Apple's Xcode 3 integrated development
|
# generated that can be used as input for Apple's Xcode 3 integrated development
|
||||||
# environment (see: https://developer.apple.com/xcode/), introduced with OSX
|
# environment (see:
|
||||||
# 10.5 (Leopard). To create a documentation set, doxygen will generate a
|
# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To
|
||||||
# Makefile in the HTML output directory. Running make will produce the docset in
|
# create a documentation set, doxygen will generate a Makefile in the HTML
|
||||||
# that directory and running make install will install the docset in
|
# output directory. Running make will produce the docset in that directory and
|
||||||
|
# running make install will install the docset in
|
||||||
# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
|
# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
|
||||||
# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy
|
# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy
|
||||||
# genXcode/_index.html for more information.
|
# genXcode/_index.html for more information.
|
||||||
@@ -1308,8 +1341,8 @@ DOCSET_PUBLISHER_NAME = Publisher
|
|||||||
# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
|
# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
|
||||||
# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
|
# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
|
||||||
# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
|
# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
|
||||||
# (see: https://www.microsoft.com/en-us/download/details.aspx?id=21138) on
|
# (see:
|
||||||
# Windows.
|
# https://www.microsoft.com/en-us/download/details.aspx?id=21138) on Windows.
|
||||||
#
|
#
|
||||||
# The HTML Help Workshop contains a compiler that can convert all HTML output
|
# The HTML Help Workshop contains a compiler that can convert all HTML output
|
||||||
# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
|
# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
|
||||||
@@ -1339,7 +1372,7 @@ CHM_FILE = blender.chm
|
|||||||
HHC_LOCATION = "C:/Program Files (x86)/HTML Help Workshop/hhc.exe"
|
HHC_LOCATION = "C:/Program Files (x86)/HTML Help Workshop/hhc.exe"
|
||||||
|
|
||||||
# The GENERATE_CHI flag controls if a separate .chi index file is generated
|
# The GENERATE_CHI flag controls if a separate .chi index file is generated
|
||||||
# (YES) or that it should be included in the master .chm file (NO).
|
# (YES) or that it should be included in the main .chm file (NO).
|
||||||
# The default value is: NO.
|
# The default value is: NO.
|
||||||
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
|
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
|
||||||
|
|
||||||
@@ -1384,7 +1417,8 @@ QCH_FILE =
|
|||||||
|
|
||||||
# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
|
# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
|
||||||
# Project output. For more information please see Qt Help Project / Namespace
|
# Project output. For more information please see Qt Help Project / Namespace
|
||||||
# (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace).
|
# (see:
|
||||||
|
# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace).
|
||||||
# The default value is: org.doxygen.Project.
|
# The default value is: org.doxygen.Project.
|
||||||
# This tag requires that the tag GENERATE_QHP is set to YES.
|
# This tag requires that the tag GENERATE_QHP is set to YES.
|
||||||
|
|
||||||
@@ -1392,8 +1426,8 @@ QHP_NAMESPACE = org.doxygen.Project
|
|||||||
|
|
||||||
# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
|
# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
|
||||||
# Help Project output. For more information please see Qt Help Project / Virtual
|
# Help Project output. For more information please see Qt Help Project / Virtual
|
||||||
# Folders (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-
|
# Folders (see:
|
||||||
# folders).
|
# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders).
|
||||||
# The default value is: doc.
|
# The default value is: doc.
|
||||||
# This tag requires that the tag GENERATE_QHP is set to YES.
|
# This tag requires that the tag GENERATE_QHP is set to YES.
|
||||||
|
|
||||||
@@ -1401,16 +1435,16 @@ QHP_VIRTUAL_FOLDER = doc
|
|||||||
|
|
||||||
# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
|
# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
|
||||||
# filter to add. For more information please see Qt Help Project / Custom
|
# filter to add. For more information please see Qt Help Project / Custom
|
||||||
# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-
|
# Filters (see:
|
||||||
# filters).
|
# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters).
|
||||||
# This tag requires that the tag GENERATE_QHP is set to YES.
|
# This tag requires that the tag GENERATE_QHP is set to YES.
|
||||||
|
|
||||||
QHP_CUST_FILTER_NAME =
|
QHP_CUST_FILTER_NAME =
|
||||||
|
|
||||||
# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
|
# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
|
||||||
# custom filter to add. For more information please see Qt Help Project / Custom
|
# custom filter to add. For more information please see Qt Help Project / Custom
|
||||||
# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-
|
# Filters (see:
|
||||||
# filters).
|
# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters).
|
||||||
# This tag requires that the tag GENERATE_QHP is set to YES.
|
# This tag requires that the tag GENERATE_QHP is set to YES.
|
||||||
|
|
||||||
QHP_CUST_FILTER_ATTRS =
|
QHP_CUST_FILTER_ATTRS =
|
||||||
@@ -1422,9 +1456,9 @@ QHP_CUST_FILTER_ATTRS =
|
|||||||
|
|
||||||
QHP_SECT_FILTER_ATTRS =
|
QHP_SECT_FILTER_ATTRS =
|
||||||
|
|
||||||
# The QHG_LOCATION tag can be used to specify the location of Qt's
|
# The QHG_LOCATION tag can be used to specify the location (absolute path
|
||||||
# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
|
# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to
|
||||||
# generated .qhp file.
|
# run qhelpgenerator on the generated .qhp file.
|
||||||
# This tag requires that the tag GENERATE_QHP is set to YES.
|
# This tag requires that the tag GENERATE_QHP is set to YES.
|
||||||
|
|
||||||
QHG_LOCATION =
|
QHG_LOCATION =
|
||||||
@@ -1501,6 +1535,17 @@ TREEVIEW_WIDTH = 246
|
|||||||
|
|
||||||
EXT_LINKS_IN_WINDOW = NO
|
EXT_LINKS_IN_WINDOW = NO
|
||||||
|
|
||||||
|
# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg
|
||||||
|
# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see
|
||||||
|
# https://inkscape.org) to generate formulas as SVG images instead of PNGs for
|
||||||
|
# the HTML output. These images will generally look nicer at scaled resolutions.
|
||||||
|
# Possible values are: png (the default) and svg (looks nicer but requires the
|
||||||
|
# pdf2svg or inkscape tool).
|
||||||
|
# The default value is: png.
|
||||||
|
# This tag requires that the tag GENERATE_HTML is set to YES.
|
||||||
|
|
||||||
|
HTML_FORMULA_FORMAT = png
|
||||||
|
|
||||||
# Use this tag to change the font size of LaTeX formulas included as images in
|
# Use this tag to change the font size of LaTeX formulas included as images in
|
||||||
# the HTML documentation. When you change the font size after a successful
|
# the HTML documentation. When you change the font size after a successful
|
||||||
# doxygen run you need to manually remove any form_*.png images from the HTML
|
# doxygen run you need to manually remove any form_*.png images from the HTML
|
||||||
@@ -1521,8 +1566,14 @@ FORMULA_FONTSIZE = 10
|
|||||||
|
|
||||||
FORMULA_TRANSPARENT = YES
|
FORMULA_TRANSPARENT = YES
|
||||||
|
|
||||||
|
# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands
|
||||||
|
# to create new LaTeX commands to be used in formulas as building blocks. See
|
||||||
|
# the section "Including formulas" for details.
|
||||||
|
|
||||||
|
FORMULA_MACROFILE =
|
||||||
|
|
||||||
# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
|
# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
|
||||||
# https://www.mathjax.org) which uses client side Javascript for the rendering
|
# https://www.mathjax.org) which uses client side JavaScript for the rendering
|
||||||
# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
|
# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
|
||||||
# installed or if you want to formulas look prettier in the HTML output. When
|
# installed or if you want to formulas look prettier in the HTML output. When
|
||||||
# enabled you may also need to install MathJax separately and configure the path
|
# enabled you may also need to install MathJax separately and configure the path
|
||||||
@@ -1534,7 +1585,7 @@ USE_MATHJAX = NO
|
|||||||
|
|
||||||
# When MathJax is enabled you can set the default output format to be used for
|
# When MathJax is enabled you can set the default output format to be used for
|
||||||
# the MathJax output. See the MathJax site (see:
|
# the MathJax output. See the MathJax site (see:
|
||||||
# http://docs.mathjax.org/en/latest/output.html) for more details.
|
# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details.
|
||||||
# Possible values are: HTML-CSS (which is slower, but has the best
|
# Possible values are: HTML-CSS (which is slower, but has the best
|
||||||
# compatibility), NativeMML (i.e. MathML) and SVG.
|
# compatibility), NativeMML (i.e. MathML) and SVG.
|
||||||
# The default value is: HTML-CSS.
|
# The default value is: HTML-CSS.
|
||||||
@@ -1550,7 +1601,7 @@ MATHJAX_FORMAT = HTML-CSS
|
|||||||
# Content Delivery Network so you can quickly see the result without installing
|
# Content Delivery Network so you can quickly see the result without installing
|
||||||
# MathJax. However, it is strongly recommended to install a local copy of
|
# MathJax. However, it is strongly recommended to install a local copy of
|
||||||
# MathJax from https://www.mathjax.org before deployment.
|
# MathJax from https://www.mathjax.org before deployment.
|
||||||
# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/.
|
# The default value is: https://cdn.jsdelivr.net/npm/mathjax@2.
|
||||||
# This tag requires that the tag USE_MATHJAX is set to YES.
|
# This tag requires that the tag USE_MATHJAX is set to YES.
|
||||||
|
|
||||||
MATHJAX_RELPATH = http://www.mathjax.org/mathjax
|
MATHJAX_RELPATH = http://www.mathjax.org/mathjax
|
||||||
@@ -1564,7 +1615,8 @@ MATHJAX_EXTENSIONS =
|
|||||||
|
|
||||||
# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
|
# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
|
||||||
# of code that will be used on startup of the MathJax code. See the MathJax site
|
# of code that will be used on startup of the MathJax code. See the MathJax site
|
||||||
# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
|
# (see:
|
||||||
|
# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an
|
||||||
# example see the documentation.
|
# example see the documentation.
|
||||||
# This tag requires that the tag USE_MATHJAX is set to YES.
|
# This tag requires that the tag USE_MATHJAX is set to YES.
|
||||||
|
|
||||||
@@ -1592,7 +1644,7 @@ MATHJAX_CODEFILE =
|
|||||||
SEARCHENGINE = NO
|
SEARCHENGINE = NO
|
||||||
|
|
||||||
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
|
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
|
||||||
# implemented using a web server instead of a web client using Javascript. There
|
# implemented using a web server instead of a web client using JavaScript. There
|
||||||
# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
|
# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
|
||||||
# setting. When disabled, doxygen will generate a PHP script for searching and
|
# setting. When disabled, doxygen will generate a PHP script for searching and
|
||||||
# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
|
# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
|
||||||
@@ -1611,7 +1663,8 @@ SERVER_BASED_SEARCH = NO
|
|||||||
#
|
#
|
||||||
# Doxygen ships with an example indexer (doxyindexer) and search engine
|
# Doxygen ships with an example indexer (doxyindexer) and search engine
|
||||||
# (doxysearch.cgi) which are based on the open source search engine library
|
# (doxysearch.cgi) which are based on the open source search engine library
|
||||||
# Xapian (see: https://xapian.org/).
|
# Xapian (see:
|
||||||
|
# https://xapian.org/).
|
||||||
#
|
#
|
||||||
# See the section "External Indexing and Searching" for details.
|
# See the section "External Indexing and Searching" for details.
|
||||||
# The default value is: NO.
|
# The default value is: NO.
|
||||||
@@ -1624,8 +1677,9 @@ EXTERNAL_SEARCH = NO
|
|||||||
#
|
#
|
||||||
# Doxygen ships with an example indexer (doxyindexer) and search engine
|
# Doxygen ships with an example indexer (doxyindexer) and search engine
|
||||||
# (doxysearch.cgi) which are based on the open source search engine library
|
# (doxysearch.cgi) which are based on the open source search engine library
|
||||||
# Xapian (see: https://xapian.org/). See the section "External Indexing and
|
# Xapian (see:
|
||||||
# Searching" for details.
|
# https://xapian.org/). See the section "External Indexing and Searching" for
|
||||||
|
# details.
|
||||||
# This tag requires that the tag SEARCHENGINE is set to YES.
|
# This tag requires that the tag SEARCHENGINE is set to YES.
|
||||||
|
|
||||||
SEARCHENGINE_URL =
|
SEARCHENGINE_URL =
|
||||||
@@ -1789,9 +1843,11 @@ LATEX_EXTRA_FILES =
|
|||||||
|
|
||||||
PDF_HYPERLINKS = NO
|
PDF_HYPERLINKS = NO
|
||||||
|
|
||||||
# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
|
# If the USE_PDFLATEX tag is set to YES, doxygen will use the engine as
|
||||||
# the PDF file directly from the LaTeX files. Set this option to YES, to get a
|
# specified with LATEX_CMD_NAME to generate the PDF file directly from the LaTeX
|
||||||
# higher quality PDF documentation.
|
# files. Set this option to YES, to get a higher quality PDF documentation.
|
||||||
|
#
|
||||||
|
# See also section LATEX_CMD_NAME for selecting the engine.
|
||||||
# The default value is: YES.
|
# The default value is: YES.
|
||||||
# This tag requires that the tag GENERATE_LATEX is set to YES.
|
# This tag requires that the tag GENERATE_LATEX is set to YES.
|
||||||
|
|
||||||
@@ -2126,7 +2182,8 @@ INCLUDE_FILE_PATTERNS =
|
|||||||
# recursively expanded use the := operator instead of the = operator.
|
# recursively expanded use the := operator instead of the = operator.
|
||||||
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
|
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
|
||||||
|
|
||||||
PREDEFINED = BUILD_DATE
|
PREDEFINED = BUILD_DATE \
|
||||||
|
DOXYGEN=1
|
||||||
|
|
||||||
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
|
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
|
||||||
# tag can be used to specify a list of macro names that should be expanded. The
|
# tag can be used to specify a list of macro names that should be expanded. The
|
||||||
@@ -2303,10 +2360,32 @@ UML_LOOK = YES
|
|||||||
# but if the number exceeds 15, the total amount of fields shown is limited to
|
# but if the number exceeds 15, the total amount of fields shown is limited to
|
||||||
# 10.
|
# 10.
|
||||||
# Minimum value: 0, maximum value: 100, default value: 10.
|
# Minimum value: 0, maximum value: 100, default value: 10.
|
||||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
# This tag requires that the tag UML_LOOK is set to YES.
|
||||||
|
|
||||||
UML_LIMIT_NUM_FIELDS = 10
|
UML_LIMIT_NUM_FIELDS = 10
|
||||||
|
|
||||||
|
# If the DOT_UML_DETAILS tag is set to NO, doxygen will show attributes and
|
||||||
|
# methods without types and arguments in the UML graphs. If the DOT_UML_DETAILS
|
||||||
|
# tag is set to YES, doxygen will add type and arguments for attributes and
|
||||||
|
# methods in the UML graphs. If the DOT_UML_DETAILS tag is set to NONE, doxygen
|
||||||
|
# will not generate fields with class member information in the UML graphs. The
|
||||||
|
# class diagrams will look similar to the default class diagrams but using UML
|
||||||
|
# notation for the relationships.
|
||||||
|
# Possible values are: NO, YES and NONE.
|
||||||
|
# The default value is: NO.
|
||||||
|
# This tag requires that the tag UML_LOOK is set to YES.
|
||||||
|
|
||||||
|
DOT_UML_DETAILS = NO
|
||||||
|
|
||||||
|
# The DOT_WRAP_THRESHOLD tag can be used to set the maximum number of characters
|
||||||
|
# to display on a single line. If the actual line length exceeds this threshold
|
||||||
|
# significantly it will wrapped across multiple lines. Some heuristics are apply
|
||||||
|
# to avoid ugly line breaks.
|
||||||
|
# Minimum value: 0, maximum value: 1000, default value: 17.
|
||||||
|
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||||
|
|
||||||
|
DOT_WRAP_THRESHOLD = 17
|
||||||
|
|
||||||
# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
|
# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
|
||||||
# collaboration graphs will show the relations between templates and their
|
# collaboration graphs will show the relations between templates and their
|
||||||
# instances.
|
# instances.
|
||||||
@@ -2496,9 +2575,11 @@ DOT_MULTI_TARGETS = YES
|
|||||||
|
|
||||||
GENERATE_LEGEND = YES
|
GENERATE_LEGEND = YES
|
||||||
|
|
||||||
# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot
|
# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate
|
||||||
# files that are used to generate the various graphs.
|
# files that are used to generate the various graphs.
|
||||||
|
#
|
||||||
|
# Note: This setting is not only used for dot files but also for msc and
|
||||||
|
# plantuml temporary files.
|
||||||
# The default value is: YES.
|
# The default value is: YES.
|
||||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
|
||||||
|
|
||||||
DOT_CLEANUP = YES
|
DOT_CLEANUP = YES
|
||||||
|
@@ -29,7 +29,7 @@ with offscreen.bind():
|
|||||||
amount = 10
|
amount = 10
|
||||||
for i in range(-amount, amount + 1):
|
for i in range(-amount, amount + 1):
|
||||||
x_pos = i / amount
|
x_pos = i / amount
|
||||||
draw_circle_2d((x_pos, 0.0), (1, 1, 1, 1), 0.5, 200)
|
draw_circle_2d((x_pos, 0.0), (1, 1, 1, 1), 0.5, segments=200)
|
||||||
|
|
||||||
|
|
||||||
# Drawing the generated texture in 3D space
|
# Drawing the generated texture in 3D space
|
||||||
|
@@ -34,7 +34,9 @@ with offscreen.bind():
|
|||||||
for i in range(RING_AMOUNT):
|
for i in range(RING_AMOUNT):
|
||||||
draw_circle_2d(
|
draw_circle_2d(
|
||||||
(random.uniform(-1, 1), random.uniform(-1, 1)),
|
(random.uniform(-1, 1), random.uniform(-1, 1)),
|
||||||
(1, 1, 1, 1), random.uniform(0.1, 1), 20)
|
(1, 1, 1, 1), random.uniform(0.1, 1),
|
||||||
|
segments=20,
|
||||||
|
)
|
||||||
|
|
||||||
buffer = fb.read_color(0, 0, WIDTH, HEIGHT, 4, 0, 'UBYTE')
|
buffer = fb.read_color(0, 0, WIDTH, HEIGHT, 4, 0, 'UBYTE')
|
||||||
|
|
||||||
|
@@ -1,2 +1,13 @@
|
|||||||
Sphinx==3.5.3
|
sphinx==3.5.4
|
||||||
|
|
||||||
|
# Sphinx dependencies that are important
|
||||||
|
Jinja2==2.11.3
|
||||||
|
Pygments==2.9.0
|
||||||
|
docutils==0.16
|
||||||
|
snowballstemmer==2.1.0
|
||||||
|
babel==2.9.1
|
||||||
|
requests==2.25.1
|
||||||
|
|
||||||
|
# Only needed to match the theme used for the official documentation.
|
||||||
|
# Without this theme, the default theme will be used.
|
||||||
sphinx_rtd_theme==0.5.2
|
sphinx_rtd_theme==0.5.2
|
||||||
|
2
extern/mantaflow/preprocessed/gitinfo.h
vendored
2
extern/mantaflow/preprocessed/gitinfo.h
vendored
@@ -1,3 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
#define MANTA_GIT_VERSION "commit 9c505cd22e289b98c9aa717efba8ef3201c7e458"
|
#define MANTA_GIT_VERSION "commit 8fbebe02459b7f72575872c20961f7cb757db408"
|
||||||
|
13
extern/mantaflow/preprocessed/kernel.h
vendored
13
extern/mantaflow/preprocessed/kernel.h
vendored
@@ -71,6 +71,19 @@ class ParticleBase;
|
|||||||
for (int j = bnd; j < (grid).getSizeY() - bnd; ++j) \
|
for (int j = bnd; j < (grid).getSizeY() - bnd; ++j) \
|
||||||
for (int i = bnd; i < (grid).getSizeX() - bnd; ++i)
|
for (int i = bnd; i < (grid).getSizeX() - bnd; ++i)
|
||||||
|
|
||||||
|
#define FOR_NEIGHBORS_BND(grid, radius, bnd) \
|
||||||
|
for (int zj = ((grid).is3D() ? std::max(bnd, k - radius) : 0); \
|
||||||
|
zj <= ((grid).is3D() ? std::min(k + radius, (grid).getSizeZ() - 1 - bnd) : 0); \
|
||||||
|
zj++) \
|
||||||
|
for (int yj = std::max(bnd, j - radius); \
|
||||||
|
yj <= std::min(j + radius, (grid).getSizeY() - 1 - bnd); \
|
||||||
|
yj++) \
|
||||||
|
for (int xj = std::max(bnd, i - radius); \
|
||||||
|
xj <= std::min(i + radius, (grid).getSizeX() - 1 - bnd); \
|
||||||
|
xj++)
|
||||||
|
|
||||||
|
#define FOR_NEIGHBORS(grid, radius) FOR_NEIGHBORS_BND(grid, radius, 0)
|
||||||
|
|
||||||
//! Basic data structure for kernel data, initialized based on kernel type (e.g. single, idx, etc).
|
//! Basic data structure for kernel data, initialized based on kernel type (e.g. single, idx, etc).
|
||||||
struct KernelBase {
|
struct KernelBase {
|
||||||
int maxX, maxY, maxZ, minZ, maxT, minT;
|
int maxX, maxY, maxZ, minZ, maxT, minT;
|
||||||
|
92
extern/mantaflow/preprocessed/plugin/flip.cpp
vendored
92
extern/mantaflow/preprocessed/plugin/flip.cpp
vendored
@@ -822,33 +822,29 @@ struct ComputeUnionLevelsetPindex : public KernelBase {
|
|||||||
{
|
{
|
||||||
const Vec3 gridPos = Vec3(i, j, k) + Vec3(0.5); // shifted by half cell
|
const Vec3 gridPos = Vec3(i, j, k) + Vec3(0.5); // shifted by half cell
|
||||||
Real phiv = radius * 1.0; // outside
|
Real phiv = radius * 1.0; // outside
|
||||||
|
const int r = int(radius) + 1;
|
||||||
|
|
||||||
int r = int(radius) + 1;
|
FOR_NEIGHBORS(phi, r)
|
||||||
int rZ = phi.is3D() ? r : 0;
|
{
|
||||||
for (int zj = k - rZ; zj <= k + rZ; zj++)
|
|
||||||
for (int yj = j - r; yj <= j + r; yj++)
|
|
||||||
for (int xj = i - r; xj <= i + r; xj++) {
|
|
||||||
if (!phi.isInBounds(Vec3i(xj, yj, zj)))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// note, for the particle indices in indexSys the access is periodic (ie, dont skip for
|
// note, for the particle indices in indexSys the access is periodic (ie, dont skip for eg
|
||||||
// eg inBounds(sx,10,10)
|
// inBounds(sx,10,10)
|
||||||
IndexInt isysIdxS = index.index(xj, yj, zj);
|
IndexInt isysIdxS = index.index(xj, yj, zj);
|
||||||
IndexInt pStart = index(isysIdxS), pEnd = 0;
|
IndexInt pStart = index(isysIdxS), pEnd = 0;
|
||||||
if (phi.isInBounds(isysIdxS + 1))
|
if (phi.isInBounds(isysIdxS + 1))
|
||||||
pEnd = index(isysIdxS + 1);
|
pEnd = index(isysIdxS + 1);
|
||||||
else
|
else
|
||||||
pEnd = indexSys.size();
|
pEnd = indexSys.size();
|
||||||
|
|
||||||
// now loop over particles in cell
|
// now loop over particles in cell
|
||||||
for (IndexInt p = pStart; p < pEnd; ++p) {
|
for (IndexInt p = pStart; p < pEnd; ++p) {
|
||||||
const int psrc = indexSys[p].sourceIndex;
|
const int psrc = indexSys[p].sourceIndex;
|
||||||
if (ptype && ((*ptype)[psrc] & exclude))
|
if (ptype && ((*ptype)[psrc] & exclude))
|
||||||
continue;
|
continue;
|
||||||
const Vec3 pos = parts[psrc].pos;
|
const Vec3 pos = parts[psrc].pos;
|
||||||
phiv = std::min(phiv, fabs(norm(gridPos - pos)) - radius);
|
phiv = std::min(phiv, fabs(norm(gridPos - pos)) - radius);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
phi(i, j, k) = phiv;
|
phi(i, j, k) = phiv;
|
||||||
}
|
}
|
||||||
inline const Grid<int> &getArg0()
|
inline const Grid<int> &getArg0()
|
||||||
@@ -1026,39 +1022,35 @@ struct ComputeAveragedLevelsetWeight : public KernelBase {
|
|||||||
|
|
||||||
// loop over neighborhood, similar to ComputeUnionLevelsetPindex
|
// loop over neighborhood, similar to ComputeUnionLevelsetPindex
|
||||||
const Real sradiusInv = 1. / (4. * radius * radius);
|
const Real sradiusInv = 1. / (4. * radius * radius);
|
||||||
int r = int(1. * radius) + 1;
|
const int r = int(radius) + 1;
|
||||||
int rZ = phi.is3D() ? r : 0;
|
|
||||||
// accumulators
|
// accumulators
|
||||||
Real wacc = 0.;
|
Real wacc = 0.;
|
||||||
Vec3 pacc = Vec3(0.);
|
Vec3 pacc = Vec3(0.);
|
||||||
Real racc = 0.;
|
Real racc = 0.;
|
||||||
|
|
||||||
for (int zj = k - rZ; zj <= k + rZ; zj++)
|
FOR_NEIGHBORS(phi, r)
|
||||||
for (int yj = j - r; yj <= j + r; yj++)
|
{
|
||||||
for (int xj = i - r; xj <= i + r; xj++) {
|
|
||||||
if (!phi.isInBounds(Vec3i(xj, yj, zj)))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
IndexInt isysIdxS = index.index(xj, yj, zj);
|
IndexInt isysIdxS = index.index(xj, yj, zj);
|
||||||
IndexInt pStart = index(isysIdxS), pEnd = 0;
|
IndexInt pStart = index(isysIdxS), pEnd = 0;
|
||||||
if (phi.isInBounds(isysIdxS + 1))
|
if (phi.isInBounds(isysIdxS + 1))
|
||||||
pEnd = index(isysIdxS + 1);
|
pEnd = index(isysIdxS + 1);
|
||||||
else
|
else
|
||||||
pEnd = indexSys.size();
|
pEnd = indexSys.size();
|
||||||
for (IndexInt p = pStart; p < pEnd; ++p) {
|
for (IndexInt p = pStart; p < pEnd; ++p) {
|
||||||
IndexInt psrc = indexSys[p].sourceIndex;
|
IndexInt psrc = indexSys[p].sourceIndex;
|
||||||
if (ptype && ((*ptype)[psrc] & exclude))
|
if (ptype && ((*ptype)[psrc] & exclude))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Vec3 pos = parts[psrc].pos;
|
Vec3 pos = parts[psrc].pos;
|
||||||
Real s = normSquare(gridPos - pos) * sradiusInv;
|
Real s = normSquare(gridPos - pos) * sradiusInv;
|
||||||
// Real w = std::max(0., cubed(1.-s) );
|
// Real w = std::max(0., cubed(1.-s) );
|
||||||
Real w = std::max(0., (1. - s)); // a bit smoother
|
Real w = std::max(0., (1. - s)); // a bit smoother
|
||||||
wacc += w;
|
wacc += w;
|
||||||
racc += radius * w;
|
racc += radius * w;
|
||||||
pacc += pos * w;
|
pacc += pos * w;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wacc > VECTOR_EPSILON) {
|
if (wacc > VECTOR_EPSILON) {
|
||||||
racc /= wacc;
|
racc /= wacc;
|
||||||
|
@@ -234,10 +234,10 @@ void subdivideMesh(
|
|||||||
normalize(ne2);
|
normalize(ne2);
|
||||||
|
|
||||||
// Real thisArea = sqrMag(cross(-e2,e0));
|
// Real thisArea = sqrMag(cross(-e2,e0));
|
||||||
// small angle approximation says sin(x) = arcsin(x) = x,
|
// small angle approximation says sin(x) = arcsin(x) = x,
|
||||||
// arccos(x) = pi/2 - arcsin(x),
|
// arccos(x) = pi/2 - arcsin(x),
|
||||||
// cos(x) = dot(A,B),
|
// cos(x) = dot(A,B),
|
||||||
// so angle is approximately 1 - dot(A,B).
|
// so angle is approximately 1 - dot(A,B).
|
||||||
Real angle[3];
|
Real angle[3];
|
||||||
angle[0] = 1.0 - dot(ne0, -ne2);
|
angle[0] = 1.0 - dot(ne0, -ne2);
|
||||||
angle[1] = 1.0 - dot(ne1, -ne0);
|
angle[1] = 1.0 - dot(ne1, -ne0);
|
||||||
|
@@ -2287,10 +2287,9 @@ struct knFlipComputePotentialTrappedAir : public KernelBase {
|
|||||||
const Vec3 &vj = scaleFromManta * v.getCentered(x, y, z);
|
const Vec3 &vj = scaleFromManta * v.getCentered(x, y, z);
|
||||||
const Vec3 xij = xi - xj;
|
const Vec3 xij = xi - xj;
|
||||||
const Vec3 vij = vi - vj;
|
const Vec3 vij = vi - vj;
|
||||||
Real h = !pot.is3D() ?
|
Real h = !pot.is3D() ? 1.414 * radius :
|
||||||
1.414 * radius :
|
1.732 * radius; // estimate sqrt(2)*radius resp. sqrt(3)*radius
|
||||||
1.732 * radius; // estimate sqrt(2)*radius resp. sqrt(3)*radius for h, due
|
// for h, due to squared resp. cubic neighbor area
|
||||||
// to squared resp. cubic neighbor area
|
|
||||||
vdiff += norm(vij) * (1 - dot(getNormalized(vij), getNormalized(xij))) *
|
vdiff += norm(vij) * (1 - dot(getNormalized(vij), getNormalized(xij))) *
|
||||||
(1 - norm(xij) / h);
|
(1 - norm(xij) / h);
|
||||||
}
|
}
|
||||||
|
@@ -79,15 +79,15 @@ typedef struct CLG_IDFilter {
|
|||||||
} CLG_IDFilter;
|
} CLG_IDFilter;
|
||||||
|
|
||||||
typedef struct CLogContext {
|
typedef struct CLogContext {
|
||||||
/** Single linked list of types. */
|
/** Single linked list of types. */
|
||||||
CLG_LogType *types;
|
CLG_LogType *types;
|
||||||
/** Single linked list of references. */
|
/** Single linked list of references. */
|
||||||
CLG_LogRef *refs;
|
CLG_LogRef *refs;
|
||||||
#ifdef WITH_CLOG_PTHREADS
|
#ifdef WITH_CLOG_PTHREADS
|
||||||
pthread_mutex_t types_lock;
|
pthread_mutex_t types_lock;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* exclude, include filters. */
|
/* exclude, include filters. */
|
||||||
CLG_IDFilter *filters[2];
|
CLG_IDFilter *filters[2];
|
||||||
bool use_color;
|
bool use_color;
|
||||||
bool use_basename;
|
bool use_basename;
|
||||||
|
@@ -132,7 +132,7 @@ def init():
|
|||||||
_workaround_buggy_drivers()
|
_workaround_buggy_drivers()
|
||||||
|
|
||||||
path = os.path.dirname(__file__)
|
path = os.path.dirname(__file__)
|
||||||
user_path = os.path.dirname(os.path.abspath(bpy.utils.user_resource('CONFIG', '')))
|
user_path = os.path.dirname(os.path.abspath(bpy.utils.user_resource('CONFIG', path='')))
|
||||||
|
|
||||||
_cycles.init(path, user_path, bpy.app.background)
|
_cycles.init(path, user_path, bpy.app.background)
|
||||||
_parse_command_line()
|
_parse_command_line()
|
||||||
|
@@ -34,12 +34,17 @@ void BlenderSync::sync_light(BL::Object &b_parent,
|
|||||||
bool *use_portal)
|
bool *use_portal)
|
||||||
{
|
{
|
||||||
/* test if we need to sync */
|
/* test if we need to sync */
|
||||||
Light *light;
|
|
||||||
ObjectKey key(b_parent, persistent_id, b_ob_instance, false);
|
ObjectKey key(b_parent, persistent_id, b_ob_instance, false);
|
||||||
BL::Light b_light(b_ob.data());
|
BL::Light b_light(b_ob.data());
|
||||||
|
|
||||||
|
Light *light = light_map.find(key);
|
||||||
|
|
||||||
|
/* Check if the transform was modified, in case a linked collection is moved we do not get a
|
||||||
|
* specific depsgraph update (T88515). This also mimics the behavior for Objects. */
|
||||||
|
const bool tfm_updated = (light && light->get_tfm() != tfm);
|
||||||
|
|
||||||
/* Update if either object or light data changed. */
|
/* Update if either object or light data changed. */
|
||||||
if (!light_map.add_or_update(&light, b_ob, b_parent, key)) {
|
if (!light_map.add_or_update(&light, b_ob, b_parent, key) && !tfm_updated) {
|
||||||
Shader *shader;
|
Shader *shader;
|
||||||
if (!shader_map.add_or_update(&shader, b_light)) {
|
if (!shader_map.add_or_update(&shader, b_light)) {
|
||||||
if (light->get_is_portal())
|
if (light->get_is_portal())
|
||||||
|
@@ -289,11 +289,10 @@ static PyObject *render_func(PyObject * /*self*/, PyObject *args)
|
|||||||
RNA_pointer_create(NULL, &RNA_Depsgraph, (ID *)PyLong_AsVoidPtr(pydepsgraph), &depsgraphptr);
|
RNA_pointer_create(NULL, &RNA_Depsgraph, (ID *)PyLong_AsVoidPtr(pydepsgraph), &depsgraphptr);
|
||||||
BL::Depsgraph b_depsgraph(depsgraphptr);
|
BL::Depsgraph b_depsgraph(depsgraphptr);
|
||||||
|
|
||||||
/* Allow Blender to execute other Python scripts, and isolate TBB tasks so we
|
/* Allow Blender to execute other Python scripts. */
|
||||||
* don't get deadlocks with Blender threads accessing shared data like images. */
|
|
||||||
python_thread_state_save(&session->python_thread_state);
|
python_thread_state_save(&session->python_thread_state);
|
||||||
|
|
||||||
tbb::this_task_arena::isolate([&] { session->render(b_depsgraph); });
|
session->render(b_depsgraph);
|
||||||
|
|
||||||
python_thread_state_restore(&session->python_thread_state);
|
python_thread_state_restore(&session->python_thread_state);
|
||||||
|
|
||||||
@@ -330,8 +329,7 @@ static PyObject *bake_func(PyObject * /*self*/, PyObject *args)
|
|||||||
|
|
||||||
python_thread_state_save(&session->python_thread_state);
|
python_thread_state_save(&session->python_thread_state);
|
||||||
|
|
||||||
tbb::this_task_arena::isolate(
|
session->bake(b_depsgraph, b_object, pass_type, pass_filter, width, height);
|
||||||
[&] { session->bake(b_depsgraph, b_object, pass_type, pass_filter, width, height); });
|
|
||||||
|
|
||||||
python_thread_state_restore(&session->python_thread_state);
|
python_thread_state_restore(&session->python_thread_state);
|
||||||
|
|
||||||
@@ -377,7 +375,7 @@ static PyObject *reset_func(PyObject * /*self*/, PyObject *args)
|
|||||||
|
|
||||||
python_thread_state_save(&session->python_thread_state);
|
python_thread_state_save(&session->python_thread_state);
|
||||||
|
|
||||||
tbb::this_task_arena::isolate([&] { session->reset_session(b_data, b_depsgraph); });
|
session->reset_session(b_data, b_depsgraph);
|
||||||
|
|
||||||
python_thread_state_restore(&session->python_thread_state);
|
python_thread_state_restore(&session->python_thread_state);
|
||||||
|
|
||||||
@@ -399,7 +397,7 @@ static PyObject *sync_func(PyObject * /*self*/, PyObject *args)
|
|||||||
|
|
||||||
python_thread_state_save(&session->python_thread_state);
|
python_thread_state_save(&session->python_thread_state);
|
||||||
|
|
||||||
tbb::this_task_arena::isolate([&] { session->synchronize(b_depsgraph); });
|
session->synchronize(b_depsgraph);
|
||||||
|
|
||||||
python_thread_state_restore(&session->python_thread_state);
|
python_thread_state_restore(&session->python_thread_state);
|
||||||
|
|
||||||
|
@@ -181,7 +181,7 @@ static void rtc_filter_occluded_func(const RTCFilterFunctionNArguments *args)
|
|||||||
/* record intersection */
|
/* record intersection */
|
||||||
ctx->local_isect->hits[hit_idx] = current_isect;
|
ctx->local_isect->hits[hit_idx] = current_isect;
|
||||||
ctx->local_isect->Ng[hit_idx] = normalize(make_float3(hit->Ng_x, hit->Ng_y, hit->Ng_z));
|
ctx->local_isect->Ng[hit_idx] = normalize(make_float3(hit->Ng_x, hit->Ng_y, hit->Ng_z));
|
||||||
/* This tells Embree to continue tracing .*/
|
/* This tells Embree to continue tracing. */
|
||||||
*args->valid = 0;
|
*args->valid = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -297,7 +297,7 @@ struct BVHSpatialBin {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
struct BVHSpatialStorage {
|
struct BVHSpatialStorage {
|
||||||
/* Accumulated bounds when sweeping from right to left. */
|
/* Accumulated bounds when sweeping from right to left. */
|
||||||
vector<BoundBox> right_bounds;
|
vector<BoundBox> right_bounds;
|
||||||
|
|
||||||
/* Bins used for histogram when selecting best split plane. */
|
/* Bins used for histogram when selecting best split plane. */
|
||||||
|
@@ -1196,16 +1196,18 @@ class OptiXDevice : public CUDADevice {
|
|||||||
|
|
||||||
const CUDAContextScope scope(cuContext);
|
const CUDAContextScope scope(cuContext);
|
||||||
|
|
||||||
|
const bool use_fast_trace_bvh = (bvh->params.bvh_type == SceneParams::BVH_STATIC);
|
||||||
|
|
||||||
// Compute memory usage
|
// Compute memory usage
|
||||||
OptixAccelBufferSizes sizes = {};
|
OptixAccelBufferSizes sizes = {};
|
||||||
OptixAccelBuildOptions options = {};
|
OptixAccelBuildOptions options = {};
|
||||||
options.operation = operation;
|
options.operation = operation;
|
||||||
if (background) {
|
if (use_fast_trace_bvh) {
|
||||||
// Prefer best performance and lowest memory consumption in background
|
VLOG(2) << "Using fast to trace OptiX BVH";
|
||||||
options.buildFlags = OPTIX_BUILD_FLAG_PREFER_FAST_TRACE | OPTIX_BUILD_FLAG_ALLOW_COMPACTION;
|
options.buildFlags = OPTIX_BUILD_FLAG_PREFER_FAST_TRACE | OPTIX_BUILD_FLAG_ALLOW_COMPACTION;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Prefer fast updates in viewport
|
VLOG(2) << "Using fast to update OptiX BVH";
|
||||||
options.buildFlags = OPTIX_BUILD_FLAG_PREFER_FAST_BUILD | OPTIX_BUILD_FLAG_ALLOW_UPDATE;
|
options.buildFlags = OPTIX_BUILD_FLAG_PREFER_FAST_BUILD | OPTIX_BUILD_FLAG_ALLOW_UPDATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1253,15 +1255,16 @@ class OptiXDevice : public CUDADevice {
|
|||||||
out_data.device_pointer,
|
out_data.device_pointer,
|
||||||
sizes.outputSizeInBytes,
|
sizes.outputSizeInBytes,
|
||||||
&out_handle,
|
&out_handle,
|
||||||
background ? &compacted_size_prop : NULL,
|
use_fast_trace_bvh ? &compacted_size_prop : NULL,
|
||||||
background ? 1 : 0));
|
use_fast_trace_bvh ? 1 : 0));
|
||||||
bvh->traversable_handle = static_cast<uint64_t>(out_handle);
|
bvh->traversable_handle = static_cast<uint64_t>(out_handle);
|
||||||
|
|
||||||
// Wait for all operations to finish
|
// Wait for all operations to finish
|
||||||
check_result_cuda_ret(cuStreamSynchronize(NULL));
|
check_result_cuda_ret(cuStreamSynchronize(NULL));
|
||||||
|
|
||||||
// Compact acceleration structure to save memory (do not do this in viewport for faster builds)
|
// Compact acceleration structure to save memory (only if using fast trace as the
|
||||||
if (background) {
|
// OPTIX_BUILD_FLAG_ALLOW_COMPACTION flag is only set in this case).
|
||||||
|
if (use_fast_trace_bvh) {
|
||||||
uint64_t compacted_size = sizes.outputSizeInBytes;
|
uint64_t compacted_size = sizes.outputSizeInBytes;
|
||||||
check_result_cuda_ret(
|
check_result_cuda_ret(
|
||||||
cuMemcpyDtoH(&compacted_size, compacted_size_prop.result, sizeof(compacted_size)));
|
cuMemcpyDtoH(&compacted_size, compacted_size_prop.result, sizeof(compacted_size)));
|
||||||
@@ -1306,6 +1309,8 @@ class OptiXDevice : public CUDADevice {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const bool use_fast_trace_bvh = (bvh->params.bvh_type == SceneParams::BVH_STATIC);
|
||||||
|
|
||||||
free_bvh_memory_delayed();
|
free_bvh_memory_delayed();
|
||||||
|
|
||||||
BVHOptiX *const bvh_optix = static_cast<BVHOptiX *>(bvh);
|
BVHOptiX *const bvh_optix = static_cast<BVHOptiX *>(bvh);
|
||||||
@@ -1315,10 +1320,10 @@ class OptiXDevice : public CUDADevice {
|
|||||||
if (!bvh->params.top_level) {
|
if (!bvh->params.top_level) {
|
||||||
assert(bvh->objects.size() == 1 && bvh->geometry.size() == 1);
|
assert(bvh->objects.size() == 1 && bvh->geometry.size() == 1);
|
||||||
|
|
||||||
// Refit is only possible in viewport for now (because AS is built with
|
|
||||||
// OPTIX_BUILD_FLAG_ALLOW_UPDATE only there, see above)
|
|
||||||
OptixBuildOperation operation = OPTIX_BUILD_OPERATION_BUILD;
|
OptixBuildOperation operation = OPTIX_BUILD_OPERATION_BUILD;
|
||||||
if (refit && !background) {
|
/* Refit is only possible when using fast to trace BVH (because AS is built with
|
||||||
|
* OPTIX_BUILD_FLAG_ALLOW_UPDATE only there, see above). */
|
||||||
|
if (refit && !use_fast_trace_bvh) {
|
||||||
assert(bvh_optix->traversable_handle != 0);
|
assert(bvh_optix->traversable_handle != 0);
|
||||||
operation = OPTIX_BUILD_OPERATION_UPDATE;
|
operation = OPTIX_BUILD_OPERATION_UPDATE;
|
||||||
}
|
}
|
||||||
|
@@ -65,7 +65,7 @@ class DenoiseParams {
|
|||||||
/* Viewport start sample. */
|
/* Viewport start sample. */
|
||||||
int start_sample;
|
int start_sample;
|
||||||
|
|
||||||
/** Native Denoiser **/
|
/** Native Denoiser. */
|
||||||
|
|
||||||
/* Pixel radius for neighboring pixels to take into account. */
|
/* Pixel radius for neighboring pixels to take into account. */
|
||||||
int radius;
|
int radius;
|
||||||
@@ -81,7 +81,7 @@ class DenoiseParams {
|
|||||||
/* Clamp the input to the range of +-1e8. Should be enough for any legitimate data. */
|
/* Clamp the input to the range of +-1e8. Should be enough for any legitimate data. */
|
||||||
bool clamp_input;
|
bool clamp_input;
|
||||||
|
|
||||||
/** OIDN/Optix Denoiser **/
|
/** OIDN/Optix Denoiser. */
|
||||||
|
|
||||||
/* Passes handed over to the OIDN/OptiX denoiser (default to color + albedo). */
|
/* Passes handed over to the OIDN/OptiX denoiser (default to color + albedo). */
|
||||||
DenoiserInput input_passes;
|
DenoiserInput input_passes;
|
||||||
|
@@ -116,7 +116,7 @@ CCL_NAMESPACE_BEGIN
|
|||||||
# endif
|
# endif
|
||||||
# endif /* __SHADOW_RECORD_ALL__ */
|
# endif /* __SHADOW_RECORD_ALL__ */
|
||||||
|
|
||||||
/* Record all intersections - Volume BVH traversal */
|
/* Record all intersections - Volume BVH traversal. */
|
||||||
|
|
||||||
# if defined(__VOLUME_RECORD_ALL__)
|
# if defined(__VOLUME_RECORD_ALL__)
|
||||||
# define BVH_FUNCTION_NAME bvh_intersect_volume_all
|
# define BVH_FUNCTION_NAME bvh_intersect_volume_all
|
||||||
|
@@ -61,8 +61,8 @@ ccl_device_forceinline float3 bsdf_ashikhmin_shirley_eval_reflect(const ShaderCl
|
|||||||
const MicrofacetBsdf *bsdf = (const MicrofacetBsdf *)sc;
|
const MicrofacetBsdf *bsdf = (const MicrofacetBsdf *)sc;
|
||||||
float3 N = bsdf->N;
|
float3 N = bsdf->N;
|
||||||
|
|
||||||
float NdotI = dot(N, I); /* in Cycles/OSL convention I is omega_out */
|
float NdotI = dot(N, I); /* in Cycles/OSL convention I is omega_out */
|
||||||
float NdotO = dot(N, omega_in); /* and consequently we use for O omaga_in ;) */
|
float NdotO = dot(N, omega_in); /* and consequently we use for O omaga_in ;) */
|
||||||
|
|
||||||
float out = 0.0f;
|
float out = 0.0f;
|
||||||
|
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
/* normal on triangle */
|
/* Normal on triangle. */
|
||||||
ccl_device_inline float3 triangle_normal(KernelGlobals *kg, ShaderData *sd)
|
ccl_device_inline float3 triangle_normal(KernelGlobals *kg, ShaderData *sd)
|
||||||
{
|
{
|
||||||
/* load triangle vertices */
|
/* load triangle vertices */
|
||||||
@@ -40,7 +40,7 @@ ccl_device_inline float3 triangle_normal(KernelGlobals *kg, ShaderData *sd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* point and normal on triangle */
|
/* Point and normal on triangle. */
|
||||||
ccl_device_inline void triangle_point_normal(
|
ccl_device_inline void triangle_point_normal(
|
||||||
KernelGlobals *kg, int object, int prim, float u, float v, float3 *P, float3 *Ng, int *shader)
|
KernelGlobals *kg, int object, int prim, float u, float v, float3 *P, float3 *Ng, int *shader)
|
||||||
{
|
{
|
||||||
|
@@ -64,7 +64,7 @@ typedef struct KernelGlobals {
|
|||||||
OSLThreadData *osl_tdata;
|
OSLThreadData *osl_tdata;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
/* **** Run-time data **** */
|
/* **** Run-time data **** */
|
||||||
|
|
||||||
/* Heap-allocated storage for transparent shadows intersections. */
|
/* Heap-allocated storage for transparent shadows intersections. */
|
||||||
Intersection *transparent_shadow_intersections;
|
Intersection *transparent_shadow_intersections;
|
||||||
|
@@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
/* Spherical coordinates <-> Cartesian direction */
|
/* Spherical coordinates <-> Cartesian direction. */
|
||||||
|
|
||||||
ccl_device float2 direction_to_spherical(float3 dir)
|
ccl_device float2 direction_to_spherical(float3 dir)
|
||||||
{
|
{
|
||||||
|
@@ -79,7 +79,7 @@ ccl_device void enqueue_ray_index_local(
|
|||||||
{
|
{
|
||||||
int lidx = ccl_local_id(1) * ccl_local_size(0) + ccl_local_id(0);
|
int lidx = ccl_local_id(1) * ccl_local_size(0) + ccl_local_id(0);
|
||||||
|
|
||||||
/* Get local queue id .*/
|
/* Get local queue id. */
|
||||||
unsigned int lqidx;
|
unsigned int lqidx;
|
||||||
if (enqueue_flag) {
|
if (enqueue_flag) {
|
||||||
lqidx = atomic_fetch_and_inc_uint32(local_queue_atomics);
|
lqidx = atomic_fetch_and_inc_uint32(local_queue_atomics);
|
||||||
|
@@ -302,7 +302,7 @@ enum PathRayFlag {
|
|||||||
PATH_RAY_DIFFUSE_ANCESTOR = (1 << 15),
|
PATH_RAY_DIFFUSE_ANCESTOR = (1 << 15),
|
||||||
/* Single pass has been written. */
|
/* Single pass has been written. */
|
||||||
PATH_RAY_SINGLE_PASS_DONE = (1 << 16),
|
PATH_RAY_SINGLE_PASS_DONE = (1 << 16),
|
||||||
/* Ray is behind a shadow catcher .*/
|
/* Ray is behind a shadow catcher. */
|
||||||
PATH_RAY_SHADOW_CATCHER = (1 << 17),
|
PATH_RAY_SHADOW_CATCHER = (1 << 17),
|
||||||
/* Store shadow data for shadow catcher or denoising. */
|
/* Store shadow data for shadow catcher or denoising. */
|
||||||
PATH_RAY_STORE_SHADOW_INFO = (1 << 18),
|
PATH_RAY_STORE_SHADOW_INFO = (1 << 18),
|
||||||
|
@@ -317,4 +317,4 @@ class OSLRenderServices : public OSL::RendererServices {
|
|||||||
|
|
||||||
CCL_NAMESPACE_END
|
CCL_NAMESPACE_END
|
||||||
|
|
||||||
#endif /* __OSL_SERVICES_H__ */
|
#endif /* __OSL_SERVICES_H__ */
|
||||||
|
@@ -52,6 +52,9 @@ shader node_vector_math(string math_type = "add",
|
|||||||
else if (math_type == "faceforward") {
|
else if (math_type == "faceforward") {
|
||||||
Vector = compatible_faceforward(Vector1, Vector2, Vector3);
|
Vector = compatible_faceforward(Vector1, Vector2, Vector3);
|
||||||
}
|
}
|
||||||
|
else if (math_type == "multiply_add") {
|
||||||
|
Vector = Vector1 * Vector2 + Vector3;
|
||||||
|
}
|
||||||
else if (math_type == "dot_product") {
|
else if (math_type == "dot_product") {
|
||||||
Value = dot(Vector1, Vector2);
|
Value = dot(Vector1, Vector2);
|
||||||
}
|
}
|
||||||
|
@@ -803,7 +803,7 @@ ccl_device void svm_node_closure_bsdf(KernelGlobals *kg,
|
|||||||
float melanin_redness = stack_load_float_default(
|
float melanin_redness = stack_load_float_default(
|
||||||
stack, melanin_redness_ofs, data_node2.w);
|
stack, melanin_redness_ofs, data_node2.w);
|
||||||
|
|
||||||
/* Randomize melanin. */
|
/* Randomize melanin. */
|
||||||
float random_color = stack_load_float_default(stack, random_color_ofs, data_node3.z);
|
float random_color = stack_load_float_default(stack, random_color_ofs, data_node3.z);
|
||||||
random_color = clamp(random_color, 0.0f, 1.0f);
|
random_color = clamp(random_color, 0.0f, 1.0f);
|
||||||
float factor_random_color = 1.0f + 2.0f * (random - 0.5f) * random_color;
|
float factor_random_color = 1.0f + 2.0f * (random - 0.5f) * random_color;
|
||||||
|
@@ -220,11 +220,13 @@ ccl_device void svm_node_hair_info(
|
|||||||
stack_store_float(stack, out_offset, data);
|
stack_store_float(stack, out_offset, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/*case NODE_INFO_CURVE_FADE: {
|
# if 0
|
||||||
|
case NODE_INFO_CURVE_FADE: {
|
||||||
data = sd->curve_transparency;
|
data = sd->curve_transparency;
|
||||||
stack_store_float(stack, out_offset, data);
|
stack_store_float(stack, out_offset, data);
|
||||||
break;
|
break;
|
||||||
}*/
|
}
|
||||||
|
# endif
|
||||||
case NODE_INFO_CURVE_TANGENT_NORMAL: {
|
case NODE_INFO_CURVE_TANGENT_NORMAL: {
|
||||||
data3 = curve_tangent_normal(kg, sd);
|
data3 = curve_tangent_normal(kg, sd);
|
||||||
stack_store_float3(stack, out_offset, data3);
|
stack_store_float3(stack, out_offset, data3);
|
||||||
|
@@ -58,7 +58,8 @@ ccl_device void svm_node_vector_math(KernelGlobals *kg,
|
|||||||
float3 vector;
|
float3 vector;
|
||||||
|
|
||||||
/* 3 Vector Operators */
|
/* 3 Vector Operators */
|
||||||
if (type == NODE_VECTOR_MATH_WRAP || type == NODE_VECTOR_MATH_FACEFORWARD) {
|
if (type == NODE_VECTOR_MATH_WRAP || type == NODE_VECTOR_MATH_FACEFORWARD ||
|
||||||
|
type == NODE_VECTOR_MATH_MULTIPLY_ADD) {
|
||||||
uint4 extra_node = read_node(kg, offset);
|
uint4 extra_node = read_node(kg, offset);
|
||||||
c = stack_load_float3(stack, extra_node.x);
|
c = stack_load_float3(stack, extra_node.x);
|
||||||
}
|
}
|
||||||
|
@@ -52,6 +52,9 @@ ccl_device void svm_vector_math(float *value,
|
|||||||
case NODE_VECTOR_MATH_FACEFORWARD:
|
case NODE_VECTOR_MATH_FACEFORWARD:
|
||||||
*vector = faceforward(a, b, c);
|
*vector = faceforward(a, b, c);
|
||||||
break;
|
break;
|
||||||
|
case NODE_VECTOR_MATH_MULTIPLY_ADD:
|
||||||
|
*vector = a * b + c;
|
||||||
|
break;
|
||||||
case NODE_VECTOR_MATH_DOT_PRODUCT:
|
case NODE_VECTOR_MATH_DOT_PRODUCT:
|
||||||
*value = dot(a, b);
|
*value = dot(a, b);
|
||||||
break;
|
break;
|
||||||
|
@@ -341,6 +341,7 @@ typedef enum NodeVectorMathType {
|
|||||||
NODE_VECTOR_MATH_TANGENT,
|
NODE_VECTOR_MATH_TANGENT,
|
||||||
NODE_VECTOR_MATH_REFRACT,
|
NODE_VECTOR_MATH_REFRACT,
|
||||||
NODE_VECTOR_MATH_FACEFORWARD,
|
NODE_VECTOR_MATH_FACEFORWARD,
|
||||||
|
NODE_VECTOR_MATH_MULTIPLY_ADD,
|
||||||
} NodeVectorMathType;
|
} NodeVectorMathType;
|
||||||
|
|
||||||
typedef enum NodeClampType {
|
typedef enum NodeClampType {
|
||||||
|
@@ -333,7 +333,7 @@ static M44d get_interpolated_matrix_for_time(const MatrixSampleMap &samples, chr
|
|||||||
|
|
||||||
chrono_t t = (time - prev_time) / (next_time - prev_time);
|
chrono_t t = (time - prev_time) / (next_time - prev_time);
|
||||||
|
|
||||||
/* ensure rotation around the shortest angle */
|
/* Ensure rotation around the shortest angle. */
|
||||||
if ((prev_rotation ^ next_rotation) < 0) {
|
if ((prev_rotation ^ next_rotation) < 0) {
|
||||||
next_rotation = -next_rotation;
|
next_rotation = -next_rotation;
|
||||||
}
|
}
|
||||||
|
@@ -606,7 +606,8 @@ void read_geometry_data(AlembicProcedural *proc,
|
|||||||
|
|
||||||
template<typename T> struct value_type_converter {
|
template<typename T> struct value_type_converter {
|
||||||
using cycles_type = float;
|
using cycles_type = float;
|
||||||
static constexpr TypeDesc type_desc = TypeFloat;
|
/* Use `TypeDesc::FLOAT` instead of `TypeFloat` to work around a compiler bug in gcc 11. */
|
||||||
|
static constexpr TypeDesc type_desc = TypeDesc::FLOAT;
|
||||||
static constexpr const char *type_name = "float (default)";
|
static constexpr const char *type_name = "float (default)";
|
||||||
|
|
||||||
static cycles_type convert_value(T value)
|
static cycles_type convert_value(T value)
|
||||||
@@ -735,13 +736,14 @@ static void process_uvs(CachedData &cache,
|
|||||||
const IV2fGeomParam::Sample &sample,
|
const IV2fGeomParam::Sample &sample,
|
||||||
double time)
|
double time)
|
||||||
{
|
{
|
||||||
if (scope != kFacevaryingScope) {
|
if (scope != kFacevaryingScope && scope != kVaryingScope && scope != kVertexScope) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const array<int> *uv_loops = cache.uv_loops.data_for_time_no_check(time).get_data_or_null();
|
const array<int> *uv_loops = cache.uv_loops.data_for_time_no_check(time).get_data_or_null();
|
||||||
|
|
||||||
if (!uv_loops) {
|
/* It's ok to not have loop indices, as long as the scope is not face-varying. */
|
||||||
|
if (!uv_loops && scope == kFacevaryingScope) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -765,9 +767,27 @@ static void process_uvs(CachedData &cache,
|
|||||||
const uint32_t *indices = sample.getIndices()->get();
|
const uint32_t *indices = sample.getIndices()->get();
|
||||||
const V2f *values = sample.getVals()->get();
|
const V2f *values = sample.getVals()->get();
|
||||||
|
|
||||||
for (const int uv_loop_index : *uv_loops) {
|
if (scope == kFacevaryingScope) {
|
||||||
const uint32_t index = indices[uv_loop_index];
|
for (const int uv_loop_index : *uv_loops) {
|
||||||
*data_float2++ = make_float2(values[index][0], values[index][1]);
|
const uint32_t index = indices[uv_loop_index];
|
||||||
|
*data_float2++ = make_float2(values[index][0], values[index][1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (scope == kVaryingScope || scope == kVertexScope) {
|
||||||
|
if (triangles) {
|
||||||
|
for (size_t i = 0; i < triangles->size(); i++) {
|
||||||
|
const int3 t = (*triangles)[i];
|
||||||
|
*data_float2++ = make_float2(values[t.x][0], values[t.x][1]);
|
||||||
|
*data_float2++ = make_float2(values[t.y][0], values[t.y][1]);
|
||||||
|
*data_float2++ = make_float2(values[t.z][0], values[t.z][1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (corners) {
|
||||||
|
for (size_t i = 0; i < corners->size(); i++) {
|
||||||
|
const int c = (*corners)[i];
|
||||||
|
*data_float2++ = make_float2(values[c][0], values[c][1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute.data.add_data(data, time);
|
attribute.data.add_data(data, time);
|
||||||
|
@@ -4425,12 +4425,12 @@ void HairInfoNode::compile(SVMCompiler &compiler)
|
|||||||
if (!out->links.empty()) {
|
if (!out->links.empty()) {
|
||||||
compiler.add_node(NODE_HAIR_INFO, NODE_INFO_CURVE_TANGENT_NORMAL, compiler.stack_assign(out));
|
compiler.add_node(NODE_HAIR_INFO, NODE_INFO_CURVE_TANGENT_NORMAL, compiler.stack_assign(out));
|
||||||
}
|
}
|
||||||
|
#if 0
|
||||||
/*out = output("Fade");
|
out = output("Fade");
|
||||||
if(!out->links.empty()) {
|
if(!out->links.empty()) {
|
||||||
compiler.add_node(NODE_HAIR_INFO, NODE_INFO_CURVE_FADE, compiler.stack_assign(out));
|
compiler.add_node(NODE_HAIR_INFO, NODE_INFO_CURVE_FADE, compiler.stack_assign(out));
|
||||||
}*/
|
}
|
||||||
|
#endif
|
||||||
out = output("Random");
|
out = output("Random");
|
||||||
if (!out->links.empty()) {
|
if (!out->links.empty()) {
|
||||||
int attr = compiler.attribute(ATTR_STD_CURVE_RANDOM);
|
int attr = compiler.attribute(ATTR_STD_CURVE_RANDOM);
|
||||||
@@ -6093,6 +6093,7 @@ NODE_DEFINE(VectorMathNode)
|
|||||||
type_enum.insert("reflect", NODE_VECTOR_MATH_REFLECT);
|
type_enum.insert("reflect", NODE_VECTOR_MATH_REFLECT);
|
||||||
type_enum.insert("refract", NODE_VECTOR_MATH_REFRACT);
|
type_enum.insert("refract", NODE_VECTOR_MATH_REFRACT);
|
||||||
type_enum.insert("faceforward", NODE_VECTOR_MATH_FACEFORWARD);
|
type_enum.insert("faceforward", NODE_VECTOR_MATH_FACEFORWARD);
|
||||||
|
type_enum.insert("multiply_add", NODE_VECTOR_MATH_MULTIPLY_ADD);
|
||||||
|
|
||||||
type_enum.insert("dot_product", NODE_VECTOR_MATH_DOT_PRODUCT);
|
type_enum.insert("dot_product", NODE_VECTOR_MATH_DOT_PRODUCT);
|
||||||
|
|
||||||
@@ -6165,7 +6166,8 @@ void VectorMathNode::compile(SVMCompiler &compiler)
|
|||||||
int vector_stack_offset = compiler.stack_assign_if_linked(vector_out);
|
int vector_stack_offset = compiler.stack_assign_if_linked(vector_out);
|
||||||
|
|
||||||
/* 3 Vector Operators */
|
/* 3 Vector Operators */
|
||||||
if (math_type == NODE_VECTOR_MATH_WRAP || math_type == NODE_VECTOR_MATH_FACEFORWARD) {
|
if (math_type == NODE_VECTOR_MATH_WRAP || math_type == NODE_VECTOR_MATH_FACEFORWARD ||
|
||||||
|
math_type == NODE_VECTOR_MATH_MULTIPLY_ADD) {
|
||||||
ShaderInput *vector3_in = input("Vector3");
|
ShaderInput *vector3_in = input("Vector3");
|
||||||
int vector3_stack_offset = compiler.stack_assign(vector3_in);
|
int vector3_stack_offset = compiler.stack_assign(vector3_in);
|
||||||
compiler.add_node(
|
compiler.add_node(
|
||||||
|
@@ -195,4 +195,4 @@ class OSLCompiler {
|
|||||||
|
|
||||||
CCL_NAMESPACE_END
|
CCL_NAMESPACE_END
|
||||||
|
|
||||||
#endif /* __OSL_H__ */
|
#endif /* __OSL_H__ */
|
||||||
|
@@ -1252,7 +1252,7 @@ bool Session::update_progressive_refine(bool cancel)
|
|||||||
double current_time = time_dt();
|
double current_time = time_dt();
|
||||||
|
|
||||||
if (current_time - last_update_time < params.progressive_update_timeout) {
|
if (current_time - last_update_time < params.progressive_update_timeout) {
|
||||||
/* if last sample was processed, we need to write buffers anyway */
|
/* If last sample was processed, we need to write buffers anyway. */
|
||||||
if (!write && sample != 1)
|
if (!write && sample != 1)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
if(WITH_GTESTS)
|
if(WITH_GTESTS)
|
||||||
Include(GTestTesting)
|
Include(GTestTesting)
|
||||||
|
|
||||||
# Otherwise we get warnings here that we cant fix in external projects
|
# Otherwise we get warnings here that we can't fix in external projects
|
||||||
remove_strict_flags()
|
remove_strict_flags()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@@ -223,12 +223,14 @@ ccl_device_inline ssef fastpow24(const ssef &arg)
|
|||||||
ssef x = fastpow<0x3F4CCCCD, 0x4F55A7FB>(arg); // error max = 0.17 avg = 0.0018 |avg| = 0.05
|
ssef x = fastpow<0x3F4CCCCD, 0x4F55A7FB>(arg); // error max = 0.17 avg = 0.0018 |avg| = 0.05
|
||||||
ssef arg2 = arg * arg;
|
ssef arg2 = arg * arg;
|
||||||
ssef arg4 = arg2 * arg2;
|
ssef arg4 = arg2 * arg2;
|
||||||
x = improve_5throot_solution(x,
|
|
||||||
arg4); /* error max = 0.018 avg = 0.0031 |avg| = 0.0031 */
|
/* error max = 0.018 avg = 0.0031 |avg| = 0.0031 */
|
||||||
x = improve_5throot_solution(x,
|
x = improve_5throot_solution(x, arg4);
|
||||||
arg4); /* error max = 0.00021 avg = 1.6e-05 |avg| = 1.6e-05 */
|
/* error max = 0.00021 avg = 1.6e-05 |avg| = 1.6e-05 */
|
||||||
x = improve_5throot_solution(x,
|
x = improve_5throot_solution(x, arg4);
|
||||||
arg4); /* error max = 6.1e-07 avg = 5.2e-08 |avg| = 1.1e-07 */
|
/* error max = 6.1e-07 avg = 5.2e-08 |avg| = 1.1e-07 */
|
||||||
|
x = improve_5throot_solution(x, arg4);
|
||||||
|
|
||||||
return x * (x * x);
|
return x * (x * x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -129,7 +129,7 @@ class DebugFlags {
|
|||||||
DEVICE_NONE,
|
DEVICE_NONE,
|
||||||
/* All OpenCL devices will be used. */
|
/* All OpenCL devices will be used. */
|
||||||
DEVICE_ALL,
|
DEVICE_ALL,
|
||||||
/* Default system OpenCL device will be used. */
|
/* Default system OpenCL device will be used. */
|
||||||
DEVICE_DEFAULT,
|
DEVICE_DEFAULT,
|
||||||
/* Host processor will be used. */
|
/* Host processor will be used. */
|
||||||
DEVICE_CPU,
|
DEVICE_CPU,
|
||||||
|
@@ -282,8 +282,8 @@ static CPUCapabilities &system_cpu_capabilities()
|
|||||||
/* actual opcode for xgetbv */
|
/* actual opcode for xgetbv */
|
||||||
__asm__(".byte 0x0f, 0x01, 0xd0" : "=a"(xcr_feature_mask), "=d"(edx) : "c"(0));
|
__asm__(".byte 0x0f, 0x01, 0xd0" : "=a"(xcr_feature_mask), "=d"(edx) : "c"(0));
|
||||||
# elif defined(_MSC_VER) && defined(_XCR_XFEATURE_ENABLED_MASK)
|
# elif defined(_MSC_VER) && defined(_XCR_XFEATURE_ENABLED_MASK)
|
||||||
xcr_feature_mask = (uint32_t)_xgetbv(
|
/* Minimum VS2010 SP1 compiler is required. */
|
||||||
_XCR_XFEATURE_ENABLED_MASK); /* min VS2010 SP1 compiler is required */
|
xcr_feature_mask = (uint32_t)_xgetbv(_XCR_XFEATURE_ENABLED_MASK);
|
||||||
# else
|
# else
|
||||||
xcr_feature_mask = 0;
|
xcr_feature_mask = 0;
|
||||||
# endif
|
# endif
|
||||||
|
@@ -88,7 +88,7 @@ class TaskScheduler {
|
|||||||
|
|
||||||
/* Approximate number of threads that will work on task, which may be lower
|
/* Approximate number of threads that will work on task, which may be lower
|
||||||
* or higher than the actual number of threads. Use as little as possible and
|
* or higher than the actual number of threads. Use as little as possible and
|
||||||
* leave splitting up tasks to the scheduler.. */
|
* leave splitting up tasks to the scheduler. */
|
||||||
static int num_threads();
|
static int num_threads();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@@ -93,42 +93,23 @@ void my_guess_pkt_duration(AVFormatContext *s, AVStream *st, AVPacket *pkt)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
FFMPEG_INLINE
|
FFMPEG_INLINE
|
||||||
void my_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp)
|
int64_t timestamp_from_pts_or_dts(int64_t pts, int64_t dts)
|
||||||
{
|
{
|
||||||
int i;
|
/* Some videos do not have any pts values, use dts instead in those cases if
|
||||||
|
* possible. Usually when this happens dts can act as pts because as all frames
|
||||||
for (i = 0; i < s->nb_streams; i++) {
|
* should then be presented in their decoded in order. IE pts == dts. */
|
||||||
AVStream *st = s->streams[i];
|
|
||||||
|
|
||||||
st->cur_dts = av_rescale(timestamp,
|
|
||||||
st->time_base.den * (int64_t)ref_st->time_base.num,
|
|
||||||
st->time_base.num * (int64_t)ref_st->time_base.den);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FFMPEG_INLINE
|
|
||||||
void av_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp)
|
|
||||||
{
|
|
||||||
my_update_cur_dts(s, ref_st, timestamp);
|
|
||||||
}
|
|
||||||
|
|
||||||
FFMPEG_INLINE
|
|
||||||
int64_t av_get_pts_from_frame(AVFormatContext *avctx, AVFrame *picture)
|
|
||||||
{
|
|
||||||
int64_t pts;
|
|
||||||
pts = picture->pts;
|
|
||||||
|
|
||||||
if (pts == AV_NOPTS_VALUE) {
|
if (pts == AV_NOPTS_VALUE) {
|
||||||
pts = picture->pkt_dts;
|
return dts;
|
||||||
}
|
}
|
||||||
if (pts == AV_NOPTS_VALUE) {
|
|
||||||
pts = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
(void)avctx;
|
|
||||||
return pts;
|
return pts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FFMPEG_INLINE
|
||||||
|
int64_t av_get_pts_from_frame(AVFrame *picture)
|
||||||
|
{
|
||||||
|
return timestamp_from_pts_or_dts(picture->pts, picture->pkt_dts);
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------- */
|
||||||
/** \name Deinterlace code block
|
/** \name Deinterlace code block
|
||||||
*
|
*
|
||||||
|
@@ -282,6 +282,7 @@ elseif(WITH_GHOST_X11 OR WITH_GHOST_WAYLAND)
|
|||||||
${wayland-egl_INCLUDE_DIRS}
|
${wayland-egl_INCLUDE_DIRS}
|
||||||
${xkbcommon_INCLUDE_DIRS}
|
${xkbcommon_INCLUDE_DIRS}
|
||||||
${wayland-cursor_INCLUDE_DIRS}
|
${wayland-cursor_INCLUDE_DIRS}
|
||||||
|
${dbus_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND SRC
|
list(APPEND SRC
|
||||||
@@ -321,6 +322,11 @@ elseif(WITH_GHOST_X11 OR WITH_GHOST_WAYLAND)
|
|||||||
xdg-shell
|
xdg-shell
|
||||||
"${WAYLAND_PROTOCOLS_DIR}/stable/xdg-shell/xdg-shell.xml"
|
"${WAYLAND_PROTOCOLS_DIR}/stable/xdg-shell/xdg-shell.xml"
|
||||||
)
|
)
|
||||||
|
# xdg-decoration.
|
||||||
|
generate_protocol_bindings(
|
||||||
|
xdg-decoration
|
||||||
|
"${WAYLAND_PROTOCOLS_DIR}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml"
|
||||||
|
)
|
||||||
# Pointer-constraints.
|
# Pointer-constraints.
|
||||||
generate_protocol_bindings(
|
generate_protocol_bindings(
|
||||||
pointer-constraints
|
pointer-constraints
|
||||||
@@ -364,6 +370,7 @@ elseif(WIN32)
|
|||||||
intern/GHOST_DropTargetWin32.cpp
|
intern/GHOST_DropTargetWin32.cpp
|
||||||
intern/GHOST_SystemWin32.cpp
|
intern/GHOST_SystemWin32.cpp
|
||||||
intern/GHOST_WindowWin32.cpp
|
intern/GHOST_WindowWin32.cpp
|
||||||
|
intern/GHOST_Wintab.cpp
|
||||||
|
|
||||||
intern/GHOST_ContextD3D.h
|
intern/GHOST_ContextD3D.h
|
||||||
intern/GHOST_DisplayManagerWin32.h
|
intern/GHOST_DisplayManagerWin32.h
|
||||||
@@ -371,6 +378,7 @@ elseif(WIN32)
|
|||||||
intern/GHOST_SystemWin32.h
|
intern/GHOST_SystemWin32.h
|
||||||
intern/GHOST_TaskbarWin32.h
|
intern/GHOST_TaskbarWin32.h
|
||||||
intern/GHOST_WindowWin32.h
|
intern/GHOST_WindowWin32.h
|
||||||
|
intern/GHOST_Wintab.h
|
||||||
)
|
)
|
||||||
|
|
||||||
if(NOT WITH_GL_EGL)
|
if(NOT WITH_GL_EGL)
|
||||||
@@ -475,10 +483,17 @@ if(WITH_XR_OPENXR)
|
|||||||
shlwapi
|
shlwapi
|
||||||
)
|
)
|
||||||
elseif(UNIX AND NOT APPLE)
|
elseif(UNIX AND NOT APPLE)
|
||||||
list(APPEND XR_PLATFORM_DEFINES
|
list(APPEND XR_PLATFORM_DEFINES -DXR_OS_LINUX)
|
||||||
-DXR_OS_LINUX
|
if (WITH_GHOST_WAYLAND)
|
||||||
-DXR_USE_PLATFORM_XLIB
|
list(APPEND XR_PLATFORM_DEFINES -DXR_USE_PLATFORM_WAYLAND)
|
||||||
)
|
endif()
|
||||||
|
if (WITH_GHOST_X11)
|
||||||
|
if (WITH_GL_EGL)
|
||||||
|
list(APPEND XR_PLATFORM_DEFINES -DXR_USE_PLATFORM_EGL)
|
||||||
|
else()
|
||||||
|
list(APPEND XR_PLATFORM_DEFINES -DXR_USE_PLATFORM_XLIB)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_definitions(-DWITH_XR_OPENXR ${XR_PLATFORM_DEFINES})
|
add_definitions(-DWITH_XR_OPENXR ${XR_PLATFORM_DEFINES})
|
||||||
|
@@ -105,7 +105,9 @@ typedef enum {
|
|||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
GHOST_kTabletAutomatic = 0,
|
GHOST_kTabletAutomatic = 0,
|
||||||
GHOST_kTabletNative,
|
/* Show as Windows Ink to users to match "Use Windows Ink" in tablet utilities,
|
||||||
|
* but we use the dependent Windows Pointer API. */
|
||||||
|
GHOST_kTabletWinPointer,
|
||||||
GHOST_kTabletWintab,
|
GHOST_kTabletWintab,
|
||||||
} GHOST_TTabletAPI;
|
} GHOST_TTabletAPI;
|
||||||
|
|
||||||
@@ -168,7 +170,7 @@ typedef enum {
|
|||||||
GHOST_kButtonMaskRight,
|
GHOST_kButtonMaskRight,
|
||||||
GHOST_kButtonMaskButton4,
|
GHOST_kButtonMaskButton4,
|
||||||
GHOST_kButtonMaskButton5,
|
GHOST_kButtonMaskButton5,
|
||||||
/* Trackballs and programmable buttons */
|
/* Trackballs and programmable buttons. */
|
||||||
GHOST_kButtonMaskButton6,
|
GHOST_kButtonMaskButton6,
|
||||||
GHOST_kButtonMaskButton7,
|
GHOST_kButtonMaskButton7,
|
||||||
GHOST_kButtonNumMasks
|
GHOST_kButtonNumMasks
|
||||||
@@ -177,15 +179,15 @@ typedef enum {
|
|||||||
typedef enum {
|
typedef enum {
|
||||||
GHOST_kEventUnknown = 0,
|
GHOST_kEventUnknown = 0,
|
||||||
|
|
||||||
GHOST_kEventCursorMove, /// Mouse move event
|
GHOST_kEventCursorMove, /* Mouse move event. */
|
||||||
GHOST_kEventButtonDown, /// Mouse button event
|
GHOST_kEventButtonDown, /* Mouse button event. */
|
||||||
GHOST_kEventButtonUp, /// Mouse button event
|
GHOST_kEventButtonUp, /* Mouse button event. */
|
||||||
GHOST_kEventWheel, /// Mouse wheel event
|
GHOST_kEventWheel, /* Mouse wheel event. */
|
||||||
GHOST_kEventTrackpad, /// Trackpad event
|
GHOST_kEventTrackpad, /* Trackpad event. */
|
||||||
|
|
||||||
#ifdef WITH_INPUT_NDOF
|
#ifdef WITH_INPUT_NDOF
|
||||||
GHOST_kEventNDOFMotion, /// N degree of freedom device motion event
|
GHOST_kEventNDOFMotion, /* N degree of freedom device motion event. */
|
||||||
GHOST_kEventNDOFButton, /// N degree of freedom device button event
|
GHOST_kEventNDOFButton, /* N degree of freedom device button event. */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GHOST_kEventKeyDown,
|
GHOST_kEventKeyDown,
|
||||||
@@ -207,8 +209,8 @@ typedef enum {
|
|||||||
GHOST_kEventDraggingExited,
|
GHOST_kEventDraggingExited,
|
||||||
GHOST_kEventDraggingDropDone,
|
GHOST_kEventDraggingDropDone,
|
||||||
|
|
||||||
GHOST_kEventOpenMainFile, // Needed for Cocoa to open double-clicked .blend file at startup
|
GHOST_kEventOpenMainFile, /* Needed for Cocoa to open double-clicked .blend file at startup. */
|
||||||
GHOST_kEventNativeResolutionChange, // Needed for Cocoa when window moves to other display
|
GHOST_kEventNativeResolutionChange, /* Needed for Cocoa when window moves to other display. */
|
||||||
|
|
||||||
GHOST_kEventTimer,
|
GHOST_kEventTimer,
|
||||||
|
|
||||||
@@ -281,7 +283,7 @@ typedef enum {
|
|||||||
GHOST_kKeyPeriod = '.',
|
GHOST_kKeyPeriod = '.',
|
||||||
GHOST_kKeySlash = '/',
|
GHOST_kKeySlash = '/',
|
||||||
|
|
||||||
// Number keys
|
/* Number keys. */
|
||||||
GHOST_kKey0 = '0',
|
GHOST_kKey0 = '0',
|
||||||
GHOST_kKey1,
|
GHOST_kKey1,
|
||||||
GHOST_kKey2,
|
GHOST_kKey2,
|
||||||
@@ -296,7 +298,7 @@ typedef enum {
|
|||||||
GHOST_kKeySemicolon = ';',
|
GHOST_kKeySemicolon = ';',
|
||||||
GHOST_kKeyEqual = '=',
|
GHOST_kKeyEqual = '=',
|
||||||
|
|
||||||
// Character keys
|
/* Character keys. */
|
||||||
GHOST_kKeyA = 'A',
|
GHOST_kKeyA = 'A',
|
||||||
GHOST_kKeyB,
|
GHOST_kKeyB,
|
||||||
GHOST_kKeyC,
|
GHOST_kKeyC,
|
||||||
@@ -335,9 +337,9 @@ typedef enum {
|
|||||||
GHOST_kKeyRightControl,
|
GHOST_kKeyRightControl,
|
||||||
GHOST_kKeyLeftAlt,
|
GHOST_kKeyLeftAlt,
|
||||||
GHOST_kKeyRightAlt,
|
GHOST_kKeyRightAlt,
|
||||||
GHOST_kKeyOS, // Command key on Apple, Windows key(s) on Windows
|
GHOST_kKeyOS, /* Command key on Apple, Windows key(s) on Windows. */
|
||||||
GHOST_kKeyGrLess, // German PC only!
|
GHOST_kKeyGrLess, /* German PC only! */
|
||||||
GHOST_kKeyApp, /* Also known as menu key. */
|
GHOST_kKeyApp, /* Also known as menu key. */
|
||||||
|
|
||||||
GHOST_kKeyCapsLock,
|
GHOST_kKeyCapsLock,
|
||||||
GHOST_kKeyNumLock,
|
GHOST_kKeyNumLock,
|
||||||
@@ -358,7 +360,7 @@ typedef enum {
|
|||||||
GHOST_kKeyUpPage,
|
GHOST_kKeyUpPage,
|
||||||
GHOST_kKeyDownPage,
|
GHOST_kKeyDownPage,
|
||||||
|
|
||||||
// Numpad keys
|
/* Numpad keys. */
|
||||||
GHOST_kKeyNumpad0,
|
GHOST_kKeyNumpad0,
|
||||||
GHOST_kKeyNumpad1,
|
GHOST_kKeyNumpad1,
|
||||||
GHOST_kKeyNumpad2,
|
GHOST_kKeyNumpad2,
|
||||||
@@ -376,7 +378,7 @@ typedef enum {
|
|||||||
GHOST_kKeyNumpadAsterisk,
|
GHOST_kKeyNumpadAsterisk,
|
||||||
GHOST_kKeyNumpadSlash,
|
GHOST_kKeyNumpadSlash,
|
||||||
|
|
||||||
// Function keys
|
/* Function keys. */
|
||||||
GHOST_kKeyF1,
|
GHOST_kKeyF1,
|
||||||
GHOST_kKeyF2,
|
GHOST_kKeyF2,
|
||||||
GHOST_kKeyF3,
|
GHOST_kKeyF3,
|
||||||
@@ -402,7 +404,7 @@ typedef enum {
|
|||||||
GHOST_kKeyF23,
|
GHOST_kKeyF23,
|
||||||
GHOST_kKeyF24,
|
GHOST_kKeyF24,
|
||||||
|
|
||||||
// Multimedia keypad buttons
|
/* Multimedia keypad buttons. */
|
||||||
GHOST_kKeyMediaPlay,
|
GHOST_kKeyMediaPlay,
|
||||||
GHOST_kKeyMediaStop,
|
GHOST_kKeyMediaStop,
|
||||||
GHOST_kKeyMediaFirst,
|
GHOST_kKeyMediaFirst,
|
||||||
@@ -479,9 +481,9 @@ typedef struct {
|
|||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
GHOST_kDragnDropTypeUnknown = 0,
|
GHOST_kDragnDropTypeUnknown = 0,
|
||||||
GHOST_kDragnDropTypeFilenames, /*Array of strings representing file names (full path) */
|
GHOST_kDragnDropTypeFilenames, /* Array of strings representing file names (full path). */
|
||||||
GHOST_kDragnDropTypeString, /* Unformatted text UTF-8 string */
|
GHOST_kDragnDropTypeString, /* Unformatted text UTF-8 string. */
|
||||||
GHOST_kDragnDropTypeBitmap /*Bitmap image data */
|
GHOST_kDragnDropTypeBitmap /* Bitmap image data. */
|
||||||
} GHOST_TDragnDropTypes;
|
} GHOST_TDragnDropTypes;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@@ -527,18 +529,23 @@ typedef enum {
|
|||||||
#ifdef WITH_INPUT_NDOF
|
#ifdef WITH_INPUT_NDOF
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/** N-degree of freedom device data v3 [GSoC 2010] */
|
/** N-degree of freedom device data v3 [GSoC 2010] */
|
||||||
// Each component normally ranges from -1 to +1, but can exceed that.
|
/* Each component normally ranges from -1 to +1, but can exceed that.
|
||||||
// These use blender standard view coordinates, with positive rotations being CCW about the axis.
|
* These use blender standard view coordinates,
|
||||||
float tx, ty, tz; // translation
|
* with positive rotations being CCW about the axis. */
|
||||||
float rx, ry, rz; // rotation:
|
/* translation: */
|
||||||
// axis = (rx,ry,rz).normalized
|
float tx, ty, tz;
|
||||||
// amount = (rx,ry,rz).magnitude [in revolutions, 1.0 = 360 deg]
|
/* rotation:
|
||||||
float dt; // time since previous NDOF Motion event
|
* - `axis = (rx,ry,rz).normalized`
|
||||||
GHOST_TProgress progress; // Starting, InProgress or Finishing (for modal handlers)
|
* - `amount = (rx,ry,rz).magnitude` [in revolutions, 1.0 = 360 deg]. */
|
||||||
|
float rx, ry, rz;
|
||||||
|
/** Time since previous NDOF Motion event */
|
||||||
|
float dt;
|
||||||
|
/** Starting, #GHOST_kInProgress or #GHOST_kFinishing (for modal handlers) */
|
||||||
|
GHOST_TProgress progress;
|
||||||
} GHOST_TEventNDOFMotionData;
|
} GHOST_TEventNDOFMotionData;
|
||||||
|
|
||||||
typedef enum { GHOST_kPress, GHOST_kRelease } GHOST_TButtonAction;
|
typedef enum { GHOST_kPress, GHOST_kRelease } GHOST_TButtonAction;
|
||||||
// good for mouse or other buttons too, hmmm?
|
/* Good for mouse or other buttons too, hmmm? */
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
GHOST_TButtonAction action;
|
GHOST_TButtonAction action;
|
||||||
@@ -561,7 +568,7 @@ typedef struct {
|
|||||||
*/
|
*/
|
||||||
/** The ascii code for the key event ('\0' if none). */
|
/** The ascii code for the key event ('\0' if none). */
|
||||||
char ascii;
|
char ascii;
|
||||||
/** The unicode character. if the length is 6, not NULL terminated if all 6 are set */
|
/** The unicode character. if the length is 6, not NULL terminated if all 6 are set. */
|
||||||
char utf8_buf[6];
|
char utf8_buf[6];
|
||||||
|
|
||||||
/** Generated by auto-repeat. */
|
/** Generated by auto-repeat. */
|
||||||
@@ -594,7 +601,8 @@ typedef void *GHOST_TEmbedderWindowID;
|
|||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
// I can't use "Window" from "<X11/Xlib.h>" because it conflits with Window defined in winlay.h
|
/* I can't use "Window" from `X11/Xlib.h`
|
||||||
|
* because it conflicts with Window defined in `winlay.h`. */
|
||||||
typedef int GHOST_TEmbedderWindowID;
|
typedef int GHOST_TEmbedderWindowID;
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
@@ -642,8 +650,10 @@ typedef void *(*GHOST_XrGraphicsContextBindFn)(void);
|
|||||||
typedef void (*GHOST_XrGraphicsContextUnbindFn)(GHOST_ContextHandle graphics_context);
|
typedef void (*GHOST_XrGraphicsContextUnbindFn)(GHOST_ContextHandle graphics_context);
|
||||||
typedef void (*GHOST_XrDrawViewFn)(const struct GHOST_XrDrawViewInfo *draw_view, void *customdata);
|
typedef void (*GHOST_XrDrawViewFn)(const struct GHOST_XrDrawViewInfo *draw_view, void *customdata);
|
||||||
|
|
||||||
/* An array of GHOST_TXrGraphicsBinding items defining the candidate bindings to use. The first
|
/**
|
||||||
* available candidate will be chosen, so order defines priority. */
|
* An array of #GHOST_TXrGraphicsBinding items defining the candidate bindings to use.
|
||||||
|
* The first available candidate will be chosen, so order defines priority.
|
||||||
|
*/
|
||||||
typedef const GHOST_TXrGraphicsBinding *GHOST_XrGraphicsBindingCandidates;
|
typedef const GHOST_TXrGraphicsBinding *GHOST_XrGraphicsBindingCandidates;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@@ -684,7 +694,7 @@ typedef struct GHOST_XrDrawViewInfo {
|
|||||||
float angle_up, angle_down;
|
float angle_up, angle_down;
|
||||||
} fov;
|
} fov;
|
||||||
|
|
||||||
/** Set if the buffer should be submitted with a srgb transfer applied. */
|
/** Set if the buffer should be submitted with a SRGB transfer applied. */
|
||||||
char expects_srgb_buffer;
|
char expects_srgb_buffer;
|
||||||
} GHOST_XrDrawViewInfo;
|
} GHOST_XrDrawViewInfo;
|
||||||
|
|
||||||
@@ -734,7 +744,7 @@ typedef struct GHOST_XrActionSpaceInfo {
|
|||||||
typedef struct GHOST_XrActionBindingInfo {
|
typedef struct GHOST_XrActionBindingInfo {
|
||||||
const char *action_name;
|
const char *action_name;
|
||||||
GHOST_TUns32 count_interaction_paths;
|
GHOST_TUns32 count_interaction_paths;
|
||||||
/** Interaction path: User (subaction) path + component path. */
|
/** Interaction path: User (sub-action) path + component path. */
|
||||||
const char **interaction_paths;
|
const char **interaction_paths;
|
||||||
} GHOST_XrActionBindingInfo;
|
} GHOST_XrActionBindingInfo;
|
||||||
|
|
||||||
|
@@ -149,6 +149,9 @@ static bool egl_chk(bool result, const char *file = NULL, int line = 0, const ch
|
|||||||
static_cast<unsigned int>(error),
|
static_cast<unsigned int>(error),
|
||||||
code ? code : "<Unknown>",
|
code ? code : "<Unknown>",
|
||||||
msg ? msg : "<Unknown>");
|
msg ? msg : "<Unknown>");
|
||||||
|
(void)(file);
|
||||||
|
(void)(line);
|
||||||
|
(void)(text);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -199,7 +202,8 @@ template<typename T> T &choose_api(EGLenum api, T &a, T &b, T &c)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GHOST_ContextEGL::GHOST_ContextEGL(bool stereoVisual,
|
GHOST_ContextEGL::GHOST_ContextEGL(const GHOST_System *const system,
|
||||||
|
bool stereoVisual,
|
||||||
EGLNativeWindowType nativeWindow,
|
EGLNativeWindowType nativeWindow,
|
||||||
EGLNativeDisplayType nativeDisplay,
|
EGLNativeDisplayType nativeDisplay,
|
||||||
EGLint contextProfileMask,
|
EGLint contextProfileMask,
|
||||||
@@ -209,6 +213,7 @@ GHOST_ContextEGL::GHOST_ContextEGL(bool stereoVisual,
|
|||||||
EGLint contextResetNotificationStrategy,
|
EGLint contextResetNotificationStrategy,
|
||||||
EGLenum api)
|
EGLenum api)
|
||||||
: GHOST_Context(stereoVisual),
|
: GHOST_Context(stereoVisual),
|
||||||
|
m_system(system),
|
||||||
m_nativeDisplay(nativeDisplay),
|
m_nativeDisplay(nativeDisplay),
|
||||||
m_nativeWindow(nativeWindow),
|
m_nativeWindow(nativeWindow),
|
||||||
m_contextProfileMask(contextProfileMask),
|
m_contextProfileMask(contextProfileMask),
|
||||||
@@ -285,6 +290,21 @@ GHOST_TSuccess GHOST_ContextEGL::getSwapInterval(int &intervalOut)
|
|||||||
return GHOST_kSuccess;
|
return GHOST_kSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EGLDisplay GHOST_ContextEGL::getDisplay() const
|
||||||
|
{
|
||||||
|
return m_display;
|
||||||
|
}
|
||||||
|
|
||||||
|
EGLConfig GHOST_ContextEGL::getConfig() const
|
||||||
|
{
|
||||||
|
return m_config;
|
||||||
|
}
|
||||||
|
|
||||||
|
EGLContext GHOST_ContextEGL::getContext() const
|
||||||
|
{
|
||||||
|
return m_context;
|
||||||
|
}
|
||||||
|
|
||||||
GHOST_TSuccess GHOST_ContextEGL::activateDrawingContext()
|
GHOST_TSuccess GHOST_ContextEGL::activateDrawingContext()
|
||||||
{
|
{
|
||||||
if (m_display) {
|
if (m_display) {
|
||||||
@@ -456,9 +476,7 @@ GHOST_TSuccess GHOST_ContextEGL::initializeDrawingContext()
|
|||||||
|
|
||||||
attrib_list.push_back(EGL_NONE);
|
attrib_list.push_back(EGL_NONE);
|
||||||
|
|
||||||
EGLConfig config;
|
if (!EGL_CHK(::eglChooseConfig(m_display, &(attrib_list[0]), &m_config, 1, &num_config)))
|
||||||
|
|
||||||
if (!EGL_CHK(::eglChooseConfig(m_display, &(attrib_list[0]), &config, 1, &num_config)))
|
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
// A common error is to assume that ChooseConfig worked because it returned EGL_TRUE
|
// A common error is to assume that ChooseConfig worked because it returned EGL_TRUE
|
||||||
@@ -466,7 +484,7 @@ GHOST_TSuccess GHOST_ContextEGL::initializeDrawingContext()
|
|||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (m_nativeWindow != 0) {
|
if (m_nativeWindow != 0) {
|
||||||
m_surface = ::eglCreateWindowSurface(m_display, config, m_nativeWindow, NULL);
|
m_surface = ::eglCreateWindowSurface(m_display, m_config, m_nativeWindow, NULL);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
static const EGLint pb_attrib_list[] = {
|
static const EGLint pb_attrib_list[] = {
|
||||||
@@ -476,7 +494,7 @@ GHOST_TSuccess GHOST_ContextEGL::initializeDrawingContext()
|
|||||||
1,
|
1,
|
||||||
EGL_NONE,
|
EGL_NONE,
|
||||||
};
|
};
|
||||||
m_surface = ::eglCreatePbufferSurface(m_display, config, pb_attrib_list);
|
m_surface = ::eglCreatePbufferSurface(m_display, m_config, pb_attrib_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!EGL_CHK(m_surface != EGL_NO_SURFACE))
|
if (!EGL_CHK(m_surface != EGL_NO_SURFACE))
|
||||||
@@ -577,7 +595,7 @@ GHOST_TSuccess GHOST_ContextEGL::initializeDrawingContext()
|
|||||||
|
|
||||||
attrib_list.push_back(EGL_NONE);
|
attrib_list.push_back(EGL_NONE);
|
||||||
|
|
||||||
m_context = ::eglCreateContext(m_display, config, m_sharedContext, &(attrib_list[0]));
|
m_context = ::eglCreateContext(m_display, m_config, m_sharedContext, &(attrib_list[0]));
|
||||||
|
|
||||||
if (!EGL_CHK(m_context != EGL_NO_CONTEXT))
|
if (!EGL_CHK(m_context != EGL_NO_CONTEXT))
|
||||||
goto error;
|
goto error;
|
||||||
|
@@ -24,6 +24,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "GHOST_Context.h"
|
#include "GHOST_Context.h"
|
||||||
|
#include "GHOST_System.h"
|
||||||
|
|
||||||
#include <GL/eglew.h>
|
#include <GL/eglew.h>
|
||||||
|
|
||||||
@@ -36,11 +37,15 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
class GHOST_ContextEGL : public GHOST_Context {
|
class GHOST_ContextEGL : public GHOST_Context {
|
||||||
|
/* XR code needs low level graphics data to send to OpenXR. */
|
||||||
|
friend class GHOST_XrGraphicsBindingOpenGL;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*/
|
*/
|
||||||
GHOST_ContextEGL(bool stereoVisual,
|
GHOST_ContextEGL(const GHOST_System *const system,
|
||||||
|
bool stereoVisual,
|
||||||
EGLNativeWindowType nativeWindow,
|
EGLNativeWindowType nativeWindow,
|
||||||
EGLNativeDisplayType nativeDisplay,
|
EGLNativeDisplayType nativeDisplay,
|
||||||
EGLint contextProfileMask,
|
EGLint contextProfileMask,
|
||||||
@@ -100,9 +105,17 @@ class GHOST_ContextEGL : public GHOST_Context {
|
|||||||
*/
|
*/
|
||||||
GHOST_TSuccess getSwapInterval(int &intervalOut);
|
GHOST_TSuccess getSwapInterval(int &intervalOut);
|
||||||
|
|
||||||
|
EGLDisplay getDisplay() const;
|
||||||
|
|
||||||
|
EGLConfig getConfig() const;
|
||||||
|
|
||||||
|
EGLContext getContext() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool initContextEGLEW();
|
bool initContextEGLEW();
|
||||||
|
|
||||||
|
const GHOST_System *const m_system;
|
||||||
|
|
||||||
EGLNativeDisplayType m_nativeDisplay;
|
EGLNativeDisplayType m_nativeDisplay;
|
||||||
EGLNativeWindowType m_nativeWindow;
|
EGLNativeWindowType m_nativeWindow;
|
||||||
|
|
||||||
@@ -117,6 +130,7 @@ class GHOST_ContextEGL : public GHOST_Context {
|
|||||||
EGLContext m_context;
|
EGLContext m_context;
|
||||||
EGLSurface m_surface;
|
EGLSurface m_surface;
|
||||||
EGLDisplay m_display;
|
EGLDisplay m_display;
|
||||||
|
EGLConfig m_config;
|
||||||
|
|
||||||
EGLint m_swap_interval;
|
EGLint m_swap_interval;
|
||||||
|
|
||||||
|
@@ -124,7 +124,7 @@ GHOST_TSuccess GHOST_ContextGLX::initializeDrawingContext()
|
|||||||
GHOST_X11_ERROR_HANDLERS_OVERRIDE(handler_store);
|
GHOST_X11_ERROR_HANDLERS_OVERRIDE(handler_store);
|
||||||
|
|
||||||
/* -------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------- */
|
||||||
/* Begin Inline Glew */
|
/* Begin Inline Glew */
|
||||||
|
|
||||||
#ifdef USE_GLXEW_INIT_WORKAROUND
|
#ifdef USE_GLXEW_INIT_WORKAROUND
|
||||||
const GLubyte *extStart = (GLubyte *)"";
|
const GLubyte *extStart = (GLubyte *)"";
|
||||||
|
@@ -161,5 +161,5 @@ GHOST_TSuccess GHOST_DisplayManagerCocoa::setCurrentDisplaySetting(
|
|||||||
|
|
||||||
// CGDisplayErr err = ::CGDisplaySwitchToMode(m_displayIDs[display], displayModeValues);
|
// CGDisplayErr err = ::CGDisplaySwitchToMode(m_displayIDs[display], displayModeValues);
|
||||||
|
|
||||||
return /*err == CGDisplayNoErr ?*/ GHOST_kSuccess /*: GHOST_kFailure*/;
|
return /* err == CGDisplayNoErr ? */ GHOST_kSuccess /* : GHOST_kFailure */;
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user