Skip to content

Commit

Permalink
Merge pull request #16 from SpaceWorksCo/static-spacecoin-dev
Browse files Browse the repository at this point in the history
Upstream komodo season 5 hardfork changes.
  • Loading branch information
lightspeed393 committed Jun 14, 2021
2 parents 2cc89f6 + e804fbe commit b861969
Show file tree
Hide file tree
Showing 168 changed files with 8,886 additions and 3,845 deletions.
35 changes: 32 additions & 3 deletions .github/workflows/spacecoin-qt_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Build (Linux)
if: runner.os == 'Linux'
run: |
./zcutil/build-linux.sh -j$(nproc)
./zcutil/build.sh -j$(nproc)
zip --junk-paths spacecoin-qt-linux src/komodod src/komodo-cli spacecoin-qt
- name: Upload spacecoin-qt-linux.zip
uses: actions/upload-artifact@v1
Expand All @@ -61,7 +61,7 @@ jobs:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get update # prevents repo404 errors on apt-remove below
sudo apt-get remove php5.6-fpm php7.0-fpm php7.1-fpm php7.2-fpm php7.3-fpm php7.3-common php7.4-fpm
sudo apt-get remove php5.6-fpm php7.0-fpm php7.1-fpm php7.2-fpm php7.3-fpm php7.3-common php7.4-fpm msodbcsql17
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get upgrade -y
sudo apt-get install automake autoconf bsdmainutils build-essential clang cmake curl git g++-multilib libboost-all-dev libcurl4-gnutls-dev libc6-dev libdb++-dev libevent-dev libncurses-dev libprotobuf-dev libqrencode-dev libsodium-dev libssl-dev libtool mingw-w64 m4 nano ncurses-dev ntp ntpdate pkg-config protobuf-compiler python python-zmq software-properties-common unzip wget zlib1g-dev -y
Expand All @@ -75,8 +75,37 @@ jobs:
run: |
./zcutil/build-win.sh -j$(nproc)
zip --junk-paths spacecoin-qt-win src/komodod.exe src/komodo-cli.exe spacecoin-qt.exe
- name: Upload tspace-qt-win.zip
- name: Upload space-qt-win.zip
uses: actions/upload-artifact@v1
with:
name: spacecoin-qt-win
path: ./spacecoin-qt-win.zip

osx-build:
name: OSX Build
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies (macOS)
run: |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
brew upgrade
brew tap discoteq/discoteq; brew install flock
brew install autoconf autogen automake
brew install binutils
brew install protobuf
brew install coreutils
brew install wget
brew install python3
brew install berkeley-db4 libtool boost miniupnpc openssl pkg-config python qt libevent qrencode
brew install librsvg
- name: Build (macOS)
run: |
./zcutil/build-mac.sh -j8
zip --junk-paths spacecoin-qt-mac src/komodod src/komodo-cli spacecoin-qt
- name: Upload spacecoin-qt-mac.zip
uses: actions/upload-artifact@v1
with:
name: spacecoin-qt-mac
path: ./spacecoin-qt-mac.zip
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,12 @@ venv-mnf/
*.lo
*.la

# Compilation
# Compilation and Qt preprocessor part
*.qm
Makefile
src/qt/komodo-qt
Komodo-Qt.app
background.tiff*

# Unit-tests
Makefile.test
Expand Down
109 changes: 72 additions & 37 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,27 @@ pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libzcashconsensus.pc
endif

KOMODOD_BIN=$(top_builddir)/src/zcashd$(EXEEXT)
KOMODO_CLI_BIN=$(top_builddir)/src/zcash-cli$(EXEEXT)
KOMODO_WIN_INSTALLER=$(PACKAGE)-$(PACKAGE_VERSION)-win$(WINDOWS_BITS)-setup$(EXEEXT)
KOMODOD_BIN=$(top_builddir)/src/$(BITCOIN_DAEMON_NAME)$(EXEEXT)
KOMODO_QT_BIN=$(top_builddir)/src/qt/$(BITCOIN_GUI_NAME)$(EXEEXT)
KOMODO_CLI_BIN=$(top_builddir)/src/$(BITCOIN_CLI_NAME)$(EXEEXT)
KOMODO_TX_BIN=$(top_builddir)/src/$(BITCOIN_TX_NAME)$(EXEEXT)
KOMODO_WIN_INSTALLER=$(PACKAGE_NAME)-$(PACKAGE_VERSION)-win$(WINDOWS_BITS)-setup$(EXEEXT)

empty :=
space := $(empty) $(empty)

