├── .gitattributes ├── .gitignore ├── CMakeLists.txt ├── COPYING ├── INSTALL.md ├── PackageOptions.cmake ├── README.md ├── cmake ├── modules │ ├── AddCompilerFlags.cmake │ ├── BinaryTest.cmake │ ├── BrewHelper.cmake │ ├── ClangTidy.cmake │ ├── Coverage.cmake │ ├── CustomCommandWithDepFile.cmake │ ├── DoOrFail.cmake │ ├── ExternalLibraryHelper.cmake │ ├── FindBerkeleyDB.cmake │ ├── FindEvent.cmake │ ├── FindGMP.cmake │ ├── FindJemalloc.cmake │ ├── FindMiniUPnPc.cmake │ ├── FindQREncode.cmake │ ├── FindRapidcheck.cmake │ ├── FindSHLWAPI.cmake │ ├── ImageHelper.cmake │ ├── InstallationHelper.cmake │ ├── NativeExecutable.cmake │ ├── OverrideInitFlags.cmake │ ├── PackageHelper.cmake │ ├── SanitizeHelper.cmake │ ├── Sanitizers.cmake │ └── TestSuite.cmake ├── platforms │ ├── Linux32.cmake │ ├── Linux64.cmake │ ├── LinuxAArch64.cmake │ ├── LinuxARM.cmake │ ├── OSX.cmake │ └── Win64.cmake ├── templates │ ├── CoverageBaseline.sh.in │ ├── CoverageTest.sh.in │ ├── NativeBuildRunner.cmake.in │ └── NativeCmakeRunner.cmake.in └── utils │ ├── CheckJemallocBuilds.c │ ├── EventCheckVersion.cpp │ ├── filter-lcov.py │ ├── gen-doc-man-footer.sh.in │ ├── gen-doc-man.sh.in │ ├── gen-doc-md.sh.in │ ├── gen-ninja-deps.py │ ├── test_wrapper.sh │ └── translate.sh.in ├── depends ├── .gitignore ├── Makefile ├── README.md ├── builders │ ├── darwin.mk │ ├── default.mk │ └── linux.mk ├── config.guess ├── config.site.in ├── config.sub ├── description.md ├── funcs.mk ├── hosts │ ├── darwin.mk │ ├── default.mk │ ├── linux.mk │ └── mingw32.mk ├── packages.md ├── packages │ ├── bdb.mk │ ├── boost.mk │ ├── expat.mk │ ├── fontconfig.mk │ ├── freetype.mk │ ├── jemalloc.mk │ ├── libXau.mk │ ├── libevent.mk │ ├── libxcb.mk │ ├── miniupnpc.mk │ ├── native_biplist.mk │ ├── native_cctools.mk │ ├── native_cdrkit.mk │ ├── native_ds_store.mk │ ├── native_libdmg-hfsplus.mk │ ├── native_mac_alias.mk │ ├── native_protobuf.mk │ ├── openssl.mk │ ├── packages.mk │ ├── protobuf.mk │ ├── qrencode.mk │ ├── qt.mk │ ├── rapidcheck.mk │ ├── xcb_proto.mk │ ├── xproto.mk │ ├── zeromq.mk │ └── zlib.mk └── patches │ ├── bdb │ ├── clang_cxx_11.patch │ └── winioctl.patch │ ├── boost │ ├── dynamic_pthread_stack_min.patch │ └── unused_var_in_process.patch │ ├── miniupnpc │ └── dont_use_wingen.patch │ ├── native_cctools │ └── ld64_disable_threading.patch │ ├── native_cdrkit │ └── cdrkit-deterministic.patch │ ├── native_libdmg-hfsplus │ └── remove-libcrypto-dependency.patch │ ├── openssl │ └── 0001-Add-OpenSSL-termios-fix-for-musl-libc.patch │ ├── qt │ ├── dont_hardcode_pwd.patch │ ├── drop_lrelease_dependency.patch │ ├── fix_configure_mac.patch │ ├── fix_no_printer.patch │ ├── fix_qt_pkgconfig.patch │ ├── fix_rcc_determinism.patch │ ├── mac-qmake.conf │ ├── no-xlib.patch │ └── xkb-default.patch │ └── zeromq │ └── remove_libstd_link.patch ├── doc ├── README.md ├── build-freebsd.md ├── build-osx.md ├── build-unix-alpine.md ├── build-unix-arch.md ├── build-unix-deb.md ├── build-unix-rpm.md ├── build-unix.md └── build-windows.md ├── share └── genbuild.sh └── src ├── .clang-format ├── .clang-tidy ├── CMakeLists.txt ├── algorithm ├── algorithm.h ├── contains.h ├── erase_if.h └── type_attributes.h ├── amount.cpp ├── amount.h ├── arith_uint256.cpp ├── arith_uint256.h ├── attributes.h ├── avm-cli-res.rc ├── avm-cli.cpp ├── base58.cpp ├── base58.h ├── big_int.cpp ├── big_int.h ├── blockfilter.cpp ├── blockfilter.h ├── blockstatus.h ├── blockvalidity.h ├── bloom.cpp ├── bloom.h ├── chain.cpp ├── chain.h ├── clientversion.cpp ├── clientversion.h ├── coins.cpp ├── coins.h ├── compat.h ├── compat ├── assumptions.h ├── byteswap.h ├── cpuid.h ├── endian.h ├── glibc_compat.cpp ├── glibc_sanity.cpp ├── glibcxx_sanity.cpp ├── sanity.h ├── setenv.h └── strnlen.cpp ├── compressor.cpp ├── compressor.h ├── config.cpp ├── config.h ├── config ├── .empty ├── CMakeLists.txt ├── bitcoin-config.h.cmake.in ├── version.h └── version.h.cmake.in ├── consensus ├── consensus.h ├── merkle.cpp └── merkle.h ├── core_io.h ├── core_memusage.h ├── core_read.cpp ├── core_write.cpp ├── crypto ├── CMakeLists.txt ├── aes.cpp ├── aes.h ├── chacha20.cpp ├── chacha20.h ├── common.h ├── ctaes │ ├── COPYING │ ├── README.md │ ├── bench.c │ ├── ctaes.c │ ├── ctaes.h │ └── test.c ├── eaglesong.cpp ├── eaglesong.h ├── hmac_sha256.cpp ├── hmac_sha256.h ├── hmac_sha512.cpp ├── hmac_sha512.h ├── ripemd160.cpp ├── ripemd160.h ├── sha1.cpp ├── sha1.h ├── sha256.cpp ├── sha256.h ├── sha256_avx2.cpp ├── sha256_shani.cpp ├── sha256_sse4.cpp ├── sha256_sse41.cpp ├── sha3.cpp ├── sha3.h ├── sha512.cpp ├── sha512.h ├── sha512_256.cpp ├── sha512_256.h ├── siphash.cpp └── siphash.h ├── cuckoocache.h ├── extversion.h ├── feerate.cpp ├── feerate.h ├── fs.cpp ├── fs.h ├── hash.cpp ├── hash.h ├── indirectmap.h ├── init.cpp ├── init.h ├── key.cpp ├── key.h ├── keystore.cpp ├── keystore.h ├── limitedmap.h ├── logging.cpp ├── logging.h ├── memusage.h ├── merkleblock.cpp ├── merkleblock.h ├── obj-test └── .gitignore ├── outputtype.cpp ├── outputtype.h ├── policy ├── policy.cpp └── policy.h ├── pow.cpp ├── pow.h ├── prevector.h ├── primitives ├── block.cpp ├── block.h ├── blockhash.h ├── transaction.cpp ├── transaction.h └── txid.h ├── pubkey.cpp ├── pubkey.h ├── random.cpp ├── random.h ├── reverse_iterator.h ├── reverselock.h ├── rwcollection.h ├── scheduler.cpp ├── scheduler.h ├── script ├── atomicalsconsensus.cpp ├── atomicalsconsensus.h ├── bitfield.cpp ├── bitfield.h ├── constants.h ├── interpreter.cpp ├── interpreter.h ├── json.hpp ├── script.cpp ├── script.h ├── script_error.cpp ├── script_error.h ├── script_execution_context.cpp ├── script_execution_context.h ├── script_flags.h ├── script_metrics.h ├── script_num.cpp ├── script_num.h ├── script_utils.cpp ├── script_utils.h ├── serialize_number.h ├── sigcache.cpp ├── sigcache.h ├── sigencoding.cpp ├── sigencoding.h ├── sighashtype.h ├── sign.cpp ├── sign.h ├── standard.cpp └── standard.h ├── secp256k1 ├── .clang-tidy ├── .gitignore ├── .travis.yml ├── CMakeLists.txt ├── COPYING ├── Makefile.am ├── README.md ├── SECURITY.md ├── TODO ├── autogen.sh ├── build-aux │ └── m4 │ │ ├── ax_jni_include_dir.m4 │ │ ├── ax_prog_cc_for_build.m4 │ │ └── bitcoin_secp.m4 ├── configure.ac ├── contrib │ ├── lax_der_parsing.c │ ├── lax_der_parsing.h │ ├── lax_der_privatekey_parsing.c │ └── lax_der_privatekey_parsing.h ├── include │ ├── secp256k1.h │ ├── secp256k1_ecdh.h │ ├── secp256k1_multiset.h │ ├── secp256k1_preallocated.h │ ├── secp256k1_recovery.h │ └── secp256k1_schnorr.h ├── libsecp256k1.pc.in ├── obj │ └── .gitignore ├── sage │ ├── group_prover.sage │ ├── secp256k1.sage │ └── weierstrass_prover.sage ├── src │ ├── asm │ │ └── field_10x26_arm.s │ ├── basic-config.h │ ├── bench.h │ ├── bench_ecdh.c │ ├── bench_ecmult.c │ ├── bench_internal.c │ ├── bench_multiset.c │ ├── bench_recover.c │ ├── bench_sign.c │ ├── bench_verify.c │ ├── ecdsa.h │ ├── ecdsa_impl.h │ ├── eckey.h │ ├── eckey_impl.h │ ├── ecmult.h │ ├── ecmult_const.h │ ├── ecmult_const_impl.h │ ├── ecmult_gen.h │ ├── ecmult_gen_impl.h │ ├── ecmult_impl.h │ ├── field.h │ ├── field_10x26.h │ ├── field_10x26_impl.h │ ├── field_5x52.h │ ├── field_5x52_asm_impl.h │ ├── field_5x52_impl.h │ ├── field_5x52_int128_impl.h │ ├── field_impl.h │ ├── gen_context.c │ ├── group.h │ ├── group_impl.h │ ├── hash.h │ ├── hash_impl.h │ ├── java │ │ ├── org │ │ │ └── bitcoin │ │ │ │ ├── NativeSecp256k1.java │ │ │ │ ├── NativeSecp256k1Test.java │ │ │ │ ├── NativeSecp256k1Util.java │ │ │ │ └── Secp256k1Context.java │ │ ├── org_bitcoin_NativeSecp256k1.c │ │ ├── org_bitcoin_NativeSecp256k1.h │ │ ├── org_bitcoin_Secp256k1Context.c │ │ └── org_bitcoin_Secp256k1Context.h │ ├── libsecp256k1-config.h.cmake.in │ ├── modules │ │ ├── ecdh │ │ │ ├── Makefile.am.include │ │ │ ├── main_impl.h │ │ │ └── tests_impl.h │ │ ├── multiset │ │ │ ├── Makefile.am.include │ │ │ ├── README.md │ │ │ ├── main_impl.h │ │ │ └── tests_impl.h │ │ ├── recovery │ │ │ ├── Makefile.am.include │ │ │ ├── main_impl.h │ │ │ └── tests_impl.h │ │ └── schnorr │ │ │ ├── Makefile.am.include │ │ │ ├── main_impl.h │ │ │ ├── schnorr.h │ │ │ ├── schnorr_impl.h │ │ │ └── tests_impl.h │ ├── num.h │ ├── num_gmp.h │ ├── num_gmp_impl.h │ ├── num_impl.h │ ├── scalar.h │ ├── scalar_4x64.h │ ├── scalar_4x64_impl.h │ ├── scalar_8x32.h │ ├── scalar_8x32_impl.h │ ├── scalar_impl.h │ ├── scalar_low.h │ ├── scalar_low_impl.h │ ├── scratch.h │ ├── scratch_impl.h │ ├── secp256k1.c │ ├── testrand.h │ ├── testrand_impl.h │ ├── tests.c │ ├── tests_exhaustive.c │ └── util.h └── travis │ ├── build_autotools.sh │ ├── build_cmake.sh │ └── install_cmake.sh ├── serialize.h ├── span.h ├── streams.h ├── support ├── allocators │ ├── secure.h │ └── zeroafterfree.h ├── cleanse.cpp ├── cleanse.h ├── events.h ├── lockedpool.cpp └── lockedpool.h ├── sync.cpp ├── sync.h ├── threadinterrupt.cpp ├── threadinterrupt.h ├── threadsafety.h ├── tinyformat.h ├── uint256.cpp ├── uint256.h ├── univalue ├── .clang-tidy ├── .gitignore ├── .travis.yml ├── CMakeLists.txt ├── COPYING ├── Makefile.am ├── README.md ├── autogen.sh ├── build-aux │ └── m4 │ │ └── .gitignore ├── configure.ac ├── gen │ └── gen.cpp ├── include │ └── univalue.h ├── lib │ ├── .gitignore │ ├── univalue.cpp │ ├── univalue_escapes.h │ ├── univalue_get.cpp │ ├── univalue_read.cpp │ ├── univalue_utffilter.h │ └── univalue_write.cpp ├── pc │ ├── libunivalue-uninstalled.pc.in │ └── libunivalue.pc.in └── test │ ├── .gitignore │ ├── fail1.json │ ├── fail10.json │ ├── fail11.json │ ├── fail12.json │ ├── fail13.json │ ├── fail14.json │ ├── fail15.json │ ├── fail16.json │ ├── fail17.json │ ├── fail19.json │ ├── fail2.json │ ├── fail20.json │ ├── fail21.json │ ├── fail22.json │ ├── fail23.json │ ├── fail24.json │ ├── fail25.json │ ├── fail26.json │ ├── fail27.json │ ├── fail28.json │ ├── fail29.json │ ├── fail3.json │ ├── fail30.json │ ├── fail31.json │ ├── fail32.json │ ├── fail33.json │ ├── fail34.json │ ├── fail35.json │ ├── fail36.json │ ├── fail37.json │ ├── fail38.json │ ├── fail39.json │ ├── fail4.json │ ├── fail40.json │ ├── fail41.json │ ├── fail42.json │ ├── fail44.json │ ├── fail45.json │ ├── fail46.json │ ├── fail47.json │ ├── fail48.json │ ├── fail49.json │ ├── fail5.json │ ├── fail50.json │ ├── fail51.json │ ├── fail52.json │ ├── fail6.json │ ├── fail7.json │ ├── fail8.json │ ├── fail9.json │ ├── object.cpp │ ├── pass1.json │ ├── pretty1.json │ ├── pretty2.json │ ├── round1.json │ ├── round2.json │ ├── round3.json │ ├── round4.json │ ├── round5.json │ ├── round6.json │ ├── round7.json │ ├── round8.json │ ├── round9.json │ ├── test_json.cpp │ └── unitester.cpp ├── util ├── asmap.cpp ├── asmap.h ├── bit_cast.h ├── bitmanip.h ├── defer.h ├── moneystr.cpp ├── moneystr.h ├── noncopyable.h ├── saltedhashers.cpp ├── saltedhashers.h ├── strencodings.cpp ├── strencodings.h ├── string.cpp ├── string.h ├── system.cpp ├── system.h ├── threadnames.cpp ├── threadnames.h ├── time.cpp ├── time.h └── vector.h ├── version.h └── versionbits.h /.gitattributes: -------------------------------------------------------------------------------- 1 | src/clientversion.cpp export-subst 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.tar.gz 2 | 3 | *.exe 4 | src/avm-cli 5 | 6 | # autoreconf 7 | aclocal.m4 8 | autom4te.cache/ 9 | build-aux/config.guess 10 | build-aux/config.sub 11 | build-aux/depcomp 12 | build-aux/install-sh 13 | build-aux/ltmain.sh 14 | build-aux/m4/libtool.m4 15 | build-aux/m4/lt~obsolete.m4 16 | build-aux/m4/ltoptions.m4 17 | build-aux/m4/ltsugar.m4 18 | build-aux/m4/ltversion.m4 19 | build-aux/missing 20 | build-aux/compile 21 | build-aux/test-driver 22 | config.log 23 | config.status 24 | configure 25 | libtool 26 | src/config/bitcoin-config.h 27 | src/config/bitcoin-config.h.in 28 | src/config/stamp-h1 29 | share/setup.nsi 30 | share/qt/Info.plist 31 | 32 | src/obj 33 | 34 | .deps 35 | .dirstamp 36 | .libs 37 | .*.swp 38 | *.*~* 39 | *.bak 40 | *.rej 41 | *.orig 42 | *.pyc 43 | *.o 44 | *.o-* 45 | *.a 46 | *.pb.cc 47 | *.pb.h 48 | 49 | *.log 50 | *.trs 51 | *.dmg 52 | 53 | *.json.h 54 | *.raw.h 55 | 56 | # Only ignore unexpected patches 57 | *.patch 58 | !depends/patches/**/*.patch 59 | 60 | #libtool object files 61 | *.lo 62 | *.la 63 | 64 | # Unit-tests 65 | Makefile.test 66 | 67 | # Resources cpp 68 | qrc_*.cpp 69 | 70 | # Mac specific 71 | .DS_Store 72 | build 73 | 74 | #lcov 75 | *.gcno 76 | *.gcda 77 | /*.info 78 | total.coverage/ 79 | coverage_percent.txt 80 | 81 | #build tests 82 | linux-coverage-build 83 | linux-build 84 | win32-build 85 | test/config.ini 86 | test/cache/* 87 | 88 | /doc/doxygen/ 89 | 90 | /doc/mkdocs.yml 91 | /doc/gen-doc-md.sh 92 | /doc/md/ 93 | /doc/html/ 94 | 95 | libatomicalsconsensus.pc 96 | contrib/devtools/split-debug.sh 97 | 98 | # vagrant 99 | .vagrant 100 | 101 | 102 | #Local Development Environment - NetBeans 103 | nbproject/ 104 | 105 | #Local Development Environment - Eclipse 106 | .cproject 107 | .project 108 | .pydevproject 109 | 110 | #Local Development Environment - Visual Studio Code 111 | .vscode 112 | -------------------------------------------------------------------------------- /INSTALL.md: -------------------------------------------------------------------------------- 1 | # Installing AVM 2 | 3 | -------------------------------------------------------------------------------- /PackageOptions.cmake: -------------------------------------------------------------------------------- 1 | # Package options 2 | set(CPACK_PACKAGE_VENDOR "${COPYRIGHT_HOLDERS_FINAL}") 3 | set(CPACK_PACKAGE_DESCRIPTION "AVM") 4 | set(CPACK_PACKAGE_HOMEPAGE_URL "${PROJECT_HOMEPAGE_URL}") 5 | set(CPACK_PACKAGE_CONTACT "info@atomicals.xyz") 6 | 7 | set(CPACK_PACKAGE_INSTALL_DIRECTORY "atomicals-node") 8 | set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING") 9 | 10 | if(CMAKE_CROSSCOMPILING) 11 | set(CPACK_SYSTEM_NAME "${TOOLCHAIN_PREFIX}") 12 | endif() 13 | 14 | # Prevent the components aware generators (such as ZIP) from generating a 15 | # different package for each component. 16 | set(CPACK_MONOLITHIC_INSTALL ON) 17 | 18 | # CPack source package options 19 | set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}") 20 | set(CPACK_SOURCE_GENERATOR "TGZ") 21 | 22 | macro(add_start_menu_link LINK_NAME EXE PARAMETERS ICON_EXE ICON_INDEX) 23 | list(APPEND CPACK_NSIS_CREATE_ICONS_EXTRA 24 | "CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${LINK_NAME}.lnk' '$INSTDIR\\\\${CMAKE_INSTALL_BINDIR}\\\\${EXE}' '${PARAMETERS}' '$INSTDIR\\\\${CMAKE_INSTALL_BINDIR}\\\\${ICON_EXE}' '${ICON_INDEX}'" 25 | ) 26 | list(APPEND CPACK_NSIS_DELETE_ICONS_EXTRA 27 | "Delete '$SMPROGRAMS\\\\$START_MENU\\\\${LINK_NAME}.lnk'" 28 | ) 29 | endmacro() 30 | 31 | get_property(CPACK_SOURCE_IGNORE_FILES GLOBAL PROPERTY SOURCE_PACKAGE_IGNORE_FILES) 32 | include(CPack) 33 | -------------------------------------------------------------------------------- /cmake/modules/BinaryTest.cmake: -------------------------------------------------------------------------------- 1 | # Facilities to run tests on the executable binaries. 2 | 3 | macro(add_to_symbols_check BINARY) 4 | if(NOT TARGET symbol-check) 5 | add_custom_target(symbol-check) 6 | endif() 7 | 8 | set(CUSTOM_TARGET_NAME "symbol-check-${BINARY}") 9 | add_custom_target("${CUSTOM_TARGET_NAME}" 10 | COMMENT "Running symbol-check.py on ${BINARY}..." 11 | COMMAND 12 | "${Python_EXECUTABLE}" 13 | "${CMAKE_SOURCE_DIR}/contrib/devtools/symbol-check.py" 14 | "$" 15 | DEPENDS 16 | "${BINARY}" 17 | ) 18 | 19 | add_dependencies(symbol-check "${CUSTOM_TARGET_NAME}") 20 | endmacro() 21 | 22 | macro(add_to_security_check BINARY) 23 | if(NOT TARGET security-check) 24 | add_custom_target(security-check) 25 | endif() 26 | 27 | set(CUSTOM_TARGET_NAME "security-check-${BINARY}") 28 | add_custom_target("${CUSTOM_TARGET_NAME}" 29 | COMMENT "Running security-check.py on ${BINARY}..." 30 | COMMAND 31 | "${Python_EXECUTABLE}" 32 | "${CMAKE_SOURCE_DIR}/contrib/devtools/security-check.py" 33 | "$" 34 | DEPENDS 35 | "${BINARY}" 36 | ) 37 | 38 | add_dependencies(security-check "${CUSTOM_TARGET_NAME}") 39 | endmacro() 40 | -------------------------------------------------------------------------------- /cmake/modules/BrewHelper.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2018 The Bitcoin developers 2 | 3 | find_program(BREW brew) 4 | 5 | function(find_brew_prefix VAR NAME) 6 | if(NOT BREW) 7 | return() 8 | endif() 9 | 10 | if(DEFINED ${VAR}) 11 | return() 12 | endif() 13 | 14 | execute_process( 15 | COMMAND ${BREW} --prefix ${NAME} 16 | OUTPUT_VARIABLE PREFIX 17 | ERROR_QUIET 18 | OUTPUT_STRIP_TRAILING_WHITESPACE 19 | ) 20 | set(${VAR} ${PREFIX} PARENT_SCOPE) 21 | endfunction() 22 | -------------------------------------------------------------------------------- /cmake/modules/ClangTidy.cmake: -------------------------------------------------------------------------------- 1 | if(NOT CLANG_TIDY_EXE) 2 | include(DoOrFail) 3 | find_program_or_fail(CLANG_TIDY_EXE clang-tidy clang-tidy-10 clang-tidy-9 clang-tidy-8) 4 | 5 | execute_process( 6 | COMMAND "${CLANG_TIDY_EXE}" -version 7 | RESULT_VARIABLE CLANG_TIDY_VERSION_RESULT 8 | OUTPUT_VARIABLE CLANG_TIDY_VERSION_OUTPUT 9 | ) 10 | 11 | string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" CLANG_TIDY_VERSION "${CLANG_TIDY_VERSION_OUTPUT}") 12 | if("${CLANG_TIDY_VERSION}" VERSION_LESS "8.0.0") 13 | message(FATAL_ERROR "clang-tidy version >= 8 is required") 14 | endif() 15 | 16 | message(STATUS "Using clang-tidy: ${CLANG_TIDY_EXE} (version ${CLANG_TIDY_VERSION})") 17 | endif() 18 | 19 | set(CLANG_TIDY_ARGS "${CLANG_TIDY_EXE}" -fix) 20 | 21 | set(CMAKE_C_CLANG_TIDY ${CLANG_TIDY_ARGS}) 22 | set(CMAKE_CXX_CLANG_TIDY ${CLANG_TIDY_ARGS}) 23 | 24 | # This is useful to run clang-tidy manually: 25 | # clang-tidy -checks= -p compile_commands.json 26 | set(CMAKE_EXPORT_COMPILE_COMMANDS ON) 27 | 28 | # Disable for a single target 29 | macro(target_disable_clang_tidy TARGET) 30 | set_target_properties(${TARGET} PROPERTIES 31 | C_CLANG_TIDY "" 32 | CXX_CLANG_TIDY "" 33 | ) 34 | endmacro() 35 | -------------------------------------------------------------------------------- /cmake/modules/CustomCommandWithDepFile.cmake: -------------------------------------------------------------------------------- 1 | # Allow to easily create a custom command that uses dep file. 2 | # depfile are a ninja only feature and a hard fail using other generators. 3 | 4 | # define how DEPFILEs are treated 5 | if(${CMAKE_VERSION} VERSION_GREATER "3.19") 6 | cmake_policy(SET CMP0116 OLD) 7 | endif() 8 | 9 | function(add_custom_command_with_depfile) 10 | cmake_parse_arguments("" "" "DEPFILE" "" ${ARGN}) 11 | 12 | if(_DEPFILE AND "${CMAKE_GENERATOR}" MATCHES "Ninja") 13 | set(_dep_file_arg DEPFILE "${_DEPFILE}") 14 | endif() 15 | 16 | add_custom_command(${_UNPARSED_ARGUMENTS} ${_dep_file_arg}) 17 | endfunction() 18 | -------------------------------------------------------------------------------- /cmake/modules/DoOrFail.cmake: -------------------------------------------------------------------------------- 1 | macro(find_program_or_fail VAR) 2 | find_program(${VAR} NAMES ${ARGN}) 3 | if(NOT ${VAR}) 4 | message( 5 | FATAL_ERROR 6 | "Failed to find program [${ARGN}], please make sure that it is installed and reachable through the system PATH.") 7 | endif() 8 | endmacro() 9 | -------------------------------------------------------------------------------- /cmake/modules/FindQREncode.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019-2020 The Bitcoin developers 2 | # Distributed under the MIT software license, see the accompanying 3 | # file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #.rst 6 | # FindQREncode 7 | # ------------- 8 | # 9 | # Find the QREncode library. The following 10 | # components are available:: 11 | # qrencode 12 | # 13 | # This will define the following variables:: 14 | # 15 | # QREncode_FOUND - system has QREncode lib 16 | # QREncode_INCLUDE_DIRS - the QREncode include directories 17 | # QREncode_LIBRARIES - Libraries needed to use QREncode 18 | # 19 | # And the following imported target:: 20 | # 21 | # QREncode::qrencode 22 | 23 | include(BrewHelper) 24 | find_brew_prefix(_QREncode_BREW_HINT qrencode) 25 | 26 | find_package(PkgConfig) 27 | pkg_check_modules(PC_QREncode QUIET libqrencode) 28 | 29 | find_path(QREncode_INCLUDE_DIR 30 | NAMES qrencode.h 31 | HINTS ${_QREncode_BREW_HINT} 32 | PATHS ${PC_QREncode_INCLUDE_DIRS} 33 | PATH_SUFFIXES include 34 | ) 35 | 36 | set(QREncode_INCLUDE_DIRS "${QREncode_INCLUDE_DIR}") 37 | mark_as_advanced(QREncode_INCLUDE_DIR) 38 | 39 | # TODO: extract a version number. 40 | # For now qrencode does not provide an easy way to extract a version number. 41 | 42 | if(QREncode_INCLUDE_DIR) 43 | include(ExternalLibraryHelper) 44 | find_component(QREncode qrencode 45 | NAMES qrencode 46 | HINTS ${_QREncode_BREW_HINT} 47 | PATHS ${PC_QREncode_LIBRARY_DIRS} 48 | INCLUDE_DIRS ${QREncode_INCLUDE_DIRS} 49 | ) 50 | endif() 51 | 52 | include(FindPackageHandleStandardArgs) 53 | find_package_handle_standard_args(QREncode 54 | REQUIRED_VARS 55 | QREncode_INCLUDE_DIR 56 | HANDLE_COMPONENTS 57 | ) 58 | -------------------------------------------------------------------------------- /cmake/modules/FindRapidcheck.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020 The Bitcoin developers 2 | # Distributed under the MIT software license, see the accompanying 3 | # file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | # .rst: 6 | # FindRapidcheck 7 | # -------------- 8 | # 9 | # Find the Rapidcheck library. The following conponents are 10 | # available:: 11 | # rapidcheck 12 | # 13 | # This will define the following variables:: 14 | # 15 | # Rapidcheck_FOUND - True if the Rapidcheck library is found. 16 | # Rapidcheck_INCLUDE_DIRS - List of the header include directories. 17 | # Rapidcheck_LIBRARIES - List of the libraries. 18 | # 19 | # And the following imported targets:: 20 | # 21 | # Rapidcheck::rapidcheck 22 | 23 | find_path(Rapidcheck_INCLUDE_DIR 24 | NAMES rapidcheck.h 25 | PATH_SUFFIXES rapidcheck 26 | ) 27 | 28 | set(Rapidcheck_INCLUDE_DIRS "${Rapidcheck_INCLUDE_DIR}") 29 | mark_as_advanced(Rapidcheck_INCLUDE_DIR) 30 | 31 | # TODO: extract a version number. 32 | # For now rapidcheck does not provide such a version number, and has no release. 33 | # See https://github.com/emil-e/rapidcheck/issues/235 for reference. 34 | 35 | if(Rapidcheck_INCLUDE_DIR) 36 | include(ExternalLibraryHelper) 37 | find_component(Rapidcheck rapidcheck 38 | NAMES rapidcheck 39 | PATH_SUFFIXES rapidcheck 40 | INCLUDE_DIRS ${Rapidcheck_INCLUDE_DIRS} 41 | ) 42 | endif() 43 | 44 | include(FindPackageHandleStandardArgs) 45 | find_package_handle_standard_args(Rapidcheck 46 | REQUIRED_VARS 47 | Rapidcheck_INCLUDE_DIR 48 | HANDLE_COMPONENTS 49 | ) 50 | -------------------------------------------------------------------------------- /cmake/modules/FindSHLWAPI.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017-2020 The Bitcoin developers 2 | # Distributed under the MIT software license, see the accompanying 3 | # file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | # .rst: 6 | # FindSHLWAPI 7 | # -------------- 8 | # 9 | # Find the SHLWAPI library. The following conponents are 10 | # available:: 11 | # shlwapi 12 | # 13 | # This will define the following variables:: 14 | # 15 | # SHLWAPI_FOUND - True if the SHLWAPI library is found. 16 | # SHLWAPI_INCLUDE_DIRS - List of the header include directories. 17 | # SHLWAPI_LIBRARIES - List of the libraries. 18 | # 19 | # And the following imported targets:: 20 | # 21 | # SHLWAPI::shlwapi 22 | 23 | find_path(SHLWAPI_INCLUDE_DIR 24 | NAMES shlwapi.h 25 | ) 26 | 27 | set(SHLWAPI_INCLUDE_DIRS "${SHLWAPI_INCLUDE_DIR}") 28 | mark_as_advanced(SHLWAPI_INCLUDE_DIR) 29 | 30 | if(SHLWAPI_INCLUDE_DIR) 31 | include(ExternalLibraryHelper) 32 | find_component(SHLWAPI shlwapi 33 | NAMES shlwapi 34 | INCLUDE_DIRS ${SHLWAPI_INCLUDE_DIRS} 35 | ) 36 | endif() 37 | 38 | include(FindPackageHandleStandardArgs) 39 | find_package_handle_standard_args(SHLWAPI 40 | REQUIRED_VARS 41 | SHLWAPI_INCLUDE_DIR 42 | HANDLE_COMPONENTS 43 | ) 44 | -------------------------------------------------------------------------------- /cmake/modules/OverrideInitFlags.cmake: -------------------------------------------------------------------------------- 1 | # This will set the initial value for the C/CXX flags. 2 | # It is included at the time a project language is enabled. 3 | 4 | # This mimics the autotools behavior by setting the CFLAGS to '-g -O2`, which 5 | # are not well suited for debugging. 6 | # FIXME: update CFLAGS with better debug oriented optimization flags 7 | set(CMAKE_C_FLAGS_DEBUG_INIT "-O2") 8 | set(CMAKE_C_FLAGS_MINSIZEREL_INIT "-Os") 9 | set(CMAKE_C_FLAGS_RELEASE_INIT "-O3") 10 | set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g -O2") 11 | 12 | set(CMAKE_CXX_FLAGS_DEBUG_INIT "-O0") 13 | set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-Os") 14 | set(CMAKE_CXX_FLAGS_RELEASE_INIT "-O3") 15 | set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-g -O2") 16 | -------------------------------------------------------------------------------- /cmake/platforms/Linux32.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019 The Bitcoin developers 2 | 3 | set(CMAKE_SYSTEM_NAME Linux) 4 | set(CMAKE_SYSTEM_PROCESSOR i686) 5 | 6 | # Use given TOOLCHAIN_PREFIX if specified 7 | if(CMAKE_TOOLCHAIN_PREFIX) 8 | set(TOOLCHAIN_PREFIX ${CMAKE_TOOLCHAIN_PREFIX}) 9 | else() 10 | set(TOOLCHAIN_PREFIX ${CMAKE_SYSTEM_PROCESSOR}-pc-linux-gnu) 11 | endif() 12 | 13 | # Cross compilers to use for C and C++ 14 | set(CMAKE_C_COMPILER gcc) 15 | set(CMAKE_CXX_COMPILER g++) 16 | 17 | set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN_PREFIX}) 18 | set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN_PREFIX}) 19 | 20 | # Target environment on the build host system 21 | # Set 1st to directory with the cross compiler's C/C++ headers/libs 22 | set(CMAKE_FIND_ROOT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/depends/${TOOLCHAIN_PREFIX}") 23 | 24 | # We also may have built dependencies for the native platform. 25 | set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/depends/${TOOLCHAIN_PREFIX}/native") 26 | 27 | # Modify default behavior of FIND_XXX() commands to: 28 | # - search for headers in the target environment, 29 | # - search the libraries in the target environment first then the host (to find 30 | # the compiler supplied libraries), 31 | # - search for programs in the build host environment. 32 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 33 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) 34 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 35 | 36 | string(APPEND CMAKE_C_FLAGS_INIT " -m32") 37 | string(APPEND CMAKE_CXX_FLAGS_INIT " -m32") 38 | -------------------------------------------------------------------------------- /cmake/platforms/Linux64.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019 The Bitcoin developers 2 | 3 | set(CMAKE_SYSTEM_NAME Linux) 4 | set(CMAKE_SYSTEM_PROCESSOR x86_64) 5 | 6 | # Use given TOOLCHAIN_PREFIX if specified 7 | if(CMAKE_TOOLCHAIN_PREFIX) 8 | set(TOOLCHAIN_PREFIX ${CMAKE_TOOLCHAIN_PREFIX}) 9 | else() 10 | set(TOOLCHAIN_PREFIX ${CMAKE_SYSTEM_PROCESSOR}-linux-gnu) 11 | endif() 12 | 13 | # Cross compilers to use for C and C++ 14 | set(CMAKE_C_COMPILER gcc) 15 | set(CMAKE_CXX_COMPILER g++) 16 | 17 | set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN_PREFIX}) 18 | set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN_PREFIX}) 19 | 20 | # Target environment on the build host system 21 | # Set 1st to directory with the cross compiler's C/C++ headers/libs 22 | set(CMAKE_FIND_ROOT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/depends/${TOOLCHAIN_PREFIX}") 23 | 24 | # We also may have built dependencies for the native platform. 25 | set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/depends/${TOOLCHAIN_PREFIX}/native") 26 | 27 | # Modify default behavior of FIND_XXX() commands to: 28 | # - search for headers in the target environment, 29 | # - search the libraries in the target environment first then the host (to find 30 | # the compiler supplied libraries), 31 | # - search for programs in the build host environment. 32 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 33 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) 34 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 35 | 36 | string(APPEND CMAKE_C_FLAGS_INIT " -m64") 37 | string(APPEND CMAKE_CXX_FLAGS_INIT " -m64") 38 | -------------------------------------------------------------------------------- /cmake/platforms/LinuxAArch64.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019 The Bitcoin developers 2 | 3 | set(CMAKE_SYSTEM_NAME Linux) 4 | set(CMAKE_SYSTEM_PROCESSOR aarch64) 5 | 6 | # Use given TOOLCHAIN_PREFIX if specified 7 | if(CMAKE_TOOLCHAIN_PREFIX) 8 | set(TOOLCHAIN_PREFIX ${CMAKE_TOOLCHAIN_PREFIX}) 9 | else() 10 | set(TOOLCHAIN_PREFIX ${CMAKE_SYSTEM_PROCESSOR}-linux-gnu) 11 | endif() 12 | 13 | # Cross compilers to use for C and C++ 14 | set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc) 15 | set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++) 16 | 17 | set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN_PREFIX}) 18 | set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN_PREFIX}) 19 | 20 | # Target environment on the build host system 21 | # Set 1st to directory with the cross compiler's C/C++ headers/libs 22 | set(CMAKE_FIND_ROOT_PATH 23 | "${CMAKE_CURRENT_SOURCE_DIR}/depends/${TOOLCHAIN_PREFIX}" 24 | "/usr/${TOOLCHAIN_PREFIX}" 25 | ) 26 | 27 | # We also may have built dependencies for the native platform. 28 | set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/depends/${TOOLCHAIN_PREFIX}/native") 29 | 30 | # Modify default behavior of FIND_XXX() commands to 31 | # search for headers/libs in the target environment and 32 | # search for programs in the build host environment 33 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 34 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 35 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 36 | -------------------------------------------------------------------------------- /cmake/platforms/LinuxARM.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019 The Bitcoin developers 2 | 3 | set(CMAKE_SYSTEM_NAME Linux) 4 | set(CMAKE_SYSTEM_PROCESSOR arm) 5 | 6 | # Use given TOOLCHAIN_PREFIX if specified 7 | if(CMAKE_TOOLCHAIN_PREFIX) 8 | set(TOOLCHAIN_PREFIX ${CMAKE_TOOLCHAIN_PREFIX}) 9 | else() 10 | set(TOOLCHAIN_PREFIX ${CMAKE_SYSTEM_PROCESSOR}-linux-gnueabihf) 11 | endif() 12 | 13 | # Cross compilers to use for C and C++ 14 | set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc) 15 | set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++) 16 | 17 | set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN_PREFIX}) 18 | set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN_PREFIX}) 19 | 20 | # Target environment on the build host system 21 | # Set 1st to directory with the cross compiler's C/C++ headers/libs 22 | set(CMAKE_FIND_ROOT_PATH 23 | "${CMAKE_CURRENT_SOURCE_DIR}/depends/${TOOLCHAIN_PREFIX}" 24 | "/usr/${TOOLCHAIN_PREFIX}" 25 | ) 26 | 27 | # We also may have built dependencies for the native platform. 28 | set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/depends/${TOOLCHAIN_PREFIX}/native") 29 | 30 | # Modify default behavior of FIND_XXX() commands to 31 | # search for headers/libs in the target environment and 32 | # search for programs in the build host environment 33 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 34 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 35 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 36 | -------------------------------------------------------------------------------- /cmake/platforms/Win64.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 The Bitcoin developers 2 | 3 | set(CMAKE_SYSTEM_NAME Windows) 4 | set(CMAKE_SYSTEM_PROCESSOR x86_64) 5 | 6 | # Use given TOOLCHAIN_PREFIX if specified 7 | if(CMAKE_TOOLCHAIN_PREFIX) 8 | set(TOOLCHAIN_PREFIX ${CMAKE_TOOLCHAIN_PREFIX}) 9 | else() 10 | set(TOOLCHAIN_PREFIX ${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32) 11 | endif() 12 | 13 | # cross compilers to use for C and C++ 14 | set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc) 15 | set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++) 16 | set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres) 17 | 18 | set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN_PREFIX}) 19 | set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN_PREFIX}) 20 | 21 | # target environment on the build host system 22 | # set 1st to dir with the cross compiler's C/C++ headers/libs 23 | set(CMAKE_FIND_ROOT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/depends/${TOOLCHAIN_PREFIX};/usr/${TOOLCHAIN_PREFIX}") 24 | 25 | # We also may have built dependencies for the native plateform. 26 | set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/depends/${TOOLCHAIN_PREFIX}/native") 27 | 28 | # modify default behavior of FIND_XXX() commands to 29 | # search for headers/libs in the target environment and 30 | # search for programs in the build host environment 31 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 32 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 33 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 34 | -------------------------------------------------------------------------------- /cmake/templates/CoverageBaseline.sh.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | export LC_ALL=C 4 | set -e 5 | 6 | # Build the default target 7 | "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" 8 | 9 | # Capture (-c) initial (-i) coverage data in order to get a baseline 10 | # before running any test. 11 | "${LCOV_EXECUTABLE}" --gcov-tool="${GCOV_EXECUTABLE}" ${LCOV_OPTIONS} \ 12 | -c -i -d "${CMAKE_BINARY_DIR}" \ 13 | -o baseline_raw.info 14 | 15 | # Remove the coverage data for the paths matching any of the patterns. 16 | "${__COVERAGE_PYTHON}" "${CMAKE_SOURCE_DIR}/cmake/utils/filter-lcov.py" \ 17 | ${LCOV_FILTER_PATTERN} baseline_raw.info "${CMAKE_BINARY_DIR}/baseline.info" 18 | -------------------------------------------------------------------------------- /cmake/templates/CoverageTest.sh.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | export LC_ALL=C 4 | set -e 5 | 6 | # Capture (-c) coverage data generated by the test. 7 | "${LCOV_EXECUTABLE}" --gcov-tool="${GCOV_EXECUTABLE}" ${LCOV_OPTIONS} \ 8 | -c -d "${CMAKE_BINARY_DIR}" \ 9 | -t ${SANITIZED_TARGET} \ 10 | -o "${TARGET}.info" 11 | 12 | # Reset to zero (-z) the counters (remove the *.gcda coverage files). 13 | "${LCOV_EXECUTABLE}" --gcov-tool="${GCOV_EXECUTABLE}" ${LCOV_OPTIONS} \ 14 | -z -d "${CMAKE_BINARY_DIR}" 15 | 16 | # Remove the coverage data for the paths matching any of the patterns. 17 | "${__COVERAGE_PYTHON}" "${CMAKE_SOURCE_DIR}/cmake/utils/filter-lcov.py" \ 18 | ${LCOV_FILTER_PATTERN} "${TARGET}.info" "${TARGET}_filtered.info" 19 | 20 | # Add (-a) the baseline and test coverage data files to combine them 21 | # into a single one. 22 | "${LCOV_EXECUTABLE}" --gcov-tool="${GCOV_EXECUTABLE}" ${LCOV_OPTIONS} \ 23 | -a "${CMAKE_BINARY_DIR}/baseline.info" \ 24 | -a "${TARGET}_filtered.info" \ 25 | -o "${TARGET}_combined.info" 26 | 27 | # Generate the HTML coverage report from the coverage data. 28 | "${GENHTML_EXECUTABLE}" ${LCOV_OPTIONS} \ 29 | --demangle-cpp \ 30 | -s "${TARGET}_combined.info" \ 31 | -o "${CMAKE_BINARY_DIR}/${TARGET}.coverage" 32 | -------------------------------------------------------------------------------- /cmake/templates/NativeBuildRunner.cmake.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd "${NATIVE_BUILD_DIR}" 4 | "${CMAKE_COMMAND}" --build "${NATIVE_BUILD_DIR}" --target "${TARGET}" 5 | "${CMAKE_COMMAND}" -E create_symlink "${NATIVE_BINARY}" "${NATIVE_LINK}" 6 | 7 | # Ok let's generate a depfile if we can. 8 | if test "x${CMAKE_GENERATOR}" = "xNinja"; then 9 | "${CMAKE_SOURCE_DIR}/cmake/utils/gen-ninja-deps.py" \ 10 | --build-dir "${NATIVE_BUILD_DIR}" \ 11 | --base-dir "${CMAKE_BINARY_DIR}" \ 12 | --ninja "${CMAKE_MAKE_PROGRAM}" \ 13 | "${RELATIVE_PATH}/native-${NAME}" "${TARGET}" > "${NATIVE_LINK}.d" 14 | fi 15 | -------------------------------------------------------------------------------- /cmake/templates/NativeCmakeRunner.cmake.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | "${CMAKE_COMMAND}" -G"${CMAKE_GENERATOR}" \ 4 | -S "${CMAKE_SOURCE_DIR}" \ 5 | -B "${NATIVE_BUILD_DIR}" \ 6 | -D__IS_NATIVE_BUILD=1 \ 7 | -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} \ 8 | ${ARGS} 9 | 10 | # Ok let's generate a depfile if we can. 11 | if test "x${CMAKE_GENERATOR}" = "xNinja"; then 12 | "${CMAKE_SOURCE_DIR}/cmake/utils/gen-ninja-deps.py" \ 13 | --build-dir "${NATIVE_BUILD_DIR}" \ 14 | --base-dir "${CMAKE_BINARY_DIR}" \ 15 | --ninja "${CMAKE_MAKE_PROGRAM}" \ 16 | native/CMakeCache.txt build.ninja \ 17 | --extra-deps build.ninja \ 18 | > "${NATIVE_BUILD_DIR}/CMakeFiles/CMakeCache.txt.d" 19 | fi 20 | -------------------------------------------------------------------------------- /cmake/utils/CheckJemallocBuilds.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char** argv) { 4 | void *volatile dummyPtr = malloc(42); 5 | (void)argv; 6 | return argc; 7 | } 8 | -------------------------------------------------------------------------------- /cmake/utils/EventCheckVersion.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main(int argc, char** argv) { 6 | uint32_t version = event_get_version_number(); 7 | std::cout << 8 | ((version & 0xff000000) >> 24) << "." << 9 | ((version & 0x00ff0000) >> 16) << "." << 10 | ((version & 0x0000ff00) >> 8); 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /cmake/utils/filter-lcov.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import argparse 4 | 5 | parser = argparse.ArgumentParser( 6 | description='Remove the coverage data from a tracefile for all files matching the pattern.') 7 | parser.add_argument('--pattern', '-p', action='append', 8 | help='the pattern of files to remove', required=True) 9 | parser.add_argument( 10 | 'tracefile', help='the tracefile to remove the coverage data from') 11 | parser.add_argument('outfile', help='filename for the output to be written to') 12 | 13 | args = parser.parse_args() 14 | tracefile = args.tracefile 15 | pattern = args.pattern 16 | outfile = args.outfile 17 | 18 | in_remove = False 19 | with open(tracefile, 'r', encoding="utf8") as f: 20 | with open(outfile, 'w', encoding="utf8") as wf: 21 | for line in f: 22 | for p in pattern: 23 | if line.startswith("SF:") and p in line: 24 | in_remove = True 25 | if not in_remove: 26 | wf.write(line) 27 | if line == 'end_of_record\n': 28 | in_remove = False 29 | -------------------------------------------------------------------------------- /cmake/utils/gen-doc-man-footer.sh.in: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright (c) 2016-2019 The Bitcoin Core developers 3 | # Copyright (c) 2020-2021 The Bitcoin developers 4 | # Distributed under the MIT software license, see the accompanying 5 | # file COPYING or http://www.opensource.org/licenses/mit-license.php. 6 | 7 | export LC_ALL=C 8 | set -e 9 | 10 | { 11 | echo "-N" 12 | echo "--version-string=v@CMAKE_PROJECT_VERSION@" 13 | echo "[COPYRIGHT]" 14 | ../../src/avmd -version | sed -n '1!p' 15 | } > footer.h2m 16 | 17 | -------------------------------------------------------------------------------- /cmake/utils/gen-doc-man.sh.in: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright (c) 2016-2019 The Bitcoin Core developers 3 | # Copyright (c) 2020-2021 The Bitcoin developers 4 | # Distributed under the MIT software license, see the accompanying 5 | # file COPYING or http://www.opensource.org/licenses/mit-license.php. 6 | 7 | export LC_ALL=C 8 | set -e 9 | 10 | if [ "@CMAKE_SOURCE_DIR@" != "@CMAKE_BINARY_DIR@" ] && [ -f "@CMAKE_CURRENT_SOURCE_DIR@/man/${1##*/}.1" ]; then 11 | # If the manpage is available in the source dir, simply copy that. 12 | # Used for cross-compilation where help2man cannot execute the compiled binaries. 13 | cp -f "@CMAKE_CURRENT_SOURCE_DIR@/man/${1##*/}.1" "${1##*/}.1" 14 | else 15 | # If the Git repository is available, set the date shown in help2man output to the date of the current commit. 16 | if [ -d "@CMAKE_SOURCE_DIR@/.git" ]; then 17 | export SOURCE_DATE_EPOCH="$(git show -s --format=%ct HEAD)" 18 | fi 19 | # Generate the manpage with help2man. 20 | if [ "@CMAKE_SYSTEM_NAME@" == "Darwin" ] && [ "$1" == "qt/avm-qt" ]; then 21 | help2man --include=footer.h2m -o "${1##*/}.1" "../../src/qt/@BITCOIN_QT_OSX_BUNDLE_NAME@.app/Contents/MacOS/@BITCOIN_QT_OSX_BUNDLE_NAME@" 22 | else 23 | help2man --include=footer.h2m -o "${1##*/}.1" "../../src/$1" 24 | fi 25 | fi 26 | -------------------------------------------------------------------------------- /cmake/utils/test_wrapper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Arch, Darwin and others just default to "C" 3 | export LC_ALL=C 4 | 5 | # Test if system glibc knows about the C.UTF-8 locale 6 | if [ -x `which locale` ] && (locale -a | grep -q "C.UTF-8"); then 7 | # Debian, Fedora, etc all have this locale 8 | export LC_ALL=C.UTF-8 9 | fi 10 | 11 | # USAGE test_wrapper.sh log executable [args] 12 | # Run the with supplied arguments. 13 | # The stdout and stderr outputs are redirected to the file, which is only 14 | # printed on error. 15 | 16 | LOG="$1" 17 | shift 1 18 | 19 | "$@" > "${LOG}" 2>&1 || (cat "${LOG}" && exit 1) 20 | -------------------------------------------------------------------------------- /cmake/utils/translate.sh.in: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export LC_ALL=C.UTF-8 4 | 5 | check_command() { 6 | if ! command -v "$1" > /dev/null; then 7 | echo "$1 is required to update the translations" 8 | exit 1 9 | fi 10 | } 11 | 12 | check_command xgettext 13 | check_command lupdate 14 | check_command git 15 | 16 | mapfile -d '' GETTEXT_SOURCES < <("@GIT_EXECUTABLE@" ls-files -z -- \ 17 | "@CMAKE_SOURCE_DIR@/src/*.cpp" \ 18 | "@CMAKE_SOURCE_DIR@/src/*.h" \ 19 | ':!:secp256k1' \ 20 | ':!:crypto/ctaes' \ 21 | ':!:leveldb' \ 22 | ':!:univalue' 23 | ) 24 | 25 | COPYRIGHT_HOLDERS="@COPYRIGHT_HOLDERS@" \ 26 | "@Python_EXECUTABLE@" "@CMAKE_SOURCE_DIR@/share/qt/extract_strings_qt.py" "${GETTEXT_SOURCES[@]}" 27 | 28 | mapfile -d '' LUPDATE_FILES < <("@GIT_EXECUTABLE@" ls-files -z -- \ 29 | "@CMAKE_SOURCE_DIR@/src/qt/*.cpp" \ 30 | "@CMAKE_SOURCE_DIR@/src/qt/*.h" \ 31 | "@CMAKE_SOURCE_DIR@/src/qt/*.mm" \ 32 | "@CMAKE_SOURCE_DIR@/src/qt/forms/*.ui") 33 | 34 | QT_SELECT=qt5 \ 35 | lupdate "@CMAKE_CURRENT_SOURCE_DIR@/bitcoinstrings.cpp" \ 36 | "${LUPDATE_FILES[@]}" \ 37 | -locations relative \ 38 | -no-obsolete \ 39 | -ts "@CMAKE_CURRENT_SOURCE_DIR@/locale/bitcoin_en.ts" 40 | -------------------------------------------------------------------------------- /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/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) --sysroot $(shell xcrun --show-sdk-path) 14 | darwin_CXX:=$(shell xcrun -f clang++) -mmacosx-version-min=$(OSX_MIN_VERSION) -stdlib=libc++ --sysroot $(shell xcrun --show-sdk-path) 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/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/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 | -------------------------------------------------------------------------------- /depends/hosts/darwin.mk: -------------------------------------------------------------------------------- 1 | OSX_MIN_VERSION=10.12 2 | OSX_SDK_VERSION=10.14 3 | OSX_SDK=$(SDK_PATH)/MacOSX$(OSX_SDK_VERSION).sdk 4 | darwin_CC=clang -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) 5 | darwin_CXX=clang++ -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -stdlib=libc++ 6 | 7 | darwin_CFLAGS=-pipe 8 | darwin_CXXFLAGS=$(darwin_CFLAGS) 9 | 10 | darwin_release_CFLAGS=-O2 11 | darwin_release_CXXFLAGS=$(darwin_release_CFLAGS) 12 | 13 | darwin_debug_CFLAGS=-O1 14 | darwin_debug_CXXFLAGS=$(darwin_debug_CFLAGS) 15 | 16 | darwin_native_toolchain=native_cctools 17 | -------------------------------------------------------------------------------- /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/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/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 | -------------------------------------------------------------------------------- /depends/packages/bdb.mk: -------------------------------------------------------------------------------- 1 | package=bdb 2 | $(package)_version=5.3.28 3 | $(package)_download_path=https://download.oracle.com/berkeley-db 4 | $(package)_file_name=db-$($(package)_version).NC.tar.gz 5 | $(package)_sha256_hash=76a25560d9e52a198d37a31440fd07632b5f1f8f9f2b6d5438f4bc3e7c9013ef 6 | $(package)_build_subdir=build_unix 7 | $(package)_patches=clang_cxx_11.patch 8 | $(package)_patches+=winioctl.patch 9 | 10 | define $(package)_set_vars 11 | $(package)_config_opts=--disable-shared --enable-cxx --disable-replication --enable-option-checking 12 | $(package)_config_opts_mingw32=--enable-mingw 13 | $(package)_config_opts_linux=--with-pic 14 | $(package)_cxxflags=-std=c++11 15 | $(package)_cppflags_mingw32=-DUNICODE -D_UNICODE 16 | endef 17 | 18 | define $(package)_preprocess_cmds 19 | cd src &&\ 20 | patch -p1 < $($(package)_patch_dir)/clang_cxx_11.patch && \ 21 | patch -p1 < $($(package)_patch_dir)/winioctl.patch && \ 22 | cd .. &&\ 23 | cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub dist 24 | endef 25 | 26 | define $(package)_config_cmds 27 | ../dist/$($(package)_autoconf) 28 | endef 29 | 30 | define $(package)_build_cmds 31 | $(MAKE) -j$(JOBS) libdb_cxx-5.3.a libdb-5.3.a 32 | endef 33 | 34 | define $(package)_stage_cmds 35 | $(MAKE) DESTDIR=$($(package)_staging_dir) install_lib install_include 36 | endef 37 | -------------------------------------------------------------------------------- /depends/packages/expat.mk: -------------------------------------------------------------------------------- 1 | package=expat 2 | $(package)_version=2.2.7 3 | $(package)_download_path=https://github.com/libexpat/libexpat/releases/download/R_2_2_7/ 4 | $(package)_file_name=$(package)-$($(package)_version).tar.bz2 5 | $(package)_sha256_hash=cbc9102f4a31a8dafd42d642e9a3aa31e79a0aedaa1f6efd2795ebc83174ec18 6 | 7 | define $(package)_set_vars 8 | $(package)_config_opts=--disable-shared --without-docbook --without-tests --without-examples 9 | $(package)_config_opts += --disable-dependency-tracking --enable-option-checking 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) -j$(JOBS) 19 | endef 20 | 21 | define $(package)_stage_cmds 22 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 23 | endef 24 | 25 | define $(package)_postprocess_cmds 26 | rm lib/*.la 27 | endef 28 | -------------------------------------------------------------------------------- /depends/packages/fontconfig.mk: -------------------------------------------------------------------------------- 1 | package=fontconfig 2 | $(package)_version=2.12.6 3 | $(package)_download_path=https://www.freedesktop.org/software/fontconfig/release/ 4 | $(package)_file_name=$(package)-$($(package)_version).tar.bz2 5 | $(package)_sha256_hash=cf0c30807d08f6a28ab46c61b8dbd55c97d2f292cf88f3a07d3384687f31f017 6 | $(package)_dependencies=freetype expat 7 | 8 | define $(package)_set_vars 9 | $(package)_config_opts=--disable-docs --disable-static --disable-libxml2 --disable-iconv 10 | $(package)_config_opts += --disable-dependency-tracking --enable-option-checking 11 | endef 12 | 13 | define $(package)_config_cmds 14 | $($(package)_autoconf) 15 | endef 16 | 17 | define $(package)_build_cmds 18 | $(MAKE) -j$(JOBS) 19 | endef 20 | 21 | define $(package)_stage_cmds 22 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 23 | endef 24 | 25 | define $(package)_postprocess_cmds 26 | rm lib/*.la 27 | endef 28 | -------------------------------------------------------------------------------- /depends/packages/freetype.mk: -------------------------------------------------------------------------------- 1 | package=freetype 2 | $(package)_version=2.7.1 3 | $(package)_download_path=https://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 --without-harfbuzz --without-bzip2 --disable-static 9 | $(package)_config_opts += --enable-option-checking 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) -j$(JOBS) 19 | endef 20 | 21 | define $(package)_stage_cmds 22 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 23 | endef 24 | 25 | define $(package)_postprocess_cmds 26 | rm lib/*.la 27 | endef 28 | -------------------------------------------------------------------------------- /depends/packages/jemalloc.mk: -------------------------------------------------------------------------------- 1 | package=jemalloc 2 | $(package)_version=5.2.1 3 | $(package)_download_path=https://github.com/jemalloc/jemalloc/releases/download/$($(package)_version) 4 | $(package)_file_name=jemalloc-$($(package)_version).tar.bz2 5 | $(package)_sha256_hash=34330e5ce276099e2e8950d9335db5a875689a4c6a56751ef3b1d8c537f887f6 6 | 7 | define $(package)_set_vars 8 | $(package)_config_opts=--disable-libdl --disable-shared --enable-cxx --enable-option-checking 9 | endef 10 | 11 | define $(package)_config_cmds 12 | $($(package)_autoconf) 13 | endef 14 | 15 | define $(package)_build_cmds 16 | $(MAKE) -j$(JOBS) 17 | endef 18 | 19 | define $(package)_stage_cmds 20 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 21 | endef 22 | -------------------------------------------------------------------------------- /depends/packages/libXau.mk: -------------------------------------------------------------------------------- 1 | package=libXau 2 | $(package)_version=1.0.8 3 | $(package)_download_path=https://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 | # When updating this package, check the default value of 9 | # --disable-xthreads. It is currently enabled. 10 | define $(package)_set_vars 11 | $(package)_config_opts=--disable-shared --disable-lint-library --without-lint 12 | $(package)_config_opts += --disable-dependency-tracking --enable-option-checking 13 | $(package)_config_opts_linux=--with-pic 14 | endef 15 | 16 | define $(package)_config_cmds 17 | $($(package)_autoconf) 18 | endef 19 | 20 | define $(package)_build_cmds 21 | $(MAKE) -j$(JOBS) 22 | endef 23 | 24 | define $(package)_stage_cmds 25 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 26 | endef 27 | 28 | define $(package)_postprocess_cmds 29 | rm lib/*.la 30 | endef 31 | -------------------------------------------------------------------------------- /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 += --disable-dependency-tracking --enable-option-checking 14 | $(package)_config_opts_release=--disable-debug-mode 15 | $(package)_config_opts_linux=--with-pic 16 | endef 17 | 18 | define $(package)_config_cmds 19 | $($(package)_autoconf) 20 | endef 21 | 22 | define $(package)_build_cmds 23 | $(MAKE) -j$(JOBS) 24 | endef 25 | 26 | define $(package)_stage_cmds 27 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 28 | endef 29 | 30 | define $(package)_postprocess_cmds 31 | rm lib/*.la 32 | endef 33 | -------------------------------------------------------------------------------- /depends/packages/miniupnpc.mk: -------------------------------------------------------------------------------- 1 | package=miniupnpc 2 | $(package)_version=2.0.20180203 3 | $(package)_download_path=https://miniupnp.tuxfamily.org/files/ 4 | $(package)_file_name=$(package)-$($(package)_version).tar.gz 5 | $(package)_sha256_hash=90dda8c7563ca6cd4a83e23b3c66dbbea89603a1675bfdb852897c2c9cc220b7 6 | $(package)_patches=dont_use_wingen.patch 7 | 8 | define $(package)_set_vars 9 | $(package)_build_opts=CC="$($(package)_cc)" 10 | $(package)_build_opts_darwin=LIBTOOL="$($(package)_libtool)" 11 | $(package)_build_opts_mingw32=-f Makefile.mingw 12 | $(package)_build_env+=CFLAGS="$($(package)_cflags) $($(package)_cppflags)" AR="$($(package)_ar)" 13 | endef 14 | 15 | define $(package)_preprocess_cmds 16 | mkdir dll && \ 17 | sed -e 's|MINIUPNPC_VERSION_STRING \"version\"|MINIUPNPC_VERSION_STRING \"$($(package)_version)\"|' -e 's|OS/version|$(host)|' miniupnpcstrings.h.in > miniupnpcstrings.h && \ 18 | patch -p1 < $($(package)_patch_dir)/dont_use_wingen.patch 19 | endef 20 | 21 | define $(package)_build_cmds 22 | $(MAKE) -j$(JOBS) libminiupnpc.a $($(package)_build_opts) 23 | endef 24 | 25 | define $(package)_stage_cmds 26 | mkdir -p $($(package)_staging_prefix_dir)/include/miniupnpc $($(package)_staging_prefix_dir)/lib &&\ 27 | install *.h $($(package)_staging_prefix_dir)/include/miniupnpc &&\ 28 | install libminiupnpc.a $($(package)_staging_prefix_dir)/lib 29 | endef 30 | -------------------------------------------------------------------------------- /depends/packages/native_biplist.mk: -------------------------------------------------------------------------------- 1 | package=native_biplist 2 | $(package)_version=1.0.3 3 | $(package)_download_path=https://bitbucket.org/wooster/biplist/downloads 4 | $(package)_file_name=biplist-$($(package)_version).tar.gz 5 | $(package)_sha256_hash=4c0549764c5fe50b28042ec21aa2e14fe1a2224e239a1dae77d9e7f3932aa4c6 6 | $(package)_install_libdir=$(build_prefix)/lib/python3/dist-packages 7 | 8 | define $(package)_build_cmds 9 | python3 setup.py build 10 | endef 11 | 12 | define $(package)_stage_cmds 13 | mkdir -p $($(package)_install_libdir) && \ 14 | python3 setup.py install --root=$($(package)_staging_dir) --prefix=$(build_prefix) --install-lib=$($(package)_install_libdir) 15 | endef 16 | -------------------------------------------------------------------------------- /depends/packages/native_cdrkit.mk: -------------------------------------------------------------------------------- 1 | package=native_cdrkit 2 | $(package)_version=1.1.11 3 | $(package)_download_path=https://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 -GNinja -DCMAKE_INSTALL_PREFIX=$(build_prefix) 14 | endef 15 | 16 | define $(package)_build_cmds 17 | ninja -j$(JOBS) genisoimage 18 | endef 19 | 20 | # Older versions of cmake do not generate install target properly, but we 21 | # need to support them because that's what is in xenial and we use xenial 22 | # for reproducible builds. So we just fallback on installing everything. 23 | define $(package)_stage_cmds 24 | DESTDIR=$($(package)_staging_dir) ninja genisoimage/install || \ 25 | DESTDIR=$($(package)_staging_dir) ninja install 26 | endef 27 | 28 | define $(package)_postprocess_cmds 29 | rm bin/isovfy bin/isoinfo bin/isodump bin/isodebug bin/devdump 30 | endef 31 | -------------------------------------------------------------------------------- /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/python3/dist-packages 7 | $(package)_dependencies=native_biplist 8 | 9 | define $(package)_build_cmds 10 | python3 setup.py build 11 | endef 12 | 13 | define $(package)_stage_cmds 14 | mkdir -p $($(package)_install_libdir) && \ 15 | python3 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=7ac55ec64c96f7800d9818ce64c79670e7f02b67 3 | $(package)_download_path=https://github.com/planetbeing/libdmg-hfsplus/archive 4 | $(package)_file_name=$($(package)_version).tar.gz 5 | $(package)_sha256_hash=56fbdc48ec110966342f0ecddd6f8f89202f4143ed2a3336e42bbf88f940850c 6 | $(package)_build_subdir=build 7 | $(package)_patches=remove-libcrypto-dependency.patch 8 | 9 | define $(package)_preprocess_cmds 10 | patch -p1 < $($(package)_patch_dir)/remove-libcrypto-dependency.patch && \ 11 | mkdir build 12 | endef 13 | 14 | define $(package)_config_cmds 15 | cmake -GNinja -DCMAKE_INSTALL_PREFIX:PATH=$(build_prefix) -DCMAKE_C_FLAGS="-Wl,--build-id=none" .. 16 | endef 17 | 18 | define $(package)_build_cmds 19 | ninja -j$(JOBS) dmg 20 | endef 21 | 22 | # Older versions of cmake do not generate install target properly, but we 23 | # need to support them because that's what is in xenial and we use xenial 24 | # for reproducible builds. So we just fallback on installing everything. 25 | define $(package)_stage_cmds 26 | DESTDIR=$($(package)_staging_dir) ninja dmg/install || \ 27 | DESTDIR=$($(package)_staging_dir) ninja install 28 | endef 29 | -------------------------------------------------------------------------------- /depends/packages/native_mac_alias.mk: -------------------------------------------------------------------------------- 1 | package=native_mac_alias 2 | $(package)_version=2.0.7 3 | $(package)_download_path=https://github.com/al45tair/mac_alias/archive/ 4 | $(package)_file_name=v$($(package)_version).tar.gz 5 | $(package)_sha256_hash=6f606d3b6bccd2112aeabf1a063f5b5ece87005a5d7e97c8faca23b916e88838 6 | $(package)_install_libdir=$(build_prefix)/lib/python3/dist-packages 7 | 8 | define $(package)_build_cmds 9 | python3 setup.py build 10 | endef 11 | 12 | define $(package)_stage_cmds 13 | mkdir -p $($(package)_install_libdir) && \ 14 | python3 setup.py install --root=$($(package)_staging_dir) --prefix=$(build_prefix) --install-lib=$($(package)_install_libdir) 15 | endef 16 | -------------------------------------------------------------------------------- /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 --without-zlib 9 | endef 10 | 11 | define $(package)_config_cmds 12 | $($(package)_autoconf) 13 | endef 14 | 15 | define $(package)_build_cmds 16 | $(MAKE) -j$(JOBS) -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/packages.mk: -------------------------------------------------------------------------------- 1 | packages:=boost openssl libevent 2 | 3 | protobuf_native_packages = native_protobuf 4 | protobuf_packages = protobuf 5 | 6 | qt_packages = qrencode zlib 7 | 8 | qt_linux_packages:=qt expat libxcb xcb_proto libXau xproto freetype fontconfig 9 | 10 | rapidcheck_packages = rapidcheck 11 | 12 | qt_darwin_packages=qt 13 | qt_mingw32_packages=qt 14 | 15 | wallet_packages=bdb 16 | 17 | zmq_packages=zeromq 18 | 19 | upnp_packages=miniupnpc 20 | 21 | darwin_native_packages = native_biplist native_ds_store native_mac_alias 22 | 23 | ifneq ($(build_os),darwin) 24 | darwin_native_packages += native_cctools native_cdrkit native_libdmg-hfsplus 25 | endif 26 | 27 | jemalloc_packages = jemalloc 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 --disable-dependency-tracking 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) -j$(JOBS) -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 lib/*.la 29 | endef 30 | -------------------------------------------------------------------------------- /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 --without-tests --disable-sdltest 9 | $(package)_config_opts += --disable-gprof --disable-gcov --disable-mudflap 10 | $(package)_config_opts += --disable-dependency-tracking --enable-option-checking 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) -j$(JOBS) 20 | endef 21 | 22 | define $(package)_stage_cmds 23 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 24 | endef 25 | 26 | define $(package)_postprocess_cmds 27 | rm lib/*.la 28 | endef 29 | -------------------------------------------------------------------------------- /depends/packages/rapidcheck.mk: -------------------------------------------------------------------------------- 1 | package=rapidcheck 2 | $(package)_version=d9482c683429fe79122e3dcab14c9655874aeb8e 3 | $(package)_download_path=https://github.com/emil-e/rapidcheck/archive 4 | $(package)_file_name=$($(package)_version).tar.gz 5 | $(package)_sha256_hash=b9ee8955b175fd3c0757ebd887bb075541761af08b0c28391b7c6c0685351f6b 6 | 7 | define $(package)_config_cmds 8 | cmake -DCMAKE_INSTALL_PREFIX=$($(package)_staging_dir)$(host_prefix) -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true -DRC_ENABLE_BOOST_TEST=ON -B . 9 | endef 10 | 11 | define $(package)_preprocess_cmds 12 | sed -i.old 's/ -Wall//' CMakeLists.txt 13 | endef 14 | 15 | define $(package)_build_cmds 16 | $(MAKE) -j$(JOBS) rapidcheck 17 | endef 18 | 19 | define $(package)_stage_cmds 20 | $(MAKE) rapidcheck install 21 | endef 22 | -------------------------------------------------------------------------------- /depends/packages/xcb_proto.mk: -------------------------------------------------------------------------------- 1 | package=xcb_proto 2 | $(package)_version=1.10 3 | $(package)_download_path=https://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 --enable-option-checking 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) -j$(JOBS) 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 | -------------------------------------------------------------------------------- /depends/packages/xproto.mk: -------------------------------------------------------------------------------- 1 | package=xproto 2 | $(package)_version=7.0.26 3 | $(package)_download_path=https://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=--without-fop --without-xmlto --without-xsltproc --disable-specs 9 | $(package)_config_opts += --disable-dependency-tracking --enable-option-checking 10 | endef 11 | 12 | define $(package)_config_cmds 13 | $($(package)_autoconf) 14 | endef 15 | 16 | define $(package)_build_cmds 17 | $(MAKE) -j$(JOBS) 18 | endef 19 | 20 | define $(package)_stage_cmds 21 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 22 | endef 23 | -------------------------------------------------------------------------------- /depends/packages/zeromq.mk: -------------------------------------------------------------------------------- 1 | package=zeromq 2 | $(package)_version=4.3.4 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=c593001a89f5a85dd2ddf564805deb860e02471171b3f204944857336295c3e5 6 | $(package)_patches=remove_libstd_link.patch 7 | 8 | define $(package)_set_vars 9 | $(package)_config_opts=--without-docs --disable-shared --disable-curve --disable-curve-keygen --disable-perf 10 | $(package)_config_opts += --without-libsodium --without-libgssapi_krb5 --without-pgm --without-norm --without-vmci 11 | $(package)_config_opts += --disable-libunwind --disable-radix-tree --without-gcov --disable-dependency-tracking 12 | $(package)_config_opts += --disable-Werror --disable-drafts --enable-option-checking 13 | $(package)_config_opts_linux=--with-pic 14 | $(package)_cxxflags=-std=c++11 15 | endef 16 | 17 | define $(package)_preprocess_cmds 18 | patch -p1 < $($(package)_patch_dir)/remove_libstd_link.patch 19 | endef 20 | 21 | define $(package)_config_cmds 22 | $($(package)_autoconf) 23 | endef 24 | 25 | define $(package)_build_cmds 26 | $(MAKE) -j$(JOBS) src/libzmq.la 27 | endef 28 | 29 | define $(package)_stage_cmds 30 | $(MAKE) DESTDIR=$($(package)_staging_dir) install-libLTLIBRARIES install-includeHEADERS install-pkgconfigDATA 31 | endef 32 | 33 | define $(package)_postprocess_cmds 34 | rm -rf bin share lib/*.la 35 | endef 36 | -------------------------------------------------------------------------------- /depends/packages/zlib.mk: -------------------------------------------------------------------------------- 1 | package=zlib 2 | $(package)_version=1.2.11 3 | $(package)_download_path=https://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)_config_opts= CC="$($(package)_cc)" 9 | $(package)_config_opts+=CFLAGS="$($(package)_cflags) $($(package)_cppflags) -fPIC" 10 | $(package)_config_opts+=RANLIB="$($(package)_ranlib)" 11 | $(package)_config_opts+=AR="$($(package)_ar)" 12 | $(package)_config_opts_darwin+=AR="$($(package)_libtool)" 13 | $(package)_config_opts_darwin+=ARFLAGS="-o" 14 | endef 15 | 16 | # zlib has its own custom configure script that takes in options like CC, 17 | # CFLAGS, RANLIB, AR, and ARFLAGS from the environment rather than from 18 | # command-line arguments. 19 | define $(package)_config_cmds 20 | env $($(package)_config_opts) ./configure --static --prefix=$(host_prefix) 21 | endef 22 | 23 | define $(package)_build_cmds 24 | $(MAKE) -j$(JOBS) libz.a 25 | endef 26 | 27 | define $(package)_stage_cmds 28 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 29 | endef 30 | 31 | -------------------------------------------------------------------------------- /depends/patches/bdb/winioctl.patch: -------------------------------------------------------------------------------- 1 | commit b2c9b538fed1aa1d65b85b372f7a49f1878e9e3b 2 | Author: Fabien 3 | Date: Mon Oct 5 11:45:28 2020 +0200 4 | 5 | Fix winioctl.h case for MinGw 6 | 7 | diff --git a/dbinc/win_db.h b/dbinc/win_db.h 8 | index 6544558..6cb6878 100644 9 | --- a/dbinc/win_db.h 10 | +++ b/dbinc/win_db.h 11 | @@ -46,7 +46,7 @@ 12 | #include 13 | #include 14 | #ifndef DB_WINCE 15 | -#include 16 | +#include 17 | #endif 18 | 19 | #ifdef HAVE_GETADDRINFO 20 | -------------------------------------------------------------------------------- /depends/patches/boost/dynamic_pthread_stack_min.patch: -------------------------------------------------------------------------------- 1 | From 74fb0a26099bc51d717f5f154b37231ce7df3e98 Mon Sep 17 00:00:00 2001 2 | From: Rob Boehne 3 | Date: Wed, 20 Nov 2019 11:25:20 -0600 4 | Subject: [PATCH] Revert change to elide a warning that caused Solaris builds 5 | to fail. 6 | 7 | --- 8 | boost/thread/pthread/thread_data.hpp | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/boost/thread/pthread/thread_data.hpp b/boost/thread/pthread/thread_data.hpp 12 | index aefbeb43..bc9b1367 100644 13 | --- a/boost/thread/pthread/thread_data.hpp 14 | +++ b/boost/thread/pthread/thread_data.hpp 15 | @@ -57,7 +57,7 @@ namespace boost 16 | #else 17 | std::size_t page_size = ::sysconf( _SC_PAGESIZE); 18 | #endif 19 | -#if PTHREAD_STACK_MIN > 0 20 | +#ifdef PTHREAD_STACK_MIN 21 | if (size 3 | Date: Mon Aug 17 20:15:17 2020 +0800 4 | 5 | Remove unused variable in Boost Process 6 | 7 | This causes issues with our linters / CI. 8 | 9 | Can be removed once depends Boost is 1.71.0 or later. 10 | 11 | diff --git a/boost/process/detail/posix/wait_group.hpp b/boost/process/detail/posix/wait_group.hpp 12 | index 9dc249803..2502d9772 100644 13 | --- a/boost/process/detail/posix/wait_group.hpp 14 | +++ b/boost/process/detail/posix/wait_group.hpp 15 | @@ -137,7 +137,6 @@ inline bool wait_until( 16 | 17 | do 18 | { 19 | - int ret_sig = 0; 20 | int status; 21 | if ((::waitpid(timeout_pid, &status, WNOHANG) != 0) 22 | && (WIFEXITED(status) || WIFSIGNALED(status))) 23 | -------------------------------------------------------------------------------- /depends/patches/miniupnpc/dont_use_wingen.patch: -------------------------------------------------------------------------------- 1 | commit e8077044df239bcf0d9e9980b0e1afb9f1f5c446 2 | Author: fanquake 3 | Date: Tue Aug 18 20:50:19 2020 +0800 4 | 5 | Don't use wingenminiupnpcstrings when generating miniupnpcstrings.h 6 | 7 | The wingenminiupnpcstrings tool is used on Windows to generate version 8 | information. This information is irrelevant for us, and trying to use 9 | wingenminiupnpcstrings would cause builds to fail, so just don't use it. 10 | 11 | We should be able to drop this once we are using 2.1 or later. See 12 | upstream commit: 9663c55c61408fdcc39a82987d2243f816b22932. 13 | 14 | diff --git a/Makefile.mingw b/Makefile.mingw 15 | index 574720e..fcc17bb 100644 16 | --- a/Makefile.mingw 17 | +++ b/Makefile.mingw 18 | @@ -74,7 +74,7 @@ wingenminiupnpcstrings: wingenminiupnpcstrings.o 19 | 20 | wingenminiupnpcstrings.o: wingenminiupnpcstrings.c 21 | 22 | -miniupnpcstrings.h: miniupnpcstrings.h.in wingenminiupnpcstrings 23 | +miniupnpcstrings.h: miniupnpcstrings.h.in 24 | wingenminiupnpcstrings $< $@ 25 | 26 | minixml.o: minixml.c minixml.h 27 | -------------------------------------------------------------------------------- /depends/patches/native_cctools/ld64_disable_threading.patch: -------------------------------------------------------------------------------- 1 | commit 584668415039adeed073decee7e04de28248afd3 2 | Author: fanquake 3 | Date: Tue Aug 18 01:20:24 2020 +0000 4 | 5 | Disable threading to fix non-determinism 6 | 7 | A bug in the file parser can cause dependencies to be calculated 8 | differently based on which files have already been parsed. This is more 9 | likely to occur on systems with more CPUs. 10 | 11 | Just disable threading for now. There is no noticable slowdown. 12 | 13 | See #9891. 14 | 15 | diff --git a/cctools/ld64/src/ld/InputFiles.h b/cctools/ld64/src/ld/InputFiles.h 16 | index ef9c756..90a70b6 100644 17 | --- a/cctools/ld64/src/ld/InputFiles.h 18 | +++ b/cctools/ld64/src/ld/InputFiles.h 19 | @@ -25,7 +25,6 @@ 20 | #ifndef __INPUT_FILES_H__ 21 | #define __INPUT_FILES_H__ 22 | 23 | -#define HAVE_PTHREADS 1 24 | 25 | #include 26 | #include 27 | -------------------------------------------------------------------------------- /depends/patches/native_libdmg-hfsplus/remove-libcrypto-dependency.patch: -------------------------------------------------------------------------------- 1 | From 3e5fd3fb56bc9ff03beb535979e33dcf83fe1f70 Mon Sep 17 00:00:00 2001 2 | From: Cory Fields 3 | Date: Thu, 8 May 2014 12:39:42 -0400 4 | Subject: [PATCH] dmg: remove libcrypto dependency 5 | 6 | --- 7 | dmg/CMakeLists.txt | 16 ---------------- 8 | 1 file changed, 16 deletions(-) 9 | 10 | diff --git a/dmg/CMakeLists.txt b/dmg/CMakeLists.txt 11 | index eec62d6..3969f64 100644 12 | --- a/dmg/CMakeLists.txt 13 | +++ b/dmg/CMakeLists.txt 14 | @@ -1,12 +1,5 @@ 15 | -INCLUDE(FindOpenSSL) 16 | INCLUDE(FindZLIB) 17 | 18 | -FIND_LIBRARY(CRYPTO_LIBRARIES crypto 19 | - PATHS 20 | - /usr/lib 21 | - /usr/local/lib 22 | - ) 23 | - 24 | IF(NOT ZLIB_FOUND) 25 | message(FATAL_ERROR "zlib is required for dmg!") 26 | ENDIF(NOT ZLIB_FOUND) 27 | @@ -18,15 +11,6 @@ link_directories(${PROJECT_BINARY_DIR}/common ${PROJECT_BINARY_DIR}/hfs) 28 | 29 | add_library(dmg adc.c base64.c checksum.c dmgfile.c dmglib.c filevault.c io.c partition.c resources.c udif.c) 30 | 31 | -IF(OPENSSL_FOUND) 32 | - add_definitions(-DHAVE_CRYPT) 33 | - include_directories(${OPENSSL_INCLUDE_DIR}) 34 | - target_link_libraries(dmg ${CRYPTO_LIBRARIES}) 35 | - IF(WIN32) 36 | - TARGET_LINK_LIBRARIES(dmg gdi32) 37 | - ENDIF(WIN32) 38 | -ENDIF(OPENSSL_FOUND) 39 | - 40 | target_link_libraries(dmg common hfs z) 41 | 42 | add_executable(dmg-bin dmg.c) 43 | -- 44 | 2.22.0 45 | 46 | -------------------------------------------------------------------------------- /depends/patches/openssl/0001-Add-OpenSSL-termios-fix-for-musl-libc.patch: -------------------------------------------------------------------------------- 1 | diff --git a/crypto/ui/ui_openssl.c b/crypto/ui/ui_openssl.c 2 | index a38c758..d99edc2 100644 3 | --- a/crypto/ui/ui_openssl.c 4 | +++ b/crypto/ui/ui_openssl.c 5 | @@ -190,9 +190,9 @@ 6 | # undef SGTTY 7 | #endif 8 | 9 | -#if defined(linux) && !defined(TERMIO) 10 | -# undef TERMIOS 11 | -# define TERMIO 12 | +#if defined(linux) 13 | +# define TERMIOS 14 | +# undef TERMIO 15 | # undef SGTTY 16 | #endif 17 | 18 | -------------------------------------------------------------------------------- /depends/patches/qt/dont_hardcode_pwd.patch: -------------------------------------------------------------------------------- 1 | commit 0e953866fc4672486e29e1ba6d83b4207e7b2f0b 2 | Author: fanquake 3 | Date: Tue Aug 18 15:09:06 2020 +0800 4 | 5 | Don't hardcode pwd path 6 | 7 | Let a man use his builtins if he wants to! Also, removes the unnecessary 8 | assumption that pwd lives under /bin/pwd. 9 | 10 | See #15581. 11 | 12 | diff --git a/qtbase/configure b/qtbase/configure 13 | index 08b49a8d..faea5b55 100755 14 | --- a/qtbase/configure 15 | +++ b/qtbase/configure 16 | @@ -36,9 +36,9 @@ 17 | relconf=`basename $0` 18 | # the directory of this script is the "source tree" 19 | relpath=`dirname $0` 20 | -relpath=`(cd "$relpath"; /bin/pwd)` 21 | +relpath=`(cd "$relpath"; pwd)` 22 | # the current directory is the "build tree" or "object tree" 23 | -outpath=`/bin/pwd` 24 | +outpath=`pwd` 25 | 26 | WHICH="which" 27 | 28 | -------------------------------------------------------------------------------- /depends/patches/qt/drop_lrelease_dependency.patch: -------------------------------------------------------------------------------- 1 | commit 67b3ed7406e1d0762188dbad2c44a06824ba0778 2 | Author: fanquake 3 | Date: Tue Aug 18 15:24:01 2020 +0800 4 | 5 | Drop dependency on lrelease 6 | 7 | Qts buildsystem insists on using the installed lrelease, but gets 8 | confused about how to find it. Since we manually control the build 9 | order, just drop the dependency. 10 | 11 | See #9469 12 | 13 | diff --git a/qttranslations/translations/translations.pro b/qttranslations/translations/translations.pro 14 | index 694544c..eff339d 100644 15 | --- a/qttranslations/translations/translations.pro 16 | +++ b/qttranslations/translations/translations.pro 17 | @@ -109,3 +109,2 @@ updateqm.commands = $$LRELEASE ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT} 18 | silent:updateqm.commands = @echo lrelease ${QMAKE_FILE_IN} && $$updateqm.commands 19 | -updateqm.depends = $$LRELEASE_EXE 20 | updateqm.name = LRELEASE ${QMAKE_FILE_IN} 21 | -------------------------------------------------------------------------------- /depends/patches/qt/fix_no_printer.patch: -------------------------------------------------------------------------------- 1 | --- x/qtbase/src/plugins/platforms/cocoa/qprintengine_mac_p.h 2 | +++ y/qtbase/src/plugins/platforms/cocoa/qprintengine_mac_p.h 3 | @@ -52,6 +52,7 @@ 4 | // 5 | 6 | #include 7 | +#include 8 | 9 | #ifndef QT_NO_PRINTER 10 | 11 | --- x/qtbase/src/plugins/plugins.pro 12 | +++ y/qtbase/src/plugins/plugins.pro 13 | @@ -8,6 +8,3 @@ qtHaveModule(gui) { 14 | qtConfig(imageformatplugin): SUBDIRS *= imageformats 15 | !android:qtConfig(library): SUBDIRS *= generic 16 | } 17 | - 18 | -!winrt:qtHaveModule(printsupport): \ 19 | - SUBDIRS += printsupport 20 | -------------------------------------------------------------------------------- /depends/patches/qt/fix_qt_pkgconfig.patch: -------------------------------------------------------------------------------- 1 | --- old/qtbase/mkspecs/features/qt_module.prf 2 | +++ new/qtbase/mkspecs/features/qt_module.prf 3 | @@ -245,7 +245,7 @@ 4 | load(qt_targets) 5 | 6 | # this builds on top of qt_common 7 | -!internal_module:!lib_bundle:if(unix|mingw) { 8 | +unix|mingw { 9 | CONFIG += create_pc 10 | QMAKE_PKGCONFIG_DESTDIR = pkgconfig 11 | host_build: \ 12 | -------------------------------------------------------------------------------- /depends/patches/qt/fix_rcc_determinism.patch: -------------------------------------------------------------------------------- 1 | --- old/qtbase/src/tools/rcc/rcc.cpp 2 | +++ new/qtbase/src/tools/rcc/rcc.cpp 3 | @@ -207,7 +207,11 @@ void RCCFileInfo::writeDataInfo(RCCResourceLibrary &lib) 4 | if (lib.formatVersion() >= 2) { 5 | // last modified time stamp 6 | const QDateTime lastModified = m_fileInfo.lastModified(); 7 | - lib.writeNumber8(quint64(lastModified.isValid() ? lastModified.toMSecsSinceEpoch() : 0)); 8 | + quint64 lastmod = quint64(lastModified.isValid() ? lastModified.toMSecsSinceEpoch() : 0); 9 | + static const quint64 sourceDate = 1000 * qgetenv("QT_RCC_SOURCE_DATE_OVERRIDE").toULongLong(); 10 | + if (sourceDate != 0) 11 | + lastmod = sourceDate; 12 | + lib.writeNumber8(lastmod); 13 | if (text || pass1) 14 | lib.writeChar('\n'); 15 | } 16 | -------------------------------------------------------------------------------- /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 | QMAKE_APPLE_DEVICE_ARCHS=x86_64 18 | !host_build: QMAKE_CFLAGS += -target $${MAC_TARGET} 19 | !host_build: QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_CFLAGS 20 | !host_build: QMAKE_CXXFLAGS += $$QMAKE_CFLAGS 21 | !host_build: QMAKE_LFLAGS += -target $${MAC_TARGET} 22 | QMAKE_AR = $${CROSS_COMPILE}ar cq 23 | QMAKE_RANLIB=$${CROSS_COMPILE}ranlib 24 | QMAKE_LIBTOOL=$${CROSS_COMPILE}libtool 25 | QMAKE_INSTALL_NAME_TOOL=$${CROSS_COMPILE}install_name_tool 26 | load(qt_config) 27 | -------------------------------------------------------------------------------- /depends/patches/qt/xkb-default.patch: -------------------------------------------------------------------------------- 1 | --- old/qtbase/src/gui/configure.pri 2018-06-06 17:28:10.000000000 -0400 2 | +++ new/qtbase/src/gui/configure.pri 2018-08-17 18:43:01.589384567 -0400 3 | @@ -43,18 +43,11 @@ 4 | } 5 | 6 | defineTest(qtConfTest_xkbConfigRoot) { 7 | - qtConfTest_getPkgConfigVariable($${1}): return(true) 8 | - 9 | - for (dir, $$list("/usr/share/X11/xkb", "/usr/local/share/X11/xkb")) { 10 | - exists($$dir) { 11 | - $${1}.value = $$dir 12 | - export($${1}.value) 13 | - $${1}.cache += value 14 | - export($${1}.cache) 15 | - return(true) 16 | - } 17 | - } 18 | - return(false) 19 | + $${1}.value = "/usr/share/X11/xkb" 20 | + export($${1}.value) 21 | + $${1}.cache += value 22 | + export($${1}.cache) 23 | + return(true) 24 | } 25 | 26 | defineTest(qtConfTest_qpaDefaultPlatform) { 27 | -------------------------------------------------------------------------------- /depends/patches/zeromq/remove_libstd_link.patch: -------------------------------------------------------------------------------- 1 | commit 47d4cd12a2c051815ddda78adebdb3923b260d8a 2 | Author: fanquake 3 | Date: Tue Aug 18 14:45:40 2020 +0800 4 | 5 | Remove needless linking against libstdc++ 6 | 7 | This is broken for a number of reasons, including: 8 | - g++ understands "static-libstdc++ -lstdc++" to mean "link against 9 | whatever libstdc++ exists, probably shared", which in itself is buggy. 10 | - another stdlib (libc++ for example) may be in use 11 | 12 | See #11981. 13 | 14 | diff --git a/src/libzmq.pc.in b/src/libzmq.pc.in 15 | index 233bc3a..3c2bf0d 100644 16 | --- a/src/libzmq.pc.in 17 | +++ b/src/libzmq.pc.in 18 | @@ -7,6 +7,6 @@ Name: libzmq 19 | Description: 0MQ c++ library 20 | Version: @VERSION@ 21 | Libs: -L${libdir} -lzmq 22 | -Libs.private: -lstdc++ @pkg_config_libs_private@ 23 | +Libs.private: @pkg_config_libs_private@ 24 | Requires.private: @pkg_config_names_private@ 25 | Cflags: -I${includedir} @pkg_config_defines@ 26 | -------------------------------------------------------------------------------- /doc/README.md: -------------------------------------------------------------------------------- 1 | # AVM Interpretor Setup 2 | 3 | To download AVM Interpretor https://github.com/atomicals/avm-interpreter.git 4 | 5 | ## Running 6 | 7 | The following are some helpful notes on how to run AVM Interpretor on your 8 | native platform. 9 | 10 | ### Unix 11 | 12 | Quick Start (Build from Source) 13 | 14 | ```bash 15 | # Clone repository and build: 16 | mkdir build && cd build 17 | cmake -GNinja .. 18 | ``` 19 | 20 | Next, finish the build 21 | 22 | ```bash 23 | ninja 24 | ``` 25 | 26 | Install: 27 | 28 | ```bash 29 | ninja install 30 | ``` 31 | 32 | Connect installed AVM libraries to the ElectrumX indexer. 33 | -------------------------------------------------------------------------------- /doc/build-freebsd.md: -------------------------------------------------------------------------------- 1 | # FreeBSD build guide 2 | 3 | (updated for FreeBSD 12.1) 4 | 5 | This guide describes how to build bitcoind and command-line utilities on FreeBSD. 6 | 7 | This guide does not contain instructions for building the GUI. 8 | 9 | ## Preparation 10 | 11 | You will need the following dependencies, which can be installed as root via pkg: 12 | 13 | ```bash 14 | pkg install cmake libevent ninja openssl boost-libs git 15 | ``` 16 | 17 | ## Building AVM Interpretor 18 | 19 | Download the source code: 20 | 21 | ```bash 22 | git clone https://github.com/avm/avm.git 23 | cd avm/ 24 | ``` 25 | 26 | To build with wallet: 27 | 28 | ```bash 29 | mkdir build 30 | cd build 31 | cmake -GNinja -DBUILD_AVM_QT=OFF .. 32 | ninja 33 | ninja check # recommended 34 | ``` 35 | 36 | To build without wallet: 37 | 38 | ```bash 39 | mkdir build 40 | cd build 41 | cmake -GNinja -DBUILD_AVM_QT=OFF -DBUILD_AVM_WALLET=OFF .. 42 | ninja 43 | ninja check # recommended 44 | ``` 45 | 46 | To build with wallet and GUI: 47 | 48 | ```bash 49 | mkdir build 50 | cd build 51 | cmake -GNinja .. 52 | ninja 53 | ninja check # recommended 54 | ninja test_bitcoin-qt # recommended 55 | ``` 56 | 57 | After a successful test you can install the newly built binaries to your bin directory. 58 | Note that this will probably overwrite any previous version installed, including 59 | binaries from different sources. 60 | It might be necessary to run as root, depending on your system configuration: 61 | 62 | ```bash 63 | ninja install #optional 64 | ``` 65 | -------------------------------------------------------------------------------- /doc/build-unix-alpine.md: -------------------------------------------------------------------------------- 1 | # Alpine build guide 2 | 3 | Instructions for alpine 3.13 4 | 5 | ## Preparation 6 | 7 | Minimal dependencies: 8 | 9 | ```sh 10 | apk add git boost-dev cmake libevent-dev openssl-dev build-base py-pip db-dev help2man bash 11 | pip install ninja 12 | ``` 13 | 14 | NOTE: Since alpine 3.12, `ninja` was replaced with `samurai`, which is not fully compatible with 15 | the build system, hence the need for installing it with `pip` 16 | 17 | ## Building 18 | 19 | Once you have installed the required dependencies (see sections above), you can 20 | build AVM as such: 21 | 22 | First fetch the code (if you haven't done so already). 23 | 24 | ```sh 25 | git clone https://github.com/atomicals/avm.git 26 | ``` 27 | 28 | Change to the avm directory, make `build` dir, and change to that directory 29 | 30 | ```sh 31 | cd avm/ 32 | mkdir build 33 | cd build 34 | ``` 35 | 36 | **Choose one:** 37 | 38 | 39 | ```sh 40 | # Build avm-cli and libatomicalsconsensus 41 | cmake -GNinja .. 42 | ``` 43 | 44 | Next, finish the build 45 | 46 | ```sh 47 | ninja 48 | ``` 49 | 50 | You will find `avm-cli` 51 | binaries in `/build/src`. 52 | 53 | ```sh 54 | sudo ninja install #optional 55 | ``` 56 | -------------------------------------------------------------------------------- /doc/build-unix-arch.md: -------------------------------------------------------------------------------- 1 | # Arch Linux build guide 2 | 3 | ## Preparation 4 | 5 | You will need the following dependencies: 6 | 7 | ```bash 8 | pacman -S boost cmake git libevent ninja python help2man 9 | ``` 10 | 11 | 12 | ## Building 13 | 14 | Once you have installed the required dependencies (see sections above), you can 15 | build AVM as such: 16 | 17 | First fetch the code (if you haven't done so already). 18 | 19 | ```sh 20 | git clone https://github.com/atomicals/avm.git 21 | ``` 22 | 23 | Change to the avm directory, make `build` dir, and change to that directory 24 | 25 | ```sh 26 | cd avm/ 27 | mkdir build 28 | cd build 29 | ``` 30 | 31 | **Choose one:** 32 | 33 | 34 | ```sh 35 | # Build avm-cli and libatomicalsconsensus 36 | cmake -GNinja .. 37 | ``` 38 | 39 | Next, finish the build 40 | 41 | ```sh 42 | ninja 43 | ``` 44 | 45 | You will find `avm-cli` 46 | binaries in `/build/src`. 47 | 48 | ```sh 49 | sudo ninja install #optional 50 | ``` 51 | -------------------------------------------------------------------------------- /doc/build-unix-rpm.md: -------------------------------------------------------------------------------- 1 | # Fedora / CentOS build guide 2 | 3 | (updated for Fedora 31) 4 | 5 | ## Preparation 6 | 7 | Minimal build requirements: 8 | 9 | ```bash 10 | sudo dnf install boost-devel cmake gcc-c++ git libevent-devel ninja-build openssl-devel python3 help2man 11 | ``` 12 | 13 | 14 | ## Building 15 | 16 | Once you have installed the required dependencies (see sections above), you can 17 | build AVM as such: 18 | 19 | First fetch the code (if you haven't done so already). 20 | 21 | ```sh 22 | git clone https://github.com/atomicals/avm.git 23 | ``` 24 | 25 | Change to the avm directory, make `build` dir, and change to that directory 26 | 27 | ```sh 28 | cd avm/ 29 | mkdir build 30 | cd build 31 | ``` 32 | 33 | **Choose one:** 34 | 35 | 36 | ```sh 37 | # Build avm-cli and libatomicalsconsensus 38 | cmake -GNinja .. 39 | ``` 40 | 41 | Next, finish the build 42 | 43 | ```sh 44 | ninja 45 | ``` 46 | 47 | You will find `avm-cli` 48 | binaries in `/build/src`. 49 | 50 | ```sh 51 | sudo ninja install #optional 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 | export LC_ALL=C 7 | if [ $# -gt 1 ]; then 8 | cd "$2" || exit 1 9 | fi 10 | if [ $# -gt 0 ]; then 11 | FILE="$1" 12 | shift 13 | if [ -f "$FILE" ]; then 14 | INFO="$(head -n 1 "$FILE")" 15 | fi 16 | else 17 | echo "Usage: $0 " 18 | exit 1 19 | fi 20 | 21 | DESC="" 22 | SUFFIX="" 23 | if [ -e "$(command -v git)" ] && [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]; then 24 | # clean 'dirty' status of touched files that haven't been modified 25 | git diff >/dev/null 2>/dev/null 26 | 27 | # if latest commit is tagged and not dirty, then override using the tag name 28 | RAWDESC=$(git describe --abbrev=0 2>/dev/null) 29 | if [ "$(git rev-parse HEAD)" = "$(git rev-list -1 "$RAWDESC" 2>/dev/null)" ]; then 30 | git diff-index --quiet HEAD -- && DESC="$RAWDESC" 31 | fi 32 | 33 | # otherwise generate suffix from git, i.e. string like "59887e8-dirty" 34 | SUFFIX=$(git rev-parse --short HEAD) 35 | git diff-index --quiet HEAD -- || SUFFIX="$SUFFIX-dirty" 36 | fi 37 | 38 | if [ -n "$DESC" ]; then 39 | NEWINFO="#define BUILD_DESC \"$DESC\"" 40 | elif [ -n "$SUFFIX" ]; then 41 | NEWINFO="#define BUILD_SUFFIX $SUFFIX" 42 | else 43 | NEWINFO="// No build information available" 44 | fi 45 | 46 | # only update build.h if necessary 47 | if [ "$INFO" != "$NEWINFO" ]; then 48 | echo "$NEWINFO" >"$FILE" 49 | fi 50 | -------------------------------------------------------------------------------- /src/.clang-format: -------------------------------------------------------------------------------- 1 | ColumnLimit: 120 2 | AlwaysBreakTemplateDeclarations: Yes 3 | IndentWidth: 4 4 | TabWidth: 4 5 | AccessModifierOffset: -4 6 | UseTab: Never 7 | IndentCaseLabels: true 8 | NamespaceIndentation: Inner 9 | BreakBeforeBraces: Attach 10 | ReflowComments: true 11 | AlignEscapedNewlines: Right 12 | AllowShortBlocksOnASingleLine: false 13 | AllowShortIfStatementsOnASingleLine: true 14 | AllowShortFunctionsOnASingleLine: Inline 15 | FixNamespaceComments: true 16 | ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH, BOOST_REVERSE_FOREACH ] 17 | CommentPragmas: '@DISABLE FORMATING FOR THIS COMMENT@' 18 | KeepEmptyLinesAtTheStartOfBlocks: false 19 | --- 20 | Language: Cpp 21 | Standard: Cpp11 22 | --- 23 | Language: ObjC 24 | ObjCBlockIndentWidth: 4 25 | -------------------------------------------------------------------------------- /src/.clang-tidy: -------------------------------------------------------------------------------- 1 | Checks: -*,boost-use-to-string,readability-braces-around-statements 2 | FormatStyle: file 3 | -------------------------------------------------------------------------------- /src/algorithm/algorithm.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 The Bitcoin developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | -------------------------------------------------------------------------------- /src/algorithm/contains.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 The Bitcoin developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | namespace algo { 10 | 11 | template 12 | // requires AssociativeContainer && Regular 13 | inline 14 | bool contains(C const& c, K const& x) { 15 | return c.find(x) != std::end(c); 16 | } 17 | 18 | } // namespace algo 19 | -------------------------------------------------------------------------------- /src/algorithm/erase_if.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 The Bitcoin developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | #include 10 | 11 | namespace algo { 12 | 13 | template 14 | // requires AssociativeContainer && UnaryPredicate

15 | inline 16 | attr::SizeType erase_if(C& c, P pred) { 17 | auto const old_size = std::size(c); 18 | auto f = std::begin(c); 19 | auto const l = std::end(c); 20 | while (f != l) { 21 | if (pred(*f)) { 22 | f = c.erase(f); 23 | } else { 24 | ++f; 25 | } 26 | } 27 | return old_size - std::size(c); 28 | } 29 | 30 | } // namespace algo 31 | -------------------------------------------------------------------------------- /src/algorithm/type_attributes.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 The Bitcoin developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | namespace attr { 10 | 11 | template 12 | // requires Container 13 | using SizeType = typename C::size_type; 14 | 15 | } // namespace attr 16 | -------------------------------------------------------------------------------- /src/amount.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2016 The Bitcoin Core developers 3 | // Copyright (c) 2017-2019 The Bitcoin developers 4 | // Distributed under the MIT software license, see the accompanying 5 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 6 | 7 | #include 8 | 9 | #include 10 | 11 | 12 | std::string Amount::ToString(bool trimTrailingZeros, bool trimTrailingDecimalPoint) const { 13 | std::string result{strprintf("%d", amount)}; 14 | 15 | unsigned int start = result.front() == '-' ? 1u : 0u; 16 | if (result.length() - start <= 8u) result.insert(start, std::string(9u + start - result.length(), '0')); // if value is less than 1 coin, left-pad zeros 17 | result.insert(result.length() - 8u, "."); // decimal place in the correct location 18 | 19 | if (trimTrailingZeros) { 20 | result.resize(result.find_last_not_of('0') + 1u); 21 | if (result.back() == '.') { // if the decimal point would be the last character... 22 | if (trimTrailingDecimalPoint) result.resize(result.length() - 1u); // strip the decimal point as well 23 | else result += '0'; // we want to keep the decimal, so append back a single .0 24 | } 25 | } 26 | return result; 27 | } 28 | -------------------------------------------------------------------------------- /src/attributes.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2018 The Bitcoin Core developers 3 | // Copyright (c) 2020 The Bitcoin developers 4 | // Distributed under the MIT software license, see the accompanying 5 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 6 | 7 | #pragma once 8 | 9 | /* This file is a place to put macros for decorating functions and variables. 10 | * 11 | * It is currently empty, however it used to be the place where the NODISCARD 12 | * macro once lived. After switching to C++17, we opted to instead retire the 13 | * macro in favor of the C++17 guaranteed-to-exist-always-on-every-compiler: 14 | * [[nodiscard]] attribute. 15 | * 16 | * However, this file is being kept in the codebase in case we need to someday 17 | * once again add attribute macros to the codebase, in which case this is where 18 | * they should live. 19 | */ 20 | 21 | -------------------------------------------------------------------------------- /src/avm-cli-res.rc: -------------------------------------------------------------------------------- 1 | #include // needed for VERSIONINFO 2 | #include // holds the needed client version information 3 | 4 | #define VER_PRODUCTVERSION CLIENT_VERSION_MAJOR,CLIENT_VERSION_MINOR,CLIENT_VERSION_REVISION 5 | #define VER_PRODUCTVERSION_STR STRINGIZE(CLIENT_VERSION_MAJOR) "." STRINGIZE(CLIENT_VERSION_MINOR) "." STRINGIZE(CLIENT_VERSION_REVISION) 6 | #define VER_FILEVERSION VER_PRODUCTVERSION 7 | #define VER_FILEVERSION_STR VER_PRODUCTVERSION_STR 8 | 9 | VS_VERSION_INFO VERSIONINFO 10 | FILEVERSION VER_FILEVERSION 11 | PRODUCTVERSION VER_PRODUCTVERSION 12 | FILEOS VOS_NT_WINDOWS32 13 | FILETYPE VFT_APP 14 | BEGIN 15 | BLOCK "StringFileInfo" 16 | BEGIN 17 | BLOCK "040904E4" // U.S. English - multilingual (hex) 18 | BEGIN 19 | VALUE "CompanyName", "Atomicals" 20 | VALUE "FileDescription", "avm-cli (JSON-RPC client for " PACKAGE_NAME ")" 21 | VALUE "FileVersion", VER_FILEVERSION_STR 22 | VALUE "InternalName", "avm-cli" 23 | VALUE "LegalCopyright", COPYRIGHT_STR 24 | VALUE "LegalTrademarks1", "Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php." 25 | VALUE "OriginalFilename", "avm-cli.exe" 26 | VALUE "ProductName", "avm-cli" 27 | VALUE "ProductVersion", VER_PRODUCTVERSION_STR 28 | END 29 | END 30 | 31 | BLOCK "VarFileInfo" 32 | BEGIN 33 | VALUE "Translation", 0x0, 1252 // language neutral - multilingual (decimal) 34 | END 35 | END 36 | -------------------------------------------------------------------------------- /src/avm-cli.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2016 The Bitcoin Core developers 3 | // Copyright (c) 2020 The Bitcoin developers 4 | // Distributed under the MIT software license, see the accompanying 5 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 6 | 7 | int main(int argc, char *argv[]) { 8 | #ifdef WIN32 9 | util::WinCmdLineArgs winArgs; 10 | std::tie(argc, argv) = winArgs.get(); 11 | #endif 12 | int ret = 0; 13 | return ret; 14 | } 15 | -------------------------------------------------------------------------------- /src/blockvalidity.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018 The Bitcoin developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | enum class BlockValidity : uint32_t { 10 | /** 11 | * Unused. 12 | */ 13 | UNKNOWN = 0, 14 | 15 | /** 16 | * Parsed, version ok, hash satisfies claimed PoW, 1 <= vtx count <= max, 17 | * timestamp not in future. 18 | */ 19 | HEADER = 1, 20 | 21 | /** 22 | * All parent headers found, difficulty matches, timestamp >= median 23 | * previous, checkpoint. Implies all parents are also at least TREE. 24 | */ 25 | TREE = 2, 26 | 27 | /** 28 | * Only first tx is coinbase, 2 <= coinbase input script length <= 100, 29 | * transactions valid, no duplicate txids, size, merkle root. 30 | * Implies all parents are at least TREE but not necessarily TRANSACTIONS. 31 | * When all parent blocks also have TRANSACTIONS, CBlockIndex::nChainTx will 32 | * be set. 33 | */ 34 | TRANSACTIONS = 3, 35 | 36 | /** 37 | * Outputs do not overspend inputs, no double spends, coinbase output ok, no 38 | * immature coinbase spends, BIP30. 39 | * Implies all parents are also at least CHAIN. 40 | */ 41 | CHAIN = 4, 42 | 43 | /** 44 | * Scripts & signatures ok. Implies all parents are also at least SCRIPTS. 45 | */ 46 | SCRIPTS = 5, 47 | }; 48 | -------------------------------------------------------------------------------- /src/compat/byteswap.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-2016 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #pragma once 6 | 7 | #if defined(HAVE_CONFIG_H) 8 | #include 9 | #endif 10 | 11 | #include 12 | 13 | #if defined(HAVE_BYTESWAP_H) 14 | #include 15 | #endif 16 | 17 | #if defined(MAC_OSX) 18 | 19 | #if !defined(bswap_16) 20 | 21 | // Mac OS X / Darwin features; we include a check for bswap_16 because if it is 22 | // already defined, protobuf has defined these macros for us already; if it 23 | // isn't, we do it ourselves. In either case, we get the exact same result 24 | // regardless which path was taken 25 | #include 26 | #define bswap_16(x) OSSwapInt16(x) 27 | #define bswap_32(x) OSSwapInt32(x) 28 | #define bswap_64(x) OSSwapInt64(x) 29 | 30 | #endif // !defined(bswap_16) 31 | 32 | #else 33 | // Non-Mac OS X / non-Darwin 34 | 35 | #if HAVE_DECL_BSWAP_16 == 0 36 | inline uint16_t bswap_16(uint16_t x) { 37 | return (x >> 8) | ((x & 0x00ff) << 8); 38 | } 39 | #endif // HAVE_DECL_BSWAP16 40 | 41 | #if HAVE_DECL_BSWAP_32 == 0 42 | inline uint32_t bswap_32(uint32_t x) { 43 | return (((x & 0xff000000U) >> 24) | ((x & 0x00ff0000U) >> 8) | 44 | ((x & 0x0000ff00U) << 8) | ((x & 0x000000ffU) << 24)); 45 | } 46 | #endif // HAVE_DECL_BSWAP32 47 | 48 | #if HAVE_DECL_BSWAP_64 == 0 49 | inline uint64_t bswap_64(uint64_t x) { 50 | return (((x & 0xff00000000000000ull) >> 56) | 51 | ((x & 0x00ff000000000000ull) >> 40) | 52 | ((x & 0x0000ff0000000000ull) >> 24) | 53 | ((x & 0x000000ff00000000ull) >> 8) | 54 | ((x & 0x00000000ff000000ull) << 8) | 55 | ((x & 0x0000000000ff0000ull) << 24) | 56 | ((x & 0x000000000000ff00ull) << 40) | 57 | ((x & 0x00000000000000ffull) << 56)); 58 | } 59 | #endif // HAVE_DECL_BSWAP64 60 | 61 | #endif // defined(MAC_OSX) 62 | -------------------------------------------------------------------------------- /src/compat/cpuid.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2019 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #pragma once 6 | 7 | #if defined(__x86_64__) || defined(__amd64__) || defined(__i386__) 8 | #define HAVE_GETCPUID 9 | 10 | #include 11 | 12 | // We can't use cpuid.h's __get_cpuid as it does not support subleafs. 13 | void static inline GetCPUID(uint32_t leaf, uint32_t subleaf, uint32_t &a, 14 | uint32_t &b, uint32_t &c, uint32_t &d) { 15 | #ifdef __GNUC__ 16 | __cpuid_count(leaf, subleaf, a, b, c, d); 17 | #else 18 | __asm__("cpuid" 19 | : "=a"(a), "=b"(b), "=c"(c), "=d"(d) 20 | : "0"(leaf), "2"(subleaf)); 21 | #endif 22 | } 23 | 24 | #endif // defined(__x86_64__) || defined(__amd64__) || defined(__i386__) 25 | -------------------------------------------------------------------------------- /src/compat/glibcxx_sanity.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2014 The Bitcoin Core developers 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 | namespace { 10 | // trigger: use ctype::widen to trigger ctype::_M_widen_init(). 11 | // test: convert a char from narrow to wide and back. Verify that the result 12 | // matches the original. 13 | bool sanity_test_widen(char testchar) { 14 | const std::ctype &test( 15 | std::use_facet>(std::locale())); 16 | return test.narrow(test.widen(testchar), 'b') == testchar; 17 | } 18 | 19 | // trigger: use list::push_back and list::pop_back to trigger _M_hook and 20 | // _M_unhook. 21 | // test: Push a sequence of integers into a list. Pop them off and verify that 22 | // they match the original sequence. 23 | bool sanity_test_list(unsigned int size) { 24 | std::list test; 25 | for (unsigned int i = 0; i != size; ++i) { 26 | test.push_back(i + 1); 27 | } 28 | 29 | if (test.size() != size) { 30 | return false; 31 | } 32 | 33 | while (!test.empty()) { 34 | if (test.back() != test.size()) { 35 | return false; 36 | } 37 | test.pop_back(); 38 | } 39 | return true; 40 | } 41 | 42 | } // namespace 43 | 44 | // trigger: string::at(x) on an empty string to trigger 45 | // __throw_out_of_range_fmt. 46 | // test: force std::string to throw an out_of_range exception. Verify that 47 | // it's caught correctly. 48 | bool sanity_test_range_fmt() { 49 | std::string test; 50 | try { 51 | test.at(1); 52 | } catch (const std::out_of_range &) { 53 | return true; 54 | } catch (...) { 55 | } 56 | return false; 57 | } 58 | 59 | bool glibcxx_sanity_test() { 60 | return sanity_test_widen('a') && sanity_test_list(100) && 61 | sanity_test_range_fmt(); 62 | } 63 | -------------------------------------------------------------------------------- /src/compat/sanity.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #pragma once 6 | 7 | bool glibc_sanity_test(); 8 | bool glibcxx_sanity_test(); 9 | -------------------------------------------------------------------------------- /src/compat/setenv.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018 The Bitcoin developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #pragma once 6 | 7 | #if defined(WIN32) 8 | 9 | #include 10 | 11 | int setenv(const char *name, const char *value, int overwrite) { 12 | return _putenv_s(name, value); 13 | } 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /src/compat/strnlen.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #if defined(HAVE_CONFIG_H) 6 | #include 7 | #endif 8 | 9 | #include 10 | 11 | #if HAVE_DECL_STRNLEN == 0 12 | size_t strnlen(const char *start, size_t max_len) { 13 | const char *end = (const char *)memchr(start, '\0', max_len); 14 | 15 | return end ? (size_t)(end - start) : max_len; 16 | } 17 | #endif // HAVE_DECL_STRNLEN 18 | -------------------------------------------------------------------------------- /src/config.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2020 The Bitcoin developers 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 | 7 | 8 | #include 9 | #include // MAX_INV_BROADCAST_* 10 | #include 11 | #include 12 | 13 | -------------------------------------------------------------------------------- /src/config.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 Amaury SÉCHET 2 | // Copyright (c) 2020 The Bitcoin 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 | #pragma once 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | -------------------------------------------------------------------------------- /src/config/.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomicals/avm-interpreter/c185e6216a3ea2cb2e011e508033ca535ece3472/src/config/.empty -------------------------------------------------------------------------------- /src/config/version.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Bitcoin developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #pragma once 6 | 7 | #define CLIENT_VERSION_MAJOR 1 8 | #define CLIENT_VERSION_MINOR 0 9 | #define CLIENT_VERSION_REVISION 0 10 | #define CLIENT_VERSION_IS_RELEASE 0 11 | -------------------------------------------------------------------------------- /src/config/version.h.cmake.in: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Bitcoin developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #pragma once 6 | 7 | #define CLIENT_VERSION_MAJOR ${CLIENT_VERSION_MAJOR} 8 | #define CLIENT_VERSION_MINOR ${CLIENT_VERSION_MINOR} 9 | #define CLIENT_VERSION_REVISION ${CLIENT_VERSION_REVISION} 10 | #cmakedefine01 CLIENT_VERSION_IS_RELEASE 11 | -------------------------------------------------------------------------------- /src/consensus/consensus.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2016 The Bitcoin Core developers 3 | // Copyright (c) 2021 The Bitcoin developers 4 | // Distributed under the MIT software license, see the accompanying 5 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | /** 1MB */ 12 | inline constexpr uint64_t ONE_MEGABYTE = 1000000; 13 | /** The maximum allowed size for a transaction, in bytes */ 14 | inline constexpr uint64_t MAX_TX_SIZE = 4 * ONE_MEGABYTE; 15 | -------------------------------------------------------------------------------- /src/consensus/merkle.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | uint256 ComputeMerkleRoot(std::vector hashes, bool *mutated = nullptr); 15 | 16 | /** 17 | * Compute the Merkle root of the transactions in a block. 18 | * *mutated is set to true if a duplicated subtree was found. 19 | */ 20 | uint256 BlockMerkleRoot(const CBlock &block, bool *mutated = nullptr); 21 | -------------------------------------------------------------------------------- /src/core_io.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2016 The Bitcoin Core developers 2 | // Copyright (c) 2020 The Bitcoin 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 | #pragma once 7 | 8 | #include 9 | #include