Skip to content

Commit 38a9e1e

Browse files
committed
Add vcpkg 3rdParty for manager osx
1 parent 7cc54fc commit 38a9e1e

28 files changed

+1081
-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: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index fa2181e..3bf5317 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -711,8 +711,8 @@ IF(PCRE2_BUILD_PCRE2_8)
6+
SET(targets ${targets} pcre2-posix-static)
7+
8+
IF(MSVC)
9+
- SET_TARGET_PROPERTIES(pcre2-8-static PROPERTIES OUTPUT_NAME pcre2-8-static)
10+
- SET_TARGET_PROPERTIES(pcre2-posix-static PROPERTIES OUTPUT_NAME pcre2-posix-static)
11+
+ SET_TARGET_PROPERTIES(pcre2-8-static PROPERTIES OUTPUT_NAME pcre2-8)
12+
+ SET_TARGET_PROPERTIES(pcre2-posix-static PROPERTIES OUTPUT_NAME pcre2-posix)
13+
ELSE(MSVC)
14+
SET_TARGET_PROPERTIES(pcre2-8-static PROPERTIES OUTPUT_NAME pcre2-8)
15+
SET_TARGET_PROPERTIES(pcre2-posix-static PROPERTIES OUTPUT_NAME pcre2-posix)
16+
@@ -777,7 +777,7 @@ IF(PCRE2_BUILD_PCRE2_16)
17+
SET(targets ${targets} pcre2-16-static)
18+
19+
IF(MSVC)
20+
- SET_TARGET_PROPERTIES(pcre2-16-static PROPERTIES OUTPUT_NAME pcre2-16-static)
21+
+ SET_TARGET_PROPERTIES(pcre2-16-static PROPERTIES OUTPUT_NAME pcre2-16)
22+
ELSE(MSVC)
23+
SET_TARGET_PROPERTIES(pcre2-16-static PROPERTIES OUTPUT_NAME pcre2-16)
24+
ENDIF(MSVC)
25+
@@ -829,7 +829,7 @@ IF(PCRE2_BUILD_PCRE2_32)
26+
SET(targets ${targets} pcre2-32-static)
27+
28+
IF(MSVC)
29+
- SET_TARGET_PROPERTIES(pcre2-32-static PROPERTIES OUTPUT_NAME pcre2-32-static)
30+
+ SET_TARGET_PROPERTIES(pcre2-32-static PROPERTIES OUTPUT_NAME pcre2-32)
31+
ELSE(MSVC)
32+
SET_TARGET_PROPERTIES(pcre2-32-static PROPERTIES OUTPUT_NAME pcre2-32)
33+
ENDIF(MSVC)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--- a/CMakeLists.txt 2020-05-09 16:43:10.000000000 +0200
2+
+++ b/CMakeLists.txt 2020-06-03 20:57:17.026182500 +0200
3+
@@ -619,6 +619,7 @@
4+
5+
IF(MSVC)
6+
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS)
7+
+ add_compile_options(/wd4146)
8+
ENDIF(MSVC)
9+
10+
SET(CMAKE_INCLUDE_CURRENT_DIR 1)
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
vcpkg_from_github(
2+
OUT_SOURCE_PATH SOURCE_PATH
3+
REPO PCRE2Project/pcre2
4+
REF pcre2-10.40
5+
SHA512 098c21d60ecb3bb8449173f50c9ab8e6018fafd5d55548be08b15df37f8e08bcd4f851d75758c4d22505db30a3444bb65783d83cd876c63fdf0de2850815ef93
6+
HEAD_REF master
7+
PATCHES
8+
pcre2-10.35_fix-uwp.patch
9+
no-static-suffix.patch
10+
)
11+
12+
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC)
13+
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" INSTALL_PDB)
14+
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" BUILD_STATIC_CRT)
15+
16+
set(JIT ON)
17+
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Emscripten" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "iOS")
18+
set(JIT OFF)
19+
endif()
20+
21+
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
22+
set(JIT OFF)
23+
endif()
24+
25+
vcpkg_cmake_configure(
26+
SOURCE_PATH "${SOURCE_PATH}"
27+
OPTIONS
28+
-DBUILD_STATIC_LIBS=${BUILD_STATIC}
29+
-DPCRE2_STATIC_RUNTIME=${BUILD_STATIC_CRT}
30+
-DPCRE2_BUILD_PCRE2_8=ON
31+
-DPCRE2_BUILD_PCRE2_16=ON
32+
-DPCRE2_BUILD_PCRE2_32=ON
33+
-DPCRE2_SUPPORT_JIT=${JIT}
34+
-DPCRE2_SUPPORT_UNICODE=ON
35+
-DPCRE2_BUILD_TESTS=OFF
36+
-DPCRE2_BUILD_PCRE2GREP=OFF
37+
-DCMAKE_DISABLE_FIND_PACKAGE_Readline=ON
38+
-DCMAKE_DISABLE_FIND_PACKAGE_Editline=ON
39+
-DINSTALL_MSVC_PDB=${INSTALL_PDB}
40+
-DCMAKE_REQUIRE_FIND_PACKAGE_BZip2=ON
41+
-DCMAKE_REQUIRE_FIND_PACKAGE_ZLIB=ON
42+
)
43+
44+
vcpkg_cmake_install()
45+
vcpkg_copy_pdbs()
46+
47+
file(READ "${CURRENT_PACKAGES_DIR}/include/pcre2.h" PCRE2_H)
48+
if(BUILD_STATIC)
49+
string(REPLACE "defined(PCRE2_STATIC)" "1" PCRE2_H "${PCRE2_H}")
50+
else()
51+
string(REPLACE "defined(PCRE2_STATIC)" "0" PCRE2_H "${PCRE2_H}")
52+
endif()
53+
file(WRITE "${CURRENT_PACKAGES_DIR}/include/pcre2.h" "${PCRE2_H}")
54+
55+
vcpkg_fixup_pkgconfig()
56+
57+
# The cmake file provided by pcre2 has some problems, so don't use it for now.
58+
#vcpkg_cmake_config_fixup(CONFIG_PATH cmake)
59+
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/cmake" "${CURRENT_PACKAGES_DIR}/debug/cmake")
60+
61+
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/man")
62+
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/doc")
63+
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
64+
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/man")
65+
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
66+
67+
if(BUILD_STATIC)
68+
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
69+
elseif(VCPKG_TARGET_IS_WINDOWS)
70+
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/bin/pcre2-config" "${CURRENT_PACKAGES_DIR}" "`dirname $0`/..")
71+
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/bin/pcre2-config")
72+
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/bin/pcre2-config" "${CURRENT_PACKAGES_DIR}" "`dirname $0`/../..")
73+
endif()
74+
endif()
75+
76+
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "pcre2",
3+
"version": "10.40",
4+
"port-version": 1,
5+
"description": "Regular Expression pattern matching using the same syntax and semantics as Perl 5.",
6+
"homepage": "https://github.com/PCRE2Project/pcre2",
7+
"license": "BSD-3-Clause",
8+
"dependencies": [
9+
{
10+
"name": "bzip2",
11+
"default-features": false
12+
},
13+
{
14+
"name": "vcpkg-cmake",
15+
"host": true
16+
},
17+
{
18+
"name": "vcpkg-cmake-config",
19+
"host": true
20+
},
21+
"zlib"
22+
]
23+
}
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 0bc4f934b9..ec703ad19b 100644
3+
--- a/build/cmake/init.cmake
4+
+++ b/build/cmake/init.cmake
5+
@@ -12,6 +12,9 @@ if(DEFINED wxBUILD_CXX_STANDARD AND NOT wxBUILD_CXX_STANDARD STREQUAL COMPILER_D
6+
set(CMAKE_CXX_STANDARD ${wxBUILD_CXX_STANDARD})
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: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
cmake_minimum_required(VERSION 3.7)
2+
3+
project(wxwidgets-example)
4+
5+
add_executable(main WIN32 popup.cpp)
6+
7+
find_package(wxWidgets REQUIRED)
8+
target_compile_definitions(main PRIVATE ${wxWidgets_DEFINITIONS} "$<$<CONFIG:DEBUG>:${wxWidgets_DEFINITIONS_DEBUG}>")
9+
target_include_directories(main PRIVATE ${wxWidgets_INCLUDE_DIRS})
10+
target_link_libraries(main PRIVATE ${wxWidgets_LIBRARIES})
11+
12+
add_executable(main2 WIN32 popup.cpp)
13+
14+
find_package(wxWidgets CONFIG REQUIRED)
15+
target_link_libraries(main2 PRIVATE wx::core wx::base)
16+
17+
option(USE_WXRC "Use the wxrc resource compiler" ON)
18+
if(USE_WXRC)
19+
execute_process(
20+
COMMAND "${wxWidgets_wxrc_EXECUTABLE}" --help
21+
RESULTS_VARIABLE error_result
22+
)
23+
if(error_result)
24+
message(FATAL_ERROR "Failed to run wxWidgets_wxrc_EXECUTABLE (${wxWidgets_wxrc_EXECUTABLE})")
25+
endif()
26+
endif()
27+
28+
set(PRINT_VARS "" CACHE STRING "Variables to print at the end of configuration")
29+
foreach(var IN LISTS PRINT_VARS)
30+
message(STATUS "${var}:=${${var}}")
31+
endforeach()
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake
2+
index b359560..7504458 100644
3+
--- a/build/cmake/config.cmake
4+
+++ b/build/cmake/config.cmake
5+
@@ -39,8 +39,14 @@ macro(wx_get_dependencies var lib)
6+
else()
7+
# For the value like $<$<CONFIG:DEBUG>:LIB_PATH>
8+
# Or $<$<NOT:$<CONFIG:DEBUG>>:LIB_PATH>
9+
- string(REGEX REPLACE "^.+>:(.+)>$" "\\1" dep_name ${dep})
10+
- if (NOT dep_name)
11+
+ if(dep MATCHES "^(.+>):(.+)>$")
12+
+ if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND CMAKE_MATCH_1 STREQUAL [[$<$<NOT:$<CONFIG:DEBUG>>]])
13+
+ continue()
14+
+ elseif(CMAKE_BUILD_TYPE STREQUAL "Release" AND CMAKE_MATCH_1 STREQUAL [[$<$<CONFIG:DEBUG>]])
15+
+ continue()
16+
+ endif()
17+
+ set(dep_name "${CMAKE_MATCH_2}")
18+
+ else()
19+
set(dep_name ${dep})
20+
endif()
21+
endif()

0 commit comments

Comments
 (0)