Skip to content

Commit 20538f4

Browse files
committed
Compile osx manager with vcpkg
1 parent 7cc54fc commit 20538f4

File tree

12 files changed

+323
-3
lines changed

12 files changed

+323
-3
lines changed

.github/workflows/osx.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,12 @@ jobs:
126126
path: deploy/macos_apps_arm64.7z
127127

128128
cmake-build:
129-
name: cmake-build
129+
name: ${{matrix.type}}-build
130130
runs-on: macos-latest
131+
strategy:
132+
matrix:
133+
type: [manager-vcpkg, libs-cmake]
134+
fail-fast: false
131135
steps:
132136
- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd
133137
with:
@@ -146,8 +150,17 @@ jobs:
146150
echo "VCPKG_BINARY_SOURCES=clear;x-aws-config,no-sign-request;x-aws,s3://vcpkg.cache.boinc/,read" >> $GITHUB_ENV
147151
148152
- name: libs cmake
153+
if: matrix.type == 'libs-cmake'
149154
run: osx/ci_build_libs_cmake.sh
150155

156+
- name: install vcpkg dependencies
157+
if: matrix.type == 'manager-vcpkg'
158+
run: ./osx/build_vcpkg_3rdparty_for_manager.sh
159+
160+
- name: vcpkg make manager
161+
if: success() && matrix.type == 'manager-vcpkg'
162+
run: ./mac_build/buildMacBOINC-CI.sh --no_shared_headers --cache_dir $(pwd)/3rdParty/osx/mac_vcpkg --vcpkg
163+
151164
- name: Prepare logs on failure
152165
if: ${{ failure() }}
153166
run: python3 ./deploy/prepare_deployment.py logs
@@ -156,5 +169,5 @@ jobs:
156169
if: ${{ failure() }}
157170
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
158171
with:
159-
name: osx_logs_cmake-build_${{ github.event.pull_request.head.sha }}
172+
name: osx_logs_${{ matrix.type }}_${{ github.event.pull_request.head.sha }}
160173
path: deploy/logs.7z
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "boinc-manager",
3+
"dependencies":
4+
[
5+
"ftgl",
6+
{
7+
"name": "curl",
8+
"features": ["openssl","c-ares"],
9+
"default-features": false
10+
},
11+
{
12+
"name": "wxwidgets",
13+
"default-features": false
14+
}
15+
]
16+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
diff --git a/include/wx/osx/choice.h b/include/wx/osx/choice.h
2+
index 37486f8a7c..d80bf53766 100644
3+
--- a/include/wx/osx/choice.h
4+
+++ b/include/wx/osx/choice.h
5+
@@ -73,6 +73,7 @@ public:
6+
virtual int FindString(const wxString& s, bool bCase = false) const wxOVERRIDE;
7+
virtual wxString GetString(unsigned int n) const wxOVERRIDE;
8+
virtual void SetString(unsigned int pos, const wxString& s) wxOVERRIDE;
9+
+ void SetItemBitmap(unsigned int n, const wxBitmap& bitmap);
10+
// osx specific event handling common for all osx-ports
11+
12+
virtual bool OSXHandleClicked(double timestampsec) wxOVERRIDE;
13+
diff --git a/include/wx/osx/core/private.h b/include/wx/osx/core/private.h
14+
index 429c8f7401..cae9f9eebe 100644
15+
--- a/include/wx/osx/core/private.h
16+
+++ b/include/wx/osx/core/private.h
17+
@@ -820,6 +820,7 @@ public :
18+
}
19+
20+
virtual void SetItem(int pos, const wxString& item) = 0;
21+
+ virtual void SetItemBitmap(unsigned int n, const wxBitmap& bitmap) = 0;
22+
};
23+
24+
25+
diff --git a/src/osx/choice_osx.cpp b/src/osx/choice_osx.cpp
26+
index 6df17b34e5..1fcb2a5fc4 100644
27+
--- a/src/osx/choice_osx.cpp
28+
+++ b/src/osx/choice_osx.cpp
29+
@@ -217,6 +217,13 @@ wxString wxChoice::GetString(unsigned int n) const
30+
return m_strings[n] ;
31+
}
32+
33+
+void wxChoice::SetItemBitmap(unsigned int n, const wxBitmap& bitmap)
34+
+{
35+
+ wxCHECK_RET( IsValid(n), wxT("wxChoice::SetItemBitmap(): invalid index") );
36+
+
37+
+ dynamic_cast<wxChoiceWidgetImpl*>(GetPeer())->SetItemBitmap(n, bitmap);
38+
+}
39+
+
40+
// ----------------------------------------------------------------------------
41+
// client data
42+
// ----------------------------------------------------------------------------
43+
diff --git a/src/osx/cocoa/choice.mm b/src/osx/cocoa/choice.mm
44+
index 2f0eb4ba51..52eb85c17d 100644
45+
--- a/src/osx/cocoa/choice.mm
46+
+++ b/src/osx/cocoa/choice.mm
47+
@@ -93,6 +93,12 @@ public:
48+
m_popUpMenu->FindItemByPosition( pos )->SetItemLabel( s ) ;
49+
}
50+
51+
+ void SetItemBitmap(unsigned int n, const wxBitmap& bitmap)
52+
+ {
53+
+ if ( bitmap.Ok() )
54+
+ m_popUpMenu->FindItemByPosition( n )->SetBitmap( bitmap ); ;
55+
+ }
56+
+
57+
private:
58+
wxMenu* m_popUpMenu;
59+
};
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake
2+
index 0584ecaeb5..3e0f5feb3e 100644
3+
--- a/build/cmake/init.cmake
4+
+++ b/build/cmake/init.cmake
5+
@@ -18,6 +18,9 @@ else()
6+
# CMAKE_CXX_STANDARD not defined.
7+
endif()
8+
9+
+set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
10+
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
11+
+
12+
if(MSVC)
13+
# Determine MSVC runtime library flag
14+
set(MSVC_LIB_USE "/MD")
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
diff --git a/wxwidgets/portfile.cmake b/wxwidgets/portfile.cmake
2+
index f812fd8c5..27e289f2b 100644
3+
--- a/wxwidgets/portfile.cmake
4+
+++ b/wxwidgets/portfile.cmake
5+
@@ -12,6 +12,8 @@ vcpkg_from_github(
6+
fix-pcre2.patch
7+
gtk3-link-libraries.patch
8+
sdl2.patch
9+
+ boinc_SetItemBitmap.patch
10+
+ boinc_SetVisibilityHidden.patch
11+
)
12+
13+
vcpkg_check_features(
14+
@@ -75,6 +77,10 @@ vcpkg_cmake_configure(
15+
-DwxUSE_UIACTIONSIMULATOR=OFF
16+
-DCMAKE_DISABLE_FIND_PACKAGE_GSPELL=ON
17+
-DCMAKE_DISABLE_FIND_PACKAGE_MSPACK=ON
18+
+ -DwxBUILD_MONOLITHIC=ON
19+
+ -DwxUSE_DIALUP_MANAGER=ON
20+
+ -DwxUSE_UNICODE=ON
21+
+ -DwxUSE_UNICODE_UTF8=ON
22+
${OPTIONS}
23+
"-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}"
24+
# The minimum cmake version requirement for Cotire is 2.8.12.

3rdParty/vcpkg_ports/ports/mac/.gitkeep

Whitespace-only changes.

3rdParty/vcpkg_ports/triplets/ci/arm64-osx.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ include(${CMAKE_CURRENT_LIST_DIR}/../../vcpkg_root_find.cmake)
1919
include(${VCPKG_ROOT}/triplets/arm64-osx.cmake)
2020

2121
set(VCPKG_BUILD_TYPE release)
22+
set(VCPKG_OSX_DEPLOYMENT_TARGET 10.13)
23+
set(VCPKG_C_FLAGS -mmacosx-version-min=10.13)
24+
set(VCPKG_CXX_FLAGS -mmacosx-version-min=10.13)

3rdParty/vcpkg_ports/triplets/ci/x64-osx.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ include(${CMAKE_CURRENT_LIST_DIR}/../../vcpkg_root_find.cmake)
1919
include(${VCPKG_ROOT}/triplets/x64-osx.cmake)
2020

2121
set(VCPKG_BUILD_TYPE release)
22+
set(VCPKG_OSX_DEPLOYMENT_TARGET 10.13)
23+
set(VCPKG_C_FLAGS -mmacosx-version-min=10.13)
24+
set(VCPKG_CXX_FLAGS -mmacosx-version-min=10.13)

ci_tools/trailing_whitespaces_check.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ def check(directory, exclude_dirs, exclude_extensions, exclude_files, fix_errors
153153
".nib",
154154
".o",
155155
".odp",
156+
".patch",
156157
".pdb",
157158
".pdf",
158159
".pdn",

mac_build/buildMacBOINC-CI.sh

Lines changed: 100 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ config=""
4646
doclean="-noclean"
4747
beautifier="cat" # we need a fallback if xcpretty is not available
4848
share_paths="yes"
49+
vcpkg="no"
4950
while [[ $# -gt 0 ]]; do
5051
key="$1"
5152
case $key in
@@ -63,6 +64,9 @@ while [[ $# -gt 0 ]]; do
6364
--no_shared_headers)
6465
share_paths="no"
6566
;;
67+
--vcpkg)
68+
vcpkg="yes"
69+
;;
6670
esac
6771
shift # past argument or value
6872
done
@@ -94,6 +98,7 @@ if [ "${style}" == "Development" ]; then
9498
fi
9599

96100
if [ ${share_paths} = "yes" ]; then
101+
echo "Building share_paths"
97102
## all targets share the same header and library search paths
98103
## Note: this does not build zip apps, upper case or VBoxWrapper projects.
99104
libSearchPathDbg=""
@@ -143,6 +148,77 @@ target="x"
143148

144149
rm -f /tmp/depversions.txt
145150

151+
if [ $vcpkg = "yes" ]; then
152+
wx_includes_dirs_vcpkg=$(ls -d $cache_dir/include/wx-3.*/)
153+
vcpkg_setting_pref_vcpkg="-setting OTHER_LDFLAGS"
154+
vcpkg_setting_mgr=" \
155+
-framework SystemConfiguration \
156+
-bind_at_load \
157+
-D_THREAD_SAFE \
158+
-L. \
159+
-lboinc \
160+
-lcurl \
161+
-lcares \
162+
-lresolv \
163+
-lssl \
164+
-lcrypto \
165+
-lexpat \
166+
-ldl \
167+
-lz \
168+
-lldap \
169+
-lwx_osx_cocoau-3.2 \
170+
-lwxscintilla-3.2 \
171+
-lbrotlicommon \
172+
-lbrotlidec \
173+
-lbrotlienc \
174+
-lnanosvg \
175+
-lnanosvgrast \
176+
-lpcre2-32 \
177+
-lpcre2-16 \
178+
-lpcre2-8 \
179+
-lpcre2-posix \
180+
-lbz2 \
181+
-ljpeg \
182+
-llzma \
183+
-lpng \
184+
-lpng16 \
185+
-ltiff \
186+
-lturbojpeg \
187+
-liconv \
188+
-lpthread \
189+
-lm \
190+
"
191+
vcpkg_setting_scr=" \
192+
-lresolv \
193+
-ljpeg \
194+
-lfreetype \
195+
-lbrotlicommon \
196+
-lbrotlidec \
197+
-lbrotlienc \
198+
-lpng \
199+
-lpng16 \
200+
-lm \
201+
-lftgl \
202+
-lz \
203+
-lbz2 \
204+
"
205+
206+
vcpkg_setting_client=" \
207+
-framework SystemConfiguration \
208+
-L. \
209+
-lboinc \
210+
-lcurl \
211+
-lcares \
212+
-lresolv \
213+
-lssl \
214+
-lcrypto \
215+
-ldl \
216+
-lz \
217+
-lldap \
218+
"
219+
220+
fi
221+
146222
## This is code that builds each target individually in the main BOINC Xcode
147223
## project, plus the zip apps, upper case and VBoxWrapper projects.
148224
for buildTarget in `xcodebuild -list -project boinc.xcodeproj`
@@ -151,7 +227,28 @@ do
151227
if [ $foundTargets -eq 1 ]; then
152228
if [ "${target}" != "Build_All" ]; then
153229
echo "Building ${target}..."
154-
source BuildMacBOINC.sh ${config} ${doclean} -target ${target} -setting HEADER_SEARCH_PATHS "../clientgui ../lib/** ../api/ ${cache_dir}/include ../samples/jpeglib ${cache_dir}/include/freetype2 \\\${HEADER_SEARCH_PATHS}" -setting USER_HEADER_SEARCH_PATHS "" -setting LIBRARY_SEARCH_PATHS "${libSearchPathDbg} ${cache_dir}/lib ../lib \\\${LIBRARY_SEARCH_PATHS}" | tee xcodebuild_${target}.log | $beautifier; retval=${PIPESTATUS[0]}
230+
231+
if [[ $vcpkg = "yes" && ("${target}" = "mgr_boinc" || "${target}" = "ss_app" || "${target}" = "BOINC_Client") ]]; then
232+
vcpkg_setting_pref=$vcpkg_setting_pref_vcpkg
233+
if [ "${target}" = "mgr_boinc" ]; then
234+
vcpkg_setting=$vcpkg_setting_mgr
235+
wx_includes_dirs=$wx_includes_dirs_vcpkg
236+
fi
237+
if [ "${target}" = "ss_app" ]; then
238+
vcpkg_setting=$vcpkg_setting_scr
239+
wx_includes_dirs=""
240+
fi
241+
if [ "${target}" = "BOINC_Client" ]; then
242+
vcpkg_setting=$vcpkg_setting_client
243+
wx_includes_dirs=""
244+
fi
245+
else
246+
vcpkg_setting_pref="-setting USER_HEADER_SEARCH_PATHS"
247+
vcpkg_setting=""
248+
wx_includes_dirs=""
249+
fi
250+
251+
source BuildMacBOINC.sh ${config} ${doclean} -target ${target} -setting HEADER_SEARCH_PATHS "../clientgui ../lib/** ../api/ ${cache_dir}/include ../samples/jpeglib ${cache_dir}/include/freetype2 \\\${HEADER_SEARCH_PATHS} $wx_includes_dirs" -setting USER_HEADER_SEARCH_PATHS "" -setting LIBRARY_SEARCH_PATHS "${libSearchPathDbg} ${cache_dir}/lib ../lib \\\${LIBRARY_SEARCH_PATHS}" $vcpkg_setting_pref "$vcpkg_setting" | tee xcodebuild_${target}.log | $beautifier; retval=${PIPESTATUS[0]}
155252
if [ ${retval} -eq 0 ]; then
156253
echo "Building ${target}...success"
157254
echo
@@ -186,6 +283,7 @@ fi
186283

187284
verify_product_archs "${rootPath}/zip/build/${style}"
188285

286+
if [ $vcpkg -eq 0 ]; then
189287
target="UpperCase2"
190288
echo "Building ${target}..."
191289
source BuildMacBOINC.sh ${config} ${doclean} -uc2 -setting HEADER_SEARCH_PATHS "../../ ../../api/ ../../lib/ ../../zip/ ../../clientgui/mac/ ../jpeglib/ ../samples/jpeglib/ ${cache_dir}/include ${cache_dir}/include/freetype2 \\\${HEADER_SEARCH_PATHS}" -setting LIBRARY_SEARCH_PATHS "../../mac_build/build/Deployment ${cache_dir}/lib \\\${LIBRARY_SEARCH_PATHS}" | tee xcodebuild_${target}.log | $beautifier; retval=${PIPESTATUS[0]}
@@ -206,4 +304,5 @@ fi
206304

207305
verify_product_archs "${rootPath}/samples/vboxwrapper/build/${style}"
208306

307+
fi
209308
cd "${rootPath}"

0 commit comments

Comments
 (0)