if TARGET_DARWIN
OSX_APP=Komodo-Qt.app
OSX_DMG=Komodo-Core.dmg
#OSX_VOLNAME = $(subst $(space),-,$(PACKAGE_NAME))
OSX_VOLNAME = $(subst $(space),-,$(PACKAGE_NAME)-$(PACKAGE_VERSION))
OSX_DMG = $(OSX_VOLNAME).dmg
OSX_BACKGROUND_SVG=background.svg
OSX_BACKGROUND_IMAGE=background.tiff
OSX_BACKGROUND_IMAGE_DPIS=36 72
OSX_DSSTORE_GEN=$(top_srcdir)/contrib/macdeploy/custom_dsstore.py
OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus
OSX_FANCY_PLIST=$(top_srcdir)/contrib/macdeploy/fancy.plist
OSX_BASE_LPROJ_DIR=$(top_srcdir)/contrib/macdeploy/Base.lproj/InfoPlist.strings
# OSX_BASE_LPROJ_DIR=$(top_srcdir)/contrib/macdeploy/Base.lproj/InfoPlist.strings
OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/komodo.icns
OSX_PLIST=$(top_srcdir)/share/qt/Info.plist #not installed
OSX_QT_TRANSLATIONS = da,de,es,hu,ru,uk,zh_CN,zh_TW
Expand All @@ -34,15 +44,21 @@ BIN_CHECKS=$(top_srcdir)/contrib/devtools/symbol-check.py \
$(top_srcdir)/contrib/devtools/security-check.py

WINDOWS_PACKAGING = $(top_srcdir)/share/pixmaps/komodo.ico \
$(top_srcdir)/share/pixmaps/nsis-header.bmp \
$(top_srcdir)/share/pixmaps/nsis-wizard.bmp
$(top_srcdir)/share/pixmaps/nsis-header.bmp \
$(top_srcdir)/share/pixmaps/nsis-wizard.bmp

if TARGET_DARWIN
OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) $(OSX_BASE_LPROJ_DIR) \
$(top_srcdir)/contrib/macdeploy/$(OSX_BACKGROUND_IMAGE) \
$(top_srcdir)/contrib/macdeploy/DS_Store \
$(top_srcdir)/contrib/macdeploy/detached-sig-apply.sh \
$(top_srcdir)/contrib/macdeploy/detached-sig-create.sh

# OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) $(OSX_BASE_LPROJ_DIR) \
# $(top_srcdir)/contrib/macdeploy/$(OSX_BACKGROUND_IMAGE) \
# $(top_srcdir)/contrib/macdeploy/DS_Store \
# $(top_srcdir)/contrib/macdeploy/detached-sig-apply.sh \
# $(top_srcdir)/contrib/macdeploy/detached-sig-create.sh
OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) \
$(top_srcdir)/contrib/macdeploy/$(OSX_BACKGROUND_SVG) \
$(OSX_DSSTORE_GEN) \
$(top_srcdir)/contrib/macdeploy/detached-sig-apply.sh \
$(top_srcdir)/contrib/macdeploy/detached-sig-create.sh
endif

if TARGET_DARWIN
Expand All @@ -60,22 +76,12 @@ COVERAGE_INFO = baseline_filtered_combined.info baseline.info block_test.info \
endif

dist-hook:
-$(MAKE) -C $(top_distdir)/src/leveldb clean
-$(MAKE) -C $(top_distdir)/src/secp256k1 distclean
-$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf -

distcheck-hook:
$(MKDIR_P) $(top_distdir)/_build/src/leveldb
cp -rf $(top_srcdir)/src/leveldb/* $(top_distdir)/_build/src/leveldb/
-$(MAKE) -C $(top_distdir)/_build/src/leveldb clean

distcleancheck:
@:

$(KOMODO_WIN_INSTALLER): all-recursive
$(MKDIR_P) $(top_builddir)/release
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(KOMODOD_BIN) $(top_builddir)/release
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(KOMODO_CLI_BIN) $(top_builddir)/release
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(KOMODO_QT_BIN) $(top_builddir)/release
@test -f $(MAKENSIS) && $(MAKENSIS) -V2 $(top_builddir)/share/setup.nsi || \
echo error: could not build $@
@echo built $@
Expand All @@ -101,45 +107,73 @@ $(OSX_APP)/Contents/Resources/komodo.icns: $(OSX_INSTALLER_ICONS)
$(MKDIR_P) $(@D)
$(INSTALL_DATA) $< $@

# $(OSX_APP)/Contents/MacOS/Komodo-Qt: $(KOMODO_QT_BIN)
# $(MKDIR_P) $(@D)
# STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $< $@

$(OSX_APP)/Contents/MacOS/Komodo-Qt: $(KOMODO_QT_BIN)
$(MKDIR_P) $(@D)
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $< $@
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $< $@

$(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings: $(OSX_BASE_LPROJ_DIR)
# $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings: $(OSX_BASE_LPROJ_DIR)
# $(MKDIR_P) $(@D)
# $(INSTALL_DATA) $< $@
$(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings:
$(MKDIR_P) $(@D)
$(INSTALL_DATA) $< $@
echo '{ CFBundleDisplayName = "$(PACKAGE_NAME)"; CFBundleName = "$(PACKAGE_NAME)"; }' > $@

OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lproj \
$(OSX_APP)/Contents/Resources/komodo.icns $(OSX_APP)/Contents/Info.plist \
$(OSX_APP)/Contents/MacOS/Komodo-Qt $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings
$(OSX_APP)/Contents/Resources/komodo.icns $(OSX_APP)/Contents/Info.plist \
$(OSX_APP)/Contents/MacOS/Komodo-Qt $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings

endif

if BUILD_DARWIN
$(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING)
$(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -translations-dir=$(QT_TRANSLATION_DIR) -dmg -fancy $(OSX_FANCY_PLIST) -verbose 2
# $(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING)
# $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -translations-dir=$(QT_TRANSLATION_DIR) -dmg -fancy $(OSX_FANCY_PLIST) -verbose 2
$(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING) $(OSX_BACKGROUND_IMAGE)
$(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -translations-dir=$(QT_TRANSLATION_DIR) -dmg -fancy $(OSX_FANCY_PLIST) -verbose 2 -volname $(OSX_VOLNAME)

$(OSX_BACKGROUND_IMAGE).png: contrib/macdeploy/$(OSX_BACKGROUND_SVG)
sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d 36 -p 36 -o $@
$(OSX_BACKGROUND_IMAGE)@2x.png: contrib/macdeploy/$(OSX_BACKGROUND_SVG)
sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d 72 -p 72 -o $@
$(OSX_BACKGROUND_IMAGE): $(OSX_BACKGROUND_IMAGE).png $(OSX_BACKGROUND_IMAGE)@2x.png
tiffutil -cathidpicheck $^ -out $@

deploydir: $(OSX_DMG)
else
APP_DIST_DIR=$(top_builddir)/dist
APP_DIST_EXTRAS=$(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE) $(APP_DIST_DIR)/.DS_Store $(APP_DIST_DIR)/Applications
endif
#endif

if TARGET_DARWIN
#if TARGET_DARWIN
$(APP_DIST_DIR)/Applications:
@rm -f $@
@cd $(@D); $(LN_S) /Applications $(@F)

$(APP_DIST_EXTRAS): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Komodo-Qt

$(OSX_DMG): $(APP_DIST_EXTRAS)
$(GENISOIMAGE) -no-cache-inodes -D -l -probe -V "Komodo-Core" -no-pad -r -apple -o $@ dist

$(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE): contrib/macdeploy/$(OSX_BACKGROUND_IMAGE)
$(GENISOIMAGE) -no-cache-inodes -D -l -probe -V "$(OSX_VOLNAME)" -no-pad -r -dir-mode 0755 -apple -o $@ dist

# $(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE): contrib/macdeploy/$(OSX_BACKGROUND_IMAGE)
# $(MKDIR_P) $(@D)
# $(INSTALL) $< $@
dpi%.$(OSX_BACKGROUND_IMAGE): contrib/macdeploy/$(OSX_BACKGROUND_SVG)
sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d $* -p $* | $(IMAGEMAGICK_CONVERT) - $@
OSX_BACKGROUND_IMAGE_DPIFILES := $(foreach dpi,$(OSX_BACKGROUND_IMAGE_DPIS),dpi$(dpi).$(OSX_BACKGROUND_IMAGE))
$(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE): $(OSX_BACKGROUND_IMAGE_DPIFILES)
$(MKDIR_P) $(@D)
$(INSTALL) $< $@
$(TIFFCP) -c none $(OSX_BACKGROUND_IMAGE_DPIFILES) $@

$(APP_DIST_DIR)/.DS_Store: contrib/macdeploy/DS_Store
echo $(PYTHON) $< "$@" "$(OSX_VOLNAME)"
$(INSTALL) $< $@

# $(APP_DIST_DIR)/.DS_Store: $(OSX_DSSTORE_GEN)
# $(PYTHON) $< "$@" "$(OSX_VOLNAME)"

$(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Komodo-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING)
INSTALLNAMETOOL=$(INSTALLNAMETOOL) OTOOL=$(OTOOL) STRIP=$(STRIP) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -translations-dir=$(QT_TRANSLATION_DIR) -add-qt-tr $(OSX_QT_TRANSLATIONS) -verbose 2

Expand Down Expand Up @@ -351,3 +385,4 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-man

clean-local:
rm -rf test_komodo.coverage/ zcash-gtest.coverage/ total.coverage/ $(OSX_APP)
rm -rf dist/ dpi36.background.tiff dpi72.background.tiff
13 changes: 12 additions & 1 deletion README-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,15 @@ bcz few procedures uses `vcalc_sha256` even to check incoming block, so it needs

### part 4

- Probably we have some unexpected / unpredictable behavior (strange side-effect) with this [linux_release_CFLAGS: -O1 -> -O2](https://github.com/DeckerSU/KomodoOcean/commit/511b27aba1c53b05acdc2a169eb374017b7b9145) commit. When wallet built with `CXXFLAGS='-g0 -O2'` all is ok, when with `CXXFLAGS='-g -O2'` - it's ok too. But when we tried to build wallet with just `CXXFLAGS='-g'` in `zcutil/build.sh ` it crashed somewhere in init of [CDBEnv](https://github.com/DeckerSU/KomodoOcean/blob/b8d315bbbece1cb3786855dae40de70a3f8385f0/src/wallet/db.cpp#L49). So, i just want to mention it here. In future it should be investigated to find a solution, may be commit should be reverted or additional BDB build flags should be added.
- Probably we have some unexpected / unpredictable behavior (strange side-effect) with this [linux_release_CFLAGS: -O1 -> -O2](https://github.com/DeckerSU/KomodoOcean/commit/511b27aba1c53b05acdc2a169eb374017b7b9145) commit. When wallet built with `CXXFLAGS='-g0 -O2'` all is ok, when with `CXXFLAGS='-g -O2'` - it's ok too. But when we tried to build wallet with just `CXXFLAGS='-g'` in `zcutil/build.sh ` it crashed somewhere in init of [CDBEnv](https://github.com/DeckerSU/KomodoOcean/blob/b8d315bbbece1cb3786855dae40de70a3f8385f0/src/wallet/db.cpp#L49). So, i just want to mention it here. In future it should be investigated to find a solution, may be commit should be reverted or additional BDB build flags should be added.

### part 5

- If you want to build under Linux for multiple OSes from the same repo / folder, like, build for Win64 and then build for MacOS - you can do the following:
```
make clean
make -C src/univalue clean
make -C src/cryptoconditions clean
rm src/qt/moc_*.cpp
```
after each different build.
24 changes: 20 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ Download from [Releases](https://github.com/SpaceWorksCo/SpaceOcean/releases) or
Visit [#wallet-qt](https://spaceworks.co/discord) channel in SpaceWorks Discord for more information.


- Linux: `build.sh` (native build)
- Windows: `build-win.sh` (cross-compilation for Win)
- MacOS: `build-mac-cross.sh` (cross-compilation for OSX)
- MacOS: `build-mac.sh` (native build)

## How to build?

#### Linux
Expand All @@ -26,12 +31,22 @@ git clone https://github.com/SpaceWorksCo/SpaceOcean --branch static-spacecoin -
cd SpaceOcean
./zcutil/fetch-params.sh
# -j8 = using 8 threads for the compilation - replace 8 with number of threads you want to use
./zcutil/build-linux.sh -j8
./zcutil/build.sh -j8
#This can take some time.
```

#### OSX (Cross-compile)

Before start, read the following docs: [depends](https://github.com/bitcoin/bitcoin/blob/master/depends/README.md), [macdeploy](https://github.com/bitcoin/bitcoin/blob/master/contrib/macdeploy/README.md) .

Install dependencies:
```
sudo apt-get install curl librsvg2-bin libtiff-tools bsdmainutils cmake imagemagick libcap-dev libz-dev libbz2-dev python3-setuptools libtinfo5 xorriso
```

Place prepared SDK file `Xcode-11.3.1-11C505-extracted-SDK-with-libcxx-headers.tar.gz` in repo root, use `build-mac-cross.sh` script to build.

#### OSX
#### OSX (Native)
Ensure you have [brew](https://brew.sh) and Command Line Tools installed.
```shell
# Install brew
Expand All @@ -43,7 +58,7 @@ brew update
brew upgrade
brew tap discoteq/discoteq; brew install flock
brew install autoconf autogen automake
brew install gcc@6
# brew install gcc@6
brew install binutils
brew install protobuf
brew install coreutils
Expand All @@ -57,6 +72,8 @@ cd SpaceOcean
# This can take some time.
```

*p.s.* Currently only `x86_64` arch supported for MacOS, build for `Apple M1` processors unfortunately not yet supported.

#### Windows
Use a debian cross-compilation setup with mingw for windows and run:
```shell
Expand All @@ -81,7 +98,6 @@ cd SpaceOcean
**SpaceOcean is experimental and a work-in-progress.** Use at your own risk.



## Developers of Qt wallet ##
- Spacecoin Fork: **SpaceWorks**
- Main developer: **Ocean**
Expand Down
Loading

0 comments on commit b861969

Please sign in to comment.