Skip to content

Commit

Permalink
Mac compilation support
Browse files Browse the repository at this point in the history
  • Loading branch information
Bitcoinote committed Aug 23, 2018
1 parent d18e6d7 commit bf1a1fd
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -5,3 +5,4 @@
/cryptonote/
/cryptonote
/Wallet_*/
CMakeLists.txt.user
9 changes: 9 additions & 0 deletions BitcoinoteDmg.json
@@ -0,0 +1,9 @@
{
"title": "BitcoiNote",
"icon": "src/images/bitcoinote.icns",
"background": "src/images/bitcoinote_dmg_background.png",
"contents": [
{ "x": 448, "y": 344, "type": "link", "path": "/Applications" },
{ "x": 192, "y": 344, "type": "file", "path": "BitcoiNote.app" }
]
}
19 changes: 13 additions & 6 deletions CMakeLists.txt
Expand Up @@ -46,6 +46,7 @@ include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})

set(VERSION "")
set(PROJECT_VERSION "1.2.1")
configure_file("cryptonote/src/version.h.in" "version.h")
configure_file("src/CryptoNoteWalletConfig.h.in" "CryptoNoteWalletConfig.h")

Expand Down Expand Up @@ -129,6 +130,7 @@ file(GLOB_RECURSE CRYPTONOTE_SOURCES
cryptonote/src/WalletLegacy/WalletUnconfirmedTransactions.cpp
cryptonote/src/WalletLegacy/WalletUserTransactionsCache.cpp
cryptonote/src/System/ContextGroup.cpp
cryptonote/src/System/ContextGroupTimeout.cpp
cryptonote/src/System/Event.cpp
cryptonote/src/System/EventLock.cpp
cryptonote/src/System/InterruptedException.cpp
Expand Down Expand Up @@ -189,10 +191,10 @@ elseif (UNIX)
set(SOURCES ${SOURCES} ${OBJC_SOURCES})
set(PLATFORM_DIR OSX)
set(MACOSX_BUNDLE_INFO_STRING "Cryptonote GUI wallet")
set(MACOSX_BUNDLE_LONG_VERSION_STRING "${VERSION_VERSION}.${VERSION_MINOR}.${VERSION_PATCH}")
set(MACOSX_BUNDLE_BUNDLE_NAME CryptonoteWallet)
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VERSION_VERSION}.${VERSION_MINOR}.${VERSION_PATCH}")
set(MACOSX_BUNDLE_BUNDLE_VERSION "$${VERSION_VERSION}.${VERSION_MINOR}.${VERSION_PATCH}")
set(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_VERSION}")
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}")
set(MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_VERSION}")

find_package(Qt5PrintSupport REQUIRED)

Expand All @@ -202,8 +204,8 @@ elseif (UNIX)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -maes -D_DARWIN_C_SOURCE")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Cocoa -framework OpenGL -framework CoreFoundation -framework Carbon -framework IOKit -L/usr/lib")

