├── INSTALL.md ├── src ├── config │ └── .empty ├── univalue │ ├── test │ │ ├── fail29.json │ │ ├── fail16.json │ │ ├── fail30.json │ │ ├── fail31.json │ │ ├── round4.json │ │ ├── round5.json │ │ ├── round7.json │ │ ├── fail33.json │ │ ├── fail34.json │ │ ├── fail36.json │ │ ├── round6.json │ │ ├── fail2.json │ │ ├── fail24.json │ │ ├── fail27.json │ │ ├── fail28.json │ │ ├── fail37.json │ │ ├── fail38.json │ │ ├── fail39.json │ │ ├── fail4.json │ │ ├── fail8.json │ │ ├── round2.json │ │ ├── fail19.json │ │ ├── fail20.json │ │ ├── fail23.json │ │ ├── fail5.json │ │ ├── fail9.json │ │ ├── fail11.json │ │ ├── fail25.json │ │ ├── fail6.json │ │ ├── fail7.json │ │ ├── fail12.json │ │ ├── fail14.json │ │ ├── fail15.json │ │ ├── fail17.json │ │ ├── fail21.json │ │ ├── fail22.json │ │ ├── fail35.json │ │ ├── round3.json │ │ ├── fail26.json │ │ ├── fail3.json │ │ ├── fail13.json │ │ ├── fail32.json │ │ ├── fail42.json │ │ ├── fail44.json │ │ ├── fail18.json │ │ ├── pass2.json │ │ ├── fail10.json │ │ ├── fail1.json │ │ ├── .gitignore │ │ ├── fail40.json │ │ ├── fail41.json │ │ ├── pass3.json │ │ ├── no_nul.cpp │ │ ├── round1.json │ │ ├── test_json.cpp │ │ ├── pass1.json │ │ └── unitester.cpp │ ├── build-aux │ │ └── m4 │ │ │ └── .gitignore │ ├── lib │ │ ├── .gitignore │ │ ├── univalue_write.cpp │ │ ├── univalue_escapes.h │ │ ├── univalue_get.cpp │ │ ├── univalue_utffilter.h │ │ └── univalue.cpp │ ├── autogen.sh │ ├── TODO │ ├── pc │ │ ├── libunivalue.pc.in │ │ └── libunivalue-uninstalled.pc.in │ ├── .gitignore │ ├── README.md │ ├── COPYING │ ├── .travis.yml │ ├── gen │ │ └── gen.cpp │ ├── configure.ac │ ├── Makefile.am │ └── include │ │ └── univalue.h ├── res │ ├── icons │ │ └── application.png │ └── application-res.rc ├── application.qrc ├── application_locale.qrc ├── main.cpp ├── locale │ └── application_en_GB.ts ├── mainwindow.cpp ├── mainwindow.h ├── forms │ └── mainwindow.ui ├── .clang-format └── Makefile.am ├── doc └── .gitignore ├── share ├── pixmaps │ ├── bitcoin.ico │ ├── bitcoin16.png │ ├── bitcoin32.png │ ├── bitcoin64.png │ ├── bitcoin128.png │ ├── bitcoin256.png │ ├── nsis-header.bmp │ ├── nsis-wizard.bmp │ ├── bitcoin16.xpm │ ├── bitcoin32.xpm │ └── bitcoin64.xpm ├── genbuild.sh ├── qt │ ├── extract_strings_qt.py │ └── Info.plist.in └── setup.nsi.in ├── depends ├── .gitignore ├── builders │ ├── linux.mk │ ├── default.mk │ └── darwin.mk ├── hosts │ ├── mingw32.mk │ ├── darwin.mk │ ├── linux.mk │ └── default.mk ├── packages │ ├── xproto.mk │ ├── xextproto.mk │ ├── expat.mk │ ├── xtrans.mk │ ├── native_ccache.mk │ ├── libXext.mk │ ├── packages.mk │ ├── qrencode.mk │ ├── freetype.mk │ ├── libXau.mk │ ├── native_ds_store.mk │ ├── native_libdmg-hfsplus.mk │ ├── libX11.mk │ ├── libICE.mk │ ├── libSM.mk │ ├── native_protobuf.mk │ ├── xcb_proto.mk │ ├── native_mac_alias.mk │ ├── native_biplist.mk │ ├── native_cdrkit.mk │ ├── dbus.mk │ ├── libevent.mk │ ├── zlib.mk │ ├── protobuf.mk │ ├── libxcb.mk │ ├── bdb.mk │ ├── fontconfig.mk │ ├── zeromq.mk │ ├── miniupnpc.mk │ ├── boost.mk │ ├── openssl.mk │ ├── native_cctools.mk │ └── qt.mk ├── patches │ └── qt │ │ └── mac-qmake.conf ├── description.md ├── config.site.in ├── README.md ├── packages.md └── funcs.mk ├── autogen.sh ├── README.md ├── COPYING ├── .gitignore ├── Makefile.am └── .travis.yml /INSTALL.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/config/.empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /doc/.gitignore: -------------------------------------------------------------------------------- 1 | Doxyfile 2 | -------------------------------------------------------------------------------- /src/univalue/test/fail29.json: -------------------------------------------------------------------------------- 1 | [0e] -------------------------------------------------------------------------------- /src/univalue/test/fail16.json: -------------------------------------------------------------------------------- 1 | [\naked] -------------------------------------------------------------------------------- /src/univalue/test/fail30.json: -------------------------------------------------------------------------------- 1 | [0e+] -------------------------------------------------------------------------------- /src/univalue/test/fail31.json: -------------------------------------------------------------------------------- 1 | [0e+-1] -------------------------------------------------------------------------------- /src/univalue/test/round4.json: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /src/univalue/test/round5.json: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /src/univalue/test/round7.json: -------------------------------------------------------------------------------- 1 | null 2 | -------------------------------------------------------------------------------- /src/univalue/test/fail33.json: -------------------------------------------------------------------------------- 1 | ["mismatch"} -------------------------------------------------------------------------------- /src/univalue/test/fail34.json: -------------------------------------------------------------------------------- 1 | {} garbage -------------------------------------------------------------------------------- /src/univalue/test/fail36.json: -------------------------------------------------------------------------------- 1 | {"a":} 2 | -------------------------------------------------------------------------------- /src/univalue/test/round6.json: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /src/univalue/build-aux/m4/.gitignore: -------------------------------------------------------------------------------- 1 | /*.m4 2 | -------------------------------------------------------------------------------- /src/univalue/lib/.gitignore: -------------------------------------------------------------------------------- 1 | gen 2 | .libs 3 | -------------------------------------------------------------------------------- /src/univalue/test/fail2.json: -------------------------------------------------------------------------------- 1 | ["Unclosed array" -------------------------------------------------------------------------------- /src/univalue/test/fail24.json: -------------------------------------------------------------------------------- 1 | ['single quote'] -------------------------------------------------------------------------------- /src/univalue/test/fail27.json: -------------------------------------------------------------------------------- 1 | ["line 2 | break"] -------------------------------------------------------------------------------- /src/univalue/test/fail28.json: -------------------------------------------------------------------------------- 1 | ["line\ 2 | break"] -------------------------------------------------------------------------------- /src/univalue/test/fail37.json: -------------------------------------------------------------------------------- 1 | {"a":1 "b":2} 2 | -------------------------------------------------------------------------------- /src/univalue/test/fail38.json: -------------------------------------------------------------------------------- 1 | ["\ud834"] 2 | -------------------------------------------------------------------------------- /src/univalue/test/fail39.json: -------------------------------------------------------------------------------- 1 | ["\udd61"] 2 | -------------------------------------------------------------------------------- /src/univalue/test/fail4.json: -------------------------------------------------------------------------------- 1 | ["extra comma",] -------------------------------------------------------------------------------- /src/univalue/test/fail8.json: -------------------------------------------------------------------------------- 1 | ["Extra close"]] -------------------------------------------------------------------------------- /src/univalue/test/round2.json: -------------------------------------------------------------------------------- 1 | ["a§■𐎒𝅘𝅥𝅯"] 2 | -------------------------------------------------------------------------------- /src/univalue/test/fail19.json: -------------------------------------------------------------------------------- 1 | {"Missing colon" null} -------------------------------------------------------------------------------- /src/univalue/test/fail20.json: -------------------------------------------------------------------------------- 1 | {"Double colon":: null} -------------------------------------------------------------------------------- /src/univalue/test/fail23.json: -------------------------------------------------------------------------------- 1 | ["Bad value", truth] -------------------------------------------------------------------------------- /src/univalue/test/fail5.json: -------------------------------------------------------------------------------- 1 | ["double extra comma",,] -------------------------------------------------------------------------------- /src/univalue/test/fail9.json: -------------------------------------------------------------------------------- 1 | {"Extra comma": true,} -------------------------------------------------------------------------------- /src/univalue/test/fail11.json: -------------------------------------------------------------------------------- 1 | {"Illegal expression": 1 + 2} -------------------------------------------------------------------------------- /src/univalue/test/fail25.json: -------------------------------------------------------------------------------- 1 | [" tab character in string "] -------------------------------------------------------------------------------- /src/univalue/test/fail6.json: -------------------------------------------------------------------------------- 1 | [ , "<-- missing value"] -------------------------------------------------------------------------------- /src/univalue/test/fail7.json: -------------------------------------------------------------------------------- 1 | ["Comma after the close"], -------------------------------------------------------------------------------- /src/univalue/test/fail12.json: -------------------------------------------------------------------------------- 1 | {"Illegal invocation": alert()} -------------------------------------------------------------------------------- /src/univalue/test/fail14.json: -------------------------------------------------------------------------------- 1 | {"Numbers cannot be hex": 0x14} -------------------------------------------------------------------------------- /src/univalue/test/fail15.json: -------------------------------------------------------------------------------- 1 | ["Illegal backslash escape: \x15"] -------------------------------------------------------------------------------- /src/univalue/test/fail17.json: -------------------------------------------------------------------------------- 1 | ["Illegal backslash escape: \017"] -------------------------------------------------------------------------------- /src/univalue/test/fail21.json: -------------------------------------------------------------------------------- 1 | {"Comma instead of colon", null} -------------------------------------------------------------------------------- /src/univalue/test/fail22.json: -------------------------------------------------------------------------------- 1 | ["Colon instead of comma": false] -------------------------------------------------------------------------------- /src/univalue/test/fail35.json: -------------------------------------------------------------------------------- 1 | [ true true true [] [] [] ] 2 | -------------------------------------------------------------------------------- /src/univalue/test/round3.json: -------------------------------------------------------------------------------- 1 | "abcdefghijklmnopqrstuvwxyz" 2 | -------------------------------------------------------------------------------- /src/univalue/test/fail26.json: -------------------------------------------------------------------------------- 1 | ["tab\ character\ in\ string\ "] -------------------------------------------------------------------------------- /src/univalue/test/fail3.json: -------------------------------------------------------------------------------- 1 | {unquoted_key: "keys must be quoted"} -------------------------------------------------------------------------------- /src/univalue/test/fail13.json: -------------------------------------------------------------------------------- 1 | {"Numbers cannot have leading zeroes": 013} -------------------------------------------------------------------------------- /src/univalue/test/fail32.json: -------------------------------------------------------------------------------- 1 | {"Comma instead if closing brace": true, -------------------------------------------------------------------------------- /src/univalue/test/fail42.json: -------------------------------------------------------------------------------- 1 | ["before nul byte"]"after nul byte" 2 | -------------------------------------------------------------------------------- /src/univalue/test/fail44.json: -------------------------------------------------------------------------------- 1 | "This file ends without a newline or close-quote. -------------------------------------------------------------------------------- /src/univalue/test/fail18.json: -------------------------------------------------------------------------------- 1 | [[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]] -------------------------------------------------------------------------------- /src/univalue/test/pass2.json: -------------------------------------------------------------------------------- 1 | [[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]] -------------------------------------------------------------------------------- /src/univalue/test/fail10.json: -------------------------------------------------------------------------------- 1 | {"Extra value after close": true} "misplaced quoted value" -------------------------------------------------------------------------------- /src/univalue/test/fail1.json: -------------------------------------------------------------------------------- 1 | "This is a string that never ends, yes it goes on and on, my friends. 2 | -------------------------------------------------------------------------------- /src/univalue/test/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | object 3 | unitester 4 | test_json 5 | no_nul 6 | 7 | *.trs 8 | *.log 9 | -------------------------------------------------------------------------------- /share/pixmaps/bitcoin.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonasschnelli/crossplatformskeleton/master/share/pixmaps/bitcoin.ico -------------------------------------------------------------------------------- /share/pixmaps/bitcoin16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonasschnelli/crossplatformskeleton/master/share/pixmaps/bitcoin16.png -------------------------------------------------------------------------------- /share/pixmaps/bitcoin32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonasschnelli/crossplatformskeleton/master/share/pixmaps/bitcoin32.png -------------------------------------------------------------------------------- /share/pixmaps/bitcoin64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonasschnelli/crossplatformskeleton/master/share/pixmaps/bitcoin64.png -------------------------------------------------------------------------------- /share/pixmaps/bitcoin128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonasschnelli/crossplatformskeleton/master/share/pixmaps/bitcoin128.png -------------------------------------------------------------------------------- /share/pixmaps/bitcoin256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonasschnelli/crossplatformskeleton/master/share/pixmaps/bitcoin256.png -------------------------------------------------------------------------------- /share/pixmaps/nsis-header.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonasschnelli/crossplatformskeleton/master/share/pixmaps/nsis-header.bmp -------------------------------------------------------------------------------- /share/pixmaps/nsis-wizard.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonasschnelli/crossplatformskeleton/master/share/pixmaps/nsis-wizard.bmp -------------------------------------------------------------------------------- /src/res/icons/application.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonasschnelli/crossplatformskeleton/master/src/res/icons/application.png -------------------------------------------------------------------------------- /src/univalue/test/fail40.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonasschnelli/crossplatformskeleton/master/src/univalue/test/fail40.json -------------------------------------------------------------------------------- /src/univalue/test/fail41.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonasschnelli/crossplatformskeleton/master/src/univalue/test/fail41.json -------------------------------------------------------------------------------- /depends/.gitignore: -------------------------------------------------------------------------------- 1 | SDKs/ 2 | work/ 3 | built/ 4 | sources/ 5 | config.site 6 | x86_64* 7 | i686* 8 | mips* 9 | arm* 10 | aarch64* 11 | -------------------------------------------------------------------------------- /depends/builders/linux.mk: -------------------------------------------------------------------------------- 1 | build_linux_SHA256SUM = sha256sum 2 | build_linux_DOWNLOAD = curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o 3 | -------------------------------------------------------------------------------- /src/application.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | res/icons/application.png 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/univalue/test/pass3.json: -------------------------------------------------------------------------------- 1 | { 2 | "JSON Test Pattern pass3": { 3 | "The outermost value": "must be an object or array.", 4 | "In this test": "It is an object." 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/application_locale.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | locale/application_en_GB.qm 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/univalue/test/no_nul.cpp: -------------------------------------------------------------------------------- 1 | #include "univalue.h" 2 | 3 | int main (int argc, char *argv[]) 4 | { 5 | char buf[] = "___[1,2,3]___"; 6 | UniValue val; 7 | return val.read(buf + 3, 7) ? 0 : 1; 8 | } 9 | -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, char** argv) 5 | { 6 | QApplication app(argc, argv); 7 | MainWindow * newWin = new MainWindow(); 8 | newWin->show(); 9 | app.exec(); 10 | } -------------------------------------------------------------------------------- /src/locale/application_en_GB.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | Global 4 | 5 | MyApplication 6 | My Application 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/univalue/autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | srcdir="$(dirname $0)" 4 | cd "$srcdir" 5 | if [ -z ${LIBTOOLIZE} ] && GLIBTOOLIZE="`which glibtoolize 2>/dev/null`"; then 6 | LIBTOOLIZE="${GLIBTOOLIZE}" 7 | export LIBTOOLIZE 8 | fi 9 | autoreconf --install --force 10 | -------------------------------------------------------------------------------- /src/univalue/TODO: -------------------------------------------------------------------------------- 1 | 2 | Rearrange tree for easier 'git subtree' style use 3 | 4 | Move towards C++11 etc. 5 | 6 | Namespace support - must come up with useful shorthand, avoiding 7 | long Univalue::Univalue::Univalue usages forced upon library users. 8 | 9 | Improve test suite 10 | 11 | -------------------------------------------------------------------------------- /src/univalue/test/round1.json: -------------------------------------------------------------------------------- 1 | ["\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u007f"] 2 | -------------------------------------------------------------------------------- /src/univalue/pc/libunivalue.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libunivalue 7 | Description: libunivalue, C++ universal value object and JSON library 8 | Version: @VERSION@ 9 | Libs: -L${libdir} -lunivalue 10 | Cflags: -I${includedir} 11 | -------------------------------------------------------------------------------- /src/univalue/pc/libunivalue-uninstalled.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libunivalue 7 | Description: libunivalue, C++ universal value object and JSON library 8 | Version: @VERSION@ 9 | Libs: ${pc_top_builddir}/${pcfiledir}/libunivalue.la 10 | -------------------------------------------------------------------------------- /depends/hosts/mingw32.mk: -------------------------------------------------------------------------------- 1 | mingw32_CFLAGS=-pipe 2 | mingw32_CXXFLAGS=$(mingw32_CFLAGS) 3 | 4 | mingw32_release_CFLAGS=-O2 5 | mingw32_release_CXXFLAGS=$(mingw32_release_CFLAGS) 6 | 7 | mingw32_debug_CFLAGS=-O1 8 | mingw32_debug_CXXFLAGS=$(mingw32_debug_CFLAGS) 9 | 10 | mingw32_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC 11 | -------------------------------------------------------------------------------- /src/univalue/.gitignore: -------------------------------------------------------------------------------- 1 | .deps/ 2 | INSTALL 3 | Makefile 4 | Makefile.in 5 | aclocal.m4 6 | autom4te.cache/ 7 | compile 8 | config.log 9 | config.status 10 | config.guess 11 | config.sub 12 | configure 13 | depcomp 14 | install-sh 15 | missing 16 | stamp-h1 17 | univalue-config.h* 18 | test-driver 19 | libtool 20 | ltmain.sh 21 | test-suite.log 22 | 23 | *.a 24 | *.la 25 | *.lo 26 | *.logs 27 | *.o 28 | *.pc 29 | *.trs 30 | 31 | .dirstamp 32 | .libs 33 | -------------------------------------------------------------------------------- /src/mainwindow.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018 Jonas Schnelli 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #include 6 | #include 7 | //#include 8 | 9 | MainWindow::MainWindow(QMainWindow *parent) : 10 | QMainWindow(parent), 11 | ui(new Ui::MainWindow) 12 | { 13 | ui->setupUi(this); 14 | 15 | } 16 | 17 | MainWindow::~MainWindow() 18 | { 19 | delete ui; 20 | } 21 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright (c) 2013-2016 The Bitcoin Core developers 3 | # Distributed under the MIT software license, see the accompanying 4 | # file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | set -e 7 | srcdir="$(dirname $0)" 8 | cd "$srcdir" 9 | if [ -z ${LIBTOOLIZE} ] && GLIBTOOLIZE="`which glibtoolize 2>/dev/null`"; then 10 | LIBTOOLIZE="${GLIBTOOLIZE}" 11 | export LIBTOOLIZE 12 | fi 13 | which autoreconf >/dev/null || \ 14 | (echo "configuration failed, please install autoconf first" && exit 1) 15 | autoreconf --install --force --warnings=all 16 | -------------------------------------------------------------------------------- /depends/packages/xproto.mk: -------------------------------------------------------------------------------- 1 | package=xproto 2 | $(package)_version=7.0.26 3 | $(package)_download_path=http://xorg.freedesktop.org/releases/individual/proto 4 | $(package)_file_name=$(package)-$($(package)_version).tar.bz2 5 | $(package)_sha256_hash=636162c1759805a5a0114a369dffdeccb8af8c859ef6e1445f26a4e6e046514f 6 | 7 | define $(package)_set_vars 8 | $(package)_config_opts=--disable-shared 9 | endef 10 | 11 | define $(package)_config_cmds 12 | $($(package)_autoconf) 13 | endef 14 | 15 | define $(package)_build_cmds 16 | $(MAKE) 17 | endef 18 | 19 | define $(package)_stage_cmds 20 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 21 | endef 22 | -------------------------------------------------------------------------------- /depends/packages/xextproto.mk: -------------------------------------------------------------------------------- 1 | package=xextproto 2 | $(package)_version=7.3.0 3 | $(package)_download_path=http://xorg.freedesktop.org/releases/individual/proto 4 | $(package)_file_name=$(package)-$($(package)_version).tar.bz2 5 | $(package)_sha256_hash=f3f4b23ac8db9c3a9e0d8edb591713f3d70ef9c3b175970dd8823dfc92aa5bb0 6 | 7 | define $(package)_set_vars 8 | $(package)_config_opts=--disable-shared 9 | endef 10 | 11 | define $(package)_config_cmds 12 | $($(package)_autoconf) 13 | endef 14 | 15 | define $(package)_build_cmds 16 | $(MAKE) 17 | endef 18 | 19 | define $(package)_stage_cmds 20 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 21 | endef 22 | -------------------------------------------------------------------------------- /depends/packages/expat.mk: -------------------------------------------------------------------------------- 1 | package=expat 2 | $(package)_version=2.2.1 3 | $(package)_download_path=https://downloads.sourceforge.net/project/expat/expat/$($(package)_version) 4 | $(package)_file_name=$(package)-$($(package)_version).tar.bz2 5 | $(package)_sha256_hash=1868cadae4c82a018e361e2b2091de103cd820aaacb0d6cfa49bd2cd83978885 6 | 7 | define $(package)_set_vars 8 | $(package)_config_opts=--disable-static 9 | endef 10 | 11 | define $(package)_config_cmds 12 | $($(package)_autoconf) 13 | endef 14 | 15 | define $(package)_build_cmds 16 | $(MAKE) 17 | endef 18 | 19 | define $(package)_stage_cmds 20 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 21 | endef 22 | -------------------------------------------------------------------------------- /src/mainwindow.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018 Jonas Schnelli 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef APPLICATION_MAINWINDOW_H 6 | #define APPLICATION_MAINWINDOW_H 7 | 8 | #include 9 | 10 | namespace Ui { 11 | class MainWindow; 12 | } 13 | 14 | /** Overview ("home") page widget */ 15 | class MainWindow : public QMainWindow 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit MainWindow(QMainWindow *parent = 0); 21 | ~MainWindow(); 22 | 23 | private: 24 | Ui::MainWindow *ui; 25 | }; 26 | 27 | #endif // APPLICATION_MAINWINDOW_H -------------------------------------------------------------------------------- /depends/packages/xtrans.mk: -------------------------------------------------------------------------------- 1 | package=xtrans 2 | $(package)_version=1.3.4 3 | $(package)_download_path=http://xorg.freedesktop.org/releases/individual/lib/ 4 | $(package)_file_name=$(package)-$($(package)_version).tar.bz2 5 | $(package)_sha256_hash=054d4ee3efd52508c753e9f7bc655ef185a29bd2850dd9e2fc2ccc33544f583a 6 | $(package)_dependencies= 7 | 8 | define $(package)_set_vars 9 | $(package)_config_opts_linux=--with-pic --disable-static 10 | endef 11 | 12 | define $(package)_config_cmds 13 | $($(package)_autoconf) 14 | endef 15 | 16 | define $(package)_build_cmds 17 | $(MAKE) 18 | endef 19 | 20 | define $(package)_stage_cmds 21 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 22 | endef 23 | -------------------------------------------------------------------------------- /depends/packages/native_ccache.mk: -------------------------------------------------------------------------------- 1 | package=native_ccache 2 | $(package)_version=3.3.4 3 | $(package)_download_path=https://samba.org/ftp/ccache 4 | $(package)_file_name=ccache-$($(package)_version).tar.bz2 5 | $(package)_sha256_hash=fa9d7f38367431bc86b19ad107d709ca7ecf1574fdacca01698bdf0a47cd8567 6 | 7 | define $(package)_set_vars 8 | $(package)_config_opts= 9 | endef 10 | 11 | define $(package)_config_cmds 12 | $($(package)_autoconf) 13 | endef 14 | 15 | define $(package)_build_cmds 16 | $(MAKE) 17 | endef 18 | 19 | define $(package)_stage_cmds 20 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 21 | endef 22 | 23 | define $(package)_postprocess_cmds 24 | rm -rf lib include 25 | endef 26 | -------------------------------------------------------------------------------- /depends/hosts/darwin.mk: -------------------------------------------------------------------------------- 1 | OSX_MIN_VERSION=10.8 2 | OSX_SDK_VERSION=10.11 3 | OSX_SDK=$(SDK_PATH)/MacOSX$(OSX_SDK_VERSION).sdk 4 | LD64_VERSION=253.9 5 | darwin_CC=clang -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) 6 | darwin_CXX=clang++ -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) -stdlib=libc++ 7 | 8 | darwin_CFLAGS=-pipe 9 | darwin_CXXFLAGS=$(darwin_CFLAGS) 10 | 11 | darwin_release_CFLAGS=-O2 12 | darwin_release_CXXFLAGS=$(darwin_release_CFLAGS) 13 | 14 | darwin_debug_CFLAGS=-O1 15 | darwin_debug_CXXFLAGS=$(darwin_debug_CFLAGS) 16 | 17 | darwin_native_toolchain=native_cctools 18 | -------------------------------------------------------------------------------- /depends/packages/libXext.mk: -------------------------------------------------------------------------------- 1 | package=libXext 2 | $(package)_version=1.3.2 3 | $(package)_download_path=http://xorg.freedesktop.org/releases/individual/lib/ 4 | $(package)_file_name=$(package)-$($(package)_version).tar.bz2 5 | $(package)_sha256_hash=f829075bc646cdc085fa25d98d5885d83b1759ceb355933127c257e8e50432e0 6 | $(package)_dependencies=xproto xextproto libX11 libXau 7 | 8 | define $(package)_set_vars 9 | $(package)_config_opts=--disable-static 10 | endef 11 | 12 | define $(package)_config_cmds 13 | $($(package)_autoconf) 14 | endef 15 | 16 | define $(package)_build_cmds 17 | $(MAKE) 18 | endef 19 | 20 | define $(package)_stage_cmds 21 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 22 | endef 23 | -------------------------------------------------------------------------------- /depends/packages/packages.mk: -------------------------------------------------------------------------------- 1 | packages:=boost openssl libevent zeromq 2 | native_packages := native_ccache 3 | 4 | qt_native_packages = native_protobuf 5 | qt_packages = qrencode protobuf zlib 6 | 7 | qt_x86_64_linux_packages:=qt expat dbus libxcb xcb_proto libXau xproto freetype fontconfig libX11 xextproto libXext xtrans 8 | qt_i686_linux_packages:=$(qt_x86_64_linux_packages) 9 | 10 | qt_darwin_packages=qt 11 | qt_mingw32_packages=qt 12 | 13 | wallet_packages=bdb 14 | 15 | upnp_packages=miniupnpc 16 | 17 | darwin_native_packages = native_biplist native_ds_store native_mac_alias 18 | 19 | ifneq ($(build_os),darwin) 20 | darwin_native_packages += native_cctools native_cdrkit native_libdmg-hfsplus 21 | endif 22 | -------------------------------------------------------------------------------- /depends/packages/qrencode.mk: -------------------------------------------------------------------------------- 1 | package=qrencode 2 | $(package)_version=3.4.4 3 | $(package)_download_path=https://fukuchi.org/works/qrencode/ 4 | $(package)_file_name=$(package)-$($(package)_version).tar.bz2 5 | $(package)_sha256_hash=efe5188b1ddbcbf98763b819b146be6a90481aac30cfc8d858ab78a19cde1fa5 6 | 7 | define $(package)_set_vars 8 | $(package)_config_opts=--disable-shared -without-tools --disable-sdltest 9 | $(package)_config_opts_linux=--with-pic 10 | endef 11 | 12 | define $(package)_config_cmds 13 | $($(package)_autoconf) 14 | endef 15 | 16 | define $(package)_build_cmds 17 | $(MAKE) 18 | endef 19 | 20 | define $(package)_stage_cmds 21 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 22 | endef 23 | -------------------------------------------------------------------------------- /depends/packages/freetype.mk: -------------------------------------------------------------------------------- 1 | package=freetype 2 | $(package)_version=2.7.1 3 | $(package)_download_path=http://download.savannah.gnu.org/releases/$(package) 4 | $(package)_file_name=$(package)-$($(package)_version).tar.bz2 5 | $(package)_sha256_hash=3a3bb2c4e15ffb433f2032f50a5b5a92558206822e22bfe8cbe339af4aa82f88 6 | 7 | define $(package)_set_vars 8 | $(package)_config_opts=--without-zlib --without-png --disable-static 9 | $(package)_config_opts_linux=--with-pic 10 | endef 11 | 12 | define $(package)_config_cmds 13 | $($(package)_autoconf) 14 | endef 15 | 16 | define $(package)_build_cmds 17 | $(MAKE) 18 | endef 19 | 20 | define $(package)_stage_cmds 21 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 22 | endef 23 | -------------------------------------------------------------------------------- /depends/packages/libXau.mk: -------------------------------------------------------------------------------- 1 | package=libXau 2 | $(package)_version=1.0.8 3 | $(package)_download_path=http://xorg.freedesktop.org/releases/individual/lib/ 4 | $(package)_file_name=$(package)-$($(package)_version).tar.bz2 5 | $(package)_sha256_hash=fdd477320aeb5cdd67272838722d6b7d544887dfe7de46e1e7cc0c27c2bea4f2 6 | $(package)_dependencies=xproto 7 | 8 | define $(package)_set_vars 9 | $(package)_config_opts=--disable-shared 10 | $(package)_config_opts_linux=--with-pic 11 | endef 12 | 13 | define $(package)_config_cmds 14 | $($(package)_autoconf) 15 | endef 16 | 17 | define $(package)_build_cmds 18 | $(MAKE) 19 | endef 20 | 21 | define $(package)_stage_cmds 22 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 23 | endef 24 | -------------------------------------------------------------------------------- /depends/packages/native_ds_store.mk: -------------------------------------------------------------------------------- 1 | package=native_ds_store 2 | $(package)_version=1.1.2 3 | $(package)_download_path=https://github.com/al45tair/ds_store/archive/ 4 | $(package)_file_name=v$($(package)_version).tar.gz 5 | $(package)_sha256_hash=3b3ecb7bf0a5157f5b6010bc3af7c141fb0ad3527084e63336220d22744bc20c 6 | $(package)_install_libdir=$(build_prefix)/lib/python/dist-packages 7 | $(package)_dependencies=native_biplist 8 | 9 | define $(package)_build_cmds 10 | python setup.py build 11 | endef 12 | 13 | define $(package)_stage_cmds 14 | mkdir -p $($(package)_install_libdir) && \ 15 | python setup.py install --root=$($(package)_staging_dir) --prefix=$(build_prefix) --install-lib=$($(package)_install_libdir) 16 | endef 17 | -------------------------------------------------------------------------------- /depends/packages/native_libdmg-hfsplus.mk: -------------------------------------------------------------------------------- 1 | package=native_libdmg-hfsplus 2 | $(package)_version=0.1 3 | $(package)_download_path=https://github.com/theuni/libdmg-hfsplus/archive 4 | $(package)_file_name=libdmg-hfsplus-v$($(package)_version).tar.gz 5 | $(package)_sha256_hash=6569a02eb31c2827080d7d59001869ea14484c281efab0ae7f2b86af5c3120b3 6 | $(package)_build_subdir=build 7 | 8 | define $(package)_preprocess_cmds 9 | mkdir build 10 | endef 11 | 12 | define $(package)_config_cmds 13 | cmake -DCMAKE_INSTALL_PREFIX:PATH=$(build_prefix)/bin .. 14 | endef 15 | 16 | define $(package)_build_cmds 17 | $(MAKE) -C dmg 18 | endef 19 | 20 | define $(package)_stage_cmds 21 | $(MAKE) DESTDIR=$($(package)_staging_dir) -C dmg install 22 | endef 23 | -------------------------------------------------------------------------------- /depends/packages/libX11.mk: -------------------------------------------------------------------------------- 1 | package=libX11 2 | $(package)_version=1.6.2 3 | $(package)_download_path=http://xorg.freedesktop.org/releases/individual/lib/ 4 | $(package)_file_name=$(package)-$($(package)_version).tar.bz2 5 | $(package)_sha256_hash=2aa027e837231d2eeea90f3a4afe19948a6eb4c8b2bec0241eba7dbc8106bd16 6 | $(package)_dependencies=libxcb xtrans xextproto xproto 7 | 8 | define $(package)_set_vars 9 | $(package)_config_opts=--disable-xkb --disable-static 10 | $(package)_config_opts_linux=--with-pic 11 | endef 12 | 13 | define $(package)_config_cmds 14 | $($(package)_autoconf) 15 | endef 16 | 17 | define $(package)_build_cmds 18 | $(MAKE) 19 | endef 20 | 21 | define $(package)_stage_cmds 22 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 23 | endef 24 | -------------------------------------------------------------------------------- /depends/packages/libICE.mk: -------------------------------------------------------------------------------- 1 | package=libICE 2 | $(package)_version=1.0.9 3 | $(package)_download_path=http://xorg.freedesktop.org/releases/individual/lib/ 4 | $(package)_file_name=$(package)-$($(package)_version).tar.bz2 5 | $(package)_sha256_hash=8f7032f2c1c64352b5423f6b48a8ebdc339cc63064af34d66a6c9aa79759e202 6 | $(package)_dependencies=xtrans xproto 7 | 8 | define $(package)_set_vars 9 | $(package)_config_opts=--disable-static --disable-docs --disable-specs --without-xsltproc 10 | $(package)_config_opts_linux=--with-pic 11 | endef 12 | 13 | define $(package)_config_cmds 14 | $($(package)_autoconf) 15 | endef 16 | 17 | define $(package)_build_cmds 18 | $(MAKE) 19 | endef 20 | 21 | define $(package)_stage_cmds 22 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 23 | endef 24 | -------------------------------------------------------------------------------- /depends/packages/libSM.mk: -------------------------------------------------------------------------------- 1 | package=libSM 2 | $(package)_version=1.2.2 3 | $(package)_download_path=http://xorg.freedesktop.org/releases/individual/lib/ 4 | $(package)_file_name=$(package)-$($(package)_version).tar.bz2 5 | $(package)_sha256_hash=0baca8c9f5d934450a70896c4ad38d06475521255ca63b717a6510fdb6e287bd 6 | $(package)_dependencies=xtrans xproto libICE 7 | 8 | define $(package)_set_vars 9 | $(package)_config_opts=--without-libuuid --without-xsltproc --disable-docs --disable-static 10 | $(package)_config_opts_linux=--with-pic 11 | endef 12 | 13 | define $(package)_config_cmds 14 | $($(package)_autoconf) 15 | endef 16 | 17 | define $(package)_build_cmds 18 | $(MAKE) 19 | endef 20 | 21 | define $(package)_stage_cmds 22 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 23 | endef 24 | -------------------------------------------------------------------------------- /depends/packages/native_protobuf.mk: -------------------------------------------------------------------------------- 1 | package=native_protobuf 2 | $(package)_version=2.6.1 3 | $(package)_download_path=https://github.com/google/protobuf/releases/download/v$($(package)_version) 4 | $(package)_file_name=protobuf-$($(package)_version).tar.bz2 5 | $(package)_sha256_hash=ee445612d544d885ae240ffbcbf9267faa9f593b7b101f21d58beceb92661910 6 | 7 | define $(package)_set_vars 8 | $(package)_config_opts=--disable-shared 9 | endef 10 | 11 | define $(package)_config_cmds 12 | $($(package)_autoconf) 13 | endef 14 | 15 | define $(package)_build_cmds 16 | $(MAKE) -C src protoc 17 | endef 18 | 19 | define $(package)_stage_cmds 20 | $(MAKE) -C src DESTDIR=$($(package)_staging_dir) install-strip 21 | endef 22 | 23 | define $(package)_postprocess_cmds 24 | rm -rf lib include 25 | endef 26 | -------------------------------------------------------------------------------- /depends/packages/xcb_proto.mk: -------------------------------------------------------------------------------- 1 | package=xcb_proto 2 | $(package)_version=1.10 3 | $(package)_download_path=http://xcb.freedesktop.org/dist 4 | $(package)_file_name=xcb-proto-$($(package)_version).tar.bz2 5 | $(package)_sha256_hash=7ef40ddd855b750bc597d2a435da21e55e502a0fefa85b274f2c922800baaf05 6 | 7 | define $(package)_set_vars 8 | $(package)_config_opts=--disable-shared 9 | $(package)_config_opts_linux=--with-pic 10 | endef 11 | 12 | define $(package)_config_cmds 13 | $($(package)_autoconf) 14 | endef 15 | 16 | define $(package)_build_cmds 17 | $(MAKE) 18 | endef 19 | 20 | define $(package)_stage_cmds 21 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 22 | endef 23 | 24 | define $(package)_postprocess_cmds 25 | find -name "*.pyc" -delete && \ 26 | find -name "*.pyo" -delete 27 | endef 28 | -------------------------------------------------------------------------------- /src/univalue/test/test_json.cpp: -------------------------------------------------------------------------------- 1 | // Test program that can be called by the JSON test suite at 2 | // https://github.com/nst/JSONTestSuite. 3 | // 4 | // It reads JSON input from stdin and exits with code 0 if it can be parsed 5 | // successfully. It also pretty prints the parsed JSON value to stdout. 6 | 7 | #include 8 | #include 9 | #include "univalue.h" 10 | 11 | using namespace std; 12 | 13 | int main (int argc, char *argv[]) 14 | { 15 | UniValue val; 16 | if (val.read(string(istreambuf_iterator(cin), 17 | istreambuf_iterator()))) { 18 | cout << val.write(1 /* prettyIndent */, 4 /* indentLevel */) << endl; 19 | return 0; 20 | } else { 21 | cerr << "JSON Parse Error." << endl; 22 | return 1; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Cross Platform Desktop Application Skeleton (Qt5) 2 | ================================================= 3 | 4 | [![Build Status](https://travis-ci.org/jonasschnelli/crossplatformskeleton.svg?branch=master)](https://travis-ci.org/jonasschnelli/crossplatformskeleton) 5 | 6 | 7 | Building cross platform desktop applications is not a simple task. 8 | The trend seems to use frameworks that build on top of an built in webbrowser leading to wasting tons of RAM. 9 | 10 | This little project skeleton may help to create a simple QT based cross platform application. 11 | 12 | Features 13 | -------- 14 | * Supports Linux, Windows and macOS 15 | * Cross compile system (see /depends) to compile static binaries for macOX, Windows on Linux 16 | * Deterministic builds with gitian 17 | * Internal C++ JSON parser (libunivalue) -------------------------------------------------------------------------------- /depends/packages/native_mac_alias.mk: -------------------------------------------------------------------------------- 1 | package=native_mac_alias 2 | $(package)_version=2.0.6 3 | $(package)_download_path=https://github.com/al45tair/mac_alias/archive/ 4 | $(package)_file_name=v$($(package)_version).tar.gz 5 | $(package)_sha256_hash=78a3332d9a597eebf09ae652d38ad1e263b28db5c2e6dd725fad357b03b77371 6 | $(package)_install_libdir=$(build_prefix)/lib/python/dist-packages 7 | $(package)_patches=python3.patch 8 | 9 | define $(package)_preprocess_cmds 10 | patch -p1 < $($(package)_patch_dir)/python3.patch 11 | endef 12 | 13 | define $(package)_build_cmds 14 | python setup.py build 15 | endef 16 | 17 | define $(package)_stage_cmds 18 | mkdir -p $($(package)_install_libdir) && \ 19 | python setup.py install --root=$($(package)_staging_dir) --prefix=$(build_prefix) --install-lib=$($(package)_install_libdir) 20 | endef 21 | -------------------------------------------------------------------------------- /depends/packages/native_biplist.mk: -------------------------------------------------------------------------------- 1 | package=native_biplist 2 | $(package)_version=0.9 3 | $(package)_download_path=https://pypi.python.org/packages/source/b/biplist 4 | $(package)_file_name=biplist-$($(package)_version).tar.gz 5 | $(package)_sha256_hash=b57cadfd26e4754efdf89e9e37de87885f9b5c847b2615688ca04adfaf6ca604 6 | $(package)_install_libdir=$(build_prefix)/lib/python/dist-packages 7 | $(package)_patches=sorted_list.patch 8 | 9 | define $(package)_preprocess_cmds 10 | patch -p1 < $($(package)_patch_dir)/sorted_list.patch 11 | endef 12 | 13 | define $(package)_build_cmds 14 | python setup.py build 15 | endef 16 | 17 | define $(package)_stage_cmds 18 | mkdir -p $($(package)_install_libdir) && \ 19 | python setup.py install --root=$($(package)_staging_dir) --prefix=$(build_prefix) --install-lib=$($(package)_install_libdir) 20 | endef 21 | -------------------------------------------------------------------------------- /depends/builders/default.mk: -------------------------------------------------------------------------------- 1 | default_build_CC = gcc 2 | default_build_CXX = g++ 3 | default_build_AR = ar 4 | default_build_RANLIB = ranlib 5 | default_build_STRIP = strip 6 | default_build_NM = nm 7 | default_build_OTOOL = otool 8 | default_build_INSTALL_NAME_TOOL = install_name_tool 9 | 10 | define add_build_tool_func 11 | build_$(build_os)_$1 ?= $$(default_build_$1) 12 | build_$(build_arch)_$(build_os)_$1 ?= $$(build_$(build_os)_$1) 13 | build_$1=$$(build_$(build_arch)_$(build_os)_$1) 14 | endef 15 | $(foreach var,CC CXX AR RANLIB NM STRIP SHA256SUM DOWNLOAD OTOOL INSTALL_NAME_TOOL,$(eval $(call add_build_tool_func,$(var)))) 16 | define add_build_flags_func 17 | build_$(build_arch)_$(build_os)_$1 += $(build_$(build_os)_$1) 18 | build_$1=$$(build_$(build_arch)_$(build_os)_$1) 19 | endef 20 | $(foreach flags, CFLAGS CXXFLAGS LDFLAGS, $(eval $(call add_build_flags_func,$(flags)))) 21 | -------------------------------------------------------------------------------- /depends/hosts/linux.mk: -------------------------------------------------------------------------------- 1 | linux_CFLAGS=-pipe 2 | linux_CXXFLAGS=$(linux_CFLAGS) 3 | 4 | linux_release_CFLAGS=-O2 5 | linux_release_CXXFLAGS=$(linux_release_CFLAGS) 6 | 7 | linux_debug_CFLAGS=-O1 8 | linux_debug_CXXFLAGS=$(linux_debug_CFLAGS) 9 | 10 | linux_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC 11 | 12 | ifeq (86,$(findstring 86,$(build_arch))) 13 | i686_linux_CC=gcc -m32 14 | i686_linux_CXX=g++ -m32 15 | i686_linux_AR=ar 16 | i686_linux_RANLIB=ranlib 17 | i686_linux_NM=nm 18 | i686_linux_STRIP=strip 19 | 20 | x86_64_linux_CC=gcc -m64 21 | x86_64_linux_CXX=g++ -m64 22 | x86_64_linux_AR=ar 23 | x86_64_linux_RANLIB=ranlib 24 | x86_64_linux_NM=nm 25 | x86_64_linux_STRIP=strip 26 | else 27 | i686_linux_CC=$(default_host_CC) -m32 28 | i686_linux_CXX=$(default_host_CXX) -m32 29 | x86_64_linux_CC=$(default_host_CC) -m64 30 | x86_64_linux_CXX=$(default_host_CXX) -m64 31 | endif 32 | -------------------------------------------------------------------------------- /depends/packages/native_cdrkit.mk: -------------------------------------------------------------------------------- 1 | package=native_cdrkit 2 | $(package)_version=1.1.11 3 | $(package)_download_path=http://distro.ibiblio.org/fatdog/source/600/c 4 | $(package)_file_name=cdrkit-$($(package)_version).tar.bz2 5 | $(package)_sha256_hash=b50d64c214a65b1a79afe3a964c691931a4233e2ba605d793eb85d0ac3652564 6 | $(package)_patches=cdrkit-deterministic.patch 7 | 8 | define $(package)_preprocess_cmds 9 | patch -p1 < $($(package)_patch_dir)/cdrkit-deterministic.patch 10 | endef 11 | 12 | define $(package)_config_cmds 13 | cmake -DCMAKE_INSTALL_PREFIX=$(build_prefix) 14 | endef 15 | 16 | define $(package)_build_cmds 17 | $(MAKE) genisoimage 18 | endef 19 | 20 | define $(package)_stage_cmds 21 | $(MAKE) DESTDIR=$($(package)_staging_dir) -C genisoimage install 22 | endef 23 | 24 | define $(package)_postprocess_cmds 25 | rm bin/isovfy bin/isoinfo bin/isodump bin/isodebug bin/devdump 26 | endef 27 | -------------------------------------------------------------------------------- /src/univalue/README.md: -------------------------------------------------------------------------------- 1 | 2 | # UniValue 3 | 4 | ## Summary 5 | 6 | A universal value class, with JSON encoding and decoding. 7 | 8 | UniValue is an abstract data type that may be a null, boolean, string, 9 | number, array container, or a key/value dictionary container, nested to 10 | an arbitrary depth. 11 | 12 | This class is aligned with the JSON standard, [RFC 13 | 7159](https://tools.ietf.org/html/rfc7159.html). 14 | 15 | ## Installation 16 | 17 | This project is a standard GNU 18 | [autotools](https://www.gnu.org/software/automake/manual/html_node/Autotools-Introduction.html) 19 | project. Build and install instructions are available in the `INSTALL` 20 | file provided with GNU autotools. 21 | 22 | ``` 23 | $ ./autogen.sh 24 | $ ./configure 25 | $ make 26 | ``` 27 | 28 | ## Design 29 | 30 | UniValue provides a single dynamic RAII C++ object class, 31 | and minimizes template use (contra json_spirit). 32 | 33 | -------------------------------------------------------------------------------- /depends/packages/dbus.mk: -------------------------------------------------------------------------------- 1 | package=dbus 2 | $(package)_version=1.10.18 3 | $(package)_download_path=https://dbus.freedesktop.org/releases/dbus 4 | $(package)_file_name=$(package)-$($(package)_version).tar.gz 5 | $(package)_sha256_hash=6049ddd5f3f3e2618f615f1faeda0a115104423a7996b7aa73e2f36e38cc514a 6 | $(package)_dependencies=expat 7 | 8 | define $(package)_set_vars 9 | $(package)_config_opts=--disable-tests --disable-doxygen-docs --disable-xml-docs --disable-static --without-x 10 | endef 11 | 12 | define $(package)_config_cmds 13 | $($(package)_autoconf) 14 | endef 15 | 16 | define $(package)_build_cmds 17 | $(MAKE) -C dbus libdbus-1.la 18 | endef 19 | 20 | define $(package)_stage_cmds 21 | $(MAKE) -C dbus DESTDIR=$($(package)_staging_dir) install-libLTLIBRARIES install-dbusincludeHEADERS install-nodist_dbusarchincludeHEADERS && \ 22 | $(MAKE) DESTDIR=$($(package)_staging_dir) install-pkgconfigDATA 23 | endef 24 | -------------------------------------------------------------------------------- /depends/packages/libevent.mk: -------------------------------------------------------------------------------- 1 | package=libevent 2 | $(package)_version=2.1.8-stable 3 | $(package)_download_path=https://github.com/libevent/libevent/archive/ 4 | $(package)_file_name=release-$($(package)_version).tar.gz 5 | $(package)_sha256_hash=316ddb401745ac5d222d7c529ef1eada12f58f6376a66c1118eee803cb70f83d 6 | 7 | define $(package)_preprocess_cmds 8 | ./autogen.sh 9 | endef 10 | 11 | define $(package)_set_vars 12 | $(package)_config_opts=--disable-shared --disable-openssl --disable-libevent-regress --disable-samples 13 | $(package)_config_opts_release=--disable-debug-mode 14 | $(package)_config_opts_linux=--with-pic 15 | endef 16 | 17 | define $(package)_config_cmds 18 | $($(package)_autoconf) 19 | endef 20 | 21 | define $(package)_build_cmds 22 | $(MAKE) 23 | endef 24 | 25 | define $(package)_stage_cmds 26 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 27 | endef 28 | 29 | define $(package)_postprocess_cmds 30 | endef 31 | -------------------------------------------------------------------------------- /depends/packages/zlib.mk: -------------------------------------------------------------------------------- 1 | package=zlib 2 | $(package)_version=1.2.11 3 | $(package)_download_path=http://www.zlib.net 4 | $(package)_file_name=$(package)-$($(package)_version).tar.gz 5 | $(package)_sha256_hash=c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1 6 | 7 | define $(package)_set_vars 8 | $(package)_build_opts= CC="$($(package)_cc)" 9 | $(package)_build_opts+=CFLAGS="$($(package)_cflags) $($(package)_cppflags) -fPIC" 10 | $(package)_build_opts+=RANLIB="$($(package)_ranlib)" 11 | $(package)_build_opts+=AR="$($(package)_ar)" 12 | $(package)_build_opts_darwin+=AR="$($(package)_libtool)" 13 | $(package)_build_opts_darwin+=ARFLAGS="-o" 14 | endef 15 | 16 | define $(package)_config_cmds 17 | ./configure --static --prefix=$(host_prefix) 18 | endef 19 | 20 | define $(package)_build_cmds 21 | $(MAKE) $($(package)_build_opts) libz.a 22 | endef 23 | 24 | define $(package)_stage_cmds 25 | $(MAKE) DESTDIR=$($(package)_staging_dir) install $($(package)_build_opts) 26 | endef 27 | 28 | -------------------------------------------------------------------------------- /depends/packages/protobuf.mk: -------------------------------------------------------------------------------- 1 | package=protobuf 2 | $(package)_version=$(native_$(package)_version) 3 | $(package)_download_path=$(native_$(package)_download_path) 4 | $(package)_file_name=$(native_$(package)_file_name) 5 | $(package)_sha256_hash=$(native_$(package)_sha256_hash) 6 | $(package)_dependencies=native_$(package) 7 | $(package)_cxxflags=-std=c++11 8 | 9 | define $(package)_set_vars 10 | $(package)_config_opts=--disable-shared --with-protoc=$(build_prefix)/bin/protoc 11 | $(package)_config_opts_linux=--with-pic 12 | endef 13 | 14 | define $(package)_config_cmds 15 | $($(package)_autoconf) 16 | endef 17 | 18 | define $(package)_build_cmds 19 | $(MAKE) -C src libprotobuf.la 20 | endef 21 | 22 | define $(package)_stage_cmds 23 | $(MAKE) DESTDIR=$($(package)_staging_dir) -C src install-libLTLIBRARIES install-nobase_includeHEADERS &&\ 24 | $(MAKE) DESTDIR=$($(package)_staging_dir) install-pkgconfigDATA 25 | endef 26 | 27 | define $(package)_postprocess_cmds 28 | rm lib/libprotoc.a 29 | endef 30 | -------------------------------------------------------------------------------- /src/univalue/COPYING: -------------------------------------------------------------------------------- 1 | 2 | Permission is hereby granted, free of charge, to any person obtaining a copy 3 | of this software and associated documentation files (the "Software"), to deal 4 | in the Software without restriction, including without limitation the rights 5 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | copies of the Software, and to permit persons to whom the Software is 7 | furnished to do so, subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 18 | THE SOFTWARE. 19 | 20 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 Jonas Schnelli 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /depends/builders/darwin.mk: -------------------------------------------------------------------------------- 1 | build_darwin_CC: = $(shell xcrun -f clang) 2 | build_darwin_CXX: = $(shell xcrun -f clang++) 3 | build_darwin_AR: = $(shell xcrun -f ar) 4 | build_darwin_RANLIB: = $(shell xcrun -f ranlib) 5 | build_darwin_STRIP: = $(shell xcrun -f strip) 6 | build_darwin_OTOOL: = $(shell xcrun -f otool) 7 | build_darwin_NM: = $(shell xcrun -f nm) 8 | build_darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool) 9 | build_darwin_SHA256SUM = shasum -a 256 10 | build_darwin_DOWNLOAD = curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o 11 | 12 | #darwin host on darwin builder. overrides darwin host preferences. 13 | darwin_CC=$(shell xcrun -f clang) -mmacosx-version-min=$(OSX_MIN_VERSION) 14 | darwin_CXX:=$(shell xcrun -f clang++) -mmacosx-version-min=$(OSX_MIN_VERSION) -stdlib=libc++ 15 | darwin_AR:=$(shell xcrun -f ar) 16 | darwin_RANLIB:=$(shell xcrun -f ranlib) 17 | darwin_STRIP:=$(shell xcrun -f strip) 18 | darwin_LIBTOOL:=$(shell xcrun -f libtool) 19 | darwin_OTOOL:=$(shell xcrun -f otool) 20 | darwin_NM:=$(shell xcrun -f nm) 21 | darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool) 22 | darwin_native_toolchain= 23 | -------------------------------------------------------------------------------- /depends/packages/libxcb.mk: -------------------------------------------------------------------------------- 1 | package=libxcb 2 | $(package)_version=1.10 3 | $(package)_download_path=http://xcb.freedesktop.org/dist 4 | $(package)_file_name=$(package)-$($(package)_version).tar.bz2 5 | $(package)_sha256_hash=98d9ab05b636dd088603b64229dd1ab2d2cc02ab807892e107d674f9c3f2d5b5 6 | $(package)_dependencies=xcb_proto libXau xproto 7 | 8 | define $(package)_set_vars 9 | $(package)_config_opts=--disable-static 10 | endef 11 | 12 | define $(package)_preprocess_cmds 13 | sed "s/pthread-stubs//" -i configure 14 | endef 15 | 16 | # Don't install xcb headers to the default path in order to work around a qt 17 | # build issue: https://bugreports.qt.io/browse/QTBUG-34748 18 | # When using qt's internal libxcb, it may end up finding the real headers in 19 | # depends staging. Use a non-default path to avoid that. 20 | 21 | define $(package)_config_cmds 22 | $($(package)_autoconf) --includedir=$(host_prefix)/include/xcb-shared 23 | endef 24 | 25 | define $(package)_build_cmds 26 | $(MAKE) 27 | endef 28 | 29 | define $(package)_stage_cmds 30 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 31 | endef 32 | 33 | define $(package)_postprocess_cmds 34 | rm -rf share/man share/doc 35 | endef 36 | -------------------------------------------------------------------------------- /depends/patches/qt/mac-qmake.conf: -------------------------------------------------------------------------------- 1 | MAKEFILE_GENERATOR = UNIX 2 | CONFIG += app_bundle incremental global_init_link_order lib_version_first plugin_no_soname absolute_library_soname 3 | QMAKE_INCREMENTAL_STYLE = sublib 4 | include(../common/macx.conf) 5 | include(../common/gcc-base-mac.conf) 6 | include(../common/clang.conf) 7 | include(../common/clang-mac.conf) 8 | QMAKE_MAC_SDK_PATH=$${MAC_SDK_PATH} 9 | QMAKE_XCODE_VERSION=4.3 10 | QMAKE_XCODE_DEVELOPER_PATH=/Developer 11 | QMAKE_MACOSX_DEPLOYMENT_TARGET = $${MAC_MIN_VERSION} 12 | QMAKE_MAC_SDK=macosx 13 | QMAKE_MAC_SDK.macosx.Path = $${MAC_SDK_PATH} 14 | QMAKE_MAC_SDK.macosx.platform_name = macosx 15 | QMAKE_MAC_SDK.macosx.SDKVersion = $${MAC_SDK_VERSION} 16 | QMAKE_MAC_SDK.macosx.PlatformPath = /phony 17 | !host_build: QMAKE_CFLAGS += -target $${MAC_TARGET} 18 | !host_build: QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_CFLAGS 19 | !host_build: QMAKE_CXXFLAGS += $$QMAKE_CFLAGS 20 | !host_build: QMAKE_LFLAGS += -target $${MAC_TARGET} -mlinker-version=$${MAC_LD64_VERSION} 21 | QMAKE_AR = $${CROSS_COMPILE}ar cq 22 | QMAKE_RANLIB=$${CROSS_COMPILE}ranlib 23 | QMAKE_LIBTOOL=$${CROSS_COMPILE}libtool 24 | QMAKE_INSTALL_NAME_TOOL=$${CROSS_COMPILE}install_name_tool 25 | load(qt_config) 26 | -------------------------------------------------------------------------------- /depends/hosts/default.mk: -------------------------------------------------------------------------------- 1 | default_host_CC = $(host_toolchain)gcc 2 | default_host_CXX = $(host_toolchain)g++ 3 | default_host_AR = $(host_toolchain)ar 4 | default_host_RANLIB = $(host_toolchain)ranlib 5 | default_host_STRIP = $(host_toolchain)strip 6 | default_host_LIBTOOL = $(host_toolchain)libtool 7 | default_host_INSTALL_NAME_TOOL = $(host_toolchain)install_name_tool 8 | default_host_OTOOL = $(host_toolchain)otool 9 | default_host_NM = $(host_toolchain)nm 10 | 11 | define add_host_tool_func 12 | $(host_os)_$1?=$$(default_host_$1) 13 | $(host_arch)_$(host_os)_$1?=$$($(host_os)_$1) 14 | $(host_arch)_$(host_os)_$(release_type)_$1?=$$($(host_os)_$1) 15 | host_$1=$$($(host_arch)_$(host_os)_$1) 16 | endef 17 | 18 | define add_host_flags_func 19 | $(host_arch)_$(host_os)_$1 += $($(host_os)_$1) 20 | $(host_arch)_$(host_os)_$(release_type)_$1 += $($(host_os)_$(release_type)_$1) 21 | host_$1 = $$($(host_arch)_$(host_os)_$1) 22 | host_$(release_type)_$1 = $$($(host_arch)_$(host_os)_$(release_type)_$1) 23 | endef 24 | 25 | $(foreach tool,CC CXX AR RANLIB STRIP NM LIBTOOL OTOOL INSTALL_NAME_TOOL,$(eval $(call add_host_tool_func,$(tool)))) 26 | $(foreach flags,CFLAGS CXXFLAGS CPPFLAGS LDFLAGS, $(eval $(call add_host_flags_func,$(flags)))) 27 | -------------------------------------------------------------------------------- /depends/packages/bdb.mk: -------------------------------------------------------------------------------- 1 | package=bdb 2 | $(package)_version=4.8.30 3 | $(package)_download_path=http://download.oracle.com/berkeley-db 4 | $(package)_file_name=db-$($(package)_version).NC.tar.gz 5 | $(package)_sha256_hash=12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef 6 | $(package)_build_subdir=build_unix 7 | 8 | define $(package)_set_vars 9 | $(package)_config_opts=--disable-shared --enable-cxx --disable-replication 10 | $(package)_config_opts_mingw32=--enable-mingw 11 | $(package)_config_opts_linux=--with-pic 12 | $(package)_cxxflags=-std=c++11 13 | endef 14 | 15 | define $(package)_preprocess_cmds 16 | sed -i.old 's/__atomic_compare_exchange/__atomic_compare_exchange_db/' dbinc/atomic.h && \ 17 | sed -i.old 's/atomic_init/atomic_init_db/' dbinc/atomic.h mp/mp_region.c mp/mp_mvcc.c mp/mp_fget.c mutex/mut_method.c mutex/mut_tas.c && \ 18 | cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub dist 19 | endef 20 | 21 | define $(package)_config_cmds 22 | ../dist/$($(package)_autoconf) 23 | endef 24 | 25 | define $(package)_build_cmds 26 | $(MAKE) libdb_cxx-4.8.a libdb-4.8.a 27 | endef 28 | 29 | define $(package)_stage_cmds 30 | $(MAKE) DESTDIR=$($(package)_staging_dir) install_lib install_include 31 | endef 32 | -------------------------------------------------------------------------------- /depends/packages/fontconfig.mk: -------------------------------------------------------------------------------- 1 | package=fontconfig 2 | $(package)_version=2.12.1 3 | $(package)_download_path=http://www.freedesktop.org/software/fontconfig/release/ 4 | $(package)_file_name=$(package)-$($(package)_version).tar.bz2 5 | $(package)_sha256_hash=b449a3e10c47e1d1c7a6ec6e2016cca73d3bd68fbbd4f0ae5cc6b573f7d6c7f3 6 | $(package)_dependencies=freetype expat 7 | 8 | define $(package)_set_vars 9 | $(package)_config_opts=--disable-docs --disable-static 10 | endef 11 | 12 | define $(package)_config_cmds 13 | $($(package)_autoconf) 14 | endef 15 | 16 | # 2.12.1 uses CHAR_WIDTH which is reserved and clashes with some glibc versions, but newer versions of fontconfig 17 | # have broken makefiles which needlessly attempt to re-generate headers with gperf. 18 | # Instead, change all uses of CHAR_WIDTH, and disable the rule that forces header re-generation. 19 | # This can be removed once the upstream build is fixed. 20 | define $(package)_build_cmds 21 | sed -i 's/CHAR_WIDTH/CHARWIDTH/g' fontconfig/fontconfig.h src/fcobjshash.gperf src/fcobjs.h src/fcobjshash.h && \ 22 | sed -i 's/fcobjshash.h: fcobjshash.gperf/fcobjshash.h:/' src/Makefile && \ 23 | $(MAKE) 24 | endef 25 | 26 | define $(package)_stage_cmds 27 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 28 | endef 29 | -------------------------------------------------------------------------------- /depends/packages/zeromq.mk: -------------------------------------------------------------------------------- 1 | package=zeromq 2 | $(package)_version=4.2.2 3 | $(package)_download_path=https://github.com/zeromq/libzmq/releases/download/v$($(package)_version)/ 4 | $(package)_file_name=$(package)-$($(package)_version).tar.gz 5 | $(package)_sha256_hash=5b23f4ca9ef545d5bd3af55d305765e3ee06b986263b31967435d285a3e6df6b 6 | $(package)_patches=0001-fix-build-with-older-mingw64.patch 7 | 8 | define $(package)_set_vars 9 | $(package)_config_opts=--without-docs --disable-shared --without-libsodium --disable-curve --disable-curve-keygen --disable-perf 10 | $(package)_config_opts_linux=--with-pic 11 | $(package)_cxxflags=-std=c++11 12 | endef 13 | 14 | define $(package)_preprocess_cmds 15 | patch -p1 < $($(package)_patch_dir)/0001-fix-build-with-older-mingw64.patch && \ 16 | ./autogen.sh 17 | endef 18 | 19 | define $(package)_config_cmds 20 | $($(package)_autoconf) 21 | endef 22 | 23 | define $(package)_build_cmds 24 | $(MAKE) src/libzmq.la 25 | endef 26 | 27 | define $(package)_stage_cmds 28 | $(MAKE) DESTDIR=$($(package)_staging_dir) install-libLTLIBRARIES install-includeHEADERS install-pkgconfigDATA 29 | endef 30 | 31 | define $(package)_postprocess_cmds 32 | sed -i.old "s/ -lstdc++//" lib/pkgconfig/libzmq.pc && \ 33 | rm -rf bin share 34 | endef 35 | -------------------------------------------------------------------------------- /depends/packages/miniupnpc.mk: -------------------------------------------------------------------------------- 1 | package=miniupnpc 2 | $(package)_version=2.0.20170509 3 | $(package)_download_path=http://miniupnp.free.fr/files 4 | $(package)_file_name=$(package)-$($(package)_version).tar.gz 5 | $(package)_sha256_hash=d3c368627f5cdfb66d3ebd64ca39ba54d6ff14a61966dbecb8dd296b7039f16a 6 | 7 | define $(package)_set_vars 8 | $(package)_build_opts=CC="$($(package)_cc)" 9 | $(package)_build_opts_darwin=OS=Darwin LIBTOOL="$($(package)_libtool)" 10 | $(package)_build_opts_mingw32=-f Makefile.mingw 11 | $(package)_build_env+=CFLAGS="$($(package)_cflags) $($(package)_cppflags)" AR="$($(package)_ar)" 12 | endef 13 | 14 | define $(package)_preprocess_cmds 15 | mkdir dll && \ 16 | sed -e 's|MINIUPNPC_VERSION_STRING \"version\"|MINIUPNPC_VERSION_STRING \"$($(package)_version)\"|' -e 's|OS/version|$(host)|' miniupnpcstrings.h.in > miniupnpcstrings.h && \ 17 | sed -i.old "s|miniupnpcstrings.h: miniupnpcstrings.h.in wingenminiupnpcstrings|miniupnpcstrings.h: miniupnpcstrings.h.in|" Makefile.mingw 18 | endef 19 | 20 | define $(package)_build_cmds 21 | $(MAKE) libminiupnpc.a $($(package)_build_opts) 22 | endef 23 | 24 | define $(package)_stage_cmds 25 | mkdir -p $($(package)_staging_prefix_dir)/include/miniupnpc $($(package)_staging_prefix_dir)/lib &&\ 26 | install *.h $($(package)_staging_prefix_dir)/include/miniupnpc &&\ 27 | install libminiupnpc.a $($(package)_staging_prefix_dir)/lib 28 | endef 29 | -------------------------------------------------------------------------------- /src/univalue/.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | 3 | compiler: 4 | - clang 5 | - gcc 6 | 7 | os: 8 | - linux 9 | - osx 10 | 11 | sudo: false 12 | 13 | env: 14 | global: 15 | - MAKEJOBS=-j3 16 | - RUN_TESTS=true 17 | - BASE_OUTDIR=$TRAVIS_BUILD_DIR/out 18 | 19 | cache: 20 | apt: true 21 | 22 | addons: 23 | apt: 24 | packages: 25 | - pkg-config 26 | 27 | before_script: 28 | - if [ -n "$USE_SHELL" ]; then export CONFIG_SHELL="$USE_SHELL"; fi 29 | - test -n "$USE_SHELL" && eval '"$USE_SHELL" -c "./autogen.sh"' || ./autogen.sh 30 | 31 | script: 32 | - if [ -n "$UNIVALUE_CONFIG" ]; then unset CC; unset CXX; fi 33 | - OUTDIR=$BASE_OUTDIR/$TRAVIS_PULL_REQUEST/$TRAVIS_JOB_NUMBER-$HOST 34 | - UNIVALUE_CONFIG_ALL="--prefix=$TRAVIS_BUILD_DIR/depends/$HOST --bindir=$OUTDIR/bin --libdir=$OUTDIR/lib" 35 | - ./configure --cache-file=config.cache $UNIVALUE_CONFIG_ALL $UNIVALUE_CONFIG || ( cat config.log && false) 36 | - make -s $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && make $GOAL ; false ) 37 | - export LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/depends/$HOST/lib 38 | - if [ "$RUN_TESTS" = "true" ]; then make $MAKEJOBS distcheck; fi 39 | 40 | matrix: 41 | fast_finish: true 42 | include: 43 | - os: linux 44 | compiler: gcc 45 | env: UNIVALUE_CONFIG=--host=x86_64-w64-mingw32 RUN_TESTS=false 46 | addons: 47 | apt: 48 | packages: 49 | - g++-mingw-w64-x86-64 50 | - gcc-mingw-w64-x86-64 51 | - binutils-mingw-w64-x86-64 52 | -------------------------------------------------------------------------------- /src/forms/mainwindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 841 10 | 494 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | 20 | 21 | Qt::Horizontal 22 | 23 | 24 | 25 | 40 26 | 20 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | PushButton 35 | 36 | 37 | 38 | 39 | 40 | 41 | Qt::Horizontal 42 | 43 | 44 | 45 | 40 46 | 20 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /src/univalue/test/pass1.json: -------------------------------------------------------------------------------- 1 | [ 2 | "JSON Test Pattern pass1", 3 | {"object with 1 member":["array with 1 element"]}, 4 | {}, 5 | [], 6 | -42, 7 | true, 8 | false, 9 | null, 10 | { 11 | "integer": 1234567890, 12 | "real": -9876.543210, 13 | "e": 0.123456789e-12, 14 | "E": 1.234567890E+34, 15 | "": 23456789012E66, 16 | "zero": 0, 17 | "one": 1, 18 | "space": " ", 19 | "quote": "\"", 20 | "backslash": "\\", 21 | "controls": "\b\f\n\r\t", 22 | "slash": "/ & \/", 23 | "alpha": "abcdefghijklmnopqrstuvwyz", 24 | "ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ", 25 | "digit": "0123456789", 26 | "0123456789": "digit", 27 | "special": "`1~!@#$%^&*()_+-={':[,]}|;.?", 28 | "hex": "\u0123\u4567\u89AB\uCDEF\uabcd\uef4A", 29 | "true": true, 30 | "false": false, 31 | "null": null, 32 | "array":[ ], 33 | "object":{ }, 34 | "address": "50 St. James Street", 35 | "url": "http://www.JSON.org/", 36 | "comment": "// /* */": " ", 38 | " s p a c e d " :[1,2 , 3 39 | 40 | , 41 | 42 | 4 , 5 , 6 ,7 ],"compact":[1,2,3,4,5,6,7], 43 | "jsontext": "{\"object with 1 member\":[\"array with 1 element\"]}", 44 | "quotes": "" \u0022 %22 0x22 034 "", 45 | "\/\\\"\uCAFE\uBABE\uAB98\uFCDE\ubcda\uef4A\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?" 46 | : "A key can be any string" 47 | }, 48 | 0.5 ,98.6 49 | , 50 | 99.44 51 | , 52 | 53 | 1066, 54 | 1e1, 55 | 0.1e1, 56 | 1e-1, 57 | 1e00,2e+00,2e-00 58 | ,"rosebud"] -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.tar.gz 2 | 3 | *.exe 4 | src/application 5 | 6 | # autoreconf 7 | Makefile.in 8 | aclocal.m4 9 | autom4te.cache/ 10 | build-aux/config.guess 11 | build-aux/config.sub 12 | build-aux/depcomp 13 | build-aux/install-sh 14 | build-aux/ltmain.sh 15 | build-aux/m4/libtool.m4 16 | build-aux/m4/lt~obsolete.m4 17 | build-aux/m4/ltoptions.m4 18 | build-aux/m4/ltsugar.m4 19 | build-aux/m4/ltversion.m4 20 | build-aux/missing 21 | build-aux/compile 22 | build-aux/test-driver 23 | config.log 24 | config.status 25 | configure 26 | libtool 27 | src/config/application-config.h 28 | src/config/application-config.h.in 29 | src/config/stamp-h1 30 | share/setup.nsi 31 | share/qt/Info.plist 32 | 33 | src/univalue/gen 34 | 35 | src/qt/*.moc 36 | src/qt/moc_*.cpp 37 | src/qt/forms/ui_*.h 38 | 39 | src/qt/test/moc*.cpp 40 | 41 | .deps 42 | .dirstamp 43 | .libs 44 | .*.swp 45 | *.*~* 46 | *.bak 47 | *.rej 48 | *.orig 49 | *.pyc 50 | *.o 51 | *.o-* 52 | *.patch 53 | *.a 54 | *.pb.cc 55 | *.pb.h 56 | 57 | *.log 58 | *.trs 59 | *.dmg 60 | 61 | *.json.h 62 | *.raw.h 63 | 64 | #libtool object files 65 | *.lo 66 | *.la 67 | 68 | # Compilation and Qt preprocessor part 69 | *.qm 70 | Makefile 71 | Application.app 72 | background.tiff* 73 | 74 | # Unit-tests 75 | Makefile.test 76 | 77 | # Resources cpp 78 | qrc_*.cpp 79 | 80 | # Mac specific 81 | .DS_Store 82 | build 83 | 84 | #lcov 85 | *.gcno 86 | *.gcda 87 | /*.info 88 | total.coverage/ 89 | coverage_percent.txt 90 | 91 | #build tests 92 | linux-coverage-build 93 | linux-build 94 | win32-build 95 | test/config.ini 96 | test/cache/* 97 | 98 | /doc/doxygen/ 99 | 100 | contrib/devtools/split-debug.sh 101 | -------------------------------------------------------------------------------- /src/.clang-format: -------------------------------------------------------------------------------- 1 | Language: Cpp 2 | AccessModifierOffset: -4 3 | AlignAfterOpenBracket: false 4 | AlignEscapedNewlinesLeft: true 5 | AlignTrailingComments: true 6 | AllowAllParametersOfDeclarationOnNextLine: false 7 | AllowShortBlocksOnASingleLine: false 8 | AllowShortFunctionsOnASingleLine: All 9 | AllowShortIfStatementsOnASingleLine: true 10 | AllowShortLoopsOnASingleLine: false 11 | AlwaysBreakBeforeMultilineStrings: false 12 | AlwaysBreakTemplateDeclarations: true 13 | BinPackParameters: false 14 | BreakBeforeBinaryOperators: false 15 | BreakBeforeBraces: Linux 16 | BreakBeforeTernaryOperators: false 17 | BreakConstructorInitializersBeforeComma: false 18 | ColumnLimit: 0 19 | CommentPragmas: '^ IWYU pragma:' 20 | ConstructorInitializerAllOnOneLineOrOnePerLine: false 21 | ConstructorInitializerIndentWidth: 4 22 | ContinuationIndentWidth: 4 23 | Cpp11BracedListStyle: true 24 | DerivePointerAlignment: false 25 | DisableFormat: false 26 | IndentCaseLabels: false 27 | IndentFunctionDeclarationAfterType: false 28 | IndentWidth: 4 29 | KeepEmptyLinesAtTheStartOfBlocks: false 30 | MaxEmptyLinesToKeep: 2 31 | NamespaceIndentation: None 32 | ObjCSpaceAfterProperty: false 33 | ObjCSpaceBeforeProtocolList: false 34 | PenaltyBreakBeforeFirstCallParameter: 1 35 | PenaltyBreakComment: 300 36 | PenaltyBreakFirstLessLess: 120 37 | PenaltyBreakString: 1000 38 | PenaltyExcessCharacter: 1000000 39 | PenaltyReturnTypeOnItsOwnLine: 200 40 | PointerAlignment: Left 41 | SpaceBeforeAssignmentOperators: true 42 | SpaceBeforeParens: ControlStatements 43 | SpaceInEmptyParentheses: false 44 | SpacesBeforeTrailingComments: 1 45 | SpacesInAngles: false 46 | SpacesInContainerLiterals: true 47 | SpacesInCStyleCastParentheses: false 48 | SpacesInParentheses: false 49 | Standard: Cpp11 50 | TabWidth: 8 51 | UseTab: Never 52 | -------------------------------------------------------------------------------- /share/genbuild.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright (c) 2012-2016 The Bitcoin Core developers 3 | # Distributed under the MIT software license, see the accompanying 4 | # file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | if [ $# -gt 1 ]; then 7 | cd "$2" || exit 1 8 | fi 9 | if [ $# -gt 0 ]; then 10 | FILE="$1" 11 | shift 12 | if [ -f "$FILE" ]; then 13 | INFO="$(head -n 1 "$FILE")" 14 | fi 15 | else 16 | echo "Usage: $0 " 17 | exit 1 18 | fi 19 | 20 | git_check_in_repo() { 21 | ! { git status --porcelain -uall --ignored "$@" 2>/dev/null || echo '??'; } | grep -q '?' 22 | } 23 | 24 | DESC="" 25 | SUFFIX="" 26 | if [ "${BITCOIN_GENBUILD_NO_GIT}" != "1" -a -e "$(which git 2>/dev/null)" -a "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ] && git_check_in_repo share/genbuild.sh; then 27 | # clean 'dirty' status of touched files that haven't been modified 28 | git diff >/dev/null 2>/dev/null 29 | 30 | # if latest commit is tagged and not dirty, then override using the tag name 31 | RAWDESC=$(git describe --abbrev=0 2>/dev/null) 32 | if [ "$(git rev-parse HEAD)" = "$(git rev-list -1 $RAWDESC 2>/dev/null)" ]; then 33 | git diff-index --quiet HEAD -- && DESC=$RAWDESC 34 | fi 35 | 36 | # otherwise generate suffix from git, i.e. string like "59887e8-dirty" 37 | SUFFIX=$(git rev-parse --short HEAD) 38 | git diff-index --quiet HEAD -- || SUFFIX="$SUFFIX-dirty" 39 | fi 40 | 41 | if [ -n "$DESC" ]; then 42 | NEWINFO="#define BUILD_DESC \"$DESC\"" 43 | elif [ -n "$SUFFIX" ]; then 44 | NEWINFO="#define BUILD_SUFFIX $SUFFIX" 45 | else 46 | NEWINFO="// No build information available" 47 | fi 48 | 49 | # only update build.h if necessary 50 | if [ "$INFO" != "$NEWINFO" ]; then 51 | echo "$NEWINFO" >"$FILE" 52 | fi 53 | -------------------------------------------------------------------------------- /src/res/application-res.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "icons/bitcoin.ico" 2 | IDI_ICON2 ICON DISCARDABLE "icons/bitcoin_testnet.ico" 3 | 4 | #include // needed for VERSIONINFO 5 | #include "../../clientversion.h" // holds the needed client version information 6 | 7 | #define VER_PRODUCTVERSION CLIENT_VERSION_MAJOR,CLIENT_VERSION_MINOR,CLIENT_VERSION_REVISION,CLIENT_VERSION_BUILD 8 | #define VER_PRODUCTVERSION_STR STRINGIZE(CLIENT_VERSION_MAJOR) "." STRINGIZE(CLIENT_VERSION_MINOR) "." STRINGIZE(CLIENT_VERSION_REVISION) "." STRINGIZE(CLIENT_VERSION_BUILD) 9 | #define VER_FILEVERSION VER_PRODUCTVERSION 10 | #define VER_FILEVERSION_STR VER_PRODUCTVERSION_STR 11 | 12 | VS_VERSION_INFO VERSIONINFO 13 | FILEVERSION VER_FILEVERSION 14 | PRODUCTVERSION VER_PRODUCTVERSION 15 | FILEOS VOS_NT_WINDOWS32 16 | FILETYPE VFT_APP 17 | BEGIN 18 | BLOCK "StringFileInfo" 19 | BEGIN 20 | BLOCK "040904E4" // U.S. English - multilingual (hex) 21 | BEGIN 22 | VALUE "CompanyName", "Bitcoin" 23 | VALUE "FileDescription", PACKAGE_NAME " (GUI node for Bitcoin)" 24 | VALUE "FileVersion", VER_FILEVERSION_STR 25 | VALUE "InternalName", "bitcoin-qt" 26 | VALUE "LegalCopyright", COPYRIGHT_STR 27 | VALUE "LegalTrademarks1", "Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php." 28 | VALUE "OriginalFilename", "bitcoin-qt.exe" 29 | VALUE "ProductName", PACKAGE_NAME 30 | VALUE "ProductVersion", VER_PRODUCTVERSION_STR 31 | END 32 | END 33 | 34 | BLOCK "VarFileInfo" 35 | BEGIN 36 | VALUE "Translation", 0x0, 1252 // language neutral - multilingual (decimal) 37 | END 38 | END 39 | -------------------------------------------------------------------------------- /depends/packages/boost.mk: -------------------------------------------------------------------------------- 1 | package=boost 2 | $(package)_version=1_64_0 3 | $(package)_download_path=https://dl.bintray.com/boostorg/release/1.64.0/source/ 4 | $(package)_file_name=$(package)_$($(package)_version).tar.bz2 5 | $(package)_sha256_hash=7bcc5caace97baa948931d712ea5f37038dbb1c5d89b43ad4def4ed7cb683332 6 | 7 | define $(package)_set_vars 8 | $(package)_config_opts_release=variant=release 9 | $(package)_config_opts_debug=variant=debug 10 | $(package)_config_opts=--layout=tagged --build-type=complete --user-config=user-config.jam 11 | $(package)_config_opts+=threading=multi link=static -sNO_BZIP2=1 -sNO_ZLIB=1 12 | $(package)_config_opts_linux=threadapi=pthread runtime-link=shared 13 | $(package)_config_opts_darwin=--toolset=darwin-4.2.1 runtime-link=shared 14 | $(package)_config_opts_mingw32=binary-format=pe target-os=windows threadapi=win32 runtime-link=static 15 | $(package)_config_opts_x86_64_mingw32=address-model=64 16 | $(package)_config_opts_i686_mingw32=address-model=32 17 | $(package)_config_opts_i686_linux=address-model=32 architecture=x86 18 | $(package)_toolset_$(host_os)=gcc 19 | $(package)_archiver_$(host_os)=$($(package)_ar) 20 | $(package)_toolset_darwin=darwin 21 | $(package)_archiver_darwin=$($(package)_libtool) 22 | $(package)_config_libraries=chrono,filesystem,program_options,system,thread,test 23 | $(package)_cxxflags=-std=c++11 -fvisibility=hidden 24 | $(package)_cxxflags_linux=-fPIC 25 | endef 26 | 27 | define $(package)_preprocess_cmds 28 | echo "using $(boost_toolset_$(host_os)) : : $($(package)_cxx) : \"$($(package)_cxxflags) $($(package)_cppflags)\" \"$($(package)_ldflags)\" \"$(boost_archiver_$(host_os))\" \"$(host_STRIP)\" \"$(host_RANLIB)\" \"$(host_WINDRES)\" : ;" > user-config.jam 29 | endef 30 | 31 | define $(package)_config_cmds 32 | ./bootstrap.sh --without-icu --with-libraries=$(boost_config_libraries) 33 | endef 34 | 35 | define $(package)_build_cmds 36 | ./b2 -d2 -j2 -d1 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) stage 37 | endef 38 | 39 | define $(package)_stage_cmds 40 | ./b2 -d0 -j4 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) install 41 | endef 42 | -------------------------------------------------------------------------------- /src/univalue/gen/gen.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2014 BitPay Inc. 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | // 6 | // To re-create univalue_escapes.h: 7 | // $ g++ -o gen gen.cpp 8 | // $ ./gen > univalue_escapes.h 9 | // 10 | 11 | #include 12 | #include 13 | #include "univalue.h" 14 | 15 | using namespace std; 16 | 17 | static bool initEscapes; 18 | static std::string escapes[256]; 19 | 20 | static void initJsonEscape() 21 | { 22 | // Escape all lower control characters (some get overridden with smaller sequences below) 23 | for (int ch=0x00; ch<0x20; ++ch) { 24 | char tmpbuf[20]; 25 | snprintf(tmpbuf, sizeof(tmpbuf), "\\u%04x", ch); 26 | escapes[ch] = std::string(tmpbuf); 27 | } 28 | 29 | escapes[(int)'"'] = "\\\""; 30 | escapes[(int)'\\'] = "\\\\"; 31 | escapes[(int)'\b'] = "\\b"; 32 | escapes[(int)'\f'] = "\\f"; 33 | escapes[(int)'\n'] = "\\n"; 34 | escapes[(int)'\r'] = "\\r"; 35 | escapes[(int)'\t'] = "\\t"; 36 | escapes[(int)'\x7f'] = "\\u007f"; // U+007F DELETE 37 | 38 | initEscapes = true; 39 | } 40 | 41 | static void outputEscape() 42 | { 43 | printf( "// Automatically generated file. Do not modify.\n" 44 | "#ifndef BITCOIN_UNIVALUE_UNIVALUE_ESCAPES_H\n" 45 | "#define BITCOIN_UNIVALUE_UNIVALUE_ESCAPES_H\n" 46 | "static const char *escapes[256] = {\n"); 47 | 48 | for (unsigned int i = 0; i < 256; i++) { 49 | if (escapes[i].empty()) { 50 | printf("\tNULL,\n"); 51 | } else { 52 | printf("\t\""); 53 | 54 | unsigned int si; 55 | for (si = 0; si < escapes[i].size(); si++) { 56 | char ch = escapes[i][si]; 57 | switch (ch) { 58 | case '"': 59 | printf("\\\""); 60 | break; 61 | case '\\': 62 | printf("\\\\"); 63 | break; 64 | default: 65 | printf("%c", escapes[i][si]); 66 | break; 67 | } 68 | } 69 | 70 | printf("\",\n"); 71 | } 72 | } 73 | 74 | printf( "};\n" 75 | "#endif // BITCOIN_UNIVALUE_UNIVALUE_ESCAPES_H\n"); 76 | } 77 | 78 | int main (int argc, char *argv[]) 79 | { 80 | initJsonEscape(); 81 | outputEscape(); 82 | return 0; 83 | } 84 | 85 | -------------------------------------------------------------------------------- /src/univalue/configure.ac: -------------------------------------------------------------------------------- 1 | m4_define([libunivalue_major_version], [1]) 2 | m4_define([libunivalue_minor_version], [1]) 3 | m4_define([libunivalue_micro_version], [3]) 4 | m4_define([libunivalue_interface_age], [3]) 5 | # If you need a modifier for the version number. 6 | # Normally empty, but can be used to make "fixup" releases. 7 | m4_define([libunivalue_extraversion], []) 8 | 9 | dnl libtool versioning from libunivalue 10 | m4_define([libunivalue_current], [m4_eval(100 * libunivalue_minor_version + libunivalue_micro_version - libunivalue_interface_age)]) 11 | m4_define([libunivalue_binary_age], [m4_eval(100 * libunivalue_minor_version + libunivalue_micro_version)]) 12 | m4_define([libunivalue_revision], [libunivalue_interface_age]) 13 | m4_define([libunivalue_age], [m4_eval(libunivalue_binary_age - libunivalue_interface_age)]) 14 | m4_define([libunivalue_version], [libunivalue_major_version().libunivalue_minor_version().libunivalue_micro_version()libunivalue_extraversion()]) 15 | 16 | 17 | AC_INIT([univalue], [1.0.3], 18 | [http://github.com/jgarzik/univalue/]) 19 | 20 | dnl make the compilation flags quiet unless V=1 is used 21 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) 22 | 23 | AC_PREREQ(2.60) 24 | AC_CONFIG_SRCDIR([lib/univalue.cpp]) 25 | AC_CONFIG_AUX_DIR([build-aux]) 26 | AC_CONFIG_MACRO_DIR([build-aux/m4]) 27 | AC_CONFIG_HEADERS([univalue-config.h]) 28 | AM_INIT_AUTOMAKE([subdir-objects foreign]) 29 | 30 | LIBUNIVALUE_MAJOR_VERSION=libunivalue_major_version 31 | LIBUNIVALUE_MINOR_VERSION=libunivalue_minor_version 32 | LIBUNIVALUE_MICRO_VERSION=libunivalue_micro_version 33 | LIBUNIVALUE_INTERFACE_AGE=libunivalue_interface_age 34 | 35 | # ABI version 36 | # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html 37 | LIBUNIVALUE_CURRENT=libunivalue_current 38 | LIBUNIVALUE_REVISION=libunivalue_revision 39 | LIBUNIVALUE_AGE=libunivalue_age 40 | 41 | AC_SUBST(LIBUNIVALUE_CURRENT) 42 | AC_SUBST(LIBUNIVALUE_REVISION) 43 | AC_SUBST(LIBUNIVALUE_AGE) 44 | 45 | LT_INIT 46 | LT_LANG([C++]) 47 | 48 | case $host in 49 | *mingw*) 50 | LIBTOOL_APP_LDFLAGS="$LIBTOOL_APP_LDFLAGS -all-static" 51 | ;; 52 | esac 53 | 54 | BUILD_EXEEXT= 55 | case $build in 56 | *mingw*) 57 | BUILD_EXEEXT=".exe" 58 | ;; 59 | esac 60 | 61 | AC_CONFIG_FILES([ 62 | Makefile 63 | pc/libunivalue.pc 64 | pc/libunivalue-uninstalled.pc]) 65 | 66 | AC_SUBST(LIBTOOL_APP_LDFLAGS) 67 | AC_SUBST(BUILD_EXEEXT) 68 | AC_OUTPUT 69 | 70 | -------------------------------------------------------------------------------- /depends/description.md: -------------------------------------------------------------------------------- 1 | This is a system of building and caching dependencies necessary for building Bitcoin. 2 | There are several features that make it different from most similar systems: 3 | 4 | ### It is designed to be builder and host agnostic 5 | 6 | In theory, binaries for any target OS/architecture can be created, from a 7 | builder running any OS/architecture. In practice, build-side tools must be 8 | specified when the defaults don't fit, and packages must be amended to work 9 | on new hosts. For now, a build architecture of x86_64 is assumed, either on 10 | Linux or OSX. 11 | 12 | ### No reliance on timestamps 13 | 14 | File presence is used to determine what needs to be built. This makes the 15 | results distributable and easily digestable by automated builders. 16 | 17 | ### Each build only has its specified dependencies available at build-time. 18 | 19 | For each build, the sysroot is wiped and the (recursive) dependencies are 20 | installed. This makes each build deterministic, since there will never be any 21 | unknown files available to cause side-effects. 22 | 23 | ### Each package is cached and only rebuilt as needed. 24 | 25 | Before building, a unique build-id is generated for each package. This id 26 | consists of a hash of all files used to build the package (Makefiles, packages, 27 | etc), and as well as a hash of the same data for each recursive dependency. If 28 | any portion of a package's build recipe changes, it will be rebuilt as well as 29 | any other package that depends on it. If any of the main makefiles (Makefile, 30 | funcs.mk, etc) are changed, all packages will be rebuilt. After building, the 31 | results are cached into a tarball that can be re-used and distributed. 32 | 33 | ### Package build results are (relatively) deterministic. 34 | 35 | Each package is configured and patched so that it will yield the same 36 | build-results with each consequent build, within a reasonable set of 37 | constraints. Some things like timestamp insertion are unavoidable, and are 38 | beyond the scope of this system. Additionally, the toolchain itself must be 39 | capable of deterministic results. When revisions are properly bumped, a cached 40 | build should represent an exact single payload. 41 | 42 | ### Sources are fetched and verified automatically 43 | 44 | Each package must define its source location and checksum. The build will fail 45 | if the fetched source does not match. Sources may be pre-seeded and/or cached 46 | as desired. 47 | 48 | ### Self-cleaning 49 | 50 | Build and staging dirs are wiped after use, and any previous version of a 51 | cached result is removed following a successful build. Automated builders 52 | should be able to build each revision and store the results with no further 53 | intervention. 54 | -------------------------------------------------------------------------------- /depends/config.site.in: -------------------------------------------------------------------------------- 1 | depends_prefix="`dirname ${ac_site_file}`/.." 2 | 3 | cross_compiling=maybe 4 | host_alias=@HOST@ 5 | ac_tool_prefix=${host_alias}- 6 | 7 | if test -z $with_boost; then 8 | with_boost=$depends_prefix 9 | fi 10 | if test -z $with_qt_plugindir; then 11 | with_qt_plugindir=$depends_prefix/plugins 12 | fi 13 | if test -z $with_qt_translationdir; then 14 | with_qt_translationdir=$depends_prefix/translations 15 | fi 16 | if test -z $with_qt_bindir && test -z "@no_qt@"; then 17 | with_qt_bindir=$depends_prefix/native/bin 18 | fi 19 | if test -z $with_protoc_bindir && test -z "@no_qt@"; then 20 | with_protoc_bindir=$depends_prefix/native/bin 21 | fi 22 | 23 | 24 | if test -z $enable_wallet && test -n "@no_wallet@"; then 25 | enable_wallet=no 26 | fi 27 | 28 | if test -z $with_miniupnpc && test -n "@no_upnp@"; then 29 | with_miniupnpc=no 30 | fi 31 | 32 | if test -z $with_gui && test -n "@no_qt@"; then 33 | with_gui=no 34 | fi 35 | 36 | if test x@host_os@ = xdarwin; then 37 | BREW=no 38 | PORT=no 39 | fi 40 | 41 | if test x@host_os@ = xmingw32; then 42 | if test -z $with_qt_incdir; then 43 | with_qt_incdir=$depends_prefix/include 44 | fi 45 | if test -z $with_qt_libdir; then 46 | with_qt_libdir=$depends_prefix/lib 47 | fi 48 | fi 49 | 50 | PATH=$depends_prefix/native/bin:$PATH 51 | PKG_CONFIG="`which pkg-config` --static" 52 | 53 | # These two need to remain exported because pkg-config does not see them 54 | # otherwise. That means they must be unexported at the end of configure.ac to 55 | # avoid ruining the cache. Sigh. 56 | export PKG_CONFIG_PATH=$depends_prefix/share/pkgconfig:$depends_prefix/lib/pkgconfig 57 | if test -z "@allow_host_packages@"; then 58 | export PKGCONFIG_LIBDIR= 59 | fi 60 | 61 | CPPFLAGS="-I$depends_prefix/include/ $CPPFLAGS" 62 | LDFLAGS="-L$depends_prefix/lib $LDFLAGS" 63 | 64 | CC="@CC@" 65 | CXX="@CXX@" 66 | OBJC="${CC}" 67 | CCACHE=$depends_prefix/native/bin/ccache 68 | PYTHONPATH=$depends_prefix/native/lib/python/dist-packages:$PYTHONPATH 69 | 70 | if test -n "@AR@"; then 71 | AR=@AR@ 72 | ac_cv_path_ac_pt_AR=${AR} 73 | fi 74 | 75 | if test -n "@RANLIB@"; then 76 | RANLIB=@RANLIB@ 77 | ac_cv_path_ac_pt_RANLIB=${RANLIB} 78 | fi 79 | 80 | if test -n "@NM@"; then 81 | NM=@NM@ 82 | ac_cv_path_ac_pt_NM=${NM} 83 | fi 84 | 85 | if test -n "@debug@"; then 86 | enable_reduce_exports=no 87 | fi 88 | 89 | if test -n "@CFLAGS@"; then 90 | CFLAGS="@CFLAGS@ $CFLAGS" 91 | fi 92 | if test -n "@CXXFLAGS@"; then 93 | CXXFLAGS="@CXXFLAGS@ $CXXFLAGS" 94 | fi 95 | if test -n "@CPPFLAGS@"; then 96 | CPPFLAGS="@CPPFLAGS@ $CPPFLAGS" 97 | fi 98 | if test -n "@LDFLAGS@"; then 99 | LDFLAGS="@LDFLAGS@ $LDFLAGS" 100 | fi 101 | -------------------------------------------------------------------------------- /share/qt/extract_strings_qt.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # Copyright (c) 2012-2017 The Bitcoin Core developers 3 | # Distributed under the MIT software license, see the accompanying 4 | # file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | ''' 6 | Extract _("...") strings for translation and convert to Qt stringdefs so that 7 | they can be picked up by Qt linguist. 8 | ''' 9 | from __future__ import division,print_function,unicode_literals 10 | from subprocess import Popen, PIPE 11 | import operator 12 | import os 13 | import sys 14 | 15 | OUT_CPP="qt/bitcoinstrings.cpp" 16 | EMPTY=['""'] 17 | 18 | def parse_po(text): 19 | """ 20 | Parse 'po' format produced by xgettext. 21 | Return a list of (msgid,msgstr) tuples. 22 | """ 23 | messages = [] 24 | msgid = [] 25 | msgstr = [] 26 | in_msgid = False 27 | in_msgstr = False 28 | 29 | for line in text.split('\n'): 30 | line = line.rstrip('\r') 31 | if line.startswith('msgid '): 32 | if in_msgstr: 33 | messages.append((msgid, msgstr)) 34 | in_msgstr = False 35 | # message start 36 | in_msgid = True 37 | 38 | msgid = [line[6:]] 39 | elif line.startswith('msgstr '): 40 | in_msgid = False 41 | in_msgstr = True 42 | msgstr = [line[7:]] 43 | elif line.startswith('"'): 44 | if in_msgid: 45 | msgid.append(line) 46 | if in_msgstr: 47 | msgstr.append(line) 48 | 49 | if in_msgstr: 50 | messages.append((msgid, msgstr)) 51 | 52 | return messages 53 | 54 | files = sys.argv[1:] 55 | 56 | # xgettext -n --keyword=_ $FILES 57 | XGETTEXT=os.getenv('XGETTEXT', 'xgettext') 58 | if not XGETTEXT: 59 | print('Cannot extract strings: xgettext utility is not installed or not configured.',file=sys.stderr) 60 | print('Please install package "gettext" and re-run \'./configure\'.',file=sys.stderr) 61 | sys.exit(1) 62 | child = Popen([XGETTEXT,'--output=-','-n','--keyword=_'] + files, stdout=PIPE) 63 | (out, err) = child.communicate() 64 | 65 | messages = parse_po(out.decode('utf-8')) 66 | 67 | f = open(OUT_CPP, 'w') 68 | f.write(""" 69 | 70 | #include 71 | 72 | // Automatically generated by extract_strings_qt.py 73 | #ifdef __GNUC__ 74 | #define UNUSED __attribute__((unused)) 75 | #else 76 | #define UNUSED 77 | #endif 78 | """) 79 | f.write('static const char UNUSED *bitcoin_strings[] = {\n') 80 | f.write('QT_TRANSLATE_NOOP("bitcoin-core", "%s"),\n' % (os.getenv('PACKAGE_NAME'),)) 81 | f.write('QT_TRANSLATE_NOOP("bitcoin-core", "%s"),\n' % (os.getenv('COPYRIGHT_HOLDERS'),)) 82 | if os.getenv('COPYRIGHT_HOLDERS_SUBSTITUTION') != os.getenv('PACKAGE_NAME'): 83 | f.write('QT_TRANSLATE_NOOP("bitcoin-core", "%s"),\n' % (os.getenv('COPYRIGHT_HOLDERS_SUBSTITUTION'),)) 84 | messages.sort(key=operator.itemgetter(0)) 85 | for (msgid, msgstr) in messages: 86 | if msgid != EMPTY: 87 | f.write('QT_TRANSLATE_NOOP("bitcoin-core", %s),\n' % ('\n'.join(msgid))) 88 | f.write('};\n') 89 | f.close() 90 | -------------------------------------------------------------------------------- /depends/packages/openssl.mk: -------------------------------------------------------------------------------- 1 | package=openssl 2 | $(package)_version=1.0.1k 3 | $(package)_download_path=https://www.openssl.org/source 4 | $(package)_file_name=$(package)-$($(package)_version).tar.gz 5 | $(package)_sha256_hash=8f9faeaebad088e772f4ef5e38252d472be4d878c6b3a2718c10a4fcebe7a41c 6 | 7 | define $(package)_set_vars 8 | $(package)_config_env=AR="$($(package)_ar)" RANLIB="$($(package)_ranlib)" CC="$($(package)_cc)" 9 | $(package)_config_opts=--prefix=$(host_prefix) --openssldir=$(host_prefix)/etc/openssl 10 | $(package)_config_opts+=no-camellia 11 | $(package)_config_opts+=no-capieng 12 | $(package)_config_opts+=no-cast 13 | $(package)_config_opts+=no-comp 14 | $(package)_config_opts+=no-dso 15 | $(package)_config_opts+=no-dtls1 16 | $(package)_config_opts+=no-ec_nistp_64_gcc_128 17 | $(package)_config_opts+=no-gost 18 | $(package)_config_opts+=no-gmp 19 | $(package)_config_opts+=no-heartbeats 20 | $(package)_config_opts+=no-idea 21 | $(package)_config_opts+=no-jpake 22 | $(package)_config_opts+=no-krb5 23 | $(package)_config_opts+=no-libunbound 24 | $(package)_config_opts+=no-md2 25 | $(package)_config_opts+=no-mdc2 26 | $(package)_config_opts+=no-rc4 27 | $(package)_config_opts+=no-rc5 28 | $(package)_config_opts+=no-rdrand 29 | $(package)_config_opts+=no-rfc3779 30 | $(package)_config_opts+=no-rsax 31 | $(package)_config_opts+=no-sctp 32 | $(package)_config_opts+=no-seed 33 | $(package)_config_opts+=no-sha0 34 | $(package)_config_opts+=no-shared 35 | $(package)_config_opts+=no-ssl-trace 36 | $(package)_config_opts+=no-ssl2 37 | $(package)_config_opts+=no-ssl3 38 | $(package)_config_opts+=no-static_engine 39 | $(package)_config_opts+=no-store 40 | $(package)_config_opts+=no-unit-test 41 | $(package)_config_opts+=no-weak-ssl-ciphers 42 | $(package)_config_opts+=no-whirlpool 43 | $(package)_config_opts+=no-zlib 44 | $(package)_config_opts+=no-zlib-dynamic 45 | $(package)_config_opts+=$($(package)_cflags) $($(package)_cppflags) 46 | $(package)_config_opts_linux=-fPIC -Wa,--noexecstack 47 | $(package)_config_opts_x86_64_linux=linux-x86_64 48 | $(package)_config_opts_i686_linux=linux-generic32 49 | $(package)_config_opts_arm_linux=linux-generic32 50 | $(package)_config_opts_aarch64_linux=linux-generic64 51 | $(package)_config_opts_mipsel_linux=linux-generic32 52 | $(package)_config_opts_mips_linux=linux-generic32 53 | $(package)_config_opts_powerpc_linux=linux-generic32 54 | $(package)_config_opts_x86_64_darwin=darwin64-x86_64-cc 55 | $(package)_config_opts_x86_64_mingw32=mingw64 56 | $(package)_config_opts_i686_mingw32=mingw 57 | endef 58 | 59 | define $(package)_preprocess_cmds 60 | sed -i.old "/define DATE/d" util/mkbuildinf.pl && \ 61 | sed -i.old "s|engines apps test|engines|" Makefile.org 62 | endef 63 | 64 | define $(package)_config_cmds 65 | ./Configure $($(package)_config_opts) 66 | endef 67 | 68 | define $(package)_build_cmds 69 | $(MAKE) -j1 build_libs libcrypto.pc libssl.pc openssl.pc 70 | endef 71 | 72 | define $(package)_stage_cmds 73 | $(MAKE) INSTALL_PREFIX=$($(package)_staging_dir) -j1 install_sw 74 | endef 75 | 76 | define $(package)_postprocess_cmds 77 | rm -rf share bin etc 78 | endef 79 | -------------------------------------------------------------------------------- /depends/README.md: -------------------------------------------------------------------------------- 1 | ### Usage 2 | 3 | To build dependencies for the current arch+OS: 4 | 5 | make 6 | 7 | To build for another arch/OS: 8 | 9 | make HOST=host-platform-triplet 10 | 11 | For example: 12 | 13 | make HOST=x86_64-w64-mingw32 -j4 14 | 15 | A prefix will be generated that's suitable for plugging into Bitcoin's 16 | configure. In the above example, a dir named x86_64-w64-mingw32 will be 17 | created. To use it for Bitcoin: 18 | 19 | ./configure --prefix=`pwd`/depends/x86_64-w64-mingw32 20 | 21 | Common `host-platform-triplets` for cross compilation are: 22 | 23 | - `i686-w64-mingw32` for Win32 24 | - `x86_64-w64-mingw32` for Win64 25 | - `x86_64-apple-darwin11` for MacOSX 26 | - `arm-linux-gnueabihf` for Linux ARM 32 bit 27 | - `aarch64-linux-gnu` for Linux ARM 64 bit 28 | 29 | No other options are needed, the paths are automatically configured. 30 | 31 | Install the required dependencies: Ubuntu & Debian 32 | -------------------------------------------------- 33 | 34 | For macOS cross compilation: 35 | 36 | sudo apt-get install curl librsvg2-bin libtiff-tools bsdmainutils cmake imagemagick libcap-dev libz-dev libbz2-dev python-setuptools 37 | 38 | For Win32/Win64 cross compilation: 39 | 40 | - see [build-windows.md](../doc/build-windows.md#cross-compilation-for-ubuntu-and-windows-subsystem-for-linux) 41 | 42 | For linux (including i386, ARM) cross compilation: 43 | 44 | sudo apt-get install curl g++-aarch64-linux-gnu g++-4.8-aarch64-linux-gnu gcc-4.8-aarch64-linux-gnu binutils-aarch64-linux-gnu g++-arm-linux-gnueabihf g++-4.8-arm-linux-gnueabihf gcc-4.8-arm-linux-gnueabihf binutils-arm-linux-gnueabihf g++-4.8-multilib gcc-4.8-multilib binutils-gold bsdmainutils 45 | 46 | 47 | Dependency Options: 48 | The following can be set when running make: make FOO=bar 49 | 50 | SOURCES_PATH: downloaded sources will be placed here 51 | BASE_CACHE: built packages will be placed here 52 | SDK_PATH: Path where sdk's can be found (used by OSX) 53 | FALLBACK_DOWNLOAD_PATH: If a source file can't be fetched, try here before giving up 54 | NO_QT: Don't download/build/cache qt and its dependencies 55 | NO_WALLET: Don't download/build/cache libs needed to enable the wallet 56 | NO_UPNP: Don't download/build/cache packages needed for enabling upnp 57 | DEBUG: disable some optimizations and enable more runtime checking 58 | HOST_ID_SALT: Optional salt to use when generating host package ids 59 | BUILD_ID_SALT: Optional salt to use when generating build package ids 60 | 61 | If some packages are not built, for example `make NO_WALLET=1`, the appropriate 62 | options will be passed to bitcoin's configure. In this case, `--disable-wallet`. 63 | 64 | Additional targets: 65 | 66 | download: run 'make download' to fetch all sources without building them 67 | download-osx: run 'make download-osx' to fetch all sources needed for osx builds 68 | download-win: run 'make download-win' to fetch all sources needed for win builds 69 | download-linux: run 'make download-linux' to fetch all sources needed for linux builds 70 | 71 | ### Other documentation 72 | 73 | - [description.md](description.md): General description of the depends system 74 | - [packages.md](packages.md): Steps for adding packages 75 | 76 | -------------------------------------------------------------------------------- /share/qt/Info.plist.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | LSMinimumSystemVersion 6 | 10.8.0 7 | 8 | LSArchitecturePriority 9 | 10 | x86_64 11 | 12 | 13 | CFBundleIconFile 14 | bitcoin.icns 15 | 16 | CFBundlePackageType 17 | APPL 18 | 19 | CFBundleGetInfoString 20 | @CLIENT_VERSION_MAJOR@.@CLIENT_VERSION_MINOR@.@CLIENT_VERSION_REVISION@, Copyright © 2009-@COPYRIGHT_YEAR@ @COPYRIGHT_HOLDERS_FINAL@ 21 | 22 | CFBundleShortVersionString 23 | @CLIENT_VERSION_MAJOR@.@CLIENT_VERSION_MINOR@.@CLIENT_VERSION_REVISION@ 24 | 25 | CFBundleVersion 26 | @CLIENT_VERSION_MAJOR@.@CLIENT_VERSION_MINOR@.@CLIENT_VERSION_REVISION@ 27 | 28 | CFBundleSignature 29 | ???? 30 | 31 | CFBundleExecutable 32 | Bitcoin-Qt 33 | 34 | CFBundleName 35 | Bitcoin-Qt 36 | 37 | LSHasLocalizedDisplayName 38 | 39 | 40 | CFBundleIdentifier 41 | org.bitcoinfoundation.Bitcoin-Qt 42 | 43 | CFBundleURLTypes 44 | 45 | 46 | CFBundleTypeRole 47 | Editor 48 | CFBundleURLName 49 | org.bitcoin.BitcoinPayment 50 | CFBundleURLSchemes 51 | 52 | bitcoin 53 | 54 | 55 | 56 | 57 | UTExportedTypeDeclarations 58 | 59 | 60 | UTTypeIdentifier 61 | org.bitcoin.paymentrequest 62 | UTTypeDescription 63 | Bitcoin payment request 64 | UTTypeConformsTo 65 | 66 | public.data 67 | 68 | UTTypeTagSpecification 69 | 70 | public.mime-type 71 | application/x-bitcoin-payment-request 72 | public.filename-extension 73 | 74 | bitcoinpaymentrequest 75 | 76 | 77 | 78 | 79 | 80 | CFBundleDocumentTypes 81 | 82 | 83 | CFBundleTypeRole 84 | Editor 85 | LSItemContentTypes 86 | 87 | org.bitcoin.paymentrequest 88 | 89 | LSHandlerRank 90 | Owner 91 | 92 | 93 | 94 | NSPrincipalClass 95 | NSApplication 96 | 97 | NSHighResolutionCapable 98 | True 99 | 100 | LSAppNapIsDisabled 101 | True 102 | 103 | LSApplicationCategoryType 104 | public.app-category.finance 105 | 106 | 107 | -------------------------------------------------------------------------------- /src/univalue/lib/univalue_write.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2014 BitPay Inc. 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #include 6 | #include 7 | #include 8 | #include "univalue.h" 9 | #include "univalue_escapes.h" 10 | 11 | using namespace std; 12 | 13 | static string json_escape(const string& inS) 14 | { 15 | string outS; 16 | outS.reserve(inS.size() * 2); 17 | 18 | for (unsigned int i = 0; i < inS.size(); i++) { 19 | unsigned char ch = inS[i]; 20 | const char *escStr = escapes[ch]; 21 | 22 | if (escStr) 23 | outS += escStr; 24 | else 25 | outS += ch; 26 | } 27 | 28 | return outS; 29 | } 30 | 31 | string UniValue::write(unsigned int prettyIndent, 32 | unsigned int indentLevel) const 33 | { 34 | string s; 35 | s.reserve(1024); 36 | 37 | unsigned int modIndent = indentLevel; 38 | if (modIndent == 0) 39 | modIndent = 1; 40 | 41 | switch (typ) { 42 | case VNULL: 43 | s += "null"; 44 | break; 45 | case VOBJ: 46 | writeObject(prettyIndent, modIndent, s); 47 | break; 48 | case VARR: 49 | writeArray(prettyIndent, modIndent, s); 50 | break; 51 | case VSTR: 52 | s += "\"" + json_escape(val) + "\""; 53 | break; 54 | case VNUM: 55 | s += val; 56 | break; 57 | case VBOOL: 58 | s += (val == "1" ? "true" : "false"); 59 | break; 60 | } 61 | 62 | return s; 63 | } 64 | 65 | static void indentStr(unsigned int prettyIndent, unsigned int indentLevel, string& s) 66 | { 67 | s.append(prettyIndent * indentLevel, ' '); 68 | } 69 | 70 | void UniValue::writeArray(unsigned int prettyIndent, unsigned int indentLevel, string& s) const 71 | { 72 | s += "["; 73 | if (prettyIndent) 74 | s += "\n"; 75 | 76 | for (unsigned int i = 0; i < values.size(); i++) { 77 | if (prettyIndent) 78 | indentStr(prettyIndent, indentLevel, s); 79 | s += values[i].write(prettyIndent, indentLevel + 1); 80 | if (i != (values.size() - 1)) { 81 | s += ","; 82 | } 83 | if (prettyIndent) 84 | s += "\n"; 85 | } 86 | 87 | if (prettyIndent) 88 | indentStr(prettyIndent, indentLevel - 1, s); 89 | s += "]"; 90 | } 91 | 92 | void UniValue::writeObject(unsigned int prettyIndent, unsigned int indentLevel, string& s) const 93 | { 94 | s += "{"; 95 | if (prettyIndent) 96 | s += "\n"; 97 | 98 | for (unsigned int i = 0; i < keys.size(); i++) { 99 | if (prettyIndent) 100 | indentStr(prettyIndent, indentLevel, s); 101 | s += "\"" + json_escape(keys[i]) + "\":"; 102 | if (prettyIndent) 103 | s += " "; 104 | s += values.at(i).write(prettyIndent, indentLevel + 1); 105 | if (i != (values.size() - 1)) 106 | s += ","; 107 | if (prettyIndent) 108 | s += "\n"; 109 | } 110 | 111 | if (prettyIndent) 112 | indentStr(prettyIndent, indentLevel - 1, s); 113 | s += "}"; 114 | } 115 | 116 | -------------------------------------------------------------------------------- /src/univalue/lib/univalue_escapes.h: -------------------------------------------------------------------------------- 1 | // Automatically generated file. Do not modify. 2 | #ifndef BITCOIN_UNIVALUE_UNIVALUE_ESCAPES_H 3 | #define BITCOIN_UNIVALUE_UNIVALUE_ESCAPES_H 4 | static const char *escapes[256] = { 5 | "\\u0000", 6 | "\\u0001", 7 | "\\u0002", 8 | "\\u0003", 9 | "\\u0004", 10 | "\\u0005", 11 | "\\u0006", 12 | "\\u0007", 13 | "\\b", 14 | "\\t", 15 | "\\n", 16 | "\\u000b", 17 | "\\f", 18 | "\\r", 19 | "\\u000e", 20 | "\\u000f", 21 | "\\u0010", 22 | "\\u0011", 23 | "\\u0012", 24 | "\\u0013", 25 | "\\u0014", 26 | "\\u0015", 27 | "\\u0016", 28 | "\\u0017", 29 | "\\u0018", 30 | "\\u0019", 31 | "\\u001a", 32 | "\\u001b", 33 | "\\u001c", 34 | "\\u001d", 35 | "\\u001e", 36 | "\\u001f", 37 | NULL, 38 | NULL, 39 | "\\\"", 40 | NULL, 41 | NULL, 42 | NULL, 43 | NULL, 44 | NULL, 45 | NULL, 46 | NULL, 47 | NULL, 48 | NULL, 49 | NULL, 50 | NULL, 51 | NULL, 52 | NULL, 53 | NULL, 54 | NULL, 55 | NULL, 56 | NULL, 57 | NULL, 58 | NULL, 59 | NULL, 60 | NULL, 61 | NULL, 62 | NULL, 63 | NULL, 64 | NULL, 65 | NULL, 66 | NULL, 67 | NULL, 68 | NULL, 69 | NULL, 70 | NULL, 71 | NULL, 72 | NULL, 73 | NULL, 74 | NULL, 75 | NULL, 76 | NULL, 77 | NULL, 78 | NULL, 79 | NULL, 80 | NULL, 81 | NULL, 82 | NULL, 83 | NULL, 84 | NULL, 85 | NULL, 86 | NULL, 87 | NULL, 88 | NULL, 89 | NULL, 90 | NULL, 91 | NULL, 92 | NULL, 93 | NULL, 94 | NULL, 95 | NULL, 96 | NULL, 97 | "\\\\", 98 | NULL, 99 | NULL, 100 | NULL, 101 | NULL, 102 | NULL, 103 | NULL, 104 | NULL, 105 | NULL, 106 | NULL, 107 | NULL, 108 | NULL, 109 | NULL, 110 | NULL, 111 | NULL, 112 | NULL, 113 | NULL, 114 | NULL, 115 | NULL, 116 | NULL, 117 | NULL, 118 | NULL, 119 | NULL, 120 | NULL, 121 | NULL, 122 | NULL, 123 | NULL, 124 | NULL, 125 | NULL, 126 | NULL, 127 | NULL, 128 | NULL, 129 | NULL, 130 | NULL, 131 | NULL, 132 | "\\u007f", 133 | NULL, 134 | NULL, 135 | NULL, 136 | NULL, 137 | NULL, 138 | NULL, 139 | NULL, 140 | NULL, 141 | NULL, 142 | NULL, 143 | NULL, 144 | NULL, 145 | NULL, 146 | NULL, 147 | NULL, 148 | NULL, 149 | NULL, 150 | NULL, 151 | NULL, 152 | NULL, 153 | NULL, 154 | NULL, 155 | NULL, 156 | NULL, 157 | NULL, 158 | NULL, 159 | NULL, 160 | NULL, 161 | NULL, 162 | NULL, 163 | NULL, 164 | NULL, 165 | NULL, 166 | NULL, 167 | NULL, 168 | NULL, 169 | NULL, 170 | NULL, 171 | NULL, 172 | NULL, 173 | NULL, 174 | NULL, 175 | NULL, 176 | NULL, 177 | NULL, 178 | NULL, 179 | NULL, 180 | NULL, 181 | NULL, 182 | NULL, 183 | NULL, 184 | NULL, 185 | NULL, 186 | NULL, 187 | NULL, 188 | NULL, 189 | NULL, 190 | NULL, 191 | NULL, 192 | NULL, 193 | NULL, 194 | NULL, 195 | NULL, 196 | NULL, 197 | NULL, 198 | NULL, 199 | NULL, 200 | NULL, 201 | NULL, 202 | NULL, 203 | NULL, 204 | NULL, 205 | NULL, 206 | NULL, 207 | NULL, 208 | NULL, 209 | NULL, 210 | NULL, 211 | NULL, 212 | NULL, 213 | NULL, 214 | NULL, 215 | NULL, 216 | NULL, 217 | NULL, 218 | NULL, 219 | NULL, 220 | NULL, 221 | NULL, 222 | NULL, 223 | NULL, 224 | NULL, 225 | NULL, 226 | NULL, 227 | NULL, 228 | NULL, 229 | NULL, 230 | NULL, 231 | NULL, 232 | NULL, 233 | NULL, 234 | NULL, 235 | NULL, 236 | NULL, 237 | NULL, 238 | NULL, 239 | NULL, 240 | NULL, 241 | NULL, 242 | NULL, 243 | NULL, 244 | NULL, 245 | NULL, 246 | NULL, 247 | NULL, 248 | NULL, 249 | NULL, 250 | NULL, 251 | NULL, 252 | NULL, 253 | NULL, 254 | NULL, 255 | NULL, 256 | NULL, 257 | NULL, 258 | NULL, 259 | NULL, 260 | NULL, 261 | }; 262 | #endif // BITCOIN_UNIVALUE_UNIVALUE_ESCAPES_H 263 | -------------------------------------------------------------------------------- /depends/packages/native_cctools.mk: -------------------------------------------------------------------------------- 1 | package=native_cctools 2 | $(package)_version=807d6fd1be5d2224872e381870c0a75387fe05e6 3 | $(package)_download_path=https://github.com/theuni/cctools-port/archive 4 | $(package)_file_name=$($(package)_version).tar.gz 5 | $(package)_sha256_hash=a09c9ba4684670a0375e42d9d67e7f12c1f62581a27f28f7c825d6d7032ccc6a 6 | $(package)_build_subdir=cctools 7 | $(package)_clang_version=3.7.1 8 | $(package)_clang_download_path=http://llvm.org/releases/$($(package)_clang_version) 9 | $(package)_clang_download_file=clang+llvm-$($(package)_clang_version)-x86_64-linux-gnu-ubuntu-14.04.tar.xz 10 | $(package)_clang_file_name=clang-llvm-$($(package)_clang_version)-x86_64-linux-gnu-ubuntu-14.04.tar.xz 11 | $(package)_clang_sha256_hash=99b28a6b48e793705228a390471991386daa33a9717cd9ca007fcdde69608fd9 12 | $(package)_extra_sources=$($(package)_clang_file_name) 13 | 14 | define $(package)_fetch_cmds 15 | $(call fetch_file,$(package),$($(package)_download_path),$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash)) && \ 16 | $(call fetch_file,$(package),$($(package)_clang_download_path),$($(package)_clang_download_file),$($(package)_clang_file_name),$($(package)_clang_sha256_hash)) 17 | endef 18 | 19 | define $(package)_extract_cmds 20 | mkdir -p $($(package)_extract_dir) && \ 21 | echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \ 22 | echo "$($(package)_clang_sha256_hash) $($(package)_source_dir)/$($(package)_clang_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ 23 | $(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \ 24 | mkdir -p toolchain/bin toolchain/lib/clang/3.5/include && \ 25 | tar --strip-components=1 -C toolchain -xf $($(package)_source_dir)/$($(package)_clang_file_name) && \ 26 | rm -f toolchain/lib/libc++abi.so* && \ 27 | echo "#!/bin/sh" > toolchain/bin/$(host)-dsymutil && \ 28 | echo "exit 0" >> toolchain/bin/$(host)-dsymutil && \ 29 | chmod +x toolchain/bin/$(host)-dsymutil && \ 30 | tar --strip-components=1 -xf $($(package)_source) 31 | endef 32 | 33 | define $(package)_set_vars 34 | $(package)_config_opts=--target=$(host) --disable-lto-support 35 | $(package)_ldflags+=-Wl,-rpath=\\$$$$$$$$\$$$$$$$$ORIGIN/../lib 36 | $(package)_cc=$($(package)_extract_dir)/toolchain/bin/clang 37 | $(package)_cxx=$($(package)_extract_dir)/toolchain/bin/clang++ 38 | endef 39 | 40 | define $(package)_preprocess_cmds 41 | cd $($(package)_build_subdir); ./autogen.sh && \ 42 | sed -i.old "/define HAVE_PTHREADS/d" ld64/src/ld/InputFiles.h 43 | endef 44 | 45 | define $(package)_config_cmds 46 | $($(package)_autoconf) 47 | endef 48 | 49 | define $(package)_build_cmds 50 | $(MAKE) 51 | endef 52 | 53 | define $(package)_stage_cmds 54 | $(MAKE) DESTDIR=$($(package)_staging_dir) install && \ 55 | cd $($(package)_extract_dir)/toolchain && \ 56 | mkdir -p $($(package)_staging_prefix_dir)/lib/clang/$($(package)_clang_version)/include && \ 57 | mkdir -p $($(package)_staging_prefix_dir)/bin $($(package)_staging_prefix_dir)/include && \ 58 | cp bin/clang $($(package)_staging_prefix_dir)/bin/ &&\ 59 | cp -P bin/clang++ $($(package)_staging_prefix_dir)/bin/ &&\ 60 | cp lib/libLTO.so $($(package)_staging_prefix_dir)/lib/ && \ 61 | cp -rf lib/clang/$($(package)_clang_version)/include/* $($(package)_staging_prefix_dir)/lib/clang/$($(package)_clang_version)/include/ && \ 62 | cp bin/llvm-dsymutil $($(package)_staging_prefix_dir)/bin/$(host)-dsymutil && \ 63 | if `test -d include/c++/`; then cp -rf include/c++/ $($(package)_staging_prefix_dir)/include/; fi && \ 64 | if `test -d lib/c++/`; then cp -rf lib/c++/ $($(package)_staging_prefix_dir)/lib/; fi 65 | endef 66 | -------------------------------------------------------------------------------- /src/univalue/Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS = -I build-aux/m4 2 | .PHONY: gen 3 | .INTERMEDIATE: $(GENBIN) 4 | 5 | include_HEADERS = include/univalue.h 6 | noinst_HEADERS = lib/univalue_escapes.h lib/univalue_utffilter.h 7 | 8 | lib_LTLIBRARIES = libunivalue.la 9 | 10 | pkgconfigdir = $(libdir)/pkgconfig 11 | pkgconfig_DATA = pc/libunivalue.pc 12 | 13 | libunivalue_la_SOURCES = \ 14 | lib/univalue.cpp \ 15 | lib/univalue_get.cpp \ 16 | lib/univalue_read.cpp \ 17 | lib/univalue_write.cpp 18 | 19 | libunivalue_la_LDFLAGS = \ 20 | -version-info $(LIBUNIVALUE_CURRENT):$(LIBUNIVALUE_REVISION):$(LIBUNIVALUE_AGE) \ 21 | -no-undefined 22 | libunivalue_la_CXXFLAGS = -I$(top_srcdir)/include 23 | 24 | TESTS = test/object test/unitester test/no_nul 25 | 26 | GENBIN = gen/gen$(BUILD_EXEEXT) 27 | GEN_SRCS = gen/gen.cpp 28 | 29 | $(GENBIN): $(GEN_SRCS) 30 | @echo Building $@ 31 | $(AM_V_at)c++ -I$(top_srcdir)/include -o $@ $< 32 | 33 | gen: lib/univalue_escapes.h $(GENBIN) 34 | @echo Updating $< 35 | $(AM_V_at)$(GENBIN) > lib/univalue_escapes.h 36 | 37 | noinst_PROGRAMS = $(TESTS) test/test_json 38 | 39 | TEST_DATA_DIR=test 40 | 41 | test_unitester_SOURCES = test/unitester.cpp 42 | test_unitester_LDADD = libunivalue.la 43 | test_unitester_CXXFLAGS = -I$(top_srcdir)/include -DJSON_TEST_SRC=\"$(srcdir)/$(TEST_DATA_DIR)\" 44 | test_unitester_LDFLAGS = -static $(LIBTOOL_APP_LDFLAGS) 45 | 46 | test_test_json_SOURCES = test/test_json.cpp 47 | test_test_json_LDADD = libunivalue.la 48 | test_test_json_CXXFLAGS = -I$(top_srcdir)/include 49 | test_test_json_LDFLAGS = -static $(LIBTOOL_APP_LDFLAGS) 50 | 51 | test_no_nul_SOURCES = test/no_nul.cpp 52 | test_no_nul_LDADD = libunivalue.la 53 | test_no_nul_CXXFLAGS = -I$(top_srcdir)/include 54 | test_no_nul_LDFLAGS = -static $(LIBTOOL_APP_LDFLAGS) 55 | 56 | test_object_SOURCES = test/object.cpp 57 | test_object_LDADD = libunivalue.la 58 | test_object_CXXFLAGS = -I$(top_srcdir)/include 59 | test_object_LDFLAGS = -static $(LIBTOOL_APP_LDFLAGS) 60 | 61 | TEST_FILES = \ 62 | $(TEST_DATA_DIR)/fail10.json \ 63 | $(TEST_DATA_DIR)/fail11.json \ 64 | $(TEST_DATA_DIR)/fail12.json \ 65 | $(TEST_DATA_DIR)/fail13.json \ 66 | $(TEST_DATA_DIR)/fail14.json \ 67 | $(TEST_DATA_DIR)/fail15.json \ 68 | $(TEST_DATA_DIR)/fail16.json \ 69 | $(TEST_DATA_DIR)/fail17.json \ 70 | $(TEST_DATA_DIR)/fail18.json \ 71 | $(TEST_DATA_DIR)/fail19.json \ 72 | $(TEST_DATA_DIR)/fail1.json \ 73 | $(TEST_DATA_DIR)/fail20.json \ 74 | $(TEST_DATA_DIR)/fail21.json \ 75 | $(TEST_DATA_DIR)/fail22.json \ 76 | $(TEST_DATA_DIR)/fail23.json \ 77 | $(TEST_DATA_DIR)/fail24.json \ 78 | $(TEST_DATA_DIR)/fail25.json \ 79 | $(TEST_DATA_DIR)/fail26.json \ 80 | $(TEST_DATA_DIR)/fail27.json \ 81 | $(TEST_DATA_DIR)/fail28.json \ 82 | $(TEST_DATA_DIR)/fail29.json \ 83 | $(TEST_DATA_DIR)/fail2.json \ 84 | $(TEST_DATA_DIR)/fail30.json \ 85 | $(TEST_DATA_DIR)/fail31.json \ 86 | $(TEST_DATA_DIR)/fail32.json \ 87 | $(TEST_DATA_DIR)/fail33.json \ 88 | $(TEST_DATA_DIR)/fail34.json \ 89 | $(TEST_DATA_DIR)/fail35.json \ 90 | $(TEST_DATA_DIR)/fail36.json \ 91 | $(TEST_DATA_DIR)/fail37.json \ 92 | $(TEST_DATA_DIR)/fail38.json \ 93 | $(TEST_DATA_DIR)/fail39.json \ 94 | $(TEST_DATA_DIR)/fail40.json \ 95 | $(TEST_DATA_DIR)/fail41.json \ 96 | $(TEST_DATA_DIR)/fail42.json \ 97 | $(TEST_DATA_DIR)/fail44.json \ 98 | $(TEST_DATA_DIR)/fail3.json \ 99 | $(TEST_DATA_DIR)/fail4.json \ 100 | $(TEST_DATA_DIR)/fail5.json \ 101 | $(TEST_DATA_DIR)/fail6.json \ 102 | $(TEST_DATA_DIR)/fail7.json \ 103 | $(TEST_DATA_DIR)/fail8.json \ 104 | $(TEST_DATA_DIR)/fail9.json \ 105 | $(TEST_DATA_DIR)/pass1.json \ 106 | $(TEST_DATA_DIR)/pass2.json \ 107 | $(TEST_DATA_DIR)/pass3.json \ 108 | $(TEST_DATA_DIR)/round1.json \ 109 | $(TEST_DATA_DIR)/round2.json \ 110 | $(TEST_DATA_DIR)/round3.json \ 111 | $(TEST_DATA_DIR)/round4.json \ 112 | $(TEST_DATA_DIR)/round5.json \ 113 | $(TEST_DATA_DIR)/round6.json \ 114 | $(TEST_DATA_DIR)/round7.json 115 | 116 | EXTRA_DIST=$(TEST_FILES) $(GEN_SRCS) 117 | -------------------------------------------------------------------------------- /share/pixmaps/bitcoin16.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char *bitcoin__[] = { 3 | /* columns rows colors chars-per-pixel */ 4 | "16 16 159 2", 5 | " c #CA7C1E", 6 | ". c #CB7D1E", 7 | "X c #D1811E", 8 | "o c #D0801F", 9 | "O c #D1801F", 10 | "+ c #D3821F", 11 | "@ c #D7831F", 12 | "# c #EE8D18", 13 | "$ c #F4931F", 14 | "% c #D78625", 15 | "& c #D88520", 16 | "* c #D98521", 17 | "= c #D98620", 18 | "- c #D78B2D", 19 | "; c #DF8D2A", 20 | ": c #DF8F2F", 21 | "> c #DF943B", 22 | ", c #D8913C", 23 | "< c #D8923E", 24 | "1 c #DF953E", 25 | "2 c #E28B23", 26 | "3 c #E38B23", 27 | "4 c #EA9023", 28 | "5 c #EB9023", 29 | "6 c #ED9122", 30 | "7 c #ED9123", 31 | "8 c #EE9123", 32 | "9 c #EE9223", 33 | "0 c #F39421", 34 | "q c #F19423", 35 | "w c #F39523", 36 | "e c #F79521", 37 | "r c #F59422", 38 | "t c #F49623", 39 | "y c #F69622", 40 | "u c #F79623", 41 | "i c #F09324", 42 | "p c #F19424", 43 | "a c #F19525", 44 | "s c #F49624", 45 | "d c #F59625", 46 | "f c #F49725", 47 | "g c #F79624", 48 | "h c #F79724", 49 | "j c #F69725", 50 | "k c #F79725", 51 | "l c #F69726", 52 | "z c #F79726", 53 | "x c #F89621", 54 | "c c #F89722", 55 | "v c #F89723", 56 | "b c #F89724", 57 | "n c #F89824", 58 | "m c #F89825", 59 | "M c #F99825", 60 | "N c #F89925", 61 | "B c #F89926", 62 | "V c #F89927", 63 | "C c #F99927", 64 | "Z c #F0972E", 65 | "A c #F7992A", 66 | "S c #F79A2B", 67 | "D c #F79B2C", 68 | "F c #F69A2D", 69 | "G c #F79D2F", 70 | "H c #F89929", 71 | "J c #F89A28", 72 | "K c #F89A29", 73 | "L c #F99A29", 74 | "P c #F99B29", 75 | "I c #F89A2A", 76 | "U c #F89A2B", 77 | "Y c #F99B2B", 78 | "T c #F89B2C", 79 | "R c #F89C2C", 80 | "E c #F99C2D", 81 | "W c #F99C2E", 82 | "Q c #F89D2E", 83 | "! c #F99D2F", 84 | "~ c #E29335", 85 | "^ c #E49639", 86 | "/ c #E2983F", 87 | "( c #F79F35", 88 | ") c #F99E31", 89 | "_ c #F89E32", 90 | "` c #F99E32", 91 | "' c #F9A033", 92 | "] c #F9A035", 93 | "[ c #F9A135", 94 | "{ c #F9A036", 95 | "} c #F9A136", 96 | "| c #F9A137", 97 | " . c #F3A03F", 98 | ".. c #F7A43F", 99 | "X. c #F8A139", 100 | "o. c #F9A23A", 101 | "O. c #FAA33B", 102 | "+. c #FAA43E", 103 | "@. c #FAA43F", 104 | "#. c #EF9F41", 105 | "$. c #EEA244", 106 | "%. c #ECA34B", 107 | "&. c #F8A440", 108 | "*. c #F9A541", 109 | "=. c #F9A644", 110 | "-. c #F9A947", 111 | ";. c #F0A349", 112 | ":. c #F5A648", 113 | ">. c #F1A74E", 114 | ",. c #F7AA4F", 115 | "<. c #E4A458", 116 | "1. c #E4A55B", 117 | "2. c #E8A95E", 118 | "3. c #F2A950", 119 | "4. c #F4AA52", 120 | "5. c #FBAF55", 121 | "6. c #E4A860", 122 | "7. c #EAAC63", 123 | "8. c #EBAF68", 124 | "9. c #F2AF61", 125 | "0. c #EBB16C", 126 | "q. c #F6B568", 127 | "w. c #E3AF71", 128 | "e. c #EBBE89", 129 | "r. c #E0BC93", 130 | "t. c #E3C199", 131 | "y. c #E6C59D", 132 | "u. c #EAC89E", 133 | "i. c #E7C8A2", 134 | "p. c #EACBA6", 135 | "a. c #EBCFAF", 136 | "s. c #F1CCA0", 137 | "d. c #E7CEB1", 138 | "f. c #ECD1B0", 139 | "g. c #E5D2BB", 140 | "h. c #E8D2B8", 141 | "j. c #DFDFDF", 142 | "k. c #E7D5C1", 143 | "l. c #E7D7C4", 144 | "z. c #E5D7C7", 145 | "x. c #E7DACB", 146 | "c. c #EADAC8", 147 | "v. c #E9DCCC", 148 | "b. c #EDDFCE", 149 | "n. c #E5DDD3", 150 | "m. c #E4DFD9", 151 | "M. c #ECE0D1", 152 | "N. c #E4E1DD", 153 | "B. c #EDE3D8", 154 | "V. c #EAE4DD", 155 | "C. c #ECE5DC", 156 | "Z. c #E2E2E2", 157 | "A. c #E5E2E0", 158 | "S. c #E4E4E4", 159 | "D. c #E7E7E7", 160 | "F. c #EAEAE9", 161 | "G. c gray92", 162 | "H. c #EEEEEE", 163 | "J. c None", 164 | /* pixels */ 165 | "J.J.J.J.J.J.J.1 > J.J.J.J.J.J.J.", 166 | "J.J.J.J.J./ ..| ' ( ~ J.J.J.J.J.", 167 | "J.J.J.< *.{ V $ r U W _ - J.J.J.", 168 | "J.J., o.J 0 # <.w.$.F N H % J.J.", 169 | "J.J.o.T e 1.r.k.x.t.S z B u J.J.", 170 | "J.^ [ Y ! #.z.H.M.n.0.d n m 2 J.", 171 | "J.X.) | =. .h.B.5.f.j.;.v B d J.", 172 | ": Q M ` &.>.A.V.p.c.l.4.E n d = ", 173 | "; I b A Z 2.D.s.u.F.a.-.} C w & ", 174 | "J.l g y 6.m.G.q.3.b.Z.,.] D 8 J.", 175 | "J.3 k c %.d.C.v.N.S.y.@.L a * J.", 176 | "J.J.j z x 8.i.g.e.9.+.W t 6 J.J.", 177 | "J.J.+ s h G :.7.O.R B s 7 . J.J.", 178 | "J.J.J.O i f P L K d p 5 J.J.J.", 179 | "J.J.J.J.J.@ 9 q i 4 + J.J.J.J.J.", 180 | "J.J.J.J.J.J.J.X o J.J.J.J.J.J.J." 181 | }; 182 | -------------------------------------------------------------------------------- /share/pixmaps/bitcoin32.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char *bitcoin__[] = { 3 | /* columns rows colors chars-per-pixel */ 4 | "32 32 102 2", 5 | " c #CC7D1D", 6 | ". c #D5831F", 7 | "X c #D48221", 8 | "o c #D98621", 9 | "O c #DC8820", 10 | "+ c #DC8D2C", 11 | "@ c #D98F36", 12 | "# c #D68F39", 13 | "$ c #DD943E", 14 | "% c #E28B23", 15 | "& c #E98F24", 16 | "* c #E18F2D", 17 | "= c #ED9124", 18 | "- c #EC942A", 19 | "; c #F59624", 20 | ": c #F89724", 21 | "> c #F79827", 22 | ", c #F89825", 23 | "< c #F0962B", 24 | "1 c #F59A2D", 25 | "2 c #F99B2B", 26 | "3 c #EC9732", 27 | "4 c #EC9A37", 28 | "5 c #E2963B", 29 | "6 c #E6983A", 30 | "7 c #EC9C3B", 31 | "8 c #F69D33", 32 | "9 c #F99E32", 33 | "0 c #F49E3A", 34 | "q c #F9A036", 35 | "w c #F6A13C", 36 | "e c #F9A33B", 37 | "r c #D79341", 38 | "t c #DC9641", 39 | "y c #E39A43", 40 | "u c #EA9D42", 41 | "i c #EFA041", 42 | "p c #EDA34B", 43 | "a c #F5A443", 44 | "s c #F9A643", 45 | "d c #FAA846", 46 | "f c #F2A64C", 47 | "g c #F9AA4B", 48 | "h c #E5A251", 49 | "j c #ECA756", 50 | "k c #EBA758", 51 | "l c #FAAF57", 52 | "z c #FBB057", 53 | "x c #FBB25B", 54 | "c c #DFB179", 55 | "v c #E4AA65", 56 | "b c #EBAE64", 57 | "n c #E9AF69", 58 | "m c #FBB665", 59 | "M c #F1B46A", 60 | "N c #F8B96D", 61 | "B c #E5B071", 62 | "V c #EBB777", 63 | "C c #EEB877", 64 | "Z c #E7B478", 65 | "A c #EBB97D", 66 | "S c #F0B671", 67 | "D c #F2B871", 68 | "F c #EFBC80", 69 | "G c #E6BD8D", 70 | "H c #EDBF88", 71 | "J c #E6BF90", 72 | "K c #F1C187", 73 | "L c #F1C288", 74 | "P c #E5C093", 75 | "I c #EEC493", 76 | "U c #E1C19B", 77 | "Y c #E9C69C", 78 | "T c #ECC89D", 79 | "R c #F1C897", 80 | "E c #DFC5A4", 81 | "W c #DBCBB8", 82 | "Q c #E2C7A7", 83 | "! c #EBCBA6", 84 | "~ c #E6CBAB", 85 | "^ c #E9D2B7", 86 | "/ c #E5D1B9", 87 | "( c #EBD6BD", 88 | ") c #EFD9BE", 89 | "_ c #DDD0C2", 90 | "` c #DCD7D2", 91 | "' c #DEDEDE", 92 | "] c #ECDAC5", 93 | "[ c #EDDECB", 94 | "{ c #E9E0D5", 95 | "} c #E7E0D9", 96 | "| c #E9E2DB", 97 | " . c #EFE8DF", 98 | ".. c #E5E5E5", 99 | "X. c #EBE7E2", 100 | "o. c #EFEAE6", 101 | "O. c #ECECEC", 102 | "+. c #F2ECE6", 103 | "@. c #F1F0EE", 104 | "#. c #F4F4F4", 105 | "$. c #FBFBFB", 106 | "%. c None", 107 | /* pixels */ 108 | "%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.", 109 | "%.%.%.%.%.%.%.%.%.%.%.%.%.%.t 5 5 $ %.%.%.%.%.%.%.%.%.%.%.%.%.%.", 110 | "%.%.%.%.%.%.%.%.%.%.%.r u w q 9 9 9 8 4 # %.%.%.%.%.%.%.%.%.%.%.", 111 | "%.%.%.%.%.%.%.%.%.y s e 9 2 , , , : > 2 9 q 5 %.%.%.%.%.%.%.%.%.", 112 | "%.%.%.%.%.%.%.%.s q 2 , , , , : , > 2 2 > > 2 9 %.%.%.%.%.%.%.%.", 113 | "%.%.%.%.%.%.t e 1 , , , , : : ; > 2 9 9 2 , , > 2 + %.%.%.%.%.%.", 114 | "%.%.%.%.%.$ e 2 , , , , , , ; u u 8 1 1 2 > , , > > + %.%.%.%.%.", 115 | "%.%.%.%.%.e 2 , , : > ; ; > < ` ` 0 c n 1 2 , , , > , %.%.%.%.%.", 116 | "%.%.%.%.e 1 , , , , ; h v - 3 ..! w ' _ 9 2 > , , , > : %.%.%.%.", 117 | "%.%.%.6 q , : , > 2 > W ..| [ #.H V ..D 9 9 2 , , , , , % %.%.%.", 118 | "%.%.%.e 2 , > 2 2 2 9 b ! #.$.$.#.#.#.Y i 1 2 > , , , > ; %.%.%.", 119 | "%.%.@ q > 2 2 2 9 q e q 0 o.$.+.) { #.#.| b 2 2 , , , , : X %.%.", 120 | "%.%.4 9 2 2 9 q e e s w b O.#.( m x I @.$...f > > , , , : & %.%.", 121 | "%.%.8 > 2 2 9 e s d g a P #.#.L x l a [ $.#.A 2 2 , : , , ; %.%.", 122 | "%.+ 1 , , 2 2 q e d g f / $.#.T n k Z o.$.O.M 9 2 > , , , ; X %.", 123 | "%.* 2 , , , 2 9 q e s f X.$.#.O.O.O.#.$.+.Y g e 9 2 , , , ; o %.", 124 | "%.* 2 , , , 2 2 q e w n O.$.[ R ( O.$.$.[ d s e 9 2 2 , , ; o %.", 125 | "%.+ 2 , , , > 2 8 8 1 G #.#.T m m N ] #.#.~ s e e 9 2 > : ; X %.", 126 | "%.%.> , , , , 2 < v B [ $.O.m z z s b #.$...g e e q 9 2 ; = %.%.", 127 | "%.%.= : , , , : 7 ' O.#.$.@.C j p u ~ #.$.} g q 9 9 2 2 ; % %.%.", 128 | "%.%.o , , , , : 0 G ^ .$.#.O.X.{ X.#.$.#.Y e 9 2 2 > , ; %.%.", 129 | "%.%.%., : , , , 2 2 2 M O.) ] #.#.#.#.O./ d 9 2 > , , ; = %.%.%.", 130 | "%.%.%.& ; , , , , 2 ; Q ..g F O.K A H S s 9 2 > , : , ; o %.%.%.", 131 | "%.%.%.%.; ; , , , , 2 E _ d ' ..d q q 9 2 > , : , , ; = %.%.%.%.", 132 | "%.%.%.%.%.; : , , , 2 q d g U J e 2 2 > , , , , , ; = %.%.%.%.%.", 133 | "%.%.%.%.%.o ; : , , , 2 9 q 9 q 9 > , : , , , , ; = . %.%.%.%.%.", 134 | "%.%.%.%.%.%.. ; ; , , > 2 2 2 > , , , , , , , ; = %.%.%.%.%.%.", 135 | "%.%.%.%.%.%.%.%.= ; : > 2 2 , , : , , , , ; ; & %.%.%.%.%.%.%.%.", 136 | "%.%.%.%.%.%.%.%.%.. = ; > : , , , , ; ; = = X %.%.%.%.%.%.%.%.%.", 137 | "%.%.%.%.%.%.%.%.%.%.%. % = ; ; ; ; & O %.%.%.%.%.%.%.%.%.%.%.", 138 | "%.%.%.%.%.%.%.%.%.%.%.%.%.%. X X %.%.%.%.%.%.%.%.%.%.%.%.%.%.", 139 | "%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%." 140 | }; 141 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2018 Jonas Schnelli 2 | # Distributed under the MIT software license, see the accompanying 3 | # file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | DIST_SUBDIRS = univalue 6 | 7 | AM_LDFLAGS = $(LIBTOOL_LDFLAGS) $(HARDENED_LDFLAGS) 8 | AM_CXXFLAGS = $(HARDENED_CXXFLAGS) $(ERROR_CXXFLAGS) 9 | AM_CPPFLAGS = $(HARDENED_CPPFLAGS) 10 | EXTRA_LIBRARIES = 11 | 12 | if EMBEDDED_UNIVALUE 13 | LIBUNIVALUE = univalue/libunivalue.la 14 | 15 | $(LIBUNIVALUE): $(wildcard univalue/lib/*) $(wildcard univalue/include/*) 16 | $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F) 17 | else 18 | LIBUNIVALUE = $(UNIVALUE_LIBS) 19 | endif 20 | 21 | APPLICATION_INCLUDES=-I$(builddir) 22 | APPLICATION_INCLUDES += $(UNIVALUE_CFLAGS) 23 | 24 | 25 | APPNAME=Application 26 | APPNAME_LC=application 27 | 28 | bin_PROGRAMS = $(APPNAME_LC) 29 | EXTRA_LIBRARIES += libapplication.a 30 | 31 | # application qt core # 32 | QT_TS = \ 33 | locale/$(APPNAME_LC)_en_GB.ts 34 | 35 | QT_FORMS_UI = \ 36 | forms/mainwindow.ui 37 | 38 | QT_MOC_CPP = \ 39 | moc_mainwindow.cpp 40 | 41 | QT_QRC_CPP = qrc_$(APPNAME_LC).cpp 42 | QT_QRC = $(APPNAME_LC).qrc 43 | QT_QRC_LOCALE_CPP = qrc_$(APPNAME_LC)_locale.cpp 44 | QT_QRC_LOCALE = $(APPNAME_LC)_locale.qrc 45 | 46 | APPLICATION_QT_H = \ 47 | mainwindow.h 48 | 49 | RES_ICONS = 50 | 51 | APPLICATION_QT_CPP = \ 52 | main.cpp \ 53 | mainwindow.cpp 54 | 55 | RES_IMAGES = 56 | 57 | APPLICATION_RC = res/$(APPNAME_LC)-res.rc 58 | 59 | APPLICATION_QT_INCLUDES = -DQT_NO_KEYWORDS 60 | 61 | libapplication_a_CPPFLAGS = $(AM_CPPFLAGS) $(APPLICATION_INCLUDES) $(APPLICATION_QT_INCLUDES) \ 62 | $(QT_INCLUDES) $(QT_DBUS_INCLUDES) 63 | libapplication_a_CXXFLAGS = $(AM_CXXFLAGS) $(QT_PIE_FLAGS) 64 | libapplication_a_OBJCXXFLAGS = $(AM_OBJCXXFLAGS) $(QT_PIE_FLAGS) 65 | 66 | libapplication_a_SOURCES = $(APPLICATION_QT_CPP) $(APPLICATION_QT_H) $(QT_FORMS_UI) \ 67 | $(QT_QRC) $(QT_QRC_LOCALE) $(QT_TS) $(RES_ICONS) $(RES_IMAGES) 68 | 69 | nodist_libapplication_a_SOURCES = $(QT_MOC_CPP) $(QT_MOC) \ 70 | $(QT_QRC_CPP) $(QT_QRC_LOCALE_CPP) 71 | 72 | # forms/foo.h -> forms/ui_foo.h 73 | QT_FORMS_H=$(join $(dir $(QT_FORMS_UI)),$(addprefix ui_, $(notdir $(QT_FORMS_UI:.ui=.h)))) 74 | 75 | # Most files will depend on the forms and moc files as includes. Generate them 76 | # before anything else. 77 | $(QT_MOC): $(QT_FORMS_H) 78 | $(libapplication_a_OBJECTS) $(application_OBJECTS) : | $(QT_MOC) 79 | 80 | # application binary # 81 | application_CPPFLAGS = $(AM_CPPFLAGS) $(APPLICATION_INCLUDES) $(APPLICATION_QT_INCLUDES) \ 82 | $(QT_INCLUDES) 83 | application_CXXFLAGS = $(AM_CXXFLAGS) $(QT_PIE_FLAGS) 84 | 85 | application_SOURCES = main.cpp 86 | if TARGET_WINDOWS 87 | application_SOURCES += $(APPLICATION_RC) 88 | endif 89 | application_LDADD = libapplication.a 90 | application_LDADD += $(LIBUNIVALUE) $(QT_LIBS) $(QT_DBUS_LIBS) 91 | application_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) 92 | application_LIBTOOLFLAGS = --tag CXX 93 | 94 | #locale/foo.ts -> locale/foo.qm 95 | QT_QM=$(QT_TS:.ts=.qm) 96 | 97 | SECONDARY: $(QT_QM) 98 | 99 | $(QT_QRC_LOCALE_CPP): $(QT_QRC_LOCALE) $(QT_QM) 100 | @test -f $(RCC) 101 | @cp -f $< $(@D)/temp_$( $@ 104 | @rm $(@D)/temp_$( $@ 110 | 111 | CLEAN_QT = $(nodist_libapplication_a_SOURCES) $(QT_QM) $(QT_FORMS_H) 112 | 113 | CLEANFILES = $(CLEAN_QT) 114 | 115 | application_clean: FORCE 116 | rm -f $(CLEAN_QT) libapplication.a $(libapplication_a_OBJECTS) $(application_OBJECTS) $(APPNAME_LC)$(EXEEXT) $(LIBAPPLICATION) 117 | 118 | ui_%.h: %.ui 119 | @test -f $(UIC) 120 | @$(MKDIR_P) $(@D) 121 | $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(UIC) -o $@ $< || (echo "Error creating $@"; false) 122 | 123 | %.moc: %.cpp 124 | $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(MOC) $(DEFAULT_INCLUDES) $(QT_INCLUDES) $(MOC_DEFS) $< | \ 125 | $(SED) -e '/^\*\*.*Created:/d' -e '/^\*\*.*by:/d' > $@ 126 | 127 | moc_%.cpp: %.h 128 | $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(MOC) $(DEFAULT_INCLUDES) $(QT_INCLUDES) $(MOC_DEFS) $< | \ 129 | $(SED) -e '/^\*\*.*Created:/d' -e '/^\*\*.*by:/d' > $@ 130 | 131 | %.qm: %.ts 132 | @test -f $(LRELEASE) 133 | @$(MKDIR_P) $(@D) 134 | $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(LRELEASE) -silent $< -qm $@ 135 | -------------------------------------------------------------------------------- /src/univalue/lib/univalue_get.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2014 BitPay Inc. 2 | // Copyright 2015 Bitcoin Core Developers 3 | // Distributed under the MIT software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include "univalue.h" 16 | 17 | namespace 18 | { 19 | static bool ParsePrechecks(const std::string& str) 20 | { 21 | if (str.empty()) // No empty string allowed 22 | return false; 23 | if (str.size() >= 1 && (json_isspace(str[0]) || json_isspace(str[str.size()-1]))) // No padding allowed 24 | return false; 25 | if (str.size() != strlen(str.c_str())) // No embedded NUL characters allowed 26 | return false; 27 | return true; 28 | } 29 | 30 | bool ParseInt32(const std::string& str, int32_t *out) 31 | { 32 | if (!ParsePrechecks(str)) 33 | return false; 34 | char *endp = NULL; 35 | errno = 0; // strtol will not set errno if valid 36 | long int n = strtol(str.c_str(), &endp, 10); 37 | if(out) *out = (int32_t)n; 38 | // Note that strtol returns a *long int*, so even if strtol doesn't report a over/underflow 39 | // we still have to check that the returned value is within the range of an *int32_t*. On 64-bit 40 | // platforms the size of these types may be different. 41 | return endp && *endp == 0 && !errno && 42 | n >= std::numeric_limits::min() && 43 | n <= std::numeric_limits::max(); 44 | } 45 | 46 | bool ParseInt64(const std::string& str, int64_t *out) 47 | { 48 | if (!ParsePrechecks(str)) 49 | return false; 50 | char *endp = NULL; 51 | errno = 0; // strtoll will not set errno if valid 52 | long long int n = strtoll(str.c_str(), &endp, 10); 53 | if(out) *out = (int64_t)n; 54 | // Note that strtoll returns a *long long int*, so even if strtol doesn't report a over/underflow 55 | // we still have to check that the returned value is within the range of an *int64_t*. 56 | return endp && *endp == 0 && !errno && 57 | n >= std::numeric_limits::min() && 58 | n <= std::numeric_limits::max(); 59 | } 60 | 61 | bool ParseDouble(const std::string& str, double *out) 62 | { 63 | if (!ParsePrechecks(str)) 64 | return false; 65 | if (str.size() >= 2 && str[0] == '0' && str[1] == 'x') // No hexadecimal floats allowed 66 | return false; 67 | std::istringstream text(str); 68 | text.imbue(std::locale::classic()); 69 | double result; 70 | text >> result; 71 | if(out) *out = result; 72 | return text.eof() && !text.fail(); 73 | } 74 | } 75 | 76 | const std::vector& UniValue::getKeys() const 77 | { 78 | if (typ != VOBJ) 79 | throw std::runtime_error("JSON value is not an object as expected"); 80 | return keys; 81 | } 82 | 83 | const std::vector& UniValue::getValues() const 84 | { 85 | if (typ != VOBJ && typ != VARR) 86 | throw std::runtime_error("JSON value is not an object or array as expected"); 87 | return values; 88 | } 89 | 90 | bool UniValue::get_bool() const 91 | { 92 | if (typ != VBOOL) 93 | throw std::runtime_error("JSON value is not a boolean as expected"); 94 | return getBool(); 95 | } 96 | 97 | const std::string& UniValue::get_str() const 98 | { 99 | if (typ != VSTR) 100 | throw std::runtime_error("JSON value is not a string as expected"); 101 | return getValStr(); 102 | } 103 | 104 | int UniValue::get_int() const 105 | { 106 | if (typ != VNUM) 107 | throw std::runtime_error("JSON value is not an integer as expected"); 108 | int32_t retval; 109 | if (!ParseInt32(getValStr(), &retval)) 110 | throw std::runtime_error("JSON integer out of range"); 111 | return retval; 112 | } 113 | 114 | int64_t UniValue::get_int64() const 115 | { 116 | if (typ != VNUM) 117 | throw std::runtime_error("JSON value is not an integer as expected"); 118 | int64_t retval; 119 | if (!ParseInt64(getValStr(), &retval)) 120 | throw std::runtime_error("JSON integer out of range"); 121 | return retval; 122 | } 123 | 124 | double UniValue::get_real() const 125 | { 126 | if (typ != VNUM) 127 | throw std::runtime_error("JSON value is not a number as expected"); 128 | double retval; 129 | if (!ParseDouble(getValStr(), &retval)) 130 | throw std::runtime_error("JSON double out of range"); 131 | return retval; 132 | } 133 | 134 | const UniValue& UniValue::get_obj() const 135 | { 136 | if (typ != VOBJ) 137 | throw std::runtime_error("JSON value is not an object as expected"); 138 | return *this; 139 | } 140 | 141 | const UniValue& UniValue::get_array() const 142 | { 143 | if (typ != VARR) 144 | throw std::runtime_error("JSON value is not an array as expected"); 145 | return *this; 146 | } 147 | 148 | -------------------------------------------------------------------------------- /src/univalue/lib/univalue_utffilter.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Wladimir J. van der Laan 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | #ifndef UNIVALUE_UTFFILTER_H 5 | #define UNIVALUE_UTFFILTER_H 6 | 7 | #include 8 | 9 | /** 10 | * Filter that generates and validates UTF-8, as well as collates UTF-16 11 | * surrogate pairs as specified in RFC4627. 12 | */ 13 | class JSONUTF8StringFilter 14 | { 15 | public: 16 | explicit JSONUTF8StringFilter(std::string &s): 17 | str(s), is_valid(true), codepoint(0), state(0), surpair(0) 18 | { 19 | } 20 | // Write single 8-bit char (may be part of UTF-8 sequence) 21 | void push_back(unsigned char ch) 22 | { 23 | if (state == 0) { 24 | if (ch < 0x80) // 7-bit ASCII, fast direct pass-through 25 | str.push_back(ch); 26 | else if (ch < 0xc0) // Mid-sequence character, invalid in this state 27 | is_valid = false; 28 | else if (ch < 0xe0) { // Start of 2-byte sequence 29 | codepoint = (ch & 0x1f) << 6; 30 | state = 6; 31 | } else if (ch < 0xf0) { // Start of 3-byte sequence 32 | codepoint = (ch & 0x0f) << 12; 33 | state = 12; 34 | } else if (ch < 0xf8) { // Start of 4-byte sequence 35 | codepoint = (ch & 0x07) << 18; 36 | state = 18; 37 | } else // Reserved, invalid 38 | is_valid = false; 39 | } else { 40 | if ((ch & 0xc0) != 0x80) // Not a continuation, invalid 41 | is_valid = false; 42 | state -= 6; 43 | codepoint |= (ch & 0x3f) << state; 44 | if (state == 0) 45 | push_back_u(codepoint); 46 | } 47 | } 48 | // Write codepoint directly, possibly collating surrogate pairs 49 | void push_back_u(unsigned int codepoint_) 50 | { 51 | if (state) // Only accept full codepoints in open state 52 | is_valid = false; 53 | if (codepoint_ >= 0xD800 && codepoint_ < 0xDC00) { // First half of surrogate pair 54 | if (surpair) // Two subsequent surrogate pair openers - fail 55 | is_valid = false; 56 | else 57 | surpair = codepoint_; 58 | } else if (codepoint_ >= 0xDC00 && codepoint_ < 0xE000) { // Second half of surrogate pair 59 | if (surpair) { // Open surrogate pair, expect second half 60 | // Compute code point from UTF-16 surrogate pair 61 | append_codepoint(0x10000 | ((surpair - 0xD800)<<10) | (codepoint_ - 0xDC00)); 62 | surpair = 0; 63 | } else // Second half doesn't follow a first half - fail 64 | is_valid = false; 65 | } else { 66 | if (surpair) // First half of surrogate pair not followed by second - fail 67 | is_valid = false; 68 | else 69 | append_codepoint(codepoint_); 70 | } 71 | } 72 | // Check that we're in a state where the string can be ended 73 | // No open sequences, no open surrogate pairs, etc 74 | bool finalize() 75 | { 76 | if (state || surpair) 77 | is_valid = false; 78 | return is_valid; 79 | } 80 | private: 81 | std::string &str; 82 | bool is_valid; 83 | // Current UTF-8 decoding state 84 | unsigned int codepoint; 85 | int state; // Top bit to be filled in for next UTF-8 byte, or 0 86 | 87 | // Keep track of the following state to handle the following section of 88 | // RFC4627: 89 | // 90 | // To escape an extended character that is not in the Basic Multilingual 91 | // Plane, the character is represented as a twelve-character sequence, 92 | // encoding the UTF-16 surrogate pair. So, for example, a string 93 | // containing only the G clef character (U+1D11E) may be represented as 94 | // "\uD834\uDD1E". 95 | // 96 | // Two subsequent \u.... may have to be replaced with one actual codepoint. 97 | unsigned int surpair; // First half of open UTF-16 surrogate pair, or 0 98 | 99 | void append_codepoint(unsigned int codepoint_) 100 | { 101 | if (codepoint_ <= 0x7f) 102 | str.push_back((char)codepoint_); 103 | else if (codepoint_ <= 0x7FF) { 104 | str.push_back((char)(0xC0 | (codepoint_ >> 6))); 105 | str.push_back((char)(0x80 | (codepoint_ & 0x3F))); 106 | } else if (codepoint_ <= 0xFFFF) { 107 | str.push_back((char)(0xE0 | (codepoint_ >> 12))); 108 | str.push_back((char)(0x80 | ((codepoint_ >> 6) & 0x3F))); 109 | str.push_back((char)(0x80 | (codepoint_ & 0x3F))); 110 | } else if (codepoint_ <= 0x1FFFFF) { 111 | str.push_back((char)(0xF0 | (codepoint_ >> 18))); 112 | str.push_back((char)(0x80 | ((codepoint_ >> 12) & 0x3F))); 113 | str.push_back((char)(0x80 | ((codepoint_ >> 6) & 0x3F))); 114 | str.push_back((char)(0x80 | (codepoint_ & 0x3F))); 115 | } 116 | } 117 | }; 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /depends/packages.md: -------------------------------------------------------------------------------- 1 | Each recipe consists of 3 main parts: defining identifiers, setting build 2 | variables, and defining build commands. 3 | 4 | The package "mylib" will be used here as an example 5 | 6 | General tips: 7 | - mylib_foo is written as $(package)_foo in order to make recipes more similar. 8 | 9 | ## Identifiers 10 | Each package is required to define at least these variables: 11 | 12 | $(package)_version: 13 | Version of the upstream library or program. If there is no version, a 14 | placeholder such as 1.0 can be used. 15 | 16 | $(package)_download_path: 17 | Location of the upstream source, without the file-name. Usually http or 18 | ftp. 19 | 20 | $(package)_file_name: 21 | The upstream source filename available at the download path. 22 | 23 | $(package)_sha256_hash: 24 | The sha256 hash of the upstream file 25 | 26 | These variables are optional: 27 | 28 | $(package)_build_subdir: 29 | cd to this dir before running configure/build/stage commands. 30 | 31 | $(package)_download_file: 32 | The file-name of the upstream source if it differs from how it should be 33 | stored locally. This can be used to avoid storing file-names with strange 34 | characters. 35 | 36 | $(package)_dependencies: 37 | Names of any other packages that this one depends on. 38 | 39 | $(package)_patches: 40 | Filenames of any patches needed to build the package 41 | 42 | $(package)_extra_sources: 43 | Any extra files that will be fetched via $(package)_fetch_cmds. These are 44 | specified so that they can be fetched and verified via 'make download'. 45 | 46 | 47 | ## Build Variables: 48 | After defining the main identifiers, build variables may be added or customized 49 | before running the build commands. They should be added to a function called 50 | $(package)_set_vars. For example: 51 | 52 | define $(package)_set_vars 53 | ... 54 | endef 55 | 56 | Most variables can be prefixed with the host, architecture, or both, to make 57 | the modifications specific to that case. For example: 58 | 59 | Universal: $(package)_cc=gcc 60 | Linux only: $(package)_linux_cc=gcc 61 | x86_64 only: $(package)_x86_64_cc = gcc 62 | x86_64 linux only: $(package)_x86_64_linux_cc = gcc 63 | 64 | These variables may be set to override or append their default values. 65 | 66 | $(package)_cc 67 | $(package)_cxx 68 | $(package)_objc 69 | $(package)_objcxx 70 | $(package)_ar 71 | $(package)_ranlib 72 | $(package)_libtool 73 | $(package)_nm 74 | $(package)_cflags 75 | $(package)_cxxflags 76 | $(package)_ldflags 77 | $(package)_cppflags 78 | $(package)_config_env 79 | $(package)_build_env 80 | $(package)_stage_env 81 | $(package)_build_opts 82 | $(package)_config_opts 83 | 84 | The *_env variables are used to add environment variables to the respective 85 | commands. 86 | 87 | Many variables respect a debug/release suffix as well, in order to use them for 88 | only the appropriate build config. For example: 89 | 90 | $(package)_cflags_release = -O3 91 | $(package)_cflags_i686_debug = -g 92 | $(package)_config_opts_release = --disable-debug 93 | 94 | These will be used in addition to the options that do not specify 95 | debug/release. All builds are considered to be release unless DEBUG=1 is set by 96 | the user. Other variables may be defined as needed. 97 | 98 | ## Build commands: 99 | 100 | For each build, a unique build dir and staging dir are created. For example, 101 | `work/build/mylib/1.0-1adac830f6e` and `work/staging/mylib/1.0-1adac830f6e`. 102 | 103 | The following build commands are available for each recipe: 104 | 105 | $(package)_fetch_cmds: 106 | Runs from: build dir 107 | Fetch the source file. If undefined, it will be fetched and verified 108 | against its hash. 109 | 110 | $(package)_extract_cmds: 111 | Runs from: build dir 112 | Verify the source file against its hash and extract it. If undefined, the 113 | source is assumed to be a tarball. 114 | 115 | $(package)_preprocess_cmds: 116 | Runs from: build dir/$(package)_build_subdir 117 | Preprocess the source as necessary. If undefined, does nothing. 118 | 119 | $(package)_config_cmds: 120 | Runs from: build dir/$(package)_build_subdir 121 | Configure the source. If undefined, does nothing. 122 | 123 | $(package)_build_cmds: 124 | Runs from: build dir/$(package)_build_subdir 125 | Build the source. If undefined, does nothing. 126 | 127 | $(package)_stage_cmds: 128 | Runs from: build dir/$(package)_build_subdir 129 | Stage the build results. If undefined, does nothing. 130 | 131 | The following variables are available for each recipe: 132 | 133 | $(1)_staging_dir: package's destination sysroot path 134 | $(1)_staging_prefix_dir: prefix path inside of the package's staging dir 135 | $(1)_extract_dir: path to the package's extracted sources 136 | $(1)_build_dir: path where configure/build/stage commands will be run 137 | $(1)_patch_dir: path where the package's patches (if any) are found 138 | 139 | Notes on build commands: 140 | 141 | For packages built with autotools, $($(package)_autoconf) can be used in the 142 | configure step to (usually) correctly configure automatically. Any 143 | $($(package)_config_opts) will be appended. 144 | 145 | Most autotools projects can be properly staged using: 146 | 147 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 148 | -------------------------------------------------------------------------------- /src/univalue/test/unitester.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2014 BitPay Inc. 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include "univalue.h" 11 | 12 | #ifndef JSON_TEST_SRC 13 | #error JSON_TEST_SRC must point to test source directory 14 | #endif 15 | 16 | #ifndef ARRAY_SIZE 17 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) 18 | #endif 19 | 20 | using namespace std; 21 | string srcdir(JSON_TEST_SRC); 22 | static bool test_failed = false; 23 | 24 | #define d_assert(expr) { if (!(expr)) { test_failed = true; fprintf(stderr, "%s failed\n", filename.c_str()); } } 25 | #define f_assert(expr) { if (!(expr)) { test_failed = true; fprintf(stderr, "%s failed\n", __func__); } } 26 | 27 | static std::string rtrim(std::string s) 28 | { 29 | s.erase(s.find_last_not_of(" \n\r\t")+1); 30 | return s; 31 | } 32 | 33 | static void runtest(string filename, const string& jdata) 34 | { 35 | string prefix = filename.substr(0, 4); 36 | 37 | bool wantPass = (prefix == "pass") || (prefix == "roun"); 38 | bool wantFail = (prefix == "fail"); 39 | bool wantRoundTrip = (prefix == "roun"); 40 | assert(wantPass || wantFail); 41 | 42 | UniValue val; 43 | bool testResult = val.read(jdata); 44 | 45 | if (wantPass) { 46 | d_assert(testResult == true); 47 | } else { 48 | d_assert(testResult == false); 49 | } 50 | 51 | if (wantRoundTrip) { 52 | std::string odata = val.write(0, 0); 53 | assert(odata == rtrim(jdata)); 54 | } 55 | } 56 | 57 | static void runtest_file(const char *filename_) 58 | { 59 | string basename(filename_); 60 | string filename = srcdir + "/" + basename; 61 | FILE *f = fopen(filename.c_str(), "r"); 62 | assert(f != NULL); 63 | 64 | string jdata; 65 | 66 | char buf[4096]; 67 | while (!feof(f)) { 68 | int bread = fread(buf, 1, sizeof(buf), f); 69 | assert(!ferror(f)); 70 | 71 | string s(buf, bread); 72 | jdata += s; 73 | } 74 | 75 | assert(!ferror(f)); 76 | fclose(f); 77 | 78 | runtest(basename, jdata); 79 | } 80 | 81 | static const char *filenames[] = { 82 | "fail10.json", 83 | "fail11.json", 84 | "fail12.json", 85 | "fail13.json", 86 | "fail14.json", 87 | "fail15.json", 88 | "fail16.json", 89 | "fail17.json", 90 | //"fail18.json", // investigate 91 | "fail19.json", 92 | "fail1.json", 93 | "fail20.json", 94 | "fail21.json", 95 | "fail22.json", 96 | "fail23.json", 97 | "fail24.json", 98 | "fail25.json", 99 | "fail26.json", 100 | "fail27.json", 101 | "fail28.json", 102 | "fail29.json", 103 | "fail2.json", 104 | "fail30.json", 105 | "fail31.json", 106 | "fail32.json", 107 | "fail33.json", 108 | "fail34.json", 109 | "fail35.json", 110 | "fail36.json", 111 | "fail37.json", 112 | "fail38.json", // invalid unicode: only first half of surrogate pair 113 | "fail39.json", // invalid unicode: only second half of surrogate pair 114 | "fail40.json", // invalid unicode: broken UTF-8 115 | "fail41.json", // invalid unicode: unfinished UTF-8 116 | "fail42.json", // valid json with garbage following a nul byte 117 | "fail44.json", // unterminated string 118 | "fail3.json", 119 | "fail4.json", // extra comma 120 | "fail5.json", 121 | "fail6.json", 122 | "fail7.json", 123 | "fail8.json", 124 | "fail9.json", // extra comma 125 | "pass1.json", 126 | "pass2.json", 127 | "pass3.json", 128 | "round1.json", // round-trip test 129 | "round2.json", // unicode 130 | "round3.json", // bare string 131 | "round4.json", // bare number 132 | "round5.json", // bare true 133 | "round6.json", // bare false 134 | "round7.json", // bare null 135 | }; 136 | 137 | // Test \u handling 138 | void unescape_unicode_test() 139 | { 140 | UniValue val; 141 | bool testResult; 142 | // Escaped ASCII (quote) 143 | testResult = val.read("[\"\\u0022\"]"); 144 | f_assert(testResult); 145 | f_assert(val[0].get_str() == "\""); 146 | // Escaped Basic Plane character, two-byte UTF-8 147 | testResult = val.read("[\"\\u0191\"]"); 148 | f_assert(testResult); 149 | f_assert(val[0].get_str() == "\xc6\x91"); 150 | // Escaped Basic Plane character, three-byte UTF-8 151 | testResult = val.read("[\"\\u2191\"]"); 152 | f_assert(testResult); 153 | f_assert(val[0].get_str() == "\xe2\x86\x91"); 154 | // Escaped Supplementary Plane character U+1d161 155 | testResult = val.read("[\"\\ud834\\udd61\"]"); 156 | f_assert(testResult); 157 | f_assert(val[0].get_str() == "\xf0\x9d\x85\xa1"); 158 | } 159 | 160 | int main (int argc, char *argv[]) 161 | { 162 | for (unsigned int fidx = 0; fidx < ARRAY_SIZE(filenames); fidx++) { 163 | runtest_file(filenames[fidx]); 164 | } 165 | 166 | unescape_unicode_test(); 167 | 168 | return test_failed ? 1 : 0; 169 | } 170 | 171 | -------------------------------------------------------------------------------- /src/univalue/lib/univalue.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2014 BitPay Inc. 2 | // Copyright 2015 Bitcoin Core Developers 3 | // Distributed under the MIT software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "univalue.h" 12 | 13 | using namespace std; 14 | 15 | const UniValue NullUniValue; 16 | 17 | void UniValue::clear() 18 | { 19 | typ = VNULL; 20 | val.clear(); 21 | keys.clear(); 22 | values.clear(); 23 | } 24 | 25 | bool UniValue::setNull() 26 | { 27 | clear(); 28 | return true; 29 | } 30 | 31 | bool UniValue::setBool(bool val_) 32 | { 33 | clear(); 34 | typ = VBOOL; 35 | if (val_) 36 | val = "1"; 37 | return true; 38 | } 39 | 40 | static bool validNumStr(const string& s) 41 | { 42 | string tokenVal; 43 | unsigned int consumed; 44 | enum jtokentype tt = getJsonToken(tokenVal, consumed, s.data(), s.data() + s.size()); 45 | return (tt == JTOK_NUMBER); 46 | } 47 | 48 | bool UniValue::setNumStr(const string& val_) 49 | { 50 | if (!validNumStr(val_)) 51 | return false; 52 | 53 | clear(); 54 | typ = VNUM; 55 | val = val_; 56 | return true; 57 | } 58 | 59 | bool UniValue::setInt(uint64_t val_) 60 | { 61 | ostringstream oss; 62 | 63 | oss << val_; 64 | 65 | return setNumStr(oss.str()); 66 | } 67 | 68 | bool UniValue::setInt(int64_t val_) 69 | { 70 | ostringstream oss; 71 | 72 | oss << val_; 73 | 74 | return setNumStr(oss.str()); 75 | } 76 | 77 | bool UniValue::setFloat(double val_) 78 | { 79 | ostringstream oss; 80 | 81 | oss << std::setprecision(16) << val_; 82 | 83 | bool ret = setNumStr(oss.str()); 84 | typ = VNUM; 85 | return ret; 86 | } 87 | 88 | bool UniValue::setStr(const string& val_) 89 | { 90 | clear(); 91 | typ = VSTR; 92 | val = val_; 93 | return true; 94 | } 95 | 96 | bool UniValue::setArray() 97 | { 98 | clear(); 99 | typ = VARR; 100 | return true; 101 | } 102 | 103 | bool UniValue::setObject() 104 | { 105 | clear(); 106 | typ = VOBJ; 107 | return true; 108 | } 109 | 110 | bool UniValue::push_back(const UniValue& val_) 111 | { 112 | if (typ != VARR) 113 | return false; 114 | 115 | values.push_back(val_); 116 | return true; 117 | } 118 | 119 | bool UniValue::push_backV(const std::vector& vec) 120 | { 121 | if (typ != VARR) 122 | return false; 123 | 124 | values.insert(values.end(), vec.begin(), vec.end()); 125 | 126 | return true; 127 | } 128 | 129 | void UniValue::__pushKV(const std::string& key, const UniValue& val_) 130 | { 131 | keys.push_back(key); 132 | values.push_back(val_); 133 | } 134 | 135 | bool UniValue::pushKV(const std::string& key, const UniValue& val_) 136 | { 137 | if (typ != VOBJ) 138 | return false; 139 | 140 | size_t idx; 141 | if (findKey(key, idx)) 142 | values[idx] = val_; 143 | else 144 | __pushKV(key, val_); 145 | return true; 146 | } 147 | 148 | bool UniValue::pushKVs(const UniValue& obj) 149 | { 150 | if (typ != VOBJ || obj.typ != VOBJ) 151 | return false; 152 | 153 | for (size_t i = 0; i < obj.keys.size(); i++) 154 | __pushKV(obj.keys[i], obj.values.at(i)); 155 | 156 | return true; 157 | } 158 | 159 | void UniValue::getObjMap(std::map& kv) const 160 | { 161 | if (typ != VOBJ) 162 | return; 163 | 164 | kv.clear(); 165 | for (size_t i = 0; i < keys.size(); i++) 166 | kv[keys[i]] = values[i]; 167 | } 168 | 169 | bool UniValue::findKey(const std::string& key, size_t& retIdx) const 170 | { 171 | for (size_t i = 0; i < keys.size(); i++) { 172 | if (keys[i] == key) { 173 | retIdx = i; 174 | return true; 175 | } 176 | } 177 | 178 | return false; 179 | } 180 | 181 | bool UniValue::checkObject(const std::map& t) const 182 | { 183 | if (typ != VOBJ) 184 | return false; 185 | 186 | for (std::map::const_iterator it = t.begin(); 187 | it != t.end(); ++it) { 188 | size_t idx = 0; 189 | if (!findKey(it->first, idx)) 190 | return false; 191 | 192 | if (values.at(idx).getType() != it->second) 193 | return false; 194 | } 195 | 196 | return true; 197 | } 198 | 199 | const UniValue& UniValue::operator[](const std::string& key) const 200 | { 201 | if (typ != VOBJ) 202 | return NullUniValue; 203 | 204 | size_t index = 0; 205 | if (!findKey(key, index)) 206 | return NullUniValue; 207 | 208 | return values.at(index); 209 | } 210 | 211 | const UniValue& UniValue::operator[](size_t index) const 212 | { 213 | if (typ != VOBJ && typ != VARR) 214 | return NullUniValue; 215 | if (index >= values.size()) 216 | return NullUniValue; 217 | 218 | return values.at(index); 219 | } 220 | 221 | const char *uvTypeName(UniValue::VType t) 222 | { 223 | switch (t) { 224 | case UniValue::VNULL: return "null"; 225 | case UniValue::VBOOL: return "bool"; 226 | case UniValue::VOBJ: return "object"; 227 | case UniValue::VARR: return "array"; 228 | case UniValue::VSTR: return "string"; 229 | case UniValue::VNUM: return "number"; 230 | } 231 | 232 | // not reached 233 | return NULL; 234 | } 235 | 236 | const UniValue& find_value(const UniValue& obj, const std::string& name) 237 | { 238 | for (unsigned int i = 0; i < obj.keys.size(); i++) 239 | if (obj.keys[i] == name) 240 | return obj.values.at(i); 241 | 242 | return NullUniValue; 243 | } 244 | 245 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2018 Jonas Schnelli 2 | # Distributed under the MIT software license, see the accompanying 3 | # file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | ACLOCAL_AMFLAGS = -I build-aux/m4 6 | SUBDIRS = src 7 | .PHONY: deploy FORCE 8 | 9 | export PYTHONPATH 10 | 11 | APPNAME=Application 12 | APPNAME_LC=application 13 | 14 | BITCOIN_QT_BIN=$(top_builddir)/src/qt/$(BITCOIN_GUI_NAME)$(EXEEXT) 15 | BITCOIN_WIN_INSTALLER=$(PACKAGE)-$(PACKAGE_VERSION)-win$(WINDOWS_BITS)-setup$(EXEEXT) 16 | 17 | empty := 18 | space := $(empty) $(empty) 19 | 20 | OSX_APP=$(APPNAME).app 21 | OSX_VOLNAME = $(subst $(space),-,$(PACKAGE_NAME)) 22 | OSX_DMG = $(OSX_VOLNAME).dmg 23 | OSX_BACKGROUND_SVG=background.svg 24 | OSX_BACKGROUND_IMAGE=background.tiff 25 | OSX_BACKGROUND_IMAGE_DPIS=36 72 26 | OSX_DSSTORE_GEN=$(top_srcdir)/contrib/macdeploy/custom_dsstore.py 27 | OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus 28 | OSX_FANCY_PLIST=$(top_srcdir)/contrib/macdeploy/fancy.plist 29 | OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/$(APPNAME_LC).icns 30 | OSX_PLIST=$(top_builddir)/share/qt/Info.plist #not installed 31 | OSX_QT_TRANSLATIONS = da,de,es,hu,ru,uk,zh_CN,zh_TW 32 | 33 | WINDOWS_PACKAGING = $(top_srcdir)/share/pixmaps/$(APPNAME_LC).ico \ 34 | $(top_srcdir)/share/pixmaps/nsis-header.bmp \ 35 | $(top_srcdir)/share/pixmaps/nsis-wizard.bmp \ 36 | $(top_srcdir)/doc/README_windows.txt 37 | 38 | OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) \ 39 | $(top_srcdir)/contrib/macdeploy/$(OSX_BACKGROUND_SVG) \ 40 | $(OSX_DSSTORE_GEN) \ 41 | $(top_srcdir)/contrib/macdeploy/detached-sig-apply.sh \ 42 | $(top_srcdir)/contrib/macdeploy/detached-sig-create.sh 43 | 44 | dist-hook: 45 | -$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf - 46 | 47 | $(BITCOIN_WIN_INSTALLER): all-recursive 48 | $(MKDIR_P) $(top_builddir)/release 49 | STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_QT_BIN) $(top_builddir)/release 50 | @test -f $(MAKENSIS) && $(MAKENSIS) -V2 $(top_builddir)/share/setup.nsi || \ 51 | echo error: could not build $@ 52 | @echo built $@ 53 | 54 | $(OSX_APP)/Contents/PkgInfo: 55 | $(MKDIR_P) $(@D) 56 | @echo "APPL????" > $@ 57 | 58 | $(OSX_APP)/Contents/Resources/empty.lproj: 59 | $(MKDIR_P) $(@D) 60 | @touch $@ 61 | 62 | $(OSX_APP)/Contents/Info.plist: $(OSX_PLIST) 63 | $(MKDIR_P) $(@D) 64 | $(INSTALL_DATA) $< $@ 65 | 66 | $(OSX_APP)/Contents/Resources/$(APPNAME_LC).icns: $(OSX_INSTALLER_ICONS) 67 | $(MKDIR_P) $(@D) 68 | $(INSTALL_DATA) $< $@ 69 | 70 | $(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(BITCOIN_QT_BIN) 71 | $(MKDIR_P) $(@D) 72 | STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $< $@ 73 | 74 | $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings: 75 | $(MKDIR_P) $(@D) 76 | echo '{ CFBundleDisplayName = "$(PACKAGE_NAME)"; CFBundleName = "$(PACKAGE_NAME)"; }' > $@ 77 | 78 | OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lproj \ 79 | $(OSX_APP)/Contents/Resources/($APPNAME_LC).icns $(OSX_APP)/Contents/Info.plist \ 80 | $(OSX_APP)/Contents/MacOS/Bitcoin-Qt $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings 81 | 82 | osx_volname: 83 | echo $(OSX_VOLNAME) >$@ 84 | 85 | if BUILD_DARWIN 86 | $(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING) $(OSX_BACKGROUND_IMAGE) 87 | $(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) 88 | 89 | $(OSX_BACKGROUND_IMAGE).png: contrib/macdeploy/$(OSX_BACKGROUND_SVG) 90 | sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d 36 -p 36 -o $@ 91 | $(OSX_BACKGROUND_IMAGE)@2x.png: contrib/macdeploy/$(OSX_BACKGROUND_SVG) 92 | sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d 72 -p 72 -o $@ 93 | $(OSX_BACKGROUND_IMAGE): $(OSX_BACKGROUND_IMAGE).png $(OSX_BACKGROUND_IMAGE)@2x.png 94 | tiffutil -cathidpicheck $^ -out $@ 95 | 96 | deploydir: $(OSX_DMG) 97 | else 98 | APP_DIST_DIR=$(top_builddir)/dist 99 | APP_DIST_EXTRAS=$(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE) $(APP_DIST_DIR)/.DS_Store $(APP_DIST_DIR)/Applications 100 | 101 | $(APP_DIST_DIR)/Applications: 102 | @rm -f $@ 103 | @cd $(@D); $(LN_S) /Applications $(@F) 104 | 105 | $(APP_DIST_EXTRAS): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt 106 | 107 | $(OSX_DMG): $(APP_DIST_EXTRAS) 108 | $(GENISOIMAGE) -no-cache-inodes -D -l -probe -V "$(OSX_VOLNAME)" -no-pad -r -dir-mode 0755 -apple -o $@ dist 109 | 110 | dpi%.$(OSX_BACKGROUND_IMAGE): contrib/macdeploy/$(OSX_BACKGROUND_SVG) 111 | sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d $* -p $* | $(IMAGEMAGICK_CONVERT) - $@ 112 | OSX_BACKGROUND_IMAGE_DPIFILES := $(foreach dpi,$(OSX_BACKGROUND_IMAGE_DPIS),dpi$(dpi).$(OSX_BACKGROUND_IMAGE)) 113 | $(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE): $(OSX_BACKGROUND_IMAGE_DPIFILES) 114 | $(MKDIR_P) $(@D) 115 | $(TIFFCP) -c none $(OSX_BACKGROUND_IMAGE_DPIFILES) $@ 116 | 117 | $(APP_DIST_DIR)/.DS_Store: $(OSX_DSSTORE_GEN) 118 | $(PYTHON) $< "$@" "$(OSX_VOLNAME)" 119 | 120 | $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING) 121 | INSTALLNAMETOOL=$(INSTALLNAMETOOL) OTOOL=$(OTOOL) STRIP=$(STRIP) $(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -translations-dir=$(QT_TRANSLATION_DIR) -add-qt-tr $(OSX_QT_TRANSLATIONS) -verbose 2 122 | 123 | deploydir: $(APP_DIST_EXTRAS) 124 | endif 125 | 126 | if TARGET_DARWIN 127 | appbundle: $(OSX_APP_BUILT) 128 | deploy: $(OSX_DMG) 129 | endif 130 | if TARGET_WINDOWS 131 | deploy: $(BITCOIN_WIN_INSTALLER) 132 | endif 133 | 134 | $(BITCOIN_QT_BIN): FORCE 135 | $(MAKE) -C src qt/$(@F) 136 | 137 | dist_noinst_SCRIPTS = autogen.sh 138 | 139 | CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER) 140 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | dist: trusty 3 | os: linux 4 | language: minimal 5 | cache: 6 | directories: 7 | - depends/built 8 | - depends/sdk-sources 9 | - $HOME/.ccache 10 | env: 11 | global: 12 | - MAKEJOBS=-j3 13 | - RUN_TESTS=false 14 | - CHECK_DOC=0 15 | - BOOST_TEST_RANDOM=1$TRAVIS_BUILD_ID 16 | - CCACHE_SIZE=100M 17 | - CCACHE_TEMPDIR=/tmp/.ccache-temp 18 | - CCACHE_COMPRESS=1 19 | - BASE_OUTDIR=$TRAVIS_BUILD_DIR/out 20 | - SDK_URL=https://bitcoincore.org/depends-sources/sdks 21 | - WINEDEBUG=fixme-all 22 | matrix: 23 | # ARM 24 | - HOST=arm-linux-gnueabihf PACKAGES="g++-arm-linux-gnueabihf python3-pip" DEP_OPTS="NO_QT=1" CHECK_DOC=1 GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports" 25 | # Win32 26 | - HOST=i686-w64-mingw32 DPKG_ADD_ARCH="i386" DEP_OPTS="NO_QT=1" PACKAGES="python3 nsis g++-mingw-w64-i686 wine1.6" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-reduce-exports" 27 | # Qt4 & system libs 28 | - HOST=x86_64-unknown-linux-gnu PACKAGES="python3-zmq qt4-dev-tools libssl-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev libdb5.1++-dev libminiupnpc-dev libzmq3-dev libprotobuf-dev protobuf-compiler libqrencode-dev xvfb" NO_DEPENDS=1 NEED_XVFB=1 RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --enable-glibc-back-compat --enable-reduce-exports --with-gui=qt4 CPPFLAGS=-DDEBUG_LOCKORDER" 29 | # 32-bit + dash 30 | - HOST=i686-pc-linux-gnu PACKAGES="g++-multilib python3-zmq" DEP_OPTS="NO_QT=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-zmq --enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++" USE_SHELL="/bin/dash" 31 | # Win64 32 | - HOST=x86_64-w64-mingw32 DPKG_ADD_ARCH="i386" DEP_OPTS="NO_QT=1" PACKAGES="python3 nsis g++-mingw-w64-x86-64 wine1.6" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-reduce-exports" 33 | # x86_64 Linux (uses qt5 dev package instead of depends Qt to speed up build and avoid timeout) 34 | - HOST=x86_64-unknown-linux-gnu PACKAGES="python3-zmq qtbase5-dev qttools5-dev-tools protobuf-compiler libdbus-1-dev libharfbuzz-dev" DEP_OPTS="NO_QT=1 NO_UPNP=1 DEBUG=1 ALLOW_HOST_PACKAGES=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-zmq --with-gui=qt5 --enable-glibc-back-compat --enable-reduce-exports CPPFLAGS=-DDEBUG_LOCKORDER" 35 | # x86_64 Linux, No wallet 36 | - HOST=x86_64-unknown-linux-gnu PACKAGES="python3" DEP_OPTS="NO_WALLET=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports" 37 | # Cross-Mac 38 | - HOST=x86_64-apple-darwin11 PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python-dev" BITCOIN_CONFIG="--enable-gui --enable-reduce-exports --enable-werror" OSX_SDK=10.11 GOAL="deploy" 39 | 40 | before_install: 41 | - export PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g") 42 | install: 43 | - if [ -n "$DPKG_ADD_ARCH" ]; then sudo dpkg --add-architecture "$DPKG_ADD_ARCH" ; fi 44 | - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get update; fi 45 | - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get install --no-install-recommends --no-upgrade -qq $PACKAGES; fi 46 | - if [ "$CHECK_DOC" = 1 -a "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then travis_retry pip3 install flake8 --user; fi 47 | before_script: 48 | - if [ "$CHECK_DOC" = 1 -a "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then contrib/devtools/commit-script-check.sh $TRAVIS_COMMIT_RANGE; fi 49 | - if [ "$CHECK_DOC" = 1 ]; then contrib/devtools/git-subtree-check.sh src/crypto/ctaes; fi 50 | - if [ "$CHECK_DOC" = 1 ]; then contrib/devtools/git-subtree-check.sh src/secp256k1; fi 51 | - if [ "$CHECK_DOC" = 1 ]; then contrib/devtools/git-subtree-check.sh src/univalue; fi 52 | - if [ "$CHECK_DOC" = 1 ]; then contrib/devtools/git-subtree-check.sh src/leveldb; fi 53 | - if [ "$CHECK_DOC" = 1 ]; then contrib/devtools/check-doc.py; fi 54 | - if [ "$CHECK_DOC" = 1 ]; then contrib/devtools/check-rpc-mappings.py .; fi 55 | - if [ "$CHECK_DOC" = 1 -a "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then contrib/devtools/lint-all.sh; fi 56 | - unset CC; unset CXX 57 | - mkdir -p depends/SDKs depends/sdk-sources 58 | - if [ -n "$OSX_SDK" -a ! -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then curl --location --fail $SDK_URL/MacOSX${OSX_SDK}.sdk.tar.gz -o depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz; fi 59 | - if [ -n "$OSX_SDK" -a -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then tar -C depends/SDKs -xf depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz; fi 60 | - if [ -z "$NO_DEPENDS" ]; then make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS; fi 61 | # Start xvfb if needed, as documented at https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-xvfb-to-Run-Tests-That-Require-a-GUI 62 | - if [ "$NEED_XVFB" = 1 ]; then export DISPLAY=:99.0; /sbin/start-stop-daemon --start --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac; fi 63 | script: 64 | - if [ "$CHECK_DOC" = 1 -a "$TRAVIS_REPO_SLUG" = "bitcoin/bitcoin" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then while read LINE; do travis_retry gpg --keyserver hkp://subset.pool.sks-keyservers.net --recv-keys $LINE; done < contrib/verify-commits/trusted-keys; fi 65 | - if [ "$CHECK_DOC" = 1 -a "$TRAVIS_REPO_SLUG" = "bitcoin/bitcoin" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then git fetch --unshallow; fi 66 | - if [ "$CHECK_DOC" = 1 -a "$TRAVIS_REPO_SLUG" = "bitcoin/bitcoin" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then contrib/verify-commits/verify-commits.sh; fi 67 | - export TRAVIS_COMMIT_LOG=`git log --format=fuller -1` 68 | - if [ -n "$USE_SHELL" ]; then export CONFIG_SHELL="$USE_SHELL"; fi 69 | - OUTDIR=$BASE_OUTDIR/$TRAVIS_PULL_REQUEST/$TRAVIS_JOB_NUMBER-$HOST 70 | - BITCOIN_CONFIG_ALL="--disable-dependency-tracking --prefix=$TRAVIS_BUILD_DIR/depends/$HOST --bindir=$OUTDIR/bin --libdir=$OUTDIR/lib" 71 | - if [ -z "$NO_DEPENDS" ]; then depends/$HOST/native/bin/ccache --max-size=$CCACHE_SIZE; fi 72 | - test -n "$USE_SHELL" && eval '"$USE_SHELL" -c "./autogen.sh"' || ./autogen.sh 73 | - mkdir build && cd build 74 | - ../configure --cache-file=config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( cat config.log && false) 75 | - make distdir VERSION=$HOST 76 | - cd bitcoin-$HOST 77 | - ./configure --cache-file=../config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( cat config.log && false) 78 | - make $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && make $GOAL V=1 ; false ) 79 | - export LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/depends/$HOST/lib 80 | - if [ "$RUN_TESTS" = "true" ]; then travis_wait 30 make $MAKEJOBS check VERBOSE=1; fi 81 | - if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then extended="--extended --exclude pruning,dbcrash"; fi 82 | - if [ "$RUN_TESTS" = "true" ]; then test/functional/test_runner.py --combinedlogslen=4000 --coverage --quiet ${extended}; fi 83 | after_script: 84 | - echo $TRAVIS_COMMIT_RANGE 85 | - echo $TRAVIS_COMMIT_LOG 86 | -------------------------------------------------------------------------------- /share/setup.nsi.in: -------------------------------------------------------------------------------- 1 | Name "@PACKAGE_NAME@ (@WINDOWS_BITS@-bit)" 2 | 3 | RequestExecutionLevel highest 4 | SetCompressor /SOLID lzma 5 | 6 | # General Symbol Definitions 7 | !define REGKEY "SOFTWARE\$(^Name)" 8 | !define VERSION @CLIENT_VERSION_MAJOR@.@CLIENT_VERSION_MINOR@.@CLIENT_VERSION_REVISION@ 9 | !define COMPANY "@PACKAGE_NAME@ project" 10 | !define URL @PACKAGE_URL@ 11 | 12 | # MUI Symbol Definitions 13 | !define MUI_ICON "@abs_top_srcdir@/share/pixmaps/bitcoin.ico" 14 | !define MUI_WELCOMEFINISHPAGE_BITMAP "@abs_top_srcdir@/share/pixmaps/nsis-wizard.bmp" 15 | !define MUI_HEADERIMAGE 16 | !define MUI_HEADERIMAGE_RIGHT 17 | !define MUI_HEADERIMAGE_BITMAP "@abs_top_srcdir@/share/pixmaps/nsis-header.bmp" 18 | !define MUI_FINISHPAGE_NOAUTOCLOSE 19 | !define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM 20 | !define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY} 21 | !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup 22 | !define MUI_STARTMENUPAGE_DEFAULTFOLDER "@PACKAGE_NAME@" 23 | !define MUI_FINISHPAGE_RUN $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@ 24 | !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico" 25 | !define MUI_UNWELCOMEFINISHPAGE_BITMAP "@abs_top_srcdir@/share/pixmaps/nsis-wizard.bmp" 26 | !define MUI_UNFINISHPAGE_NOAUTOCLOSE 27 | 28 | # Included files 29 | !include Sections.nsh 30 | !include MUI2.nsh 31 | !if "@WINDOWS_BITS@" == "64" 32 | !include x64.nsh 33 | !endif 34 | 35 | # Variables 36 | Var StartMenuGroup 37 | 38 | # Installer pages 39 | !insertmacro MUI_PAGE_WELCOME 40 | !insertmacro MUI_PAGE_DIRECTORY 41 | !insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup 42 | !insertmacro MUI_PAGE_INSTFILES 43 | !insertmacro MUI_PAGE_FINISH 44 | !insertmacro MUI_UNPAGE_CONFIRM 45 | !insertmacro MUI_UNPAGE_INSTFILES 46 | 47 | # Installer languages 48 | !insertmacro MUI_LANGUAGE English 49 | 50 | # Installer attributes 51 | OutFile @abs_top_srcdir@/@PACKAGE_TARNAME@-${VERSION}-win@WINDOWS_BITS@-setup.exe 52 | !if "@WINDOWS_BITS@" == "64" 53 | InstallDir $PROGRAMFILES64\Bitcoin 54 | !else 55 | InstallDir $PROGRAMFILES\Bitcoin 56 | !endif 57 | CRCCheck on 58 | XPStyle on 59 | BrandingText " " 60 | ShowInstDetails show 61 | VIProductVersion ${VERSION}.@CLIENT_VERSION_BUILD@ 62 | VIAddVersionKey ProductName "@PACKAGE_NAME@" 63 | VIAddVersionKey ProductVersion "${VERSION}" 64 | VIAddVersionKey CompanyName "${COMPANY}" 65 | VIAddVersionKey CompanyWebsite "${URL}" 66 | VIAddVersionKey FileVersion "${VERSION}" 67 | VIAddVersionKey FileDescription "" 68 | VIAddVersionKey LegalCopyright "" 69 | InstallDirRegKey HKCU "${REGKEY}" Path 70 | ShowUninstDetails show 71 | 72 | # Installer sections 73 | Section -Main SEC0000 74 | SetOutPath $INSTDIR 75 | SetOverwrite on 76 | File @abs_top_srcdir@/release/@BITCOIN_GUI_NAME@@EXEEXT@ 77 | File /oname=COPYING.txt @abs_top_srcdir@/COPYING 78 | File /oname=readme.txt @abs_top_srcdir@/doc/README_windows.txt 79 | SetOutPath $INSTDIR\daemon 80 | File @abs_top_srcdir@/release/@BITCOIN_DAEMON_NAME@@EXEEXT@ 81 | File @abs_top_srcdir@/release/@BITCOIN_CLI_NAME@@EXEEXT@ 82 | SetOutPath $INSTDIR\doc 83 | File /r @abs_top_srcdir@/doc\*.* 84 | SetOutPath $INSTDIR 85 | WriteRegStr HKCU "${REGKEY}\Components" Main 1 86 | SectionEnd 87 | 88 | Section -post SEC0001 89 | WriteRegStr HKCU "${REGKEY}" Path $INSTDIR 90 | SetOutPath $INSTDIR 91 | WriteUninstaller $INSTDIR\uninstall.exe 92 | !insertmacro MUI_STARTMENU_WRITE_BEGIN Application 93 | CreateDirectory $SMPROGRAMS\$StartMenuGroup 94 | CreateShortcut "$SMPROGRAMS\$StartMenuGroup\$(^Name).lnk" $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@ 95 | CreateShortcut "$SMPROGRAMS\$StartMenuGroup\@PACKAGE_NAME@ (testnet, @WINDOWS_BITS@-bit).lnk" "$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" "-testnet" "$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" 1 96 | CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk" $INSTDIR\uninstall.exe 97 | !insertmacro MUI_STARTMENU_WRITE_END 98 | WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)" 99 | WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayVersion "${VERSION}" 100 | WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" Publisher "${COMPANY}" 101 | WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" URLInfoAbout "${URL}" 102 | WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\uninstall.exe 103 | WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\uninstall.exe 104 | WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1 105 | WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1 106 | WriteRegStr HKCR "@PACKAGE_TARNAME@" "URL Protocol" "" 107 | WriteRegStr HKCR "@PACKAGE_TARNAME@" "" "URL:Bitcoin" 108 | WriteRegStr HKCR "@PACKAGE_TARNAME@\DefaultIcon" "" $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@ 109 | WriteRegStr HKCR "@PACKAGE_TARNAME@\shell\open\command" "" '"$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" "%1"' 110 | SectionEnd 111 | 112 | # Macro for selecting uninstaller sections 113 | !macro SELECT_UNSECTION SECTION_NAME UNSECTION_ID 114 | Push $R0 115 | ReadRegStr $R0 HKCU "${REGKEY}\Components" "${SECTION_NAME}" 116 | StrCmp $R0 1 0 next${UNSECTION_ID} 117 | !insertmacro SelectSection "${UNSECTION_ID}" 118 | GoTo done${UNSECTION_ID} 119 | next${UNSECTION_ID}: 120 | !insertmacro UnselectSection "${UNSECTION_ID}" 121 | done${UNSECTION_ID}: 122 | Pop $R0 123 | !macroend 124 | 125 | # Uninstaller sections 126 | Section /o -un.Main UNSEC0000 127 | Delete /REBOOTOK $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@ 128 | Delete /REBOOTOK $INSTDIR\COPYING.txt 129 | Delete /REBOOTOK $INSTDIR\readme.txt 130 | RMDir /r /REBOOTOK $INSTDIR\daemon 131 | RMDir /r /REBOOTOK $INSTDIR\doc 132 | DeleteRegValue HKCU "${REGKEY}\Components" Main 133 | SectionEnd 134 | 135 | Section -un.post UNSEC0001 136 | DeleteRegKey HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" 137 | Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk" 138 | Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\$(^Name).lnk" 139 | Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\@PACKAGE_NAME@ (testnet, @WINDOWS_BITS@-bit).lnk" 140 | Delete /REBOOTOK "$SMSTARTUP\Bitcoin.lnk" 141 | Delete /REBOOTOK $INSTDIR\uninstall.exe 142 | Delete /REBOOTOK $INSTDIR\debug.log 143 | Delete /REBOOTOK $INSTDIR\db.log 144 | DeleteRegValue HKCU "${REGKEY}" StartMenuGroup 145 | DeleteRegValue HKCU "${REGKEY}" Path 146 | DeleteRegKey /IfEmpty HKCU "${REGKEY}\Components" 147 | DeleteRegKey /IfEmpty HKCU "${REGKEY}" 148 | DeleteRegKey HKCR "@PACKAGE_TARNAME@" 149 | RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup 150 | RmDir /REBOOTOK $INSTDIR 151 | Push $R0 152 | StrCpy $R0 $StartMenuGroup 1 153 | StrCmp $R0 ">" no_smgroup 154 | no_smgroup: 155 | Pop $R0 156 | SectionEnd 157 | 158 | # Installer functions 159 | Function .onInit 160 | InitPluginsDir 161 | !if "@WINDOWS_BITS@" == "64" 162 | ${If} ${RunningX64} 163 | ; disable registry redirection (enable access to 64-bit portion of registry) 164 | SetRegView 64 165 | ${Else} 166 | MessageBox MB_OK|MB_ICONSTOP "Cannot install 64-bit version on a 32-bit system." 167 | Abort 168 | ${EndIf} 169 | !endif 170 | FunctionEnd 171 | 172 | # Uninstaller functions 173 | Function un.onInit 174 | ReadRegStr $INSTDIR HKCU "${REGKEY}" Path 175 | !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup 176 | !insertmacro SELECT_UNSECTION Main ${UNSEC0000} 177 | FunctionEnd 178 | -------------------------------------------------------------------------------- /src/univalue/include/univalue.h: -------------------------------------------------------------------------------- 1 | // Copyright 2014 BitPay Inc. 2 | // Copyright 2015 Bitcoin Core Developers 3 | // Distributed under the MIT software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | #ifndef __UNIVALUE_H__ 7 | #define __UNIVALUE_H__ 8 | 9 | #include 10 | #include 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #include // .get_int64() 18 | #include // std::pair 19 | 20 | class UniValue { 21 | public: 22 | enum VType { VNULL, VOBJ, VARR, VSTR, VNUM, VBOOL, }; 23 | 24 | UniValue() { typ = VNULL; } 25 | UniValue(UniValue::VType initialType, const std::string& initialStr = "") { 26 | typ = initialType; 27 | val = initialStr; 28 | } 29 | UniValue(uint64_t val_) { 30 | setInt(val_); 31 | } 32 | UniValue(int64_t val_) { 33 | setInt(val_); 34 | } 35 | UniValue(bool val_) { 36 | setBool(val_); 37 | } 38 | UniValue(int val_) { 39 | setInt(val_); 40 | } 41 | UniValue(double val_) { 42 | setFloat(val_); 43 | } 44 | UniValue(const std::string& val_) { 45 | setStr(val_); 46 | } 47 | UniValue(const char *val_) { 48 | std::string s(val_); 49 | setStr(s); 50 | } 51 | ~UniValue() {} 52 | 53 | void clear(); 54 | 55 | bool setNull(); 56 | bool setBool(bool val); 57 | bool setNumStr(const std::string& val); 58 | bool setInt(uint64_t val); 59 | bool setInt(int64_t val); 60 | bool setInt(int val_) { return setInt((int64_t)val_); } 61 | bool setFloat(double val); 62 | bool setStr(const std::string& val); 63 | bool setArray(); 64 | bool setObject(); 65 | 66 | enum VType getType() const { return typ; } 67 | const std::string& getValStr() const { return val; } 68 | bool empty() const { return (values.size() == 0); } 69 | 70 | size_t size() const { return values.size(); } 71 | 72 | bool getBool() const { return isTrue(); } 73 | void getObjMap(std::map& kv) const; 74 | bool checkObject(const std::map& memberTypes) const; 75 | const UniValue& operator[](const std::string& key) const; 76 | const UniValue& operator[](size_t index) const; 77 | bool exists(const std::string& key) const { size_t i; return findKey(key, i); } 78 | 79 | bool isNull() const { return (typ == VNULL); } 80 | bool isTrue() const { return (typ == VBOOL) && (val == "1"); } 81 | bool isFalse() const { return (typ == VBOOL) && (val != "1"); } 82 | bool isBool() const { return (typ == VBOOL); } 83 | bool isStr() const { return (typ == VSTR); } 84 | bool isNum() const { return (typ == VNUM); } 85 | bool isArray() const { return (typ == VARR); } 86 | bool isObject() const { return (typ == VOBJ); } 87 | 88 | bool push_back(const UniValue& val); 89 | bool push_back(const std::string& val_) { 90 | UniValue tmpVal(VSTR, val_); 91 | return push_back(tmpVal); 92 | } 93 | bool push_back(const char *val_) { 94 | std::string s(val_); 95 | return push_back(s); 96 | } 97 | bool push_back(uint64_t val_) { 98 | UniValue tmpVal(val_); 99 | return push_back(tmpVal); 100 | } 101 | bool push_back(int64_t val_) { 102 | UniValue tmpVal(val_); 103 | return push_back(tmpVal); 104 | } 105 | bool push_back(int val_) { 106 | UniValue tmpVal(val_); 107 | return push_back(tmpVal); 108 | } 109 | bool push_back(double val_) { 110 | UniValue tmpVal(val_); 111 | return push_back(tmpVal); 112 | } 113 | bool push_backV(const std::vector& vec); 114 | 115 | void __pushKV(const std::string& key, const UniValue& val); 116 | bool pushKV(const std::string& key, const UniValue& val); 117 | bool pushKV(const std::string& key, const std::string& val_) { 118 | UniValue tmpVal(VSTR, val_); 119 | return pushKV(key, tmpVal); 120 | } 121 | bool pushKV(const std::string& key, const char *val_) { 122 | std::string _val(val_); 123 | return pushKV(key, _val); 124 | } 125 | bool pushKV(const std::string& key, int64_t val_) { 126 | UniValue tmpVal(val_); 127 | return pushKV(key, tmpVal); 128 | } 129 | bool pushKV(const std::string& key, uint64_t val_) { 130 | UniValue tmpVal(val_); 131 | return pushKV(key, tmpVal); 132 | } 133 | bool pushKV(const std::string& key, bool val_) { 134 | UniValue tmpVal((bool)val_); 135 | return pushKV(key, tmpVal); 136 | } 137 | bool pushKV(const std::string& key, int val_) { 138 | UniValue tmpVal((int64_t)val_); 139 | return pushKV(key, tmpVal); 140 | } 141 | bool pushKV(const std::string& key, double val_) { 142 | UniValue tmpVal(val_); 143 | return pushKV(key, tmpVal); 144 | } 145 | bool pushKVs(const UniValue& obj); 146 | 147 | std::string write(unsigned int prettyIndent = 0, 148 | unsigned int indentLevel = 0) const; 149 | 150 | bool read(const char *raw, size_t len); 151 | bool read(const char *raw) { return read(raw, strlen(raw)); } 152 | bool read(const std::string& rawStr) { 153 | return read(rawStr.data(), rawStr.size()); 154 | } 155 | 156 | private: 157 | UniValue::VType typ; 158 | std::string val; // numbers are stored as C++ strings 159 | std::vector keys; 160 | std::vector values; 161 | 162 | bool findKey(const std::string& key, size_t& retIdx) const; 163 | void writeArray(unsigned int prettyIndent, unsigned int indentLevel, std::string& s) const; 164 | void writeObject(unsigned int prettyIndent, unsigned int indentLevel, std::string& s) const; 165 | 166 | public: 167 | // Strict type-specific getters, these throw std::runtime_error if the 168 | // value is of unexpected type 169 | const std::vector& getKeys() const; 170 | const std::vector& getValues() const; 171 | bool get_bool() const; 172 | const std::string& get_str() const; 173 | int get_int() const; 174 | int64_t get_int64() const; 175 | double get_real() const; 176 | const UniValue& get_obj() const; 177 | const UniValue& get_array() const; 178 | 179 | enum VType type() const { return getType(); } 180 | bool push_back(std::pair pear) { 181 | return pushKV(pear.first, pear.second); 182 | } 183 | friend const UniValue& find_value( const UniValue& obj, const std::string& name); 184 | }; 185 | 186 | // 187 | // The following were added for compatibility with json_spirit. 188 | // Most duplicate other methods, and should be removed. 189 | // 190 | static inline std::pair Pair(const char *cKey, const char *cVal) 191 | { 192 | std::string key(cKey); 193 | UniValue uVal(cVal); 194 | return std::make_pair(key, uVal); 195 | } 196 | 197 | static inline std::pair Pair(const char *cKey, std::string strVal) 198 | { 199 | std::string key(cKey); 200 | UniValue uVal(strVal); 201 | return std::make_pair(key, uVal); 202 | } 203 | 204 | static inline std::pair Pair(const char *cKey, uint64_t u64Val) 205 | { 206 | std::string key(cKey); 207 | UniValue uVal(u64Val); 208 | return std::make_pair(key, uVal); 209 | } 210 | 211 | static inline std::pair Pair(const char *cKey, int64_t i64Val) 212 | { 213 | std::string key(cKey); 214 | UniValue uVal(i64Val); 215 | return std::make_pair(key, uVal); 216 | } 217 | 218 | static inline std::pair Pair(const char *cKey, bool iVal) 219 | { 220 | std::string key(cKey); 221 | UniValue uVal(iVal); 222 | return std::make_pair(key, uVal); 223 | } 224 | 225 | static inline std::pair Pair(const char *cKey, int iVal) 226 | { 227 | std::string key(cKey); 228 | UniValue uVal(iVal); 229 | return std::make_pair(key, uVal); 230 | } 231 | 232 | static inline std::pair Pair(const char *cKey, double dVal) 233 | { 234 | std::string key(cKey); 235 | UniValue uVal(dVal); 236 | return std::make_pair(key, uVal); 237 | } 238 | 239 | static inline std::pair Pair(const char *cKey, const UniValue& uVal) 240 | { 241 | std::string key(cKey); 242 | return std::make_pair(key, uVal); 243 | } 244 | 245 | static inline std::pair Pair(std::string key, const UniValue& uVal) 246 | { 247 | return std::make_pair(key, uVal); 248 | } 249 | 250 | enum jtokentype { 251 | JTOK_ERR = -1, 252 | JTOK_NONE = 0, // eof 253 | JTOK_OBJ_OPEN, 254 | JTOK_OBJ_CLOSE, 255 | JTOK_ARR_OPEN, 256 | JTOK_ARR_CLOSE, 257 | JTOK_COLON, 258 | JTOK_COMMA, 259 | JTOK_KW_NULL, 260 | JTOK_KW_TRUE, 261 | JTOK_KW_FALSE, 262 | JTOK_NUMBER, 263 | JTOK_STRING, 264 | }; 265 | 266 | extern enum jtokentype getJsonToken(std::string& tokenVal, 267 | unsigned int& consumed, const char *raw, const char *end); 268 | extern const char *uvTypeName(UniValue::VType t); 269 | 270 | static inline bool jsonTokenIsValue(enum jtokentype jtt) 271 | { 272 | switch (jtt) { 273 | case JTOK_KW_NULL: 274 | case JTOK_KW_TRUE: 275 | case JTOK_KW_FALSE: 276 | case JTOK_NUMBER: 277 | case JTOK_STRING: 278 | return true; 279 | 280 | default: 281 | return false; 282 | } 283 | 284 | // not reached 285 | } 286 | 287 | static inline bool json_isspace(int ch) 288 | { 289 | switch (ch) { 290 | case 0x20: 291 | case 0x09: 292 | case 0x0a: 293 | case 0x0d: 294 | return true; 295 | 296 | default: 297 | return false; 298 | } 299 | 300 | // not reached 301 | } 302 | 303 | extern const UniValue NullUniValue; 304 | 305 | const UniValue& find_value( const UniValue& obj, const std::string& name); 306 | 307 | #endif // __UNIVALUE_H__ 308 | -------------------------------------------------------------------------------- /depends/packages/qt.mk: -------------------------------------------------------------------------------- 1 | PACKAGE=qt 2 | $(package)_version=5.7.1 3 | $(package)_download_path=http://download.qt.io/official_releases/qt/5.7/$($(package)_version)/submodules 4 | $(package)_suffix=opensource-src-$($(package)_version).tar.gz 5 | $(package)_file_name=qtbase-$($(package)_suffix) 6 | $(package)_sha256_hash=95f83e532d23b3ddbde7973f380ecae1bac13230340557276f75f2e37984e410 7 | $(package)_dependencies=openssl zlib 8 | $(package)_linux_dependencies=freetype fontconfig libxcb libX11 xproto libXext 9 | $(package)_build_subdir=qtbase 10 | $(package)_qt_libs=corelib network widgets gui plugins testlib 11 | $(package)_patches=mac-qmake.conf mingw-uuidof.patch pidlist_absolute.patch fix-xcb-include-order.patch fix_qt_pkgconfig.patch 12 | 13 | $(package)_qttranslations_file_name=qttranslations-$($(package)_suffix) 14 | $(package)_qttranslations_sha256_hash=3a15aebd523c6d89fb97b2d3df866c94149653a26d27a00aac9b6d3020bc5a1d 15 | 16 | 17 | $(package)_qttools_file_name=qttools-$($(package)_suffix) 18 | $(package)_qttools_sha256_hash=22d67de915cb8cd93e16fdd38fa006224ad9170bd217c2be1e53045a8dd02f0f 19 | 20 | $(package)_extra_sources = $($(package)_qttranslations_file_name) 21 | $(package)_extra_sources += $($(package)_qttools_file_name) 22 | 23 | define $(package)_set_vars 24 | $(package)_config_opts_release = -release 25 | $(package)_config_opts_debug = -debug 26 | $(package)_config_opts += -bindir $(build_prefix)/bin 27 | $(package)_config_opts += -c++std c++11 28 | $(package)_config_opts += -confirm-license 29 | $(package)_config_opts += -dbus-runtime 30 | $(package)_config_opts += -hostprefix $(build_prefix) 31 | $(package)_config_opts += -no-alsa 32 | $(package)_config_opts += -no-audio-backend 33 | $(package)_config_opts += -no-cups 34 | $(package)_config_opts += -no-egl 35 | $(package)_config_opts += -no-eglfs 36 | $(package)_config_opts += -no-feature-style-windowsmobile 37 | $(package)_config_opts += -no-feature-style-windowsce 38 | $(package)_config_opts += -no-freetype 39 | $(package)_config_opts += -no-gif 40 | $(package)_config_opts += -no-glib 41 | $(package)_config_opts += -no-gstreamer 42 | $(package)_config_opts += -no-icu 43 | $(package)_config_opts += -no-iconv 44 | $(package)_config_opts += -no-kms 45 | $(package)_config_opts += -no-linuxfb 46 | $(package)_config_opts += -no-libudev 47 | $(package)_config_opts += -no-mitshm 48 | $(package)_config_opts += -no-mtdev 49 | $(package)_config_opts += -no-pulseaudio 50 | $(package)_config_opts += -no-openvg 51 | $(package)_config_opts += -no-reduce-relocations 52 | $(package)_config_opts += -no-qml-debug 53 | $(package)_config_opts += -no-sql-db2 54 | $(package)_config_opts += -no-sql-ibase 55 | $(package)_config_opts += -no-sql-oci 56 | $(package)_config_opts += -no-sql-tds 57 | $(package)_config_opts += -no-sql-mysql 58 | $(package)_config_opts += -no-sql-odbc 59 | $(package)_config_opts += -no-sql-psql 60 | $(package)_config_opts += -no-sql-sqlite 61 | $(package)_config_opts += -no-sql-sqlite2 62 | $(package)_config_opts += -no-use-gold-linker 63 | $(package)_config_opts += -no-xinput2 64 | $(package)_config_opts += -no-xrender 65 | $(package)_config_opts += -nomake examples 66 | $(package)_config_opts += -nomake tests 67 | $(package)_config_opts += -opensource 68 | $(package)_config_opts += -openssl-linked 69 | $(package)_config_opts += -optimized-qmake 70 | $(package)_config_opts += -pch 71 | $(package)_config_opts += -pkg-config 72 | $(package)_config_opts += -prefix $(host_prefix) 73 | $(package)_config_opts += -qt-libpng 74 | $(package)_config_opts += -qt-libjpeg 75 | $(package)_config_opts += -qt-pcre 76 | $(package)_config_opts += -system-zlib 77 | $(package)_config_opts += -reduce-exports 78 | $(package)_config_opts += -static 79 | $(package)_config_opts += -silent 80 | $(package)_config_opts += -v 81 | $(package)_config_opts += -no-feature-printer 82 | $(package)_config_opts += -no-feature-printdialog 83 | 84 | ifneq ($(build_os),darwin) 85 | $(package)_config_opts_darwin = -xplatform macx-clang-linux 86 | $(package)_config_opts_darwin += -device-option MAC_SDK_PATH=$(OSX_SDK) 87 | $(package)_config_opts_darwin += -device-option MAC_SDK_VERSION=$(OSX_SDK_VERSION) 88 | $(package)_config_opts_darwin += -device-option CROSS_COMPILE="$(host)-" 89 | $(package)_config_opts_darwin += -device-option MAC_MIN_VERSION=$(OSX_MIN_VERSION) 90 | $(package)_config_opts_darwin += -device-option MAC_TARGET=$(host) 91 | $(package)_config_opts_darwin += -device-option MAC_LD64_VERSION=$(LD64_VERSION) 92 | endif 93 | 94 | $(package)_config_opts_linux = -qt-xkbcommon 95 | $(package)_config_opts_linux += -qt-xcb 96 | $(package)_config_opts_linux += -system-freetype 97 | $(package)_config_opts_linux += -no-sm 98 | $(package)_config_opts_linux += -fontconfig 99 | $(package)_config_opts_linux += -no-opengl 100 | $(package)_config_opts_arm_linux = -platform linux-g++ -xplatform $(host) 101 | $(package)_config_opts_i686_linux = -xplatform linux-g++-32 102 | $(package)_config_opts_mingw32 = -no-opengl -xplatform win32-g++ -device-option CROSS_COMPILE="$(host)-" 103 | $(package)_build_env = QT_RCC_TEST=1 104 | endef 105 | 106 | define $(package)_fetch_cmds 107 | $(call fetch_file,$(package),$($(package)_download_path),$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash)) && \ 108 | $(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttranslations_file_name),$($(package)_qttranslations_file_name),$($(package)_qttranslations_sha256_hash)) && \ 109 | $(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttools_file_name),$($(package)_qttools_file_name),$($(package)_qttools_sha256_hash)) 110 | endef 111 | 112 | define $(package)_extract_cmds 113 | mkdir -p $($(package)_extract_dir) && \ 114 | echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \ 115 | echo "$($(package)_qttranslations_sha256_hash) $($(package)_source_dir)/$($(package)_qttranslations_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ 116 | echo "$($(package)_qttools_sha256_hash) $($(package)_source_dir)/$($(package)_qttools_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ 117 | $(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \ 118 | mkdir qtbase && \ 119 | tar --strip-components=1 -xf $($(package)_source) -C qtbase && \ 120 | mkdir qttranslations && \ 121 | tar --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttranslations_file_name) -C qttranslations && \ 122 | mkdir qttools && \ 123 | tar --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttools_file_name) -C qttools 124 | endef 125 | 126 | 127 | define $(package)_preprocess_cmds 128 | sed -i.old "s|updateqm.commands = \$$$$\$$$$LRELEASE|updateqm.commands = $($(package)_extract_dir)/qttools/bin/lrelease|" qttranslations/translations/translations.pro && \ 129 | sed -i.old "/updateqm.depends =/d" qttranslations/translations/translations.pro && \ 130 | sed -i.old "s/src_plugins.depends = src_sql src_xml src_network/src_plugins.depends = src_xml src_network/" qtbase/src/src.pro && \ 131 | sed -i.old "s|X11/extensions/XIproto.h|X11/X.h|" qtbase/src/plugins/platforms/xcb/qxcbxsettings.cpp && \ 132 | sed -i.old 's/if \[ "$$$$XPLATFORM_MAC" = "yes" \]; then xspecvals=$$$$(macSDKify/if \[ "$$$$BUILD_ON_MAC" = "yes" \]; then xspecvals=$$$$(macSDKify/' qtbase/configure && \ 133 | sed -i.old 's/CGEventCreateMouseEvent(0, kCGEventMouseMoved, pos, 0)/CGEventCreateMouseEvent(0, kCGEventMouseMoved, pos, kCGMouseButtonLeft)/' qtbase/src/plugins/platforms/cocoa/qcocoacursor.mm && \ 134 | mkdir -p qtbase/mkspecs/macx-clang-linux &&\ 135 | cp -f qtbase/mkspecs/macx-clang/Info.plist.lib qtbase/mkspecs/macx-clang-linux/ &&\ 136 | cp -f qtbase/mkspecs/macx-clang/Info.plist.app qtbase/mkspecs/macx-clang-linux/ &&\ 137 | cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\ 138 | cp -f $($(package)_patch_dir)/mac-qmake.conf qtbase/mkspecs/macx-clang-linux/qmake.conf && \ 139 | patch -p1 < $($(package)_patch_dir)/mingw-uuidof.patch && \ 140 | patch -p1 < $($(package)_patch_dir)/pidlist_absolute.patch && \ 141 | patch -p1 < $($(package)_patch_dir)/fix-xcb-include-order.patch && \ 142 | patch -p1 < $($(package)_patch_dir)/fix_qt_pkgconfig.patch && \ 143 | echo "!host_build: QMAKE_CFLAGS += $($(package)_cflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ 144 | echo "!host_build: QMAKE_CXXFLAGS += $($(package)_cxxflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ 145 | echo "!host_build: QMAKE_LFLAGS += $($(package)_ldflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ 146 | sed -i.old "s|QMAKE_CFLAGS = |!host_build: QMAKE_CFLAGS = $($(package)_cflags) $($(package)_cppflags) |" qtbase/mkspecs/win32-g++/qmake.conf && \ 147 | sed -i.old "s|QMAKE_LFLAGS = |!host_build: QMAKE_LFLAGS = $($(package)_ldflags) |" qtbase/mkspecs/win32-g++/qmake.conf && \ 148 | sed -i.old "s|QMAKE_CXXFLAGS = |!host_build: QMAKE_CXXFLAGS = $($(package)_cxxflags) $($(package)_cppflags) |" qtbase/mkspecs/win32-g++/qmake.conf 149 | 150 | endef 151 | 152 | define $(package)_config_cmds 153 | export PKG_CONFIG_SYSROOT_DIR=/ && \ 154 | export PKG_CONFIG_LIBDIR=$(host_prefix)/lib/pkgconfig && \ 155 | export PKG_CONFIG_PATH=$(host_prefix)/share/pkgconfig && \ 156 | ./configure $($(package)_config_opts) && \ 157 | echo "host_build: QT_CONFIG ~= s/system-zlib/zlib" >> mkspecs/qconfig.pri && \ 158 | echo "CONFIG += force_bootstrap" >> mkspecs/qconfig.pri && \ 159 | $(MAKE) sub-src-clean && \ 160 | cd ../qttranslations && ../qtbase/bin/qmake qttranslations.pro -o Makefile && \ 161 | cd translations && ../../qtbase/bin/qmake translations.pro -o Makefile && cd ../.. &&\ 162 | cd qttools/src/linguist/lrelease/ && ../../../../qtbase/bin/qmake lrelease.pro -o Makefile 163 | endef 164 | 165 | define $(package)_build_cmds 166 | $(MAKE) -C src $(addprefix sub-,$($(package)_qt_libs)) && \ 167 | $(MAKE) -C ../qttools/src/linguist/lrelease && \ 168 | $(MAKE) -C ../qttranslations 169 | endef 170 | 171 | define $(package)_stage_cmds 172 | $(MAKE) -C src INSTALL_ROOT=$($(package)_staging_dir) $(addsuffix -install_subtargets,$(addprefix sub-,$($(package)_qt_libs))) && cd .. &&\ 173 | $(MAKE) -C qttools/src/linguist/lrelease INSTALL_ROOT=$($(package)_staging_dir) install_target && \ 174 | $(MAKE) -C qttranslations INSTALL_ROOT=$($(package)_staging_dir) install_subtargets && \ 175 | if `test -f qtbase/src/plugins/platforms/xcb/xcb-static/libxcb-static.a`; then \ 176 | cp qtbase/src/plugins/platforms/xcb/xcb-static/libxcb-static.a $($(package)_staging_prefix_dir)/lib; \ 177 | fi 178 | endef 179 | 180 | define $(package)_postprocess_cmds 181 | rm -rf native/mkspecs/ native/lib/ lib/cmake/ && \ 182 | rm -f lib/lib*.la lib/*.prl plugins/*/*.prl 183 | endef 184 | -------------------------------------------------------------------------------- /share/pixmaps/bitcoin64.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char *bitcoin__[] = { 3 | /* columns rows colors chars-per-pixel */ 4 | "64 64 172 2", 5 | " c #8F6319", 6 | ". c #8F6A1A", 7 | "X c #90651A", 8 | "o c #916C1A", 9 | "O c #AF7C1E", 10 | "+ c #B1781E", 11 | "@ c #9A7026", 12 | "# c #AC801F", 13 | "$ c #B1811F", 14 | "% c #A9812B", 15 | "& c #B08320", 16 | "* c #BB8621", 17 | "= c #BD8E22", 18 | "- c #A58132", 19 | "; c #FC8400", 20 | ": c #FD8A03", 21 | "> c #FD8E0C", 22 | ", c #FF910E", 23 | "< c #F98F14", 24 | "1 c #F79117", 25 | "2 c #FD9314", 26 | "3 c #FC951B", 27 | "4 c #FE9A1D", 28 | "5 c #CA8E22", 29 | "6 c #CC8E2A", 30 | "7 c #D48D23", 31 | "8 c #C39223", 32 | "9 c #CE9925", 33 | "0 c #D19C25", 34 | "q c #D19329", 35 | "w c #D5992B", 36 | "e c #DD9D33", 37 | "r c #D69F3C", 38 | "t c #E29425", 39 | "y c #E79925", 40 | "u c #EA9926", 41 | "i c #E69A2C", 42 | "p c #F79625", 43 | "a c #F99524", 44 | "s c #F79825", 45 | "d c #F89825", 46 | "f c #F3962A", 47 | "g c #F69B2C", 48 | "h c #F89B2B", 49 | "j c #E19F30", 50 | "k c #EE9B34", 51 | "l c #F49D33", 52 | "z c #F99E32", 53 | "x c #F39F3B", 54 | "c c #DFA731", 55 | "v c #D7A43D", 56 | "b c #DCA63C", 57 | "n c #EEA328", 58 | "m c #FFA225", 59 | "M c #FFAB26", 60 | "N c #F3A529", 61 | "B c #FEA429", 62 | "V c #F4AB2A", 63 | "C c #FFAC2A", 64 | "Z c #FFB325", 65 | "A c #FFB42C", 66 | "S c #FFBB2D", 67 | "D c #E3A335", 68 | "F c #E5A438", 69 | "G c #EDA03D", 70 | "H c #F7A037", 71 | "J c #FAA135", 72 | "K c #F3AB31", 73 | "L c #FEAB31", 74 | "P c #F4A13C", 75 | "I c #F9A33B", 76 | "U c #FDB432", 77 | "Y c #FFBF37", 78 | "T c #FFC12F", 79 | "R c #FFC230", 80 | "E c #FFC03E", 81 | "W c #DFAF41", 82 | "Q c #ECA34D", 83 | "! c #EDA84E", 84 | "~ c #F2A343", 85 | "^ c #FAA642", 86 | "/ c #FAA846", 87 | "( c #F1A74C", 88 | ") c #F6A94F", 89 | "_ c #FAAA4A", 90 | "` c #E7A451", 91 | "' c #ECA754", 92 | "] c #EFAA56", 93 | "[ c #ECAC5B", 94 | "{ c #F3AA52", 95 | "} c #FCAE52", 96 | "| c #FBB056", 97 | " . c #FBB25C", 98 | ".. c #E7AB61", 99 | "X. c #ECB067", 100 | "o. c #E7B36D", 101 | "O. c #EBB36C", 102 | "+. c #F2B163", 103 | "@. c #FCB460", 104 | "#. c #F0B56B", 105 | "$. c #E3B274", 106 | "%. c #EDB672", 107 | "&. c #EDB877", 108 | "*. c #E2B57C", 109 | "=. c #ECB97B", 110 | "-. c #E4BA83", 111 | ";. c #EBBD83", 112 | ":. c #E7BF8D", 113 | ">. c #EBBD88", 114 | ",. c #E9C08C", 115 | "<. c #E7C496", 116 | "1. c #EBC393", 117 | "2. c #EBC997", 118 | "3. c #E7C49A", 119 | "4. c #E9C69A", 120 | "5. c #E3CA9D", 121 | "6. c #E9C89E", 122 | "7. c #DCC9AE", 123 | "8. c #DDCBB2", 124 | "9. c #E3C7A2", 125 | "0. c #E5CAA3", 126 | "q. c #E9CBA3", 127 | "w. c #E5CEAB", 128 | "e. c #E8CEAA", 129 | "r. c #E4D4AC", 130 | "t. c #EBD2AF", 131 | "y. c #E7CFB2", 132 | "u. c #E1D4B4", 133 | "i. c #E8D5B6", 134 | "p. c #E5D7BB", 135 | "a. c #E9D6BB", 136 | "s. c #E5D8B9", 137 | "d. c #EAD8BE", 138 | "f. c #F0D6B4", 139 | "g. c #DFDFC6", 140 | "h. c #E3D6C1", 141 | "j. c #E9D7C0", 142 | "k. c #E6DAC5", 143 | "l. c #EBDCC7", 144 | "z. c #E5DCCA", 145 | "x. c #EADEC9", 146 | "c. c #E8DFD0", 147 | "v. c #D7E2D9", 148 | "b. c #E3E0C9", 149 | "n. c #EEE2CB", 150 | "m. c #E6E1D4", 151 | "M. c #E9E2D3", 152 | "N. c #E4E4DC", 153 | "B. c #E9E5DE", 154 | "V. c #F4EDDE", 155 | "C. c #DFE8E6", 156 | "Z. c #DEEEE8", 157 | "A. c #DFF2F3", 158 | "S. c #DDFFFF", 159 | "D. c #E1E6E0", 160 | "F. c #E8E6E2", 161 | "G. c #E8E9E5", 162 | "H. c #E5EFEC", 163 | "J. c #E8E9EA", 164 | "K. c #EAF3EE", 165 | "L. c #F3F3EB", 166 | "P. c #E7EDF2", 167 | "I. c #E8EEF3", 168 | "U. c #E7F4F7", 169 | "Y. c #E9F0F7", 170 | "T. c #EBF5FD", 171 | "R. c #E4FEFF", 172 | "E. c #ECFCFF", 173 | "W. c #F4F5F4", 174 | "Q. c #F4FFFF", 175 | "!. c #FEFFFF", 176 | "~. c None", 177 | /* pixels */ 178 | "~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.", 179 | "~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.", 180 | "~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.", 181 | "~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.", 182 | "~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.F L h C C A A A A C C h L e ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.", 183 | "~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.D N C m d d a a p a a p a a d m m C N j ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.", 184 | "~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.- K M m a p s d d d d d d d d d d d d s p d m M V % ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.", 185 | "~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.Y M d a d d d d d d d d d d d d d d d d h h d s a d M U ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.", 186 | "~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.E m 4 a d d d d d d d d d d d d d d d d d d h h h d d d a d M U ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.", 187 | "~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.C 4 a d d d d d d d d d d d d d d d d d h h h h h h d d d d d a m C ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.", 188 | "~.~.~.~.~.~.~.~.~.~.~.~.~.W S a p d d d d d d d d d d d d d d d d h h h h g g h h h d d d d d p a S c ~.~.~.~.~.~.~.~.~.~.~.~.~.", 189 | "~.~.~.~.~.~.~.~.~.~.~.~.v M a s d d d d d d d d d d d d d d d h h h h h g z z g h h d d d d d d s a C w ~.~.~.~.~.~.~.~.~.~.~.~.", 190 | "~.~.~.~.~.~.~.~.~.~.~.r Z a d d d d d d d d d d d d d d d g 4 : 2 h z z z z z h h h h d d d d d d d a S q ~.~.~.~.~.~.~.~.~.~.~.", 191 | "~.~.~.~.~.~.~.~.~.~.b Z a d d d d d d d d d d d d d d h h 4 x $.l a z H h h H z h h h d d d d d d d d a A w ~.~.~.~.~.~.~.~.~.~.", 192 | "~.~.~.~.~.~.~.~.~.~.T a s d d d d d d d d d d d d h h h g : $.R.T.7.a B x f > a H h h d d d d d d d d s a R ~.~.~.~.~.~.~.~.~.~.", 193 | "~.~.~.~.~.~.~.~.~.U a s d d d d d d d d d d d d h h h h z : e.!.!.p.2 3 8.D.5.' a h h h d d d d d d d d p d A ~.~.~.~.~.~.~.~.~.", 194 | "~.~.~.~.~.~.~.~.U M p d d d d d d d d d d h h 1 : : 2 h h p B.!.Q.%., l J.!.R.-.> z h h h d d d d d d d d p C N ~.~.~.~.~.~.~.~.", 195 | "~.~.~.~.~.~.~.~.S a d d d d d d d d d d h d 3 7.r.O.G p ; k E.!.T.( , [ E.!.T.~ 4 z h h h d d d d d d d d d a S ~.~.~.~.~.~.~.~.", 196 | "~.~.~.~.~.~.~.V d s d d d d d d d d h h h 2 l E.!.Q.T.m.:.q.!.!.l.: : -.Q.!.c.a z z z g h h d d d d d d d d s m A ~.~.~.~.~.~.~.", 197 | "~.~.~.~.~.~.@ S a d d d d d d d h h h h z : *.R.!.!.!.!.Q.!.!.!.V.,.Q d.!.Q.1.2 I z z h h h d d d d d d d d d a S X ~.~.~.~.~.~.", 198 | "~.~.~.~.~.~.U d s d d d d d h h h h h g z a [ 5.M.Q.!.!.!.!.!.!.!.Q.E.!.!.Q.&.; 3 J H z h h h d d d d d d d d s h C ~.~.~.~.~.~.", 199 | "~.~.~.~.~.~.S a d d d d h h h h h h z z z I d > < %.W.!.!.!.!.!.!.!.!.!.!.!.W.s.[ > 4 H g h h d d d d d d d d d a S ~.~.~.~.~.~.", 200 | "~.~.~.~.~.i M p d d d h h h h g z z z z J H I I J > x.!.!.!.!.Q.T.E.Q.!.!.!.!.!.E.u.f 2 H h h h d d d d d d d d p C 7 ~.~.~.~.~.", 201 | "~.~.~.~.~.C a d h h h h h g g z z z J J I I I I J P J.!.!.!.!.d.P =.e.G.E.!.!.!.!.Q.Z.f 2 z h h d d d d d d d d d d A ~.~.~.~.~.", 202 | "~.~.~.~.~.A a h h h h h g z z z J H I I I I ^ / d X.E.!.!.!.Q.1.4 I J I ;.U.!.!.!.!.!.N.1 h g h h d d d d d d d d a S ~.~.~.~.~.", 203 | "~.~.~.~.6 C p d h h h z z J J J I I I I ^ ^ ^ _ a 3.Q.!.!.!.E.#.I . ._ 3 ] K.!.!.!.!.E.O., z h h h d d d d d d d p A + ~.~.~.~.", 204 | "~.~.~.~.i B d d h h h g z J I I I I ^ ^ ^ / / _ h k.!.!.!.!.J.) } . .| .3 6.Q.!.!.!.Q.q.> z g h h d d d d d d d d B t ~.~.~.~.", 205 | "~.~.~.~.B d d d d h h h z z J I I ^ / / / _ _ ^ ( I.!.!.!.Q.d.I . . .| .d 1.Q.!.!.!.Q.q.2 z h h h d d d d d d d d d B ~.~.~.~.", 206 | "~.~.~.~.C a d d d d h h g z J H I ^ ^ / _ _ } J %.E.!.!.!.Q.;.4 _ } | } J f m.!.!.!.!.Q.;.2 J z g h h d d d d d d d a A ~.~.~.~.", 207 | "~.~.~.~.C a d d d d h h h z z J I I ^ ^ / _ } z 6.Q.!.!.!.!.n.<.&.+.{ ) ] h.Q.!.!.!.!.R.~ d H z z h h h d d d d d d a A ~.~.~.~.", 208 | "~.~.~.~.A a d d d d d h h g z z H I I ^ / _ _ z k.!.!.!.!.!.!.Q.E.I.F.F.T.Q.!.!.!.!.E.9.2 I J z z h h h d d d d d d d A ~.~.~.~.", 209 | "~.~.~.~.S a d d d d d h h h z z J I I ^ ^ / I ( P.!.!.!.!.Q.Q.!.!.!.!.!.!.!.!.!.!.E.w.d J I I J z h h h d d d d d d d A ~.~.~.~.", 210 | "~.~.~.~.A a d d d d d d h h h z J J I I ^ / h O.E.!.!.!.Q.f.1.z.Y.E.!.!.!.!.!.!.L.! , ^ / I I H z z h h h d d d d d d A ~.~.~.~.", 211 | "~.~.~.~.S p d d d d d d h h h z z J I I ^ / d <.Q.!.!.!.E.+.d _ +.>.k.E.!.!.!.!.Q.s.P J _ ^ I I J z z h h h d d d d d A ~.~.~.~.", 212 | "~.~.~.~.C a d d d d d d d h h g z z H I I ^ d k.!.!.!.!.J.{ | @.} I I O.H.!.!.!.!.Q.C.l I ^ I I H J z g h h d d d d a A ~.~.~.~.", 213 | "~.~.~.~.B a d d d d d d d h h h h z z J I J x P.!.!.!.Q.j.I . . . . .B { K.!.!.!.!.Q.0.a / ^ I I J z z h h h d d d a A ~.~.~.~.", 214 | "~.~.~.~.B d d d d d d d d d h h h J h f 2 ; [ E.!.!.!.Q.1.I . . .| | .d 4.Q.!.!.!.!.m.z I ^ I I I J z h h h h d d d B ~.~.~.~.", 215 | "~.~.~.~.u B d d d d d d d d h h z , ' v.q.X.M.!.!.!.!.E.#.^ . .| } } } d >.Q.!.!.!.!.F.x J I I I J J z z h h h d d C t ~.~.~.~.", 216 | "~.~.~.~.7 C p d d d d d d d d h h : y.Q.Q.Q.!.!.!.!.!.B.d B / _ } } } J 1 k.!.!.!.!.!.c.s J I H J J z z z h h h h s A + ~.~.~.~.", 217 | "~.~.~.~.~.A a d d d d d d d d h > ` R.!.!.!.!.!.!.!.!.L.q.=.[ ~ z h h l 0.Q.!.!.!.!.Q.q.2 I J J z z h h h h h h h a S ~.~.~.~.~.", 218 | "~.~.~.~.~.C d d d d d d d d d d > ..g.Y.E.Q.!.!.!.!.!.!.Q.E.T.B.k.a.d.P.Q.!.!.!.!.!.E.[ 2 J z z z g h h h h d d d d C ~.~.~.~.~.", 219 | "~.~.~.~.~.y C p d d d d d d d d g 3 > l [ <.x.W.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.Q.z.> z z z h h h h h d d d d p C 7 ~.~.~.~.~.", 220 | "~.~.~.~.~.~.S a d d d d d d d d d h h 3 , > ; =.Q.!.W.T.Q.!.!.!.!.!.!.!.!.!.!.!.Q.A.g 2 z h h h h h h d d d d d a S ~.~.~.~.~.~.", 221 | "~.~.~.~.~.~.C h s d d d d d d d d d h g z H : <.!.!.t.l &.V.!.!.Q.Q.Q.Q.!.Q.Q.E.b.l > H h h h h h d d d d d d s m C ~.~.~.~.~.~.", 222 | "~.~.~.~.~.~.X S a d d d d d d d d d h h h h p N.!.Q.=.: < c.!.Q.2.&.e.a.d.i.6.[ < 2 z h h h h d d d d d d d d a S ~.~.~.~.~.~.", 223 | "~.~.~.~.~.~.~.A h s d d d d d d d d d h g 2 ~ E.!.E.{ 2 [ E.!.T.l : 2 1 3 2 > > h z h h h h d d d d d d d d s m A ~.~.~.~.~.~.~.", 224 | "~.~.~.~.~.~.~.~.S a d d d d d d d d d h h : -.R.!.B.h 2 =.Q.!.M.p z z z h h z g h h h d d d d d d d d d d d a S ~.~.~.~.~.~.~.~.", 225 | "~.~.~.~.~.~.~.~.N C p d d d d d d d d d h 3 ' 2.N.9.2 3 z.!.!.q.> J z h h h h h h d d d d d d d d d d d d p C n ~.~.~.~.~.~.~.~.", 226 | "~.~.~.~.~.~.~.~.~.S h p d d d d d d d d d z 3 : p l J g 8.T.S.O.> z h h h h h d d d d d d d d d d d d d p h S ~.~.~.~.~.~.~.~.~.", 227 | "~.~.~.~.~.~.~.~.~.~.S a s d d d d d d d d h h z d h I J a P o.P d g h h h d d d d d d d d d d d d d d s a S ~.~.~.~.~.~.~.~.~.~.", 228 | "~.~.~.~.~.~.~.~.~.~.* S a s d d d d d d d d h h g z J J h 3 > d z h h h d d d d d d d d d d d d d d s a S * ~.~.~.~.~.~.~.~.~.~.", 229 | "~.~.~.~.~.~.~.~.~.~.~.$ T a s d d d d d d d h h h z z z h g g h h d d d d d d d d d d d d d d d d s a T O ~.~.~.~.~.~.~.~.~.~.~.", 230 | "~.~.~.~.~.~.~.~.~.~.~.~.& S a p d d d d d d h h h z g h h h h h d d d d d d d d d d d d d d d d p a S # ~.~.~.~.~.~.~.~.~.~.~.~.", 231 | "~.~.~.~.~.~.~.~.~.~.~.~.~.8 S d p d d d d d d h h g h h h h d d d d d d d d d d d d d d d d d p h S = ~.~.~.~.~.~.~.~.~.~.~.~.~.", 232 | "~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.S A a s d d d d h h h h h d d d d d d d d d d d d d d d d d s a A S ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.", 233 | "~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.0 T m p d d d d h h h d d d d d d d d d d d d d d d d d p B S 9 ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.", 234 | "~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.V S m a p d h d d d d d d d d d d d d d d d d p a m S V ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.", 235 | "~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.o V S C d p p d d d d d d d d d d d d p p d C S N . ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.", 236 | "~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.5 C S A B d d a a d d a a a d B A S C 5 ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.", 237 | "~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.O t B A A A A A A A A B t O ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.", 238 | "~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.", 239 | "~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.", 240 | "~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.", 241 | "~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~." 242 | }; 243 | -------------------------------------------------------------------------------- /depends/funcs.mk: -------------------------------------------------------------------------------- 1 | define int_vars 2 | #Set defaults for vars which may be overridden per-package 3 | $(1)_cc=$($($(1)_type)_CC) 4 | $(1)_cxx=$($($(1)_type)_CXX) 5 | $(1)_objc=$($($(1)_type)_OBJC) 6 | $(1)_objcxx=$($($(1)_type)_OBJCXX) 7 | $(1)_ar=$($($(1)_type)_AR) 8 | $(1)_ranlib=$($($(1)_type)_RANLIB) 9 | $(1)_libtool=$($($(1)_type)_LIBTOOL) 10 | $(1)_nm=$($($(1)_type)_NM) 11 | $(1)_cflags=$($($(1)_type)_CFLAGS) $($($(1)_type)_$(release_type)_CFLAGS) 12 | $(1)_cxxflags=$($($(1)_type)_CXXFLAGS) $($($(1)_type)_$(release_type)_CXXFLAGS) 13 | $(1)_ldflags=$($($(1)_type)_LDFLAGS) $($($(1)_type)_$(release_type)_LDFLAGS) -L$($($(1)_type)_prefix)/lib 14 | $(1)_cppflags=$($($(1)_type)_CPPFLAGS) $($($(1)_type)_$(release_type)_CPPFLAGS) -I$($($(1)_type)_prefix)/include 15 | $(1)_recipe_hash:= 16 | endef 17 | 18 | define int_get_all_dependencies 19 | $(sort $(foreach dep,$(2),$(2) $(call int_get_all_dependencies,$(1),$($(dep)_dependencies)))) 20 | endef 21 | 22 | define fetch_file_inner 23 | ( mkdir -p $$($(1)_download_dir) && echo Fetching $(3) from $(2) && \ 24 | $(build_DOWNLOAD) "$$($(1)_download_dir)/$(4).temp" "$(2)/$(3)" && \ 25 | echo "$(5) $$($(1)_download_dir)/$(4).temp" > $$($(1)_download_dir)/.$(4).hash && \ 26 | $(build_SHA256SUM) -c $$($(1)_download_dir)/.$(4).hash && \ 27 | mv $$($(1)_download_dir)/$(4).temp $$($(1)_source_dir)/$(4) && \ 28 | rm -rf $$($(1)_download_dir) ) 29 | endef 30 | 31 | define fetch_file 32 | ( test -f $$($(1)_source_dir)/$(4) || \ 33 | ( $(call fetch_file_inner,$(1),$(2),$(3),$(4),$(5)) || \ 34 | $(call fetch_file_inner,$(1),$(FALLBACK_DOWNLOAD_PATH),$(3),$(4),$(5)))) 35 | endef 36 | 37 | define int_get_build_recipe_hash 38 | $(eval $(1)_all_file_checksums:=$(shell $(build_SHA256SUM) $(meta_depends) packages/$(1).mk $(addprefix $(PATCHES_PATH)/$(1)/,$($(1)_patches)) | cut -d" " -f1)) 39 | $(eval $(1)_recipe_hash:=$(shell echo -n "$($(1)_all_file_checksums)" | $(build_SHA256SUM) | cut -d" " -f1)) 40 | endef 41 | 42 | define int_get_build_id 43 | $(eval $(1)_dependencies += $($(1)_$(host_arch)_$(host_os)_dependencies) $($(1)_$(host_os)_dependencies)) 44 | $(eval $(1)_all_dependencies:=$(call int_get_all_dependencies,$(1),$($($(1)_type)_native_toolchain) $($(1)_dependencies))) 45 | $(foreach dep,$($(1)_all_dependencies),$(eval $(1)_build_id_deps+=$(dep)-$($(dep)_version)-$($(dep)_recipe_hash))) 46 | $(eval $(1)_build_id_long:=$(1)-$($(1)_version)-$($(1)_recipe_hash)-$(release_type) $($(1)_build_id_deps) $($($(1)_type)_id_string)) 47 | $(eval $(1)_build_id:=$(shell echo -n "$($(1)_build_id_long)" | $(build_SHA256SUM) | cut -c-$(HASH_LENGTH))) 48 | final_build_id_long+=$($(package)_build_id_long) 49 | 50 | #compute package-specific paths 51 | $(1)_build_subdir?=. 52 | $(1)_download_file?=$($(1)_file_name) 53 | $(1)_source_dir:=$(SOURCES_PATH) 54 | $(1)_source:=$$($(1)_source_dir)/$($(1)_file_name) 55 | $(1)_staging_dir=$(base_staging_dir)/$(host)/$(1)/$($(1)_version)-$($(1)_build_id) 56 | $(1)_staging_prefix_dir:=$$($(1)_staging_dir)$($($(1)_type)_prefix) 57 | $(1)_extract_dir:=$(base_build_dir)/$(host)/$(1)/$($(1)_version)-$($(1)_build_id) 58 | $(1)_download_dir:=$(base_download_dir)/$(1)-$($(1)_version) 59 | $(1)_build_dir:=$$($(1)_extract_dir)/$$($(1)_build_subdir) 60 | $(1)_cached_checksum:=$(BASE_CACHE)/$(host)/$(1)/$(1)-$($(1)_version)-$($(1)_build_id).tar.gz.hash 61 | $(1)_patch_dir:=$(base_build_dir)/$(host)/$(1)/$($(1)_version)-$($(1)_build_id)/.patches-$($(1)_build_id) 62 | $(1)_prefixbin:=$($($(1)_type)_prefix)/bin/ 63 | $(1)_cached:=$(BASE_CACHE)/$(host)/$(1)/$(1)-$($(1)_version)-$($(1)_build_id).tar.gz 64 | $(1)_all_sources=$($(1)_file_name) $($(1)_extra_sources) 65 | 66 | #stamps 67 | $(1)_fetched=$(SOURCES_PATH)/download-stamps/.stamp_fetched-$(1)-$($(1)_file_name).hash 68 | $(1)_extracted=$$($(1)_extract_dir)/.stamp_extracted 69 | $(1)_preprocessed=$$($(1)_extract_dir)/.stamp_preprocessed 70 | $(1)_cleaned=$$($(1)_extract_dir)/.stamp_cleaned 71 | $(1)_built=$$($(1)_build_dir)/.stamp_built 72 | $(1)_configured=$$($(1)_build_dir)/.stamp_configured 73 | $(1)_staged=$$($(1)_staging_dir)/.stamp_staged 74 | $(1)_postprocessed=$$($(1)_staging_prefix_dir)/.stamp_postprocessed 75 | $(1)_download_path_fixed=$(subst :,\:,$$($(1)_download_path)) 76 | 77 | 78 | #default commands 79 | $(1)_fetch_cmds ?= $(call fetch_file,$(1),$(subst \:,:,$$($(1)_download_path_fixed)),$$($(1)_download_file),$($(1)_file_name),$($(1)_sha256_hash)) 80 | $(1)_extract_cmds ?= mkdir -p $$($(1)_extract_dir) && echo "$$($(1)_sha256_hash) $$($(1)_source)" > $$($(1)_extract_dir)/.$$($(1)_file_name).hash && $(build_SHA256SUM) -c $$($(1)_extract_dir)/.$$($(1)_file_name).hash && tar --strip-components=1 -xf $$($(1)_source) 81 | $(1)_preprocess_cmds ?= 82 | $(1)_build_cmds ?= 83 | $(1)_config_cmds ?= 84 | $(1)_stage_cmds ?= 85 | $(1)_set_vars ?= 86 | 87 | 88 | all_sources+=$$($(1)_fetched) 89 | endef 90 | #$(foreach dep_target,$($(1)_all_dependencies),$(eval $(1)_dependency_targets=$($(dep_target)_cached))) 91 | 92 | 93 | define int_config_attach_build_config 94 | $(eval $(call $(1)_set_vars,$(1))) 95 | $(1)_cflags+=$($(1)_cflags_$(release_type)) 96 | $(1)_cflags+=$($(1)_cflags_$(host_arch)) $($(1)_cflags_$(host_arch)_$(release_type)) 97 | $(1)_cflags+=$($(1)_cflags_$(host_os)) $($(1)_cflags_$(host_os)_$(release_type)) 98 | $(1)_cflags+=$($(1)_cflags_$(host_arch)_$(host_os)) $($(1)_cflags_$(host_arch)_$(host_os)_$(release_type)) 99 | 100 | $(1)_cxxflags+=$($(1)_cxxflags_$(release_type)) 101 | $(1)_cxxflags+=$($(1)_cxxflags_$(host_arch)) $($(1)_cxxflags_$(host_arch)_$(release_type)) 102 | $(1)_cxxflags+=$($(1)_cxxflags_$(host_os)) $($(1)_cxxflags_$(host_os)_$(release_type)) 103 | $(1)_cxxflags+=$($(1)_cxxflags_$(host_arch)_$(host_os)) $($(1)_cxxflags_$(host_arch)_$(host_os)_$(release_type)) 104 | 105 | $(1)_cppflags+=$($(1)_cppflags_$(release_type)) 106 | $(1)_cppflags+=$($(1)_cppflags_$(host_arch)) $($(1)_cppflags_$(host_arch)_$(release_type)) 107 | $(1)_cppflags+=$($(1)_cppflags_$(host_os)) $($(1)_cppflags_$(host_os)_$(release_type)) 108 | $(1)_cppflags+=$($(1)_cppflags_$(host_arch)_$(host_os)) $($(1)_cppflags_$(host_arch)_$(host_os)_$(release_type)) 109 | 110 | $(1)_ldflags+=$($(1)_ldflags_$(release_type)) 111 | $(1)_ldflags+=$($(1)_ldflags_$(host_arch)) $($(1)_ldflags_$(host_arch)_$(release_type)) 112 | $(1)_ldflags+=$($(1)_ldflags_$(host_os)) $($(1)_ldflags_$(host_os)_$(release_type)) 113 | $(1)_ldflags+=$($(1)_ldflags_$(host_arch)_$(host_os)) $($(1)_ldflags_$(host_arch)_$(host_os)_$(release_type)) 114 | 115 | $(1)_build_opts+=$$($(1)_build_opts_$(release_type)) 116 | $(1)_build_opts+=$$($(1)_build_opts_$(host_arch)) $$($(1)_build_opts_$(host_arch)_$(release_type)) 117 | $(1)_build_opts+=$$($(1)_build_opts_$(host_os)) $$($(1)_build_opts_$(host_os)_$(release_type)) 118 | $(1)_build_opts+=$$($(1)_build_opts_$(host_arch)_$(host_os)) $$($(1)_build_opts_$(host_arch)_$(host_os)_$(release_type)) 119 | 120 | $(1)_config_opts+=$$($(1)_config_opts_$(release_type)) 121 | $(1)_config_opts+=$$($(1)_config_opts_$(host_arch)) $$($(1)_config_opts_$(host_arch)_$(release_type)) 122 | $(1)_config_opts+=$$($(1)_config_opts_$(host_os)) $$($(1)_config_opts_$(host_os)_$(release_type)) 123 | $(1)_config_opts+=$$($(1)_config_opts_$(host_arch)_$(host_os)) $$($(1)_config_opts_$(host_arch)_$(host_os)_$(release_type)) 124 | 125 | $(1)_config_env+=$$($(1)_config_env_$(release_type)) 126 | $(1)_config_env+=$($(1)_config_env_$(host_arch)) $($(1)_config_env_$(host_arch)_$(release_type)) 127 | $(1)_config_env+=$($(1)_config_env_$(host_os)) $($(1)_config_env_$(host_os)_$(release_type)) 128 | $(1)_config_env+=$($(1)_config_env_$(host_arch)_$(host_os)) $($(1)_config_env_$(host_arch)_$(host_os)_$(release_type)) 129 | 130 | $(1)_config_env+=PKG_CONFIG_LIBDIR=$($($(1)_type)_prefix)/lib/pkgconfig 131 | $(1)_config_env+=PKG_CONFIG_PATH=$($($(1)_type)_prefix)/share/pkgconfig 132 | $(1)_config_env+=PATH=$(build_prefix)/bin:$(PATH) 133 | $(1)_build_env+=PATH=$(build_prefix)/bin:$(PATH) 134 | $(1)_stage_env+=PATH=$(build_prefix)/bin:$(PATH) 135 | $(1)_autoconf=./configure --host=$($($(1)_type)_host) --disable-dependency-tracking --prefix=$($($(1)_type)_prefix) $$($(1)_config_opts) CC="$$($(1)_cc)" CXX="$$($(1)_cxx)" 136 | 137 | ifneq ($($(1)_nm),) 138 | $(1)_autoconf += NM="$$($(1)_nm)" 139 | endif 140 | ifneq ($($(1)_ranlib),) 141 | $(1)_autoconf += RANLIB="$$($(1)_ranlib)" 142 | endif 143 | ifneq ($($(1)_ar),) 144 | $(1)_autoconf += AR="$$($(1)_ar)" 145 | endif 146 | ifneq ($($(1)_cflags),) 147 | $(1)_autoconf += CFLAGS="$$($(1)_cflags)" 148 | endif 149 | ifneq ($($(1)_cxxflags),) 150 | $(1)_autoconf += CXXFLAGS="$$($(1)_cxxflags)" 151 | endif 152 | ifneq ($($(1)_cppflags),) 153 | $(1)_autoconf += CPPFLAGS="$$($(1)_cppflags)" 154 | endif 155 | ifneq ($($(1)_ldflags),) 156 | $(1)_autoconf += LDFLAGS="$$($(1)_ldflags)" 157 | endif 158 | endef 159 | 160 | define int_add_cmds 161 | $($(1)_fetched): 162 | $(AT)mkdir -p $$(@D) $(SOURCES_PATH) 163 | $(AT)rm -f $$@ 164 | $(AT)touch $$@ 165 | $(AT)cd $$(@D); $(call $(1)_fetch_cmds,$(1)) 166 | $(AT)cd $($(1)_source_dir); $(foreach source,$($(1)_all_sources),$(build_SHA256SUM) $(source) >> $$(@);) 167 | $(AT)touch $$@ 168 | $($(1)_extracted): | $($(1)_fetched) 169 | $(AT)echo Extracting $(1)... 170 | $(AT)mkdir -p $$(@D) 171 | $(AT)cd $$(@D); $(call $(1)_extract_cmds,$(1)) 172 | $(AT)touch $$@ 173 | $($(1)_preprocessed): | $($(1)_dependencies) $($(1)_extracted) 174 | $(AT)echo Preprocessing $(1)... 175 | $(AT)mkdir -p $$(@D) $($(1)_patch_dir) 176 | $(AT)$(foreach patch,$($(1)_patches),cd $(PATCHES_PATH)/$(1); cp $(patch) $($(1)_patch_dir) ;) 177 | $(AT)cd $$(@D); $(call $(1)_preprocess_cmds, $(1)) 178 | $(AT)touch $$@ 179 | $($(1)_configured): | $($(1)_preprocessed) 180 | $(AT)echo Configuring $(1)... 181 | $(AT)rm -rf $(host_prefix); mkdir -p $(host_prefix)/lib; cd $(host_prefix); $(foreach package,$($(1)_all_dependencies), tar xf $($(package)_cached); ) 182 | $(AT)mkdir -p $$(@D) 183 | $(AT)+cd $$(@D); $($(1)_config_env) $(call $(1)_config_cmds, $(1)) 184 | $(AT)touch $$@ 185 | $($(1)_built): | $($(1)_configured) 186 | $(AT)echo Building $(1)... 187 | $(AT)mkdir -p $$(@D) 188 | $(AT)+cd $$(@D); $($(1)_build_env) $(call $(1)_build_cmds, $(1)) 189 | $(AT)touch $$@ 190 | $($(1)_staged): | $($(1)_built) 191 | $(AT)echo Staging $(1)... 192 | $(AT)mkdir -p $($(1)_staging_dir)/$(host_prefix) 193 | $(AT)cd $($(1)_build_dir); $($(1)_stage_env) $(call $(1)_stage_cmds, $(1)) 194 | $(AT)rm -rf $($(1)_extract_dir) 195 | $(AT)touch $$@ 196 | $($(1)_postprocessed): | $($(1)_staged) 197 | $(AT)echo Postprocessing $(1)... 198 | $(AT)cd $($(1)_staging_prefix_dir); $(call $(1)_postprocess_cmds) 199 | $(AT)touch $$@ 200 | $($(1)_cached): | $($(1)_dependencies) $($(1)_postprocessed) 201 | $(AT)echo Caching $(1)... 202 | $(AT)cd $$($(1)_staging_dir)/$(host_prefix); find . | sort | tar --no-recursion -czf $$($(1)_staging_dir)/$$(@F) -T - 203 | $(AT)mkdir -p $$(@D) 204 | $(AT)rm -rf $$(@D) && mkdir -p $$(@D) 205 | $(AT)mv $$($(1)_staging_dir)/$$(@F) $$(@) 206 | $(AT)rm -rf $($(1)_staging_dir) 207 | $($(1)_cached_checksum): $($(1)_cached) 208 | $(AT)cd $$(@D); $(build_SHA256SUM) $$( $$(@) 209 | 210 | .PHONY: $(1) 211 | $(1): | $($(1)_cached_checksum) 212 | .SECONDARY: $($(1)_cached) $($(1)_postprocessed) $($(1)_staged) $($(1)_built) $($(1)_configured) $($(1)_preprocessed) $($(1)_extracted) $($(1)_fetched) 213 | 214 | endef 215 | 216 | # These functions create the build targets for each package. They must be 217 | # broken down into small steps so that each part is done for all packages 218 | # before moving on to the next step. Otherwise, a package's info 219 | # (build-id for example) would only be available to another package if it 220 | # happened to be computed already. 221 | 222 | #set the type for host/build packages. 223 | $(foreach native_package,$(native_packages),$(eval $(native_package)_type=build)) 224 | $(foreach package,$(packages),$(eval $(package)_type=$(host_arch)_$(host_os))) 225 | 226 | #set overridable defaults 227 | $(foreach package,$(all_packages),$(eval $(call int_vars,$(package)))) 228 | 229 | #include package files 230 | $(foreach package,$(all_packages),$(eval include packages/$(package).mk)) 231 | 232 | #compute a hash of all files that comprise this package's build recipe 233 | $(foreach package,$(all_packages),$(eval $(call int_get_build_recipe_hash,$(package)))) 234 | 235 | #generate a unique id for this package, incorporating its dependencies as well 236 | $(foreach package,$(all_packages),$(eval $(call int_get_build_id,$(package)))) 237 | 238 | #compute final vars after reading package vars 239 | $(foreach package,$(all_packages),$(eval $(call int_config_attach_build_config,$(package)))) 240 | 241 | #create build targets 242 | $(foreach package,$(all_packages),$(eval $(call int_add_cmds,$(package)))) 243 | 244 | #special exception: if a toolchain package exists, all non-native packages depend on it 245 | $(foreach package,$(packages),$(eval $($(package)_unpacked): |$($($(host_arch)_$(host_os)_native_toolchain)_cached) )) 246 | --------------------------------------------------------------------------------