integrating libwallet

This commit is contained in:
Ilya Kitaev 2016-05-17 16:03:59 +03:00
parent 382fa30283
commit f9e0916776
3 changed files with 50 additions and 6 deletions

View file

@ -1,5 +1,6 @@
#include "WalletManager.h"
#include "Wallet.h"
#include "wallet/wallet2_api.h"
#include <QFile>
#include <QFileInfo>
#include <QDir>
@ -17,6 +18,8 @@ WalletManager *WalletManager::instance()
if (!m_instance) {
m_instance = new WalletManager;
}
// Checking linkage (doesn't work, TODO: have every dependencies linked statically into libwallet)
Bitmonero::WalletManager * wallet_manager_impl = Bitmonero::WalletManagerFactory::getWalletManager();
return m_instance;
}

39
get_libwallet_api.sh Executable file
View file

@ -0,0 +1,39 @@
#!/bin/bash
BITMONERO_URL=https://github.com/mbg033/bitmonero
CPU_CORE_COUNT=$(grep -c ^processor /proc/cpuinfo)
pushd $(pwd)
ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
INSTALL_DIR=$ROOT_DIR/wallet
BITMONERO_DIR=$ROOT_DIR/bitmonero
if [ ! -d $BITMONERO_DIR ]; then
git clone --depth=1 $BITMONERO_URL $BITMONERO_DIR
fi
rm -fr $BITMONERO_DIR/build
mkdir -p $BITMONERO_DIR/build/release
pushd $BITMONERO_DIR/build/release
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX="$BITMONERO_DIR" ../..
pushd $BITMONERO_DIR/build/release/src/wallet
make -j$CPU_CORE_COUNT
make install -j$CPU_CORE_COUNT
popd
popd

View file

@ -2,8 +2,14 @@ TEMPLATE = app
QT += qml quick widgets
WALLET_ROOT=$$PWD/bitmonero
CONFIG += c++11
INCLUDEPATH += $$WALLET_ROOT/include
message($$INCLUDEPATH)
HEADERS += \
filter.h \
clipboardAdapter.h \
@ -26,6 +32,8 @@ SOURCES = *.qml \
wizard/*.qml
}
LIBS += -L$$WALLET_ROOT/lib -lwallet
# translations files;
TRANSLATIONS = monero-core_en.ts \ # English (could be untranslated)
monero-core_de.ts # Deutsch
@ -71,9 +79,3 @@ OTHER_FILES += \
DISTFILES += \
notes.txt