set(MACOSX_BUNDLE_ICON_FILE cryptonote.icns)
set(APPLICATION_ICON src/images/cryptonote.icns)
set(MACOSX_BUNDLE_ICON_FILE bitcoinote.icns)
set(APPLICATION_ICON src/images/bitcoinote.icns)
set_source_files_properties(${APPLICATION_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")

set(BUILD_PLATFORM MACOSX_BUNDLE)
Expand All @@ -212,6 +214,11 @@ elseif (UNIX)
GET_TARGET_PROPERTY(QT_LIB_DIR "${Qt5Widgets_LIBRARIES}" LOCATION)
GET_FILENAME_COMPONENT(QT_LIB_DIR "${QT_LIB_DIR}" PATH)

ADD_CUSTOM_COMMAND(
TARGET ${PROJECT_NAME} PRE_BUILD
COMMAND macdeployqt ${PROJECT_NAME}.app
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})

else(APPLE)

set(PLATFORM_DIR Linux)
Expand Down Expand Up @@ -247,4 +254,4 @@ qt5_use_modules(${PROJECT_NAME} Widgets Gui Network)
set(ROCKSDB_WITHOUT_GTEST ON CACHE BOOL "No gtest in rocksdb")

add_subdirectory(cryptonote/external)
#add_subdirectory(cryptonote/src)
#add_subdirectory(cryptonote/src)
24 changes: 24 additions & 0 deletions README.md
Expand Up @@ -86,6 +86,30 @@ C:\WINDOWS\system32\vcruntime140.dll

To compile the debug version, omit the `/p:Configuration=Release` parameter. Then you need to copy the debug dlls instead of the normal ones. These have the same name, only with a `d` at the end (e.g. `Qt5Cored.dll`), and are in the same location, except for `ucrtbased.dll` which you can find in `C:\Program Files (x86)\Windows Kits\10\bin\x64\ucrt\ucrtbased.dll`.

### macOS

Tested only with macOS High Sierra 10.13.6.

Dependencies: `clang 9.1.0` or later, `CMake 3.5.2` or later, `Boost 1.67` or later and `Qt5` (tested with `Qt 5.10.1`).

* Use [Homebrew](https://brew.sh/) to install `cmake` and `boost`.
* Use [qt.io](https://www.qt.io/) to install QtCreator.

To create the symlink to the core directory, use:

```
ln -s ../Bitcoinote-Core cryptonote
```

To build, open the `CMakeLists.txt` in QtCreator. Also you can turn on `PORTABLE` flag in the project settings tab.

The resulting package `Bitcoinote.app` can be found in `build` directory which will be created.

To build `.dmg` file we recommend to use [node-appdmg](https://github.com/LinusU/node-appdmg) project.
Just place the `BitcoinoteDmg.json`, `Bitcoinote.icns` and `Bitcoinote.app` in one directory and run the following command:

`$ appdmg BitcoinoteDmg.json Bitcoinote.dmg`

## Usage Notes

To run the GUI wallet, the BitcoiNote Core daemon is not required to run. If a daemon already runs, it will be used - otherwise the wallet will use its own "internal daemon" instead.
Expand Down
14 changes: 7 additions & 7 deletions src/Application/BlogReader.cpp
Expand Up @@ -212,27 +212,27 @@ void BlogReader::processBlogReplyData(const QString& _data) {
QList<MessageItem> newMessages;
while (!xml.atEnd() && newMessages.size() < MAX_MESSAGE_COUNT) {
xml.readNext();
if (xml.isStartElement() && !xml.name().compare("entry")) {
if (xml.isStartElement() && !xml.name().compare(QLatin1Literal("entry"))) {
MessageItem messageItem;
while (!xml.atEnd() && !(xml.isEndElement() && !xml.name().compare("entry"))) {
while (!xml.atEnd() && !(xml.isEndElement() && !xml.name().compare(QLatin1Literal("entry")))) {
xml.readNext();
if (xml.isStartElement()) {
if (!xml.name().compare(BLOG_RSS_ID_TAG_NAME)) {
if (!xml.name().compare(QLatin1Literal(BLOG_RSS_ID_TAG_NAME))) {
messageItem.messageId = xml.readElementText();
} else if(!xml.name().compare(BLOG_RSS_LINK_TAG_NAME)) {
} else if(!xml.name().compare(QLatin1Literal(BLOG_RSS_LINK_TAG_NAME))) {
messageItem.messageSourceUrl = xml.attributes().value(BLOG_RSS_LINK_HREF_ATTRIBUTE_NAME).toString();
// Handle root-relative path
if(!messageItem.messageSourceUrl.length() || messageItem.messageSourceUrl.at(0).toLatin1() == '/') {
messageItem.messageSourceUrl = QString(BLOG_RSS_SCHEME) + QString("://") + QString(BLOG_RSS_HOST) + messageItem.messageSourceUrl;
}
} else if(!xml.name().compare(BLOG_RSS_TITLE_TAG_NAME)) {
} else if(!xml.name().compare(QLatin1Literal(BLOG_RSS_TITLE_TAG_NAME))) {
messageItem.messageTitle = xml.readElementText();
} else if(!xml.name().compare(BLOG_RSS_CONTENT_TAG_NAME)) {
} else if(!xml.name().compare(QLatin1Literal(BLOG_RSS_CONTENT_TAG_NAME))) {
QString htmlText = xml.readElementText();
QTextDocument textDoc;
textDoc.setHtml(htmlText);
messageItem.messageText = textDoc.toPlainText();
} else if(!xml.name().compare(BLOG_RSS_UPDATED_TAG_NAME)) {
} else if(!xml.name().compare(QLatin1Literal(BLOG_RSS_UPDATED_TAG_NAME))) {
QString timeString = xml.readElementText();
messageItem.messageTime = QDateTime::fromString(timeString, Qt::ISODate);
}
Expand Down
Binary file modified src/images/bitcoinote.icns
Binary file not shown.
1 change: 1 addition & 0 deletions src/images/bitcoinote.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/bitcoinote_dmg_background.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bf1a1fd

Please sign in to comment.