Browse Source

Merge pull request #105 from MyHush/v1.0.13-mac

Merge v1.0.13-mac into dev
z_importviewingkey_bug
FireMartZ 6 years ago
committed by GitHub
parent
commit
44ce1531f2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      .gitignore
  2. 69
      INSTALL.md
  3. 47
      contrib/DEBIAN/changelog
  4. 10
      depends/builders/darwin.mk
  5. 9
      depends/packages/boost.mk
  6. 20
      depends/packages/googlemock.mk
  7. 19
      depends/packages/googletest.mk
  8. 5
      src/netbase.cpp
  9. 4
      src/paymentdisclosure.h
  10. 10
      src/snark/Makefile
  11. 23
      src/univalue/include/univalue.h
  12. 11
      src/univalue/lib/univalue.cpp
  13. 2
      src/wallet/wallet.h
  14. 72
      zcutil/build-mac.sh

1
.gitignore

@ -88,6 +88,7 @@ qrc_*.cpp
# Mac specific
.DS_Store
build
*.dSYM
#lcov
*.gcno

69
INSTALL.md

@ -13,9 +13,11 @@
mkdir -p ~/.hush
echo "rpcuser=username" >> ~/.hush/hush.conf
echo "rpcpassword=`head -c 32 /dev/urandom | base64`" >>~/.hush/hush.conf
echo "addnode=node.myhush.network" >> ~/.hush/hush.conf
echo "addnode=mmc01.madbuda.me" >> ~/.hush/hush.conf
echo "addnode=zdash.suprnova.cc" >> ~/.hush/hush.conf
echo "addnode=explorer.myhush.org" >> ~/.hush/hush.conf
echo "addnode=dnsseed.myhush.org" >> ~/.hush/hush.conf
echo "addnode=dnsseed2.myhush.org" >> ~/.hush/hush.conf
echo "addnode=dnsseed.bleuzero.com" >> ~/.hush/hush.conf
echo "addnode=dnsseed.hush.quebec" >> ~/.hush/hush.conf
```
## Download proving key
@ -51,19 +53,18 @@ The following build process generally applies to Ubuntu (and similar) Linux
distributions. For best results it is recommended to use Ubuntu Linux 16.04
or later.
Build HUSH along with most dependencies from source by running
Build HUSH along with most dependencies from source by running:
## Linux
Get dependencies:
```{r, engine='bash'}
sudo apt-get install \
build-essential pkg-config libc6-dev m4 g++-multilib \
autoconf libtool ncurses-dev unzip git python \
zlib1g-dev wget bsdmainutils automake
```
Make sure to create a HUSH configuration file as described above.
## Downloading Git source repo, building and running Hush
Downloading Git source repo, building and running Hush:
```{r, engine='bash'}
# pull
@ -77,6 +78,58 @@ cd hush
./src/hushd
```
## Windows (cross-compiled on Linux)
Get dependencies:
```{r, engine='bash'}
sudo apt-get install \
build-essential pkg-config libc6-dev m4 g++-multilib \
autoconf libtool ncurses-dev unzip git python \
zlib1g-dev wget bsdmainutils automake mingw-w64
```
Downloading Git source repo, building and running Hush:
```{r, engine='bash'}
# pull
git clone https://github.com/MyHush/hush.git
cd hush
# fetch key
./zcutil/fetch-params.sh
# Build
./zcutil/build-win.sh -j$(nproc)
# Run a HUSH node
./src/hushd
```
## Mac
Get dependencies:
```{r, engine='bash'}
# Install xcode
xcode-select --install
# Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install cmake autoconf libtool automake coreutils pkgconfig gmp wget
brew install gcc5 --without-multilib
```
Downloading Git source repo, building and running Hush:
```{r, engine='bash'}
# pull
git clone https://github.com/MyHush/hush.git
cd hush
# fetch key
./zcutil/fetch-params.sh
# Build
./zcutil/build-mac.sh
# Run a HUSH node
./src/hushd
```
Make sure to create a HUSH configuration file as described above.
## Supported Platforms
Currently Linux, Windows and Mac OS X are our supported platforms. If you

47
contrib/DEBIAN/changelog

@ -1,47 +0,0 @@
zcash (1.0.3) jessie; urgency=medium
* 1.0.3 release.
-- Zcash Company <team@z.cash> Wed, 17 Nov 2016 15:56:00 -0700
zcash (1.0.2) jessie; urgency=medium
* 1.0.2 release.
-- Zcash Company <team@z.cash> Mon, 07 Nov 2016 19:01:35 -0600
zcash (1.0.1) jessie; urgency=medium
* 1.0.1 release.
-- Zcash Company <team@z.cash> Thu, 03 Nov 2016 23:21:09 -0500
zcash (1.0.0-sprout) jessie; urgency=medium
* 1.0.0 release.
-- Zcash Company <team@z.cash> Fri, 28 Oct 2016 03:00:50 -0700
zcash (1.0.0-rc4) jessie; urgency=medium
* 1.0.0-rc4 release.
-- Zcash Company <team@z.cash> Thu, 27 Oct 2016 13:36:00 +0100
zcash (1.0.0-rc3) jessie; urgency=medium
* 1.0.0-rc3 release.
-- Zcash Company <team@z.cash> Wed, 26 Oct 2016 23:17:03 +0100
zcash (1.0.0-rc2) jessie; urgency=medium
* 1.0.0-rc2 release.
-- Zcash Company <team@z.cash> Sun, 23 Oct 2016 01:51:27 +0100
zcash (1.0.0-rc1) jessie; urgency=medium
* Initial packaging for Debian.
-- Zcash Company <team@z.cash> Mon, 17 Oct 2016 11:47:02 -0700

10
depends/builders/darwin.mk

@ -1,5 +1,5 @@
build_darwin_CC: = $(shell xcrun -f clang)
build_darwin_CXX: = $(shell xcrun -f clang++)
build_darwin_CC = gcc-5
build_darwin_CXX = g++-5
build_darwin_AR: = $(shell xcrun -f ar)
build_darwin_RANLIB: = $(shell xcrun -f ranlib)
build_darwin_STRIP: = $(shell xcrun -f strip)
@ -7,11 +7,11 @@ build_darwin_OTOOL: = $(shell xcrun -f otool)
build_darwin_NM: = $(shell xcrun -f nm)
build_darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool)
build_darwin_SHA256SUM = shasum -a 256
build_darwin_DOWNLOAD = curl --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -L -o
build_darwin_DOWNLOAD = wget --timeout=$(DOWNLOAD_CONNECT_TIMEOUT) --tries=$(DOWNLOAD_RETRIES) -nv -O
#darwin host on darwin builder. overrides darwin host preferences.
darwin_CC=$(shell xcrun -f clang) -mmacosx-version-min=$(OSX_MIN_VERSION)
darwin_CXX:=$(shell xcrun -f clang++) -mmacosx-version-min=$(OSX_MIN_VERSION)
darwin_CC= gcc-5
darwin_CXX= g++-5
darwin_AR:=$(shell xcrun -f ar)
darwin_RANLIB:=$(shell xcrun -f ranlib)
darwin_STRIP:=$(shell xcrun -f strip)

9
depends/packages/boost.mk

@ -11,15 +11,14 @@ $(package)_config_opts_debug=variant=debug
$(package)_config_opts=--layout=tagged --build-type=complete --user-config=user-config.jam
$(package)_config_opts+=threading=multi link=static -sNO_BZIP2=1 -sNO_ZLIB=1
$(package)_config_opts_linux=threadapi=pthread runtime-link=shared
$(package)_config_opts_darwin=--toolset=darwin-4.2.1 runtime-link=shared
$(package)_config_opts_darwin=--toolset=gcc threadapi=pthread runtime-link=shared
$(package)_config_opts_mingw32=binary-format=pe target-os=windows threadapi=win32 runtime-link=static
$(package)_config_opts_x86_64_mingw32=address-model=64
$(package)_config_opts_i686_mingw32=address-model=32
$(package)_config_opts_i686_linux=address-model=32 architecture=x86
$(package)_toolset_$(host_os)=gcc
$(package)_archiver_$(host_os)=$($(package)_ar)
$(package)_toolset_darwin=darwin
$(package)_archiver_darwin=$($(package)_libtool)
$(package)_toolset_darwin=gcc
$(package)_config_libraries=chrono,filesystem,program_options,system,thread,test
$(package)_cxxflags=-fvisibility=hidden
$(package)_cxxflags_linux=-fPIC
@ -36,9 +35,9 @@ define $(package)_config_cmds
endef
define $(package)_build_cmds
./b2 -d2 -j2 -d1 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) stage
./b2 -d2 -j2 -d1 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) cxxflags=-std=c++11 stage
endef
define $(package)_stage_cmds
./b2 -d0 -j4 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) install
./b2 -d0 -j4 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) cxxflags=-std=c++11 install
endef

20
depends/packages/googlemock.mk

@ -9,12 +9,22 @@ $(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_download_file=release-$($(package)_version).tar.gz
$(package)_sha256_hash=3f20b6acb37e5a98e8c4518165711e3e35d47deb6cdb5a4dd4566563b5efd232
define $(package)_build_cmds
$(MAKE) -C make GTEST_DIR='$(host_prefix)' CXXFLAGS='-fPIC' gmock-all.o
define $(package)_set_vars
$(package)_build_env=AR="$($(package)_ar)" RANLIB="$($(package)_ranlib)" CC="$($(package)_cc)" CXX="$($(package)_cxx)" CXXFLAGS="$($(package)_cxxflags)"
endef
BUILD_OS := $(shell uname)
ifeq ($(BUILD_OS),Darwin)
$(package)_install=ginstall
else
$(package)_install=install
endif
define $(package)_stage_cmds
install -D ./make/gmock-all.o $($(package)_staging_dir)$(host_prefix)/lib/libgmock.a && \
cp -a ./include $($(package)_staging_dir)$(host_prefix)/include
define $(package)_build_cmds
$(MAKE) -C make GTEST_DIR='$(host_prefix)' gmock-all.o
endef
define $(package)_stage_cmds
$($(package)_install) -D ./make/gmock-all.o $($(package)_staging_dir)$(host_prefix)/lib/libgmock.a && \
cp -a ./include $($(package)_staging_dir)$(host_prefix)/include
endef

19
depends/packages/googletest.mk

@ -5,11 +5,22 @@ $(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_download_file=release-$($(package)_version).tar.gz
$(package)_sha256_hash=f73a6546fdf9fce9ff93a5015e0333a8af3062a152a9ad6bcb772c96687016cc
define $(package)_set_vars
$(package)_build_env=AR="$($(package)_ar)" RANLIB="$($(package)_ranlib)" CC="$($(package)_cc)" CXX="$($(package)_cxx)" CXXFLAGS="$($(package)_cxxflags)"
endef
BUILD_OS := $(shell uname)
ifeq ($(BUILD_OS),Darwin)
$(package)_install=ginstall
else
$(package)_install=install
endif
define $(package)_build_cmds
$(MAKE) -C make CXXFLAGS=-fPIC gtest.a
$(MAKE) -C make gtest.a
endef
define $(package)_stage_cmds
install -D ./make/gtest.a $($(package)_staging_dir)$(host_prefix)/lib/libgtest.a && \
cp -a ./include $($(package)_staging_dir)$(host_prefix)/include
endef
$($(package)_install) -D ./make/gtest.a $($(package)_staging_dir)$(host_prefix)/lib/libgtest.a && \
cp -a ./include $($(package)_staging_dir)$(host_prefix)/include
endef

5
src/netbase.cpp

@ -17,8 +17,13 @@
#include "utilstrencodings.h"
#ifdef HAVE_GETADDRINFO_A
#if defined(__APPLE__)
// On MacOSX we end up with this defined, but no gettaddrinfo_a
#undef HAVE_GETADDRINFO_A
#else
#include <netdb.h>
#endif
#endif
#ifndef WIN32
#if HAVE_INET_PTON

4
src/paymentdisclosure.h

@ -71,7 +71,7 @@ struct PaymentDisclosurePayload {
uint8_t version; // 0 = experimental, 1 = first production version, etc.
uint256 esk; // zcash/NoteEncryption.cpp
uint256 txid; // primitives/transaction.h
size_t js; // Index into CTransaction.vjoinsplit
uint64_t js; // Index into CTransaction.vjoinsplit
uint8_t n; // Index into JSDescription fields of length ZC_NUM_JS_OUTPUTS
libzcash::PaymentAddress zaddr; // zcash/Address.hpp
std::string message; // parameter to RPC call
@ -142,4 +142,4 @@ struct PaymentDisclosure {
typedef std::pair<PaymentDisclosureKey, PaymentDisclosureInfo> PaymentDisclosureKeyInfo;
#endif // ZCASH_PAYMENTDISCLOSURE_H
#endif // ZCASH_PAYMENTDISCLOSURE_H

10
src/snark/Makefile

@ -199,13 +199,11 @@ $(LIBGTEST_A): $(GTESTDIR)/src/gtest-all.cc $(DEPINST_EXISTS)
# libsnark.a will contains all of our relevant object files, and we also mash in the .a files of relevant dependencies built by ./prepare-depends.sh
$(LIBSNARK_A): $(LIB_OBJS) $(AR_LIBS)
( \
echo "create $(LIBSNARK_A)"; \
echo "addmod $(LIB_OBJS)"; \
echo " $(LIBSNARK_A)"; \
echo " $(LIB_OBJS)"; \
if [ -n "$(AR_LIBS)" ]; then for AR_LIB in $(AR_LIBS); do echo addlib $$AR_LIB; done; fi; \
echo "save"; \
echo "end"; \
) | $(AR) -M
$(AR) s $(LIBSNARK_A)
) | xargs $(AR) -r
$(AR) s $(LIBSNARK_A)
libsnark.so: $(LIBSNARK_A) $(DEPINST_EXISTS)
$(CXX) -o $@ --shared -Wl,--whole-archive $(LIBSNARK_A) $(CXXFLAGS) $(LDFLAGS) -Wl,--no-whole-archive $(LDLIBS)

23
src/univalue/include/univalue.h

@ -25,6 +25,11 @@ public:
typ = initialType;
val = initialStr;
}
#ifdef __APPLE__
UniValue(size_t val_) {
setInt(val_);
}
#endif
UniValue(uint64_t val_) {
setInt(val_);
}
@ -54,6 +59,9 @@ public:
bool setNull();
bool setBool(bool val);
bool setNumStr(const std::string& val);
#ifdef __APPLE__
bool setInt(size_t val_);
#endif
bool setInt(uint64_t val);
bool setInt(int64_t val);
bool setInt(int val_) { return setInt((int64_t)val_); }
@ -92,6 +100,12 @@ public:
std::string s(val_);
return push_back(s);
}
#ifdef __APPLE__
bool push_back(size_t val_) {
UniValue tmpVal(val_);
return push_back(tmpVal);
}
#endif
bool push_back(uint64_t val_) {
UniValue tmpVal(val_);
return push_back(tmpVal);
@ -190,6 +204,15 @@ static inline std::pair<std::string,UniValue> Pair(const char *cKey, std::string
return std::make_pair(key, uVal);
}
#ifdef __APPLE__
static inline std::pair<std::string,UniValue> Pair(const char *cKey, size_t sizeVal)
{
std::string key(cKey);
UniValue uVal(sizeVal);
return std::make_pair(key, uVal);
}
#endif
static inline std::pair<std::string,UniValue> Pair(const char *cKey, uint64_t u64Val)
{
std::string key(cKey);

11
src/univalue/lib/univalue.cpp

@ -119,6 +119,17 @@ bool UniValue::setNumStr(const string& val_)
return true;
}
#ifdef __APPLE__
bool UniValue::setInt(size_t val_)
{
ostringstream oss;
oss << val_;
return setNumStr(oss.str());
}
#endif
bool UniValue::setInt(uint64_t val_)
{
ostringstream oss;

2
src/wallet/wallet.h

@ -160,7 +160,7 @@ public:
// Transaction hash
uint256 hash;
// Index into CTransaction.vjoinsplit
size_t js;
uint64_t js;
// Index into JSDescription fields of length ZC_NUM_JS_OUTPUTS
uint8_t n;

72
zcutil/build-mac.sh

@ -0,0 +1,72 @@
#!/bin/bash
export CC=gcc-5
export CXX=g++-5
export LIBTOOL=libtool
export AR=ar
export RANLIB=ranlib
export STRIP=strip
export OTOOL=otool
export NM=nm
set -eu -o pipefail
if [ "x$*" = 'x--help' ]
then
cat <<EOF
Usage:
$0 --help
Show this help message and exit.
$0 [ --enable-lcov ] [ MAKEARGS... ]
Build Zen and most of its transitive dependencies from
source. MAKEARGS are applied to both dependencies and Zen itself. If
--enable-lcov is passed, Zen is configured to add coverage
instrumentation, thus enabling "make cov" to work.
EOF
exit 0
fi
# If --enable-lcov is the first argument, enable lcov coverage support:
LCOV_ARG=''
HARDENING_ARG='--disable-hardening'
if [ "x${1:-}" = 'x--enable-lcov' ]
then
LCOV_ARG='--enable-lcov'
HARDENING_ARG='--disable-hardening'
shift
fi
# If --disable-mining is the next argument, disable mining code:
MINING_ARG=''
if [ "x${1:-}" = 'x--disable-mining' ]
then
MINING_ARG='--enable-mining=no'
shift
fi
# If --disable-rust is the next argument, disable Rust code:
RUST_ARG=''
if [ "x${1:-}" = 'x--disable-rust' ]
then
RUST_ARG='--enable-rust=no'
shift
fi
# If --enable-proton is the next argument, enable building Proton code:
PROTON_ARG='--enable-proton=no'
if [ "x${1:-}" = 'x--enable-proton' ]
then
PROTON_ARG=''
shift
fi
TRIPLET=`./depends/config.guess`
PREFIX="$(pwd)/depends/$TRIPLET"
NO_RUST="$RUST_ARG" NO_PROTON="$PROTON_ARG" make "$@" -C ./depends/ V=1 NO_QT=1
./autogen.sh
CPPFLAGS="-I$PREFIX/include -arch x86_64" LDFLAGS="-L$PREFIX/lib -arch x86_64 -Wl,-no_pie" \
CXXFLAGS='-arch x86_64 -I/usr/local/Cellar/gcc5/5.4.0/include/c++/5.4.0 -I$PREFIX/include -fwrapv -fno-strict-aliasing -Werror -g -Wl,-undefined -Wl,dynamic_lookup' \
./configure --prefix="${PREFIX}" --with-gui=no "$HARDENING_ARG" "$LCOV_ARG" "$RUST_ARG" "$PROTON_ARG" "$MINING_ARG"
make "$@" V=1 NO_GTEST=0 STATIC=1
Loading…
Cancel
Save