Skip to content

Commit

Permalink
Fix macOS build
Browse files Browse the repository at this point in the history
Setup Xcode version for Github Actions build to support older macOS - Fixes wallets crashing on older macOS versions with error Symbol not found: ____chkstk_darwin
Correct errors in Info.plist file - I guess it accidentally got replaced by version from LiteWallet
  • Loading branch information
aivve committed Jul 2, 2020
1 parent e8bf688 commit 51a3244
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 14 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/release.yml
Expand Up @@ -84,9 +84,16 @@ jobs:
build-macos:
name: macOS
runs-on: macos-latest
env:
MACOSX_DEPLOYMENT_TARGET: '10.12'
steps:
- uses: actions/checkout@master

- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@1.0
with:
xcode-version: '10'

- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
Expand All @@ -100,7 +107,7 @@ jobs:
build_folder="build/release"
krb_ver=$(echo ${{ github.ref }} | sed 's|refs/tags/||')
release_name="karbowallet-macOS-$krb_ver"
app_name="karbowallet.app"
app_name="KarboWallet.app"
brew install gcc boost@1.60
brew link boost@1.60 --force
rm -rf cryptonote
Expand Down
44 changes: 37 additions & 7 deletions CMakeLists.txt
Expand Up @@ -195,8 +195,7 @@ set(WITH_TOOLS OFF CACHE BOOL "No tools")

add_subdirectory(cryptonote/external/miniupnpc EXCLUDE_FROM_ALL)

add_subdirectory(cryptonote/external/zstd EXCLUDE_FROM_ALL)
set_property(TARGET zstd PROPERTY FOLDER "external")


if (WIN32)
if (NOT MSVC)
Expand All @@ -207,6 +206,9 @@ if (WIN32)

add_definitions(/D_CRT_SECURE_NO_WARNINGS /D_WIN32_WINNT=0x0600 /DSTATICLIB)

add_subdirectory(cryptonote/external/zstd EXCLUDE_FROM_ALL)
set_property(TARGET zstd PROPERTY FOLDER "external")

add_subdirectory(cryptonote/external/rocksdb EXCLUDE_FROM_ALL)
set_property(TARGET rocksdb PROPERTY FOLDER "external")

Expand All @@ -220,12 +222,40 @@ if (WIN32)

elseif (UNIX)

execute_process(
COMMAND ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR}/cryptonote/external/rocksdb -DARCH=${ARCH} -DWITH_ZSTD=${WITH_ZSTD} -DWITH_GFLAGS=0 -DCMAKE_BUILD_TYPE=MinSizeRel -DWITH_TESTS=OFF -DWITH_TOOLS=OFF -DPORTABLE=ON -B${PROJECT_BINARY_DIR}/rocksdb
)
if (APPLE)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.12")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.12")
execute_process(
COMMAND ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR}/cryptonote/external/zstd -DCMAKE_C_FLAGS="-mmacosx-version-min=10.12" -DCMAKE_CXX_FLAGS="-mmacosx-version-min=10.12" -B${PROJECT_BINARY_DIR}/zstd
)
else()
execute_process(
COMMAND ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR}/cryptonote/external/zstd -B${PROJECT_BINARY_DIR}/zstd
)
endif()

add_custom_target(
zstd
COMMAND $(MAKE) zstd
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/zstd
)
add_library(zstdlib STATIC IMPORTED GLOBAL)
set_target_properties(zstdlib PROPERTIES IMPORTED_LOCATION ${PROJECT_BINARY_DIR}/zstd/libzstd.a)
add_dependencies(zstdlib zstd)

if (APPLE)
execute_process(
COMMAND ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR}/cryptonote/external/rocksdb -DARCH=${ARCH} -DWITH_ZSTD=ON -DWITH_GFLAGS=0 -DCMAKE_BUILD_TYPE=MinSizeRel -DWITH_TESTS=OFF -DWITH_TOOLS=OFF -DPORTABLE=ON -DCMAKE_C_FLAGS="-mmacosx-version-min=10.12" -DCMAKE_CXX_FLAGS="-mmacosx-version-min=10.12" -B${PROJECT_BINARY_DIR}/rocksdb
)
else()
execute_process(
COMMAND ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR}/cryptonote/external/rocksdb -DARCH=${ARCH} -DWITH_ZSTD=ON -DWITH_GFLAGS=0 -DCMAKE_BUILD_TYPE=MinSizeRel -DWITH_TESTS=OFF -DWITH_TOOLS=OFF -DPORTABLE=ON -B${PROJECT_BINARY_DIR}/rocksdb
)
endif()
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${PROJECT_BINARY_DIR}/rocksdb/librocksdb.a")

set_property(TARGET upnpc-static zstd PROPERTY FOLDER "external")
set_property(TARGET upnpc-static PROPERTY FOLDER "external")

add_custom_target(
rocksdb
COMMAND $(MAKE) rocksdb
Expand Down Expand Up @@ -283,7 +313,7 @@ add_library(Mnemonics ${Mnemonics})
set_target_properties(${CRYPTONOTE_LIB} PROPERTIES COMPILE_DEFINITIONS _GNU_SOURCE)

if (APPLE OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
target_link_libraries(${CRYPTONOTE_LIB} rocksdblib zstd ${Boost_LIBRARIES} ${Qt5DBus_LIBRARIES} -lresolv)
target_link_libraries(${CRYPTONOTE_LIB} rocksdblib zstdlib ${Boost_LIBRARIES} ${Qt5DBus_LIBRARIES} -lresolv)
else ()
target_link_libraries(${CRYPTONOTE_LIB} rocksdb zstd ${Boost_LIBRARIES} ${Qt5DBus_LIBRARIES})
endif ()
Expand Down
2 changes: 1 addition & 1 deletion cryptonote
12 changes: 7 additions & 5 deletions src/Info.plist.in
Expand Up @@ -5,27 +5,29 @@
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>KarboLite</string>
<string>@WALLET_NAME@</string>
<key>CFBundleGetInfoString</key>
<string>Karbo Lite Wallet</string>
<string>Karbo Spring Wallet</string>
<key>CFBundleIconFile</key>
<string>Karbovanets.icns</string>
<key>CFBundleIdentifier</key>
<string>org.karbo.KarboLite-Qt</string>
<string>org.karbo.SpringWallet-Qt</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string>@WALLET_VERSION@</string>
<key>CFBundleDisplayName</key>
<string>Karbo Spring Wallet</string>
<key>CFBundleName</key>
<string>Karbo Lite Wallet</string>
<string>Spring Wallet</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>@WALLET_VERSION@</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>karboLite@WALLET_VERSION@</string>
<string>karboSpring@WALLET_VERSION@</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>NSRequiresAquaSystemAppearance</key>
Expand Down

0 comments on commit 51a3244

Please sign in to comment.