diff --git a/cmake/modules/InstallationHelper.cmake b/cmake/modules/InstallationHelper.cmake index 7df03901b..c734d06a3 100644 --- a/cmake/modules/InstallationHelper.cmake +++ b/cmake/modules/InstallationHelper.cmake @@ -1,196 +1,219 @@ # This file contains facilities for installing the files. include(GNUInstallDirs) include(SanitizeHelper) function(_add_install_target COMPONENT) cmake_parse_arguments(ARG "EXCLUDE_FROM_ALL" "" "DEPENDS" ${ARGN} ) sanitize_target_name("install-" "${COMPONENT}" INSTALL_TARGET) if(NOT TARGET ${INSTALL_TARGET}) add_custom_target(${INSTALL_TARGET} COMMENT "Installing component ${COMPONENT}" COMMAND "${CMAKE_COMMAND}" -E env CMAKE_INSTALL_ALWAYS=ON "${CMAKE_COMMAND}" -DCOMPONENT="${COMPONENT}" -DCMAKE_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}" -P cmake_install.cmake WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" ) if(TARGET install-all) add_dependencies(install-all ${INSTALL_TARGET}) endif() endif() # Other arguments are additional dependencies if(ARG_DEPENDS) add_dependencies(${INSTALL_TARGET} ${ARG_DEPENDS}) endif() if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") if(NOT TARGET "install-${COMPONENT}-debug") add_custom_target("install-${COMPONENT}-debug" COMMENT "Splitting out the debug symbols for component ${COMPONENT}" COMMAND "${CMAKE_SOURCE_DIR}/cmake/utils/split-installed-component.sh" "${CMAKE_BINARY_DIR}/contrib/devtools/split-debug.sh" "${CMAKE_BINARY_DIR}/install_manifest_${COMPONENT}.txt" "${CMAKE_INSTALL_BINDIR}" "${CMAKE_INSTALL_LIBDIR}" DEPENDS "${INSTALL_TARGET}" "${CMAKE_BINARY_DIR}/contrib/devtools/split-debug.sh" ) endif() if(NOT ARG_EXCLUDE_FROM_ALL AND TARGET install-debug) add_dependencies(install-debug "install-${COMPONENT}-debug") endif() if(TARGET install-all-debug) add_dependencies(install-all-debug "install-${COMPONENT}-debug") endif() endif() endfunction() function(install_target _target) cmake_parse_arguments(ARG "EXCLUDE_FROM_ALL" "COMPONENT" "" ${ARGN} ) if(NOT ARG_COMPONENT) set(ARG_COMPONENT ${PROJECT_NAME}) endif() if(ARG_EXCLUDE_FROM_ALL) set(INSTALL_EXCLUDE_FROM_ALL EXCLUDE_FROM_ALL) endif() set(COMMON_INSTALL_ARGUMENTS COMPONENT ${ARG_COMPONENT} ${INSTALL_EXCLUDE_FROM_ALL} ${ARG_UNPARSED_ARGUMENTS} ) install( TARGETS ${_target} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ${COMMON_INSTALL_ARGUMENTS} ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" ${COMMON_INSTALL_ARGUMENTS} LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ${COMMON_INSTALL_ARGUMENTS} PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" ${COMMON_INSTALL_ARGUMENTS} ) _add_install_target("${ARG_COMPONENT}" ${INSTALL_EXCLUDE_FROM_ALL} DEPENDS ${_target} ) endfunction() function(install_shared_library NAME) cmake_parse_arguments(ARG "EXCLUDE_FROM_ALL" "" "PUBLIC_HEADER" ${ARGN} ) set(_sources ${ARG_UNPARSED_ARGUMENTS}) get_target_property(_target_type ${NAME} TYPE) if(_target_type STREQUAL "SHARED_LIBRARY") set(_shared_name "${NAME}") target_sources(${NAME} PRIVATE ${_sources}) else() set(_shared_name "${NAME}-shared") add_library(${_shared_name} SHARED ${_sources}) target_link_libraries(${_shared_name} ${NAME}) endif() if(ARG_PUBLIC_HEADER) set_property(TARGET ${_shared_name} PROPERTY PUBLIC_HEADER ${ARG_PUBLIC_HEADER}) endif() if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") # FIXME For compatibility reason with autotools, the version is set # to 0.0.0 (major being actually 0). This is obviously wrong and the # version of the library should reflect the version of the release. # On platforms other than linux, only the major version (0) is used. # Replace the VERSION line with the statement below to set the # correct version: # set(_properties VERSION "${CMAKE_PROJECT_VERSION}") list(APPEND _properties VERSION "${CMAKE_PROJECT_VERSION_MAJOR}.0.0") else() list(APPEND _properties VERSION "${CMAKE_PROJECT_VERSION_MAJOR}") endif() # For autotools compatibility, rename the library to ${OUTPUT_NAME}-0.dll if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") list(APPEND _properties OUTPUT_NAME "${NAME}-${CMAKE_PROJECT_VERSION_MAJOR}") # DLL_EXPORT is defined by libtool, and is expected by some sources. target_compile_definitions(${_shared_name} PRIVATE DLL_EXPORT) else() list(APPEND _properties OUTPUT_NAME "${NAME}") endif() list(APPEND _properties SOVERSION "${CMAKE_PROJECT_VERSION_MAJOR}") set_target_properties(${_shared_name} PROPERTIES ${_properties}) # Forward EXCLUDE_FROM_ALL if set if(ARG_EXCLUDE_FROM_ALL) set(FORWARD_EXCLUDE_FROM_ALL EXCLUDE_FROM_ALL) endif() install_target(${_shared_name} ${FORWARD_EXCLUDE_FROM_ALL}) endfunction() -function(install_manpages) +function(install_manpage TARGET) set(MAN_DESTINATION "${CMAKE_INSTALL_MANDIR}/man1") + set(MAN_PAGE "${CMAKE_BINARY_DIR}/doc/man/${TARGET}.1") + add_custom_command( + OUTPUT "${MAN_PAGE}" + COMMENT "Generating man page for ${TARGET}" + COMMAND + "${CMAKE_SOURCE_DIR}/doc/man/gen-manpages.sh" + "$" + "$" + "${MAN_PAGE}" + DEPENDS + bitcoind + "${TARGET}" + ) + add_custom_target(gen-manpage-${TARGET} + DEPENDS "${MAN_PAGE}" + ) + install( - FILES ${ARGN} + FILES "${MAN_PAGE}" DESTINATION "${MAN_DESTINATION}" - COMPONENT manpages + COMPONENT manpage-${TARGET} + EXCLUDE_FROM_ALL ) - _add_install_target(manpages) + _add_install_target(manpage-${TARGET} + DEPENDS gen-manpage-${TARGET} + ) + _add_install_target(manpages + DEPENDS install-manpage-${TARGET} + ) if(NOT TARGET install-manpages-html) set(INPUT_DIR "${CMAKE_INSTALL_PREFIX}/${MAN_DESTINATION}") set(OUTPUT_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_MANDIR}/html") configure_file( "${CMAKE_SOURCE_DIR}/cmake/templates/man2html.sh.in" "${CMAKE_BINARY_DIR}/config/man2html.sh" @ONLY ) add_custom_target(install-manpages-html COMMENT "Generating man pages for web rendering" COMMAND "${CMAKE_BINARY_DIR}/config/man2html.sh" DEPENDS install-manpages "${CMAKE_BINARY_DIR}/config/man2html.sh" ) endif() endfunction() diff --git a/contrib/devtools/gen-manpages.sh b/contrib/devtools/gen-manpages.sh deleted file mode 100755 index 4905a6816..000000000 --- a/contrib/devtools/gen-manpages.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash - -export LC_ALL=C - -set -euxo pipefail - -TOPDIR=${TOPDIR:-$(git rev-parse --show-toplevel)} -BUILDDIR=${BUILDDIR:-$TOPDIR} - -BINDIR=${BINDIR:-$BUILDDIR/src} -MANDIR=${MANDIR:-$TOPDIR/doc/man} - -BITCOIND=${BITCOIND:-$BINDIR/bitcoind} -BITCOINCLI=${BITCOINCLI:-$BINDIR/bitcoin-cli} -BITCOINTX=${BITCOINTX:-$BINDIR/bitcoin-tx} -WALLET_TOOL=${WALLET_TOOL:-$BINDIR/bitcoin-wallet} -BITCOINQT=${BITCOINQT:-$BINDIR/qt/bitcoin-qt} - -[ ! -x $BITCOIND ] && echo "$BITCOIND not found or not executable." && exit 1 - -# The autodetected version git tag can screw up manpage output a little bit -read -r -a BTCVER <<< "$($BITCOINCLI --version | head -n1 | awk -F'[ -]' '{ print $6, $7 }')" - -# Create a footer file with copyright content. -# This gets autodetected fine for bitcoind if --version-string is not set, -# but has different outcomes for bitcoin-qt and bitcoin-cli. -cleanup() { - rm -f footer.h2m -} -trap "cleanup" EXIT -echo "[COPYRIGHT]" > footer.h2m -$BITCOIND --version | sed -n '1!p' >> footer.h2m - -for cmd in $BITCOIND $BITCOINCLI $BITCOINTX $WALLET_TOOL $BITCOINQT; do - cmdname="${cmd##*/}" - help2man -N --version-string=${BTCVER[0]} --include=footer.h2m -o ${MANDIR}/${cmdname}.1 ${cmd} - sed -i "s/\\\-${BTCVER[1]}//g" ${MANDIR}/${cmdname}.1 -done diff --git a/contrib/gitian-descriptors/gitian-osx.yml b/contrib/gitian-descriptors/gitian-osx.yml index 44f5f4d35..ee44fedb5 100644 --- a/contrib/gitian-descriptors/gitian-osx.yml +++ b/contrib/gitian-descriptors/gitian-osx.yml @@ -1,200 +1,201 @@ --- name: "bitcoin-abc-osx" enable_cache: true distro: "debian" suites: - "buster" architectures: - "amd64" packages: - "autoconf" - "automake" - "bsdmainutils" - "ca-certificates" - "curl" - "faketime" - "fonts-tuffy" - "g++" - "git" - "imagemagick" - "libbz2-dev" - "libcap-dev" - "librsvg2-bin" - "libtiff-tools" - "libtinfo5" - "libtool" - "libz-dev" - "ninja-build" - "pkg-config" - "python3" - "python3-dev" - "python3-setuptools" # FIXME: these dependencies are only required to make CMake happy when building # native tools. They can be removed when the `NativeExecutable.cmake` gets # improved to avoid requiring all the bitcoin-abc dependencies. - "libboost-all-dev" - "libevent-dev" - "libssl-dev" repositories: - "distribution": "buster-backports" "source": "deb http://deb.debian.org/debian/ buster-backports main" packages: - "cmake" remotes: - "url": "https://github.com/Bitcoin-ABC/bitcoin-abc.git" "dir": "bitcoin" files: - "MacOSX10.14.sdk.tar.gz" script: | WRAP_DIR=$HOME/wrapped HOSTS="x86_64-apple-darwin16" # CMake toolchain file name differ from host name declare -A CMAKE_TOOLCHAIN_FILE CMAKE_TOOLCHAIN_FILE[x86_64-apple-darwin16]=OSX.cmake FAKETIME_HOST_PROGS="" FAKETIME_PROGS="ar ranlib date dmg genisoimage" export QT_RCC_TEST=1 export QT_RCC_SOURCE_DATE_OVERRIDE=1 export GZIP="-9n" export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" export TZ="UTC" export BUILD_DIR=`pwd` mkdir -p ${WRAP_DIR} if test -n "$GBUILD_CACHE_ENABLED"; then export SOURCES_PATH=${GBUILD_COMMON_CACHE} export BASE_CACHE=${GBUILD_PACKAGE_CACHE} mkdir -p ${BASE_CACHE} ${SOURCES_PATH} fi export ZERO_AR_DATE=1 function create_global_faketime_wrappers { for prog in ${FAKETIME_PROGS}; do echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${prog} echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog} echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog} echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog} echo "\$REAL \$@" >> $WRAP_DIR/${prog} chmod +x ${WRAP_DIR}/${prog} done } function create_per-host_faketime_wrappers { for i in $HOSTS; do for prog in ${FAKETIME_HOST_PROGS}; do echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}-${prog} echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog} echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog} echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog} echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog} chmod +x ${WRAP_DIR}/${i}-${prog} done done } # Faketime for depends so intermediate results are comparable export PATH_orig=${PATH} create_global_faketime_wrappers "2000-01-01 12:00:00" create_per-host_faketime_wrappers "2000-01-01 12:00:00" export PATH=${WRAP_DIR}:${PATH} cd bitcoin SOURCEDIR=`pwd` BASEPREFIX=`pwd`/depends mkdir -p ${BASEPREFIX}/SDKs tar -C ${BASEPREFIX}/SDKs -xf ${BUILD_DIR}/MacOSX10.14.sdk.tar.gz # Build dependencies for each host for i in $HOSTS; do make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}" done # Faketime for binaries export PATH=${PATH_orig} create_global_faketime_wrappers "${REFERENCE_DATETIME}" create_per-host_faketime_wrappers "${REFERENCE_DATETIME}" export PATH=${WRAP_DIR}:${PATH} mkdir -p source_package pushd source_package cmake -GNinja .. \ -DBUILD_BITCOIN_WALLET=OFF \ -DBUILD_BITCOIN_ZMQ=OFF \ -DBUILD_BITCOIN_ZMQ=OFF \ -DBUILD_BITCOIN_SEEDER=OFF \ -DBUILD_BITCOIN_CLI=OFF \ -DBUILD_BITCOIN_TX=OFF \ -DBUILD_BITCOIN_QT=OFF \ -DBUILD_LIBBITCOINCONSENSUS=OFF \ -DENABLE_CLANG_TIDY=OFF \ -DENABLE_QRCODE=OFF \ -DENABLE_UPNP=OFF \ -DUSE_JEMALLOC=OFF ninja package_source SOURCEDIST=`echo bitcoin-abc-*.tar.gz` mv ${SOURCEDIST} .. popd DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'` # Correct tar file order mkdir -p temp pushd temp tar xf ../$SOURCEDIST find bitcoin-abc-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST popd ORIGPATH="$PATH" # Extract the release tarball into a dir for each host and build for i in ${HOSTS}; do export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH} mkdir -p distsrc-${i} cd distsrc-${i} INSTALLPATH=`pwd`/installed/${DISTNAME} mkdir -p ${INSTALLPATH} tar --strip-components=1 -xf ../$SOURCEDIST cmake -GNinja .. \ -DCMAKE_TOOLCHAIN_FILE=${SOURCEDIR}/cmake/platforms/${CMAKE_TOOLCHAIN_FILE[${i}]} \ -DCLIENT_VERSION_IS_RELEASE=ON \ -DENABLE_CLANG_TIDY=OFF \ -DENABLE_REDUCE_EXPORTS=ON \ -DCMAKE_INSTALL_PREFIX=${INSTALLPATH} \ -DCCACHE=OFF \ -DGENISOIMAGE_EXECUTABLE="${WRAP_DIR}/genisoimage" ninja ninja install/strip + ninja install-manpages export PYTHONPATH="${BASEPREFIX}/${i}/native/lib/python3/dist-packages:${PYTHONPATH}" ninja osx-deploydir OSX_VOLNAME="$(cat osx_volname)" mkdir -p unsigned-app-${i} cp osx_volname unsigned-app-${i}/ cp contrib/macdeploy/detached-sig-apply.sh unsigned-app-${i} cp contrib/macdeploy/detached-sig-create.sh unsigned-app-${i} cp ${BASEPREFIX}/${i}/native/bin/dmg ${BASEPREFIX}/${i}/native/bin/genisoimage unsigned-app-${i} cp ${BASEPREFIX}/${i}/native/bin/${i}-codesign_allocate unsigned-app-${i}/codesign_allocate cp ${BASEPREFIX}/${i}/native/bin/${i}-pagestuff unsigned-app-${i}/pagestuff mv dist unsigned-app-${i} pushd unsigned-app-${i} find . | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-osx-unsigned.tar.gz popd ninja osx-dmg ${WRAP_DIR}/dmg dmg "${OSX_VOLNAME}.dmg" ${OUTDIR}/${DISTNAME}-osx-unsigned.dmg cd installed find -path "*.app*" -type f -executable -exec mv {} ${DISTNAME}/bin/bitcoin-qt \; find ${DISTNAME} -not -path "*.app*" | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}.tar.gz cd ../../ done mkdir -p $OUTDIR/src mv $SOURCEDIST $OUTDIR/src mv ${OUTDIR}/${DISTNAME}-x86_64-*.tar.gz ${OUTDIR}/${DISTNAME}-osx64.tar.gz diff --git a/contrib/source-control-tools/automated-commits.sh b/contrib/source-control-tools/automated-commits.sh index 044dae020..e6e5cbfad 100755 --- a/contrib/source-control-tools/automated-commits.sh +++ b/contrib/source-control-tools/automated-commits.sh @@ -1,310 +1,269 @@ #!/usr/bin/env bash # Note: Any bot running this script must have the appropriate permissions to # push commits upstream. When running locally, this script will git push in a # dry run by default. export LC_ALL=C.UTF-8 set -euxo pipefail DEFAULT_PARENT_COMMIT="origin/master" help_message() { set +x echo "Generate a commit from available recipes." echo echo "Options:" echo "-p, --parent The parent commit to build ontop of. Default: '${DEFAULT_PARENT_COMMIT}'" echo " Note: This should only be used for testing since the behavior of setting" echo " this to a particular commit varies slightly from the default." echo "-h, --help Display this help message." echo echo "Environment Variables:" echo "COMMIT_TYPE (required) The commit recipe to run." echo "DRY_RUN If set to 'no', this script will push the generated changes upstream. Default: 'yes'" set -x } PARENT_COMMIT="${DEFAULT_PARENT_COMMIT}" # Parse command line arguments while [[ $# -gt 0 ]]; do case $1 in -p|--parent) PARENT_COMMIT=$(git rev-parse "$2") shift # shift past argument shift # shift past value ;; -h|--help) help_message exit 0 ;; *) echo "Unknown argument: $1" help_message exit 1 ;; esac done : "${COMMIT_TYPE:=}" if [ -z "${COMMIT_TYPE}" ]; then echo "Error: Environment variable COMMIT_TYPE must be set" exit 2 fi GIT_PUSH_OPTIONS=("--verbose") case ${DRY_RUN:=yes} in no|NO|false|FALSE) if [ "${PARENT_COMMIT}" != "${DEFAULT_PARENT_COMMIT}" ]; then echo "Error: Running with DRY_RUN=no on a commit parent other than '${DEFAULT_PARENT_COMMIT}'" exit 3 fi ;; *) GIT_PUSH_OPTIONS+=("--dry-run") ;; esac echo "Building automated commit '${COMMIT_TYPE}'..." BOT_PREFIX="[Automated]" TOPLEVEL=$(git rev-parse --show-toplevel) BUILD_DIR="${TOPLEVEL}/abc-ci-builds/automated-commit-${COMMIT_TYPE}" mkdir -p "${BUILD_DIR}" export BUILD_DIR DEVTOOLS_DIR="${TOPLEVEL}"/contrib/devtools # Make sure tree is clean git checkout master git reset --hard "${PARENT_COMMIT}" # Utility functions to compare version strings version_greater_equal() { printf '%s\n%s\n' "$2" "$1" | sort -V -C } version_greater() { [ "$1" != "$2" ] && version_greater_equal "$1" "$2" } version_less_equal() { ! version_greater "$1" "$2" } version_less() { ! version_greater_equal "$1" "$2" } get_current_version() { local -n CURRENT_VERSION=$1 # Get the current version of the software "${DEVTOOLS_DIR}"/build_cmake.sh --no-build pushd "$BUILD_DIR" CURRENT_VERSION="$(ninja print-version | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$')" popd } # Common script to update the AUR packages. # Usage: update-aur-version update-aur-version() { PACKAGE="$1" CURRENT_VERSION="" get_current_version CURRENT_VERSION # Get the current version of the AUR package PKGBUILD="${TOPLEVEL}"/contrib/aur/${PACKAGE}/PKGBUILD # shellcheck source=../aur/bitcoin-abc/PKGBUILD source "${PKGBUILD}" # Compare the versions. We only want to update if # (software version > package version) to prevent downgrades. if version_less_equal "${CURRENT_VERSION}" "${pkgver}" then echo "Current version ${CURRENT_VERSION} <= ${PACKAGE} AUR package version ${pkgver}, skip the update" exit 0 fi # Reset the release version to 0 and update the package version in the # PKGBUILD file. # Note that this pattern is very safe: because of the shell script syntax, # no whitespace can occur and we have the original value as a variable. sed -i "s/pkgrel=${pkgrel}/pkgrel=0/" "${PKGBUILD}" sed -i "s/pkgver=${pkgver}/pkgver=${CURRENT_VERSION}/" "${PKGBUILD}" git add "${PKGBUILD}" git commit -m "Bump ${PACKAGE} AUR package version to ${CURRENT_VERSION}" } case "${COMMIT_TYPE}" in archive-release-notes) RELEASE_NOTES_FILE="${TOPLEVEL}/doc/release-notes.md" RELEASE_NOTES_VERSION=$(sed -n "1s/^Bitcoin ABC version \([0-9]\+\.[0-9]\+\.[0-9]\+\).\+$/\1/p" "${RELEASE_NOTES_FILE}") RELEASE_NOTES_ARCHIVE="${TOPLEVEL}/doc/release-notes/release-notes-${RELEASE_NOTES_VERSION}.md" CURRENT_VERSION="" get_current_version CURRENT_VERSION # Compare the versions. We only want to archive the release notes if the # current version is greater the our release notes version. if version_less_equal "${CURRENT_VERSION}" "${RELEASE_NOTES_VERSION}" then echo "Current version ${CURRENT_VERSION} <= release-notes version ${RELEASE_NOTES_VERSION}, skip the update" exit 0 fi # Archive the release notes cp "${RELEASE_NOTES_FILE}" "${RELEASE_NOTES_ARCHIVE}" # Generate a fresh blank release notes file for the new version PROJECT_VERSION="${CURRENT_VERSION}" envsubst < "${TOPLEVEL}/doc/release-notes/release-notes.md.in" > "${RELEASE_NOTES_FILE}" git add "${RELEASE_NOTES_FILE}" "${RELEASE_NOTES_ARCHIVE}" git commit -m "${BOT_PREFIX} Archive release notes for version ${RELEASE_NOTES_VERSION}" ;; update-aur-version-bitcoin-abc) update-aur-version "bitcoin-abc" ;; update-aur-version-bitcoin-abc-qt) update-aur-version "bitcoin-abc-qt" ;; update-chainparams) CHAINPARAMS_SCRIPTS_DIR="${DEVTOOLS_DIR}"/chainparams # Assumes bitcoind instances are already running on mainnet and testnet pushd "${CHAINPARAMS_SCRIPTS_DIR}" CHAINPARAMS_MAINNET_TXT="chainparams_main.txt" ./make_chainparams.py > "${CHAINPARAMS_MAINNET_TXT}" git add "${CHAINPARAMS_MAINNET_TXT}" CHAINPARAMS_TESTNET_TXT="chainparams_test.txt" ./make_chainparams.py -a 127.0.0.1:18332 > "${CHAINPARAMS_TESTNET_TXT}" git add "${CHAINPARAMS_TESTNET_TXT}" CHAINPARAMS_CONSTANTS="${TOPLEVEL}"/src/chainparamsconstants.h ./generate_chainparams_constants.py . > "${CHAINPARAMS_CONSTANTS}" git add "${CHAINPARAMS_CONSTANTS}" popd git commit -m "${BOT_PREFIX} Update chainparams" ;; - update-manpages) - # Unfortunately bitcoin-qt requires a handle on the DISPLAY, even for the - # --help option. We can spoof an X window using xvfb. - command -v xvfb-run > /dev/null || (echo "Error: Package 'xvfb' is needed to run bitcoin-qt headlessly." && exit 11) - - "${DEVTOOLS_DIR}"/build_cmake.sh - BUILDDIR="${BUILD_DIR}" xvfb-run "${DEVTOOLS_DIR}"/gen-manpages.sh - - MANPAGES_DIR="${TOPLEVEL}"/doc/man - - # Sanity check that the current bitcoind version is in the manpages. - # Note that this check could be more complex, checking that all version - # instances match the current bitcoind version. But, it's impossible to - # know if some other version number will appear in the help text due to - # deprecation notices or otherwise. - EXPECTED_VERSION=$("${BUILD_DIR}"/src/bitcoind --version | head -1 | grep -oE "v[0-9]+\.[0-9]+\.[0-9]+") - grep "${EXPECTED_VERSION}" "${MANPAGES_DIR}"/*\.1 - - # Sanity check that the version string was not dirty or that something - # unexpected occurred. - grep "${EXPECTED_VERSION}-dirty" "${MANPAGES_DIR}"/*\.1 && { - echo "Error: Unexpected dirty version string." - exit 12 - } - grep "${EXPECTED_VERSION}-unk" "${MANPAGES_DIR}"/*\.1 && { - echo "Error: Unknown error detected in version string." - exit 13 - } - - # If there is no change, we're done. - if [ -z "$(git status --porcelain)" ] - then - echo "No update to perform on the man pages" - exit 0 - fi - - git add "${MANPAGES_DIR}"/*\.1 - - git commit -m "${BOT_PREFIX} Update manpages" - ;; - update-seeds) # Assumes seeder instances are already running on mainnet and testnet pushd "${TOPLEVEL}"/contrib/seeds : "${SEEDS_MAIN:=seeds_main.txt}" ./makeseeds.py < "${SEEDS_MAIN}" > nodes_main.txt git add nodes_main.txt : "${SEEDS_TEST:=seeds_test.txt}" ./makeseeds.py < "${SEEDS_TEST}" > nodes_test.txt git add nodes_test.txt SEEDS_HEADER="${TOPLEVEL}"/src/chainparamsseeds.h ./generate-seeds.py . > "${SEEDS_HEADER}" git add "${SEEDS_HEADER}" popd # Check that seeds have good connectivity "${DEVTOOLS_DIR}"/build_cmake.sh SEEDS_DIR="${TOPLEVEL}"/contrib/seeds RPC_PORT=18832 "${SEEDS_DIR}"/check-seeds.sh main 80 RPC_PORT=18833 "${SEEDS_DIR}"/check-seeds.sh test 70 git commit -m "${BOT_PREFIX} Update seeds" ;; update-timings) "${DEVTOOLS_DIR}"/build_cmake.sh pushd "${BUILD_DIR}" ninja check-functional-extended TIMING_SRC_FILE="${TOPLEVEL}"/test/functional/timing.json mv timing.json "${TIMING_SRC_FILE}" popd # Check that all tests are included in timing.json pushd "${TOPLEVEL}"/test/functional NON_TESTS=$(python3 -c 'from test_runner import NON_SCRIPTS; print(" ".join(NON_SCRIPTS))') export NON_TESTS check_missing() { # Exclude non-tests from the check if [[ "${NON_TESTS}" =~ $1 ]]; then exit 0 fi if ! grep -q $1 timing.json ; then echo "Error: Test file '$1' is missing from timing.json" exit 1 fi } export -f check_missing find . -maxdepth 1 -name '*.py' | cut -c 3- | xargs -I'{}' -n1 bash -c 'check_missing {}' popd git add "${TIMING_SRC_FILE}" git commit -m "${BOT_PREFIX} Update timing.json" ;; *) echo "Error: Invalid commit name '${COMMIT_TYPE}'" exit 10 ;; esac # Smoke tests to give some confidence that master won't be put into a bad state "${DEVTOOLS_DIR}"/smoke-tests.sh echo "Pushing automated commit '${COMMIT_TYPE}'..." # Make sure master is up-to-date. If there is a merge conflict, this script # will not attempt to resolve it and simply fail. git fetch origin master git rebase "${PARENT_COMMIT}" git push "${GIT_PUSH_OPTIONS[@]}" origin master diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 8b7b5247f..663d09197 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,6 +1,5 @@ # Copyright (c) 2019 The Bitcoin developers configure_file(Doxyfile.cmake.in Doxyfile ESCAPE_QUOTES) -add_subdirectory(man) add_subdirectory(rpc) diff --git a/doc/man/CMakeLists.txt b/doc/man/CMakeLists.txt deleted file mode 100644 index 732c0246d..000000000 --- a/doc/man/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2019 The Bitcoin developers -include(InstallationHelper) - -install_manpages(bitcoind.1) - -if(BUILD_BITCOIN_CLI) - install_manpages(bitcoin-cli.1) -endif() - -if(BUILD_BITCOIN_TX) - install_manpages(bitcoin-tx.1) -endif() - -if(BUILD_BITCOIN_QT) - install_manpages(bitcoin-qt.1) -endif() - -if(BUILD_BITCOIN_WALLET) - install_manpages(bitcoin-wallet.1) -endif() diff --git a/doc/man/bitcoin-cli.1 b/doc/man/bitcoin-cli.1 deleted file mode 100644 index 221af1e6b..000000000 --- a/doc/man/bitcoin-cli.1 +++ /dev/null @@ -1,120 +0,0 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.8. -.TH BITCOIN-CLI "1" "September 2020" "bitcoin-cli v0.22.2" "User Commands" -.SH NAME -bitcoin-cli \- manual page for bitcoin-cli v0.22.2 -.SH SYNOPSIS -.B bitcoin-cli -[\fI\,options\/\fR] \fI\, \/\fR[\fI\,params\/\fR] \fI\,Send command to Bitcoin ABC\/\fR -.br -.B bitcoin-cli -[\fI\,options\/\fR] \fI\,-named \/\fR[\fI\,name=value\/\fR]... \fI\,Send command to Bitcoin ABC (with named arguments)\/\fR -.br -.B bitcoin-cli -[\fI\,options\/\fR] \fI\,help List commands\/\fR -.br -.B bitcoin-cli -[\fI\,options\/\fR] \fI\,help Get help for a command\/\fR -.SH DESCRIPTION -Bitcoin ABC RPC client version v0.22.2 -.SH OPTIONS -.HP -\-? -.IP -This help message -.HP -\fB\-conf=\fR -.IP -Specify configuration file. Relative paths will be prefixed by datadir -location. (default: bitcoin.conf) -.HP -\fB\-datadir=\fR -.IP -Specify data directory -.HP -\fB\-getinfo\fR -.IP -Get general information from the remote server. Note that unlike -server\-side RPC calls, the results of \fB\-getinfo\fR is the result of -multiple non\-atomic requests. Some entries in the result may -represent results from different states (e.g. wallet balance may -be as of a different block from the chain state reported) -.HP -\fB\-named\fR -.IP -Pass named instead of positional arguments (default: false) -.HP -\fB\-rpcclienttimeout=\fR -.IP -Timeout in seconds during HTTP requests, or 0 for no timeout. (default: -900) -.HP -\fB\-rpcconnect=\fR -.IP -Send commands to node running on (default: 127.0.0.1) -.HP -\fB\-rpccookiefile=\fR -.IP -Location of the auth cookie. Relative paths will be prefixed by a -net\-specific datadir location. (default: data dir) -.HP -\fB\-rpcpassword=\fR -.IP -Password for JSON\-RPC connections -.HP -\fB\-rpcport=\fR -.IP -Connect to JSON\-RPC on (default: 8332, testnet: 18332, regtest: -18443) -.HP -\fB\-rpcuser=\fR -.IP -Username for JSON\-RPC connections -.HP -\fB\-rpcwait\fR -.IP -Wait for RPC server to start -.HP -\fB\-rpcwallet=\fR -.IP -Send RPC for non\-default wallet on RPC server (needs to exactly match -corresponding \fB\-wallet\fR option passed to bitcoind) -.HP -\fB\-stdin\fR -.IP -Read extra arguments from standard input, one per line until EOF/Ctrl\-D -(recommended for sensitive information such as passphrases) -.HP -\fB\-stdinrpcpass\fR -.IP -Read RPC password from standard input as a single line. When combined -with \fB\-stdin\fR, the first line from standard input is used for the -RPC password. -.HP -\fB\-version\fR -.IP -Print version and exit -.PP -Chain selection options: -.HP -\fB\-chain=\fR -.IP -Use the chain (default: main). Allowed values: main, test, -regtest -.HP -\fB\-testnet\fR -.IP -Use the test chain. Equivalent to \fB\-chain\fR=\fI\,test\/\fR. -.SH COPYRIGHT -Copyright (C) 2009-2020 The Bitcoin developers - -Please contribute if you find Bitcoin ABC useful. Visit - for further information about the software. -The source code is available from . - -This is experimental software. -Distributed under the MIT software license, see the accompanying file COPYING -or - -This product includes software developed by the OpenSSL Project for use in the -OpenSSL Toolkit and cryptographic software written by -Eric Young and UPnP software written by Thomas Bernard. diff --git a/doc/man/bitcoin-qt.1 b/doc/man/bitcoin-qt.1 deleted file mode 100644 index 7b307cdd1..000000000 --- a/doc/man/bitcoin-qt.1 +++ /dev/null @@ -1,662 +0,0 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.8. -.TH BITCOIN-QT "1" "September 2020" "bitcoin-qt v0.22.2" "User Commands" -.SH NAME -bitcoin-qt \- manual page for bitcoin-qt v0.22.2 -.SH SYNOPSIS -.B bitcoin-qt -[\fI\,command-line options\/\fR] -.SH DESCRIPTION -Bitcoin ABC version v0.22.2 (64\-bit) -.SH OPTIONS -.HP -\-? -.IP -Print this help message and exit -.HP -\fB\-alertnotify=\fR -.IP -Execute command when a relevant alert is received or we see a really -long fork (%s in cmd is replaced by message) -.HP -\fB\-assumevalid=\fR -.IP -If this block is in the chain assume that it and its ancestors are valid -and potentially skip their script verification (0 to verify all, -default: -0000000000000000011fd96aa2f90943cd624e15b78b929c792474980cb5ff8a, -testnet: -00000000000000d2c2d5c102580e1832d60952019823dd83d57f5e77f069efe8) -.HP -\fB\-blockfilterindex=\fR -.IP -Maintain an index of compact filters by block (default: 0, values: -basic). If is not supplied or if = 1, indexes for -all known types are enabled. -.HP -\fB\-blocknotify=\fR -.IP -Execute command when the best block changes (%s in cmd is replaced by -block hash) -.HP -\fB\-blockreconstructionextratxn=\fR -.IP -Extra transactions to keep in memory for compact block reconstructions -(default: 100) -.HP -\fB\-blocksdir=\fR -.IP -Specify directory to hold blocks subdirectory for *.dat files (default: -) -.HP -\fB\-blocksonly\fR -.IP -Whether to reject transactions from network peers. Transactions from the -wallet or RPC are not affected. (default: 0) -.HP -\fB\-conf=\fR -.IP -Specify configuration file. Relative paths will be prefixed by datadir -location. (default: bitcoin.conf) -.HP -\fB\-daemon\fR -.IP -Run in the background as a daemon and accept commands -.HP -\fB\-datadir=\fR -.IP -Specify data directory -.HP -\fB\-dbcache=\fR -.IP -Set database cache size in megabytes (4 to 16384, default: 450) -.HP -\fB\-debuglogfile=\fR -.IP -Specify location of debug log file. Relative paths will be prefixed by a -net\-specific datadir location. (0 to disable; default: debug.log) -.HP -\fB\-finalizationdelay=\fR -.IP -Set the minimum amount of time to wait between a block header reception -and the block finalization. Unit is seconds (default: 7200) -.HP -\fB\-includeconf=\fR -.IP -Specify additional configuration file, relative to the \fB\-datadir\fR path -(only useable from configuration file, not command line) -.HP -\fB\-loadblock=\fR -.IP -Imports blocks from external blk000??.dat file on startup -.HP -\fB\-maxmempool=\fR -.IP -Keep the transaction memory pool below megabytes (default: 300) -.HP -\fB\-maxorphantx=\fR -.IP -Keep at most unconnectable transactions in memory (default: 100) -.HP -\fB\-maxreorgdepth=\fR -.IP -Configure at what depth blocks are considered final (default: 10). Use -\fB\-1\fR to disable. -.HP -\fB\-mempoolexpiry=\fR -.IP -Do not keep transactions in the mempool longer than hours (default: -336) -.HP -\fB\-par=\fR -.IP -Set the number of script verification threads (\fB\-16\fR to 15, 0 = auto, <0 = -leave that many cores free, default: 0) -.HP -\fB\-persistmempool\fR -.IP -Whether to save the mempool on shutdown and load on restart (default: 1) -.HP -\fB\-pid=\fR -.IP -Specify pid file. Relative paths will be prefixed by a net\-specific -datadir location. (default: bitcoind.pid) -.HP -\fB\-prune=\fR -.IP -Reduce storage requirements by enabling pruning (deleting) of old -blocks. This allows the pruneblockchain RPC to be called to -delete specific blocks, and enables automatic pruning of old -blocks if a target size in MiB is provided. This mode is -incompatible with \fB\-txindex\fR and \fB\-rescan\fR. Warning: Reverting this -setting requires re\-downloading the entire blockchain. (default: -0 = disable pruning blocks, 1 = allow manual pruning via RPC, ->=550 = automatically prune block files to stay under the -specified target size in MiB) -.HP -\fB\-reindex\fR -.IP -Rebuild chain state and block index from the blk*.dat files on disk -.HP -\fB\-reindex\-chainstate\fR -.IP -Rebuild chain state from the currently indexed blocks. When in pruning -mode or if blocks on disk might be corrupted, use full \fB\-reindex\fR -instead. -.HP -\fB\-sysperms\fR -.IP -Create new files with system default permissions, instead of umask 077 -(only effective with disabled wallet functionality) -.HP -\fB\-txindex\fR -.IP -Maintain a full transaction index, used by the getrawtransaction rpc -call (default: 0) -.HP -\fB\-usecashaddr\fR -.IP -Use Cash Address for destination encoding instead of base58 (activate by -default on Jan, 14) -.HP -\fB\-version\fR -.IP -Print version and exit -.PP -Connection options: -.HP -\fB\-addnode=\fR -.IP -Add a node to connect to and attempt to keep the connection open (see -the `addnode` RPC command help for more info) -.HP -\fB\-banscore=\fR -.IP -Threshold for disconnecting and discouraging misbehaving peers (default: -100) -.HP -\fB\-bantime=\fR -.IP -Default duration (in seconds) of manually configured bans (default: -86400) -.HP -\fB\-bind=\fR -.IP -Bind to given address and always listen on it. Use [host]:port notation -for IPv6 -.HP -\fB\-connect=\fR -.IP -Connect only to the specified node(s); \fB\-connect\fR=\fI\,0\/\fR disables automatic -connections (the rules for this peer are the same as for -\fB\-addnode\fR) -.HP -\fB\-discover\fR -.IP -Discover own IP addresses (default: 1 when listening and no \fB\-externalip\fR -or \fB\-proxy\fR) -.HP -\fB\-dns\fR -.IP -Allow DNS lookups for \fB\-addnode\fR, \fB\-seednode\fR and \fB\-connect\fR (default: 1) -.HP -\fB\-dnsseed\fR -.IP -Query for peer addresses via DNS lookup, if low on addresses (default: 1 -unless \fB\-connect\fR used) -.HP -\fB\-enablebip61\fR -.IP -Send reject messages per BIP61 (default: 0) -.HP -\fB\-externalip=\fR -.IP -Specify your own public address -.HP -\fB\-forcednsseed\fR -.IP -Always query for peer addresses via DNS lookup (default: 0) -.HP -\fB\-listen\fR -.IP -Accept connections from outside (default: 1 if no \fB\-proxy\fR or \fB\-connect\fR) -.HP -\fB\-listenonion\fR -.IP -Automatically create Tor hidden service (default: 1) -.HP -\fB\-maxconnections=\fR -.IP -Maintain at most connections to peers (default: 125) -.HP -\fB\-maxreceivebuffer=\fR -.IP -Maximum per\-connection receive buffer, *1000 bytes (default: 5000) -.HP -\fB\-maxsendbuffer=\fR -.IP -Maximum per\-connection send buffer, *1000 bytes (default: 1000) -.HP -\fB\-maxtimeadjustment\fR -.IP -Maximum allowed median peer time offset adjustment. Local perspective of -time may be influenced by peers forward or backward by this -amount. (default: 4200 seconds) -.HP -\fB\-maxuploadtarget=\fR -.IP -Tries to keep outbound traffic under the given target (in MiB per 24h), -0 = no limit (default: 0) -.HP -\fB\-onion=\fR -.IP -Use separate SOCKS5 proxy to reach peers via Tor hidden services -(default: \fB\-proxy\fR) -.HP -\fB\-onlynet=\fR -.IP -Make outgoing connections only through network (ipv4, ipv6 or -onion). Incoming connections are not affected by this option. -This option can be specified multiple times to allow multiple -networks. -.HP -\fB\-peerbloomfilters\fR -.IP -Support filtering of blocks and transaction with bloom filters (default: -1) -.HP -\fB\-peertimeout=\fR -.IP -Specify p2p connection timeout in seconds. This option determines the -amount of time a peer may be inactive before the connection to it -is dropped. (minimum: 1, default: 60) -.HP -\fB\-permitbaremultisig\fR -.IP -Relay non\-P2SH multisig (default: 1) -.HP -\fB\-port=\fR -.IP -Listen for connections on (default: 8333, testnet: 18333, -regtest: 18444) -.HP -\fB\-proxy=\fR -.IP -Connect through SOCKS5 proxy -.HP -\fB\-proxyrandomize\fR -.IP -Randomize credentials for every proxy connection. This enables Tor -stream isolation (default: 1) -.HP -\fB\-seednode=\fR -.IP -Connect to a node to retrieve peer addresses, and disconnect -.HP -\fB\-timeout=\fR -.IP -Specify connection timeout in milliseconds (minimum: 1, default: 5000) -.HP -\fB\-torcontrol=\fR: -.IP -Tor control port to use if onion listening enabled (default: -127.0.0.1:9051) -.HP -\fB\-torpassword=\fR -.IP -Tor control port password (default: empty) -.HP -\fB\-upnp\fR -.IP -Use UPnP to map the listening port (default: 0) -.HP -\fB\-whitebind=\fR -.IP -Bind to given address and whitelist peers connecting to it. Use -[host]:port notation for IPv6 -.HP -\fB\-whitelist=\fR -.IP -Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or -CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple -times. Whitelisted peers cannot be DoS banned and their -transactions are always relayed, even if they are already in the -mempool, useful e.g. for a gateway -.PP -Wallet options: -.HP -\fB\-avoidpartialspends\fR -.IP -Group outputs by address, selecting all or none, instead of selecting on -a per\-output basis. Privacy is improved as an address is only -used once (unless someone sends to it after spending from it), -but may result in slightly higher fees as suboptimal coin -selection may result due to the added limitation (default: 0 -(always enabled for wallets with "avoid_reuse" enabled)) -.HP -\fB\-disablewallet\fR -.IP -Do not load the wallet and disable wallet RPC calls -.HP -\fB\-fallbackfee=\fR -.IP -A fee rate (in BCH/kB) that will be used when fee estimation has -insufficient data. 0 to entirely disable the fallbackfee feature. -(default: 0.00) -.HP -\fB\-keypool=\fR -.IP -Set key pool size to (default: 1000) -.HP -\fB\-mintxfee=\fR -.IP -Fees (in BCH/kB) smaller than this are considered zero fee for -transaction creation (default: 0.00001) -.HP -\fB\-paytxfee=\fR -.IP -Fee (in BCH/kB) to add to transactions you send (default: 0.00) -.HP -\fB\-rescan\fR -.IP -Rescan the block chain for missing wallet transactions on startup -.HP -\fB\-salvagewallet\fR -.IP -Attempt to recover private keys from a corrupt wallet on startup -.HP -\fB\-spendzeroconfchange\fR -.IP -Spend unconfirmed change when sending transactions (default: 1) -.HP -\fB\-upgradewallet\fR -.IP -Upgrade wallet to latest format on startup -.HP -\fB\-wallet=\fR -.IP -Specify wallet database path. Can be specified multiple times to load -multiple wallets. Path is interpreted relative to if -it is not absolute, and will be created if it does not exist (as -a directory containing a wallet.dat file and log files). For -backwards compatibility this will also accept names of existing -data files in .) -.HP -\fB\-walletbroadcast\fR -.IP -Make the wallet broadcast transactions (default: 1) -.HP -\fB\-walletdir=\fR -.IP -Specify directory to hold wallets (default: /wallets if it -exists, otherwise ) -.HP -\fB\-walletnotify=\fR -.IP -Execute command when a wallet transaction changes (%s in cmd is replaced -by TxID) -.HP -\fB\-zapwallettxes=\fR -.IP -Delete all wallet transactions and only recover those parts of the -blockchain through \fB\-rescan\fR on startup (1 = keep tx meta data e.g. -payment request information, 2 = drop tx meta data) -.PP -ZeroMQ notification options: -.HP -\fB\-zmqpubhashblock=\fR
-.IP -Enable publish hash block in
-.HP -\fB\-zmqpubhashblockhwm=\fR -.IP -Set publish hash block outbound message high water mark (default: 1000) -.HP -\fB\-zmqpubhashtx=\fR
-.IP -Enable publish hash transaction in
-.HP -\fB\-zmqpubhashtxhwm=\fR -.IP -Set publish hash transaction outbound message high water mark (default: -1000) -.HP -\fB\-zmqpubrawblock=\fR
-.IP -Enable publish raw block in
-.HP -\fB\-zmqpubrawblockhwm=\fR -.IP -Set publish raw block outbound message high water mark (default: 1000) -.HP -\fB\-zmqpubrawtx=\fR
-.IP -Enable publish raw transaction in
-.HP -\fB\-zmqpubrawtxhwm=\fR -.IP -Set publish raw transaction outbound message high water mark (default: -1000) -.PP -Debugging/Testing options: -.HP -\fB\-debug=\fR -.IP -Output debugging information (default: 0, supplying is -optional). If is not supplied or if = 1, -output all debugging information. can be: net, tor, -mempool, http, bench, zmq, db, rpc, estimatefee, addrman, -selectcoins, reindex, cmpctblock, rand, prune, proxy, mempoolrej, -libevent, coindb, qt, leveldb, validation. -.HP -\fB\-debugexclude=\fR -.IP -Exclude debugging information for a category. Can be used in conjunction -with \fB\-debug\fR=\fI\,1\/\fR to output debug logs for all categories except one -or more specified categories. -.HP -\fB\-help\-debug\fR -.IP -Print help message with debugging options and exit -.HP -\fB\-logips\fR -.IP -Include IP addresses in debug output (default: 0) -.HP -\fB\-logthreadnames\fR -.IP -Prepend debug output with name of the originating thread (only available -on platforms supporting thread_local) (default: 0) -.HP -\fB\-logtimestamps\fR -.IP -Prepend debug output with timestamp (default: 1) -.HP -\fB\-maxtxfee=\fR -.IP -Maximum total fees (in BCH) to use in a single wallet transaction or raw -transaction; setting this too low may abort large transactions -(default: 0.10) -.HP -\fB\-printtoconsole\fR -.IP -Send trace/debug info to console instead of debug.log file (default: 1 -when no \fB\-daemon\fR. To disable logging to file, set debuglogfile=0) -.HP -\fB\-shrinkdebugfile\fR -.IP -Shrink debug.log file on client startup (default: 1 when no \fB\-debug\fR) -.HP -\fB\-uacomment=\fR -.IP -Append comment to the user agent string -.PP -Chain selection options: -.HP -\fB\-chain=\fR -.IP -Use the chain (default: main). Allowed values: main, test, -regtest -.HP -\fB\-testnet\fR -.IP -Use the test chain. Equivalent to \fB\-chain\fR=\fI\,test\/\fR. -.PP -Node relay options: -.HP -\fB\-bytespersigop\fR -.IP -Equivalent bytes per sigop in transactions for relay and mining -(default: 50) -.HP -\fB\-datacarrier\fR -.IP -Relay and mine data carrier transactions (default: 1) -.HP -\fB\-datacarriersize\fR -.IP -Maximum size of data in data carrier transactions we relay and mine -(default: 223) -.HP -\fB\-minrelaytxfee=\fR -.IP -Fees (in BCH/kB) smaller than this are rejected for relaying, mining and -transaction creation (default: 0.00001) -.HP -\fB\-whitelistforcerelay\fR -.IP -Force relay of transactions from whitelisted peers even if they violate -local relay policy (default: 0) -.HP -\fB\-whitelistrelay\fR -.IP -Accept relayed transactions received from whitelisted peers even when -not relaying transactions (default: 1) -.PP -Block creation options: -.HP -\fB\-blockmaxsize=\fR -.IP -Set maximum block size in bytes (default: 2000000) -.HP -\fB\-blockmintxfee=\fR -.IP -Set lowest fee rate (in BCH/kB) for transactions to be included in block -creation. (default: 0.00001) -.PP -RPC server options: -.HP -\fB\-rest\fR -.IP -Accept public REST requests (default: 0) -.HP -\fB\-rpcallowip=\fR -.IP -Allow JSON\-RPC connections from specified source. Valid for are a -single IP (e.g. 1.2.3.4), a network/netmask (e.g. -1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This -option can be specified multiple times -.HP -\fB\-rpcauth=\fR -.IP -Username and hashed password for JSON\-RPC connections. The field - comes in the format: :$. A -canonical python script is included in share/rpcauth. The client -then connects normally using the -rpcuser=/rpcpassword= pair of arguments. This -option can be specified multiple times -.HP -\fB\-rpcbind=\fR[:port] -.IP -Bind to given address to listen for JSON\-RPC connections. Do not expose -the RPC server to untrusted networks such as the public internet! -This option is ignored unless \fB\-rpcallowip\fR is also passed. Port is -optional and overrides \fB\-rpcport\fR. Use [host]:port notation for -IPv6. This option can be specified multiple times (default: -127.0.0.1 and ::1 i.e., localhost) -.HP -\fB\-rpccookiefile=\fR -.IP -Location of the auth cookie. Relative paths will be prefixed by a -net\-specific datadir location. (default: data dir) -.HP -\fB\-rpccorsdomain\fR=\fI\,value\/\fR -.IP -Domain from which to accept cross origin requests (browser enforced) -.HP -\fB\-rpcpassword=\fR -.IP -Password for JSON\-RPC connections -.HP -\fB\-rpcport=\fR -.IP -Listen for JSON\-RPC connections on (default: 8332, testnet: -18332, regtest: 18443) -.HP -\fB\-rpcthreads=\fR -.IP -Set the number of threads to service RPC calls (default: 4) -.HP -\fB\-rpcuser=\fR -.IP -Username for JSON\-RPC connections -.HP -\fB\-rpcwhitelist=\fR -.IP -Set a whitelist to filter incoming RPC calls for a specific user. The -field comes in the format: :,,...,. If multiple whitelists are set for a given user, -they are set\-intersected. See \fB\-rpcwhitelistdefault\fR documentation -for information on default whitelist behavior. -.HP -\fB\-rpcwhitelistdefault\fR -.IP -Sets default behavior for rpc whitelisting. Unless rpcwhitelistdefault -is set to 0, if any \fB\-rpcwhitelist\fR is set, the rpc server acts as -if all rpc users are subject to empty\-unless\-otherwise\-specified -whitelists. If rpcwhitelistdefault is set to 1 and no -\fB\-rpcwhitelist\fR is set, rpc server acts as if all rpc users are -subject to empty whitelists. -.HP -\fB\-server\fR -.IP -Accept command line and JSON\-RPC commands -.PP -UI Options: -.HP -\fB\-choosedatadir\fR -.IP -Choose data directory on startup (default: 0) -.HP -\fB\-lang=\fR -.IP -Set language, for example "de_DE" (default: system locale) -.HP -\fB\-min\fR -.IP -Start minimized -.HP -\fB\-resetguisettings\fR -.IP -Reset all settings changed in the GUI -.HP -\fB\-rootcertificates=\fR -.IP -Set SSL root certificates for payment request (default: \fB\-system\-\fR) -.HP -\fB\-splash\fR -.IP -Show splash screen on startup (default: 1) -.SH COPYRIGHT -Copyright (C) 2009-2020 The Bitcoin developers - -Please contribute if you find Bitcoin ABC useful. Visit - for further information about the software. -The source code is available from . - -This is experimental software. -Distributed under the MIT software license, see the accompanying file COPYING -or - -This product includes software developed by the OpenSSL Project for use in the -OpenSSL Toolkit and cryptographic software written by -Eric Young and UPnP software written by Thomas Bernard. diff --git a/doc/man/bitcoin-tx.1 b/doc/man/bitcoin-tx.1 deleted file mode 100644 index 4f3a53098..000000000 --- a/doc/man/bitcoin-tx.1 +++ /dev/null @@ -1,117 +0,0 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.8. -.TH BITCOIN-TX "1" "September 2020" "bitcoin-tx v0.22.2" "User Commands" -.SH NAME -bitcoin-tx \- manual page for bitcoin-tx v0.22.2 -.SH SYNOPSIS -.B bitcoin-tx -[\fI\,options\/\fR] \fI\, \/\fR[\fI\,commands\/\fR] \fI\,Update hex-encoded bitcoin transaction\/\fR -.br -.B bitcoin-tx -[\fI\,options\/\fR] \fI\,-create \/\fR[\fI\,commands\/\fR] \fI\,Create hex-encoded bitcoin transaction\/\fR -.SH DESCRIPTION -Bitcoin ABC bitcoin\-tx utility version v0.22.2 -.SH OPTIONS -.HP -\-? -.IP -This help message -.HP -\fB\-create\fR -.IP -Create new, empty TX. -.HP -\fB\-json\fR -.IP -Select JSON output -.HP -\fB\-txid\fR -.IP -Output only the hex\-encoded transaction id of the resultant transaction. -.PP -Chain selection options: -.HP -\fB\-chain=\fR -.IP -Use the chain (default: main). Allowed values: main, test, -regtest -.HP -\fB\-testnet\fR -.IP -Use the test chain. Equivalent to \fB\-chain\fR=\fI\,test\/\fR. -.PP -Commands: -.IP -delin=N -.IP -Delete input N from TX -.IP -delout=N -.IP -Delete output N from TX -.IP -in=TXID:VOUT(:SEQUENCE_NUMBER) -.IP -Add input to TX -.IP -locktime=N -.IP -Set TX lock time to N -.IP -nversion=N -.IP -Set TX version to N -.IP -outaddr=VALUE:ADDRESS -.IP -Add address\-based output to TX -.IP -outdata=[VALUE:]DATA -.IP -Add data\-based output to TX -.IP -outmultisig=VALUE:REQUIRED:PUBKEYS:PUBKEY1:PUBKEY2:....[:FLAGS] -.IP -Add Pay To n\-of\-m Multi\-sig output to TX. n = REQUIRED, m = PUBKEYS. -Optionally add the "S" flag to wrap the output in a -pay\-to\-script\-hash. -.IP -outpubkey=VALUE:PUBKEY[:FLAGS] -.IP -Add pay\-to\-pubkey output to TX. Optionally add the "S" flag to wrap the -output in a pay\-to\-script\-hash. -.IP -outscript=VALUE:SCRIPT[:FLAGS] -.IP -Add raw script output to TX. Optionally add the "S" flag to wrap the -output in a pay\-to\-script\-hash. -.IP -sign=SIGHASH\-FLAGS -.IP -Add zero or more signatures to transaction. This command requires JSON -registers:prevtxs=JSON object, privatekeys=JSON object. See -signrawtransactionwithkey docs for format of sighash flags, JSON -objects. -.PP -Register Commands: -.IP -load=NAME:FILENAME -.IP -Load JSON file FILENAME into register NAME -.IP -set=NAME:JSON\-STRING -.IP -Set register NAME to given JSON\-STRING -.SH COPYRIGHT -Copyright (C) 2009-2020 The Bitcoin developers - -Please contribute if you find Bitcoin ABC useful. Visit - for further information about the software. -The source code is available from . - -This is experimental software. -Distributed under the MIT software license, see the accompanying file COPYING -or - -This product includes software developed by the OpenSSL Project for use in the -OpenSSL Toolkit and cryptographic software written by -Eric Young and UPnP software written by Thomas Bernard. diff --git a/doc/man/bitcoin-wallet.1 b/doc/man/bitcoin-wallet.1 deleted file mode 100644 index 31bb4fb98..000000000 --- a/doc/man/bitcoin-wallet.1 +++ /dev/null @@ -1,72 +0,0 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.8. -.TH BITCOIN-WALLET "1" "September 2020" "bitcoin-wallet v0.22.2" "User Commands" -.SH NAME -bitcoin-wallet \- manual page for bitcoin-wallet v0.22.2 -.SH DESCRIPTION -Bitcoin ABC bitcoin\-wallet version v0.22.2 -.PP -wallet\-tool is an offline tool for creating and interacting with Bitcoin ABC wallet files. -By default wallet\-tool will act on wallets in the default mainnet wallet directory in the datadir. -To change the target wallet, use the \fB\-datadir\fR, \fB\-wallet\fR and \fB\-testnet\fR/\-regtest arguments. -.SS "Usage:" -.IP -bitcoin\-wallet [options] -.SH OPTIONS -.HP -\-? -.IP -This help message -.HP -\fB\-datadir=\fR -.IP -Specify data directory -.HP -\fB\-wallet=\fR -.IP -Specify wallet name -.PP -Debugging/Testing options: -.HP -\fB\-debug=\fR -.IP -Output debugging information (default: 0). -.HP -\fB\-printtoconsole\fR -.IP -Send trace/debug info to console (default: 1 when no \fB\-debug\fR is true, 0 -otherwise. -.PP -Chain selection options: -.HP -\fB\-chain=\fR -.IP -Use the chain (default: main). Allowed values: main, test, -regtest -.HP -\fB\-testnet\fR -.IP -Use the test chain. Equivalent to \fB\-chain\fR=\fI\,test\/\fR. -.PP -Commands: -.IP -create -.IP -Create new wallet file -.IP -info -.IP -Get wallet info -.SH COPYRIGHT -Copyright (C) 2009-2020 The Bitcoin developers - -Please contribute if you find Bitcoin ABC useful. Visit - for further information about the software. -The source code is available from . - -This is experimental software. -Distributed under the MIT software license, see the accompanying file COPYING -or - -This product includes software developed by the OpenSSL Project for use in the -OpenSSL Toolkit and cryptographic software written by -Eric Young and UPnP software written by Thomas Bernard. diff --git a/doc/man/bitcoind.1 b/doc/man/bitcoind.1 deleted file mode 100644 index a0f07b1b5..000000000 --- a/doc/man/bitcoind.1 +++ /dev/null @@ -1,636 +0,0 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.8. -.TH BITCOIND "1" "September 2020" "bitcoind v0.22.2" "User Commands" -.SH NAME -bitcoind \- manual page for bitcoind v0.22.2 -.SH SYNOPSIS -.B bitcoind -[\fI\,options\/\fR] \fI\,Start Bitcoin ABC Daemon\/\fR -.SH DESCRIPTION -Bitcoin ABC Daemon version v0.22.2 -.SH OPTIONS -.HP -\-? -.IP -Print this help message and exit -.HP -\fB\-alertnotify=\fR -.IP -Execute command when a relevant alert is received or we see a really -long fork (%s in cmd is replaced by message) -.HP -\fB\-assumevalid=\fR -.IP -If this block is in the chain assume that it and its ancestors are valid -and potentially skip their script verification (0 to verify all, -default: -0000000000000000011fd96aa2f90943cd624e15b78b929c792474980cb5ff8a, -testnet: -00000000000000d2c2d5c102580e1832d60952019823dd83d57f5e77f069efe8) -.HP -\fB\-blockfilterindex=\fR -.IP -Maintain an index of compact filters by block (default: 0, values: -basic). If is not supplied or if = 1, indexes for -all known types are enabled. -.HP -\fB\-blocknotify=\fR -.IP -Execute command when the best block changes (%s in cmd is replaced by -block hash) -.HP -\fB\-blockreconstructionextratxn=\fR -.IP -Extra transactions to keep in memory for compact block reconstructions -(default: 100) -.HP -\fB\-blocksdir=\fR -.IP -Specify directory to hold blocks subdirectory for *.dat files (default: -) -.HP -\fB\-blocksonly\fR -.IP -Whether to reject transactions from network peers. Transactions from the -wallet or RPC are not affected. (default: 0) -.HP -\fB\-conf=\fR -.IP -Specify configuration file. Relative paths will be prefixed by datadir -location. (default: bitcoin.conf) -.HP -\fB\-daemon\fR -.IP -Run in the background as a daemon and accept commands -.HP -\fB\-datadir=\fR -.IP -Specify data directory -.HP -\fB\-dbcache=\fR -.IP -Set database cache size in megabytes (4 to 16384, default: 450) -.HP -\fB\-debuglogfile=\fR -.IP -Specify location of debug log file. Relative paths will be prefixed by a -net\-specific datadir location. (0 to disable; default: debug.log) -.HP -\fB\-finalizationdelay=\fR -.IP -Set the minimum amount of time to wait between a block header reception -and the block finalization. Unit is seconds (default: 7200) -.HP -\fB\-includeconf=\fR -.IP -Specify additional configuration file, relative to the \fB\-datadir\fR path -(only useable from configuration file, not command line) -.HP -\fB\-loadblock=\fR -.IP -Imports blocks from external blk000??.dat file on startup -.HP -\fB\-maxmempool=\fR -.IP -Keep the transaction memory pool below megabytes (default: 300) -.HP -\fB\-maxorphantx=\fR -.IP -Keep at most unconnectable transactions in memory (default: 100) -.HP -\fB\-maxreorgdepth=\fR -.IP -Configure at what depth blocks are considered final (default: 10). Use -\fB\-1\fR to disable. -.HP -\fB\-mempoolexpiry=\fR -.IP -Do not keep transactions in the mempool longer than hours (default: -336) -.HP -\fB\-par=\fR -.IP -Set the number of script verification threads (\fB\-16\fR to 15, 0 = auto, <0 = -leave that many cores free, default: 0) -.HP -\fB\-persistmempool\fR -.IP -Whether to save the mempool on shutdown and load on restart (default: 1) -.HP -\fB\-pid=\fR -.IP -Specify pid file. Relative paths will be prefixed by a net\-specific -datadir location. (default: bitcoind.pid) -.HP -\fB\-prune=\fR -.IP -Reduce storage requirements by enabling pruning (deleting) of old -blocks. This allows the pruneblockchain RPC to be called to -delete specific blocks, and enables automatic pruning of old -blocks if a target size in MiB is provided. This mode is -incompatible with \fB\-txindex\fR and \fB\-rescan\fR. Warning: Reverting this -setting requires re\-downloading the entire blockchain. (default: -0 = disable pruning blocks, 1 = allow manual pruning via RPC, ->=550 = automatically prune block files to stay under the -specified target size in MiB) -.HP -\fB\-reindex\fR -.IP -Rebuild chain state and block index from the blk*.dat files on disk -.HP -\fB\-reindex\-chainstate\fR -.IP -Rebuild chain state from the currently indexed blocks. When in pruning -mode or if blocks on disk might be corrupted, use full \fB\-reindex\fR -instead. -.HP -\fB\-sysperms\fR -.IP -Create new files with system default permissions, instead of umask 077 -(only effective with disabled wallet functionality) -.HP -\fB\-txindex\fR -.IP -Maintain a full transaction index, used by the getrawtransaction rpc -call (default: 0) -.HP -\fB\-usecashaddr\fR -.IP -Use Cash Address for destination encoding instead of base58 (activate by -default on Jan, 14) -.HP -\fB\-version\fR -.IP -Print version and exit -.PP -Connection options: -.HP -\fB\-addnode=\fR -.IP -Add a node to connect to and attempt to keep the connection open (see -the `addnode` RPC command help for more info) -.HP -\fB\-banscore=\fR -.IP -Threshold for disconnecting and discouraging misbehaving peers (default: -100) -.HP -\fB\-bantime=\fR -.IP -Default duration (in seconds) of manually configured bans (default: -86400) -.HP -\fB\-bind=\fR -.IP -Bind to given address and always listen on it. Use [host]:port notation -for IPv6 -.HP -\fB\-connect=\fR -.IP -Connect only to the specified node(s); \fB\-connect\fR=\fI\,0\/\fR disables automatic -connections (the rules for this peer are the same as for -\fB\-addnode\fR) -.HP -\fB\-discover\fR -.IP -Discover own IP addresses (default: 1 when listening and no \fB\-externalip\fR -or \fB\-proxy\fR) -.HP -\fB\-dns\fR -.IP -Allow DNS lookups for \fB\-addnode\fR, \fB\-seednode\fR and \fB\-connect\fR (default: 1) -.HP -\fB\-dnsseed\fR -.IP -Query for peer addresses via DNS lookup, if low on addresses (default: 1 -unless \fB\-connect\fR used) -.HP -\fB\-enablebip61\fR -.IP -Send reject messages per BIP61 (default: 0) -.HP -\fB\-externalip=\fR -.IP -Specify your own public address -.HP -\fB\-forcednsseed\fR -.IP -Always query for peer addresses via DNS lookup (default: 0) -.HP -\fB\-listen\fR -.IP -Accept connections from outside (default: 1 if no \fB\-proxy\fR or \fB\-connect\fR) -.HP -\fB\-listenonion\fR -.IP -Automatically create Tor hidden service (default: 1) -.HP -\fB\-maxconnections=\fR -.IP -Maintain at most connections to peers (default: 125) -.HP -\fB\-maxreceivebuffer=\fR -.IP -Maximum per\-connection receive buffer, *1000 bytes (default: 5000) -.HP -\fB\-maxsendbuffer=\fR -.IP -Maximum per\-connection send buffer, *1000 bytes (default: 1000) -.HP -\fB\-maxtimeadjustment\fR -.IP -Maximum allowed median peer time offset adjustment. Local perspective of -time may be influenced by peers forward or backward by this -amount. (default: 4200 seconds) -.HP -\fB\-maxuploadtarget=\fR -.IP -Tries to keep outbound traffic under the given target (in MiB per 24h), -0 = no limit (default: 0) -.HP -\fB\-onion=\fR -.IP -Use separate SOCKS5 proxy to reach peers via Tor hidden services -(default: \fB\-proxy\fR) -.HP -\fB\-onlynet=\fR -.IP -Make outgoing connections only through network (ipv4, ipv6 or -onion). Incoming connections are not affected by this option. -This option can be specified multiple times to allow multiple -networks. -.HP -\fB\-peerbloomfilters\fR -.IP -Support filtering of blocks and transaction with bloom filters (default: -1) -.HP -\fB\-peertimeout=\fR -.IP -Specify p2p connection timeout in seconds. This option determines the -amount of time a peer may be inactive before the connection to it -is dropped. (minimum: 1, default: 60) -.HP -\fB\-permitbaremultisig\fR -.IP -Relay non\-P2SH multisig (default: 1) -.HP -\fB\-port=\fR -.IP -Listen for connections on (default: 8333, testnet: 18333, -regtest: 18444) -.HP -\fB\-proxy=\fR -.IP -Connect through SOCKS5 proxy -.HP -\fB\-proxyrandomize\fR -.IP -Randomize credentials for every proxy connection. This enables Tor -stream isolation (default: 1) -.HP -\fB\-seednode=\fR -.IP -Connect to a node to retrieve peer addresses, and disconnect -.HP -\fB\-timeout=\fR -.IP -Specify connection timeout in milliseconds (minimum: 1, default: 5000) -.HP -\fB\-torcontrol=\fR: -.IP -Tor control port to use if onion listening enabled (default: -127.0.0.1:9051) -.HP -\fB\-torpassword=\fR -.IP -Tor control port password (default: empty) -.HP -\fB\-upnp\fR -.IP -Use UPnP to map the listening port (default: 0) -.HP -\fB\-whitebind=\fR -.IP -Bind to given address and whitelist peers connecting to it. Use -[host]:port notation for IPv6 -.HP -\fB\-whitelist=\fR -.IP -Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or -CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple -times. Whitelisted peers cannot be DoS banned and their -transactions are always relayed, even if they are already in the -mempool, useful e.g. for a gateway -.PP -Wallet options: -.HP -\fB\-avoidpartialspends\fR -.IP -Group outputs by address, selecting all or none, instead of selecting on -a per\-output basis. Privacy is improved as an address is only -used once (unless someone sends to it after spending from it), -but may result in slightly higher fees as suboptimal coin -selection may result due to the added limitation (default: 0 -(always enabled for wallets with "avoid_reuse" enabled)) -.HP -\fB\-disablewallet\fR -.IP -Do not load the wallet and disable wallet RPC calls -.HP -\fB\-fallbackfee=\fR -.IP -A fee rate (in BCH/kB) that will be used when fee estimation has -insufficient data. 0 to entirely disable the fallbackfee feature. -(default: 0.00) -.HP -\fB\-keypool=\fR -.IP -Set key pool size to (default: 1000) -.HP -\fB\-mintxfee=\fR -.IP -Fees (in BCH/kB) smaller than this are considered zero fee for -transaction creation (default: 0.00001) -.HP -\fB\-paytxfee=\fR -.IP -Fee (in BCH/kB) to add to transactions you send (default: 0.00) -.HP -\fB\-rescan\fR -.IP -Rescan the block chain for missing wallet transactions on startup -.HP -\fB\-salvagewallet\fR -.IP -Attempt to recover private keys from a corrupt wallet on startup -.HP -\fB\-spendzeroconfchange\fR -.IP -Spend unconfirmed change when sending transactions (default: 1) -.HP -\fB\-upgradewallet\fR -.IP -Upgrade wallet to latest format on startup -.HP -\fB\-wallet=\fR -.IP -Specify wallet database path. Can be specified multiple times to load -multiple wallets. Path is interpreted relative to if -it is not absolute, and will be created if it does not exist (as -a directory containing a wallet.dat file and log files). For -backwards compatibility this will also accept names of existing -data files in .) -.HP -\fB\-walletbroadcast\fR -.IP -Make the wallet broadcast transactions (default: 1) -.HP -\fB\-walletdir=\fR -.IP -Specify directory to hold wallets (default: /wallets if it -exists, otherwise ) -.HP -\fB\-walletnotify=\fR -.IP -Execute command when a wallet transaction changes (%s in cmd is replaced -by TxID) -.HP -\fB\-zapwallettxes=\fR -.IP -Delete all wallet transactions and only recover those parts of the -blockchain through \fB\-rescan\fR on startup (1 = keep tx meta data e.g. -payment request information, 2 = drop tx meta data) -.PP -ZeroMQ notification options: -.HP -\fB\-zmqpubhashblock=\fR
-.IP -Enable publish hash block in
-.HP -\fB\-zmqpubhashblockhwm=\fR -.IP -Set publish hash block outbound message high water mark (default: 1000) -.HP -\fB\-zmqpubhashtx=\fR
-.IP -Enable publish hash transaction in
-.HP -\fB\-zmqpubhashtxhwm=\fR -.IP -Set publish hash transaction outbound message high water mark (default: -1000) -.HP -\fB\-zmqpubrawblock=\fR
-.IP -Enable publish raw block in
-.HP -\fB\-zmqpubrawblockhwm=\fR -.IP -Set publish raw block outbound message high water mark (default: 1000) -.HP -\fB\-zmqpubrawtx=\fR
-.IP -Enable publish raw transaction in
-.HP -\fB\-zmqpubrawtxhwm=\fR -.IP -Set publish raw transaction outbound message high water mark (default: -1000) -.PP -Debugging/Testing options: -.HP -\fB\-debug=\fR -.IP -Output debugging information (default: 0, supplying is -optional). If is not supplied or if = 1, -output all debugging information. can be: net, tor, -mempool, http, bench, zmq, db, rpc, estimatefee, addrman, -selectcoins, reindex, cmpctblock, rand, prune, proxy, mempoolrej, -libevent, coindb, qt, leveldb, validation. -.HP -\fB\-debugexclude=\fR -.IP -Exclude debugging information for a category. Can be used in conjunction -with \fB\-debug\fR=\fI\,1\/\fR to output debug logs for all categories except one -or more specified categories. -.HP -\fB\-help\-debug\fR -.IP -Print help message with debugging options and exit -.HP -\fB\-logips\fR -.IP -Include IP addresses in debug output (default: 0) -.HP -\fB\-logthreadnames\fR -.IP -Prepend debug output with name of the originating thread (only available -on platforms supporting thread_local) (default: 0) -.HP -\fB\-logtimestamps\fR -.IP -Prepend debug output with timestamp (default: 1) -.HP -\fB\-maxtxfee=\fR -.IP -Maximum total fees (in BCH) to use in a single wallet transaction or raw -transaction; setting this too low may abort large transactions -(default: 0.10) -.HP -\fB\-printtoconsole\fR -.IP -Send trace/debug info to console instead of debug.log file (default: 1 -when no \fB\-daemon\fR. To disable logging to file, set debuglogfile=0) -.HP -\fB\-shrinkdebugfile\fR -.IP -Shrink debug.log file on client startup (default: 1 when no \fB\-debug\fR) -.HP -\fB\-uacomment=\fR -.IP -Append comment to the user agent string -.PP -Chain selection options: -.HP -\fB\-chain=\fR -.IP -Use the chain (default: main). Allowed values: main, test, -regtest -.HP -\fB\-testnet\fR -.IP -Use the test chain. Equivalent to \fB\-chain\fR=\fI\,test\/\fR. -.PP -Node relay options: -.HP -\fB\-bytespersigop\fR -.IP -Equivalent bytes per sigop in transactions for relay and mining -(default: 50) -.HP -\fB\-datacarrier\fR -.IP -Relay and mine data carrier transactions (default: 1) -.HP -\fB\-datacarriersize\fR -.IP -Maximum size of data in data carrier transactions we relay and mine -(default: 223) -.HP -\fB\-minrelaytxfee=\fR -.IP -Fees (in BCH/kB) smaller than this are rejected for relaying, mining and -transaction creation (default: 0.00001) -.HP -\fB\-whitelistforcerelay\fR -.IP -Force relay of transactions from whitelisted peers even if they violate -local relay policy (default: 0) -.HP -\fB\-whitelistrelay\fR -.IP -Accept relayed transactions received from whitelisted peers even when -not relaying transactions (default: 1) -.PP -Block creation options: -.HP -\fB\-blockmaxsize=\fR -.IP -Set maximum block size in bytes (default: 2000000) -.HP -\fB\-blockmintxfee=\fR -.IP -Set lowest fee rate (in BCH/kB) for transactions to be included in block -creation. (default: 0.00001) -.PP -RPC server options: -.HP -\fB\-rest\fR -.IP -Accept public REST requests (default: 0) -.HP -\fB\-rpcallowip=\fR -.IP -Allow JSON\-RPC connections from specified source. Valid for are a -single IP (e.g. 1.2.3.4), a network/netmask (e.g. -1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This -option can be specified multiple times -.HP -\fB\-rpcauth=\fR -.IP -Username and hashed password for JSON\-RPC connections. The field - comes in the format: :$. A -canonical python script is included in share/rpcauth. The client -then connects normally using the -rpcuser=/rpcpassword= pair of arguments. This -option can be specified multiple times -.HP -\fB\-rpcbind=\fR[:port] -.IP -Bind to given address to listen for JSON\-RPC connections. Do not expose -the RPC server to untrusted networks such as the public internet! -This option is ignored unless \fB\-rpcallowip\fR is also passed. Port is -optional and overrides \fB\-rpcport\fR. Use [host]:port notation for -IPv6. This option can be specified multiple times (default: -127.0.0.1 and ::1 i.e., localhost) -.HP -\fB\-rpccookiefile=\fR -.IP -Location of the auth cookie. Relative paths will be prefixed by a -net\-specific datadir location. (default: data dir) -.HP -\fB\-rpccorsdomain\fR=\fI\,value\/\fR -.IP -Domain from which to accept cross origin requests (browser enforced) -.HP -\fB\-rpcpassword=\fR -.IP -Password for JSON\-RPC connections -.HP -\fB\-rpcport=\fR -.IP -Listen for JSON\-RPC connections on (default: 8332, testnet: -18332, regtest: 18443) -.HP -\fB\-rpcthreads=\fR -.IP -Set the number of threads to service RPC calls (default: 4) -.HP -\fB\-rpcuser=\fR -.IP -Username for JSON\-RPC connections -.HP -\fB\-rpcwhitelist=\fR -.IP -Set a whitelist to filter incoming RPC calls for a specific user. The -field comes in the format: :,,...,. If multiple whitelists are set for a given user, -they are set\-intersected. See \fB\-rpcwhitelistdefault\fR documentation -for information on default whitelist behavior. -.HP -\fB\-rpcwhitelistdefault\fR -.IP -Sets default behavior for rpc whitelisting. Unless rpcwhitelistdefault -is set to 0, if any \fB\-rpcwhitelist\fR is set, the rpc server acts as -if all rpc users are subject to empty\-unless\-otherwise\-specified -whitelists. If rpcwhitelistdefault is set to 1 and no -\fB\-rpcwhitelist\fR is set, rpc server acts as if all rpc users are -subject to empty whitelists. -.HP -\fB\-server\fR -.IP -Accept command line and JSON\-RPC commands -.SH COPYRIGHT -Copyright (C) 2009-2020 The Bitcoin developers - -Please contribute if you find Bitcoin ABC useful. Visit - for further information about the software. -The source code is available from . - -This is experimental software. -Distributed under the MIT software license, see the accompanying file COPYING -or - -This product includes software developed by the OpenSSL Project for use in the -OpenSSL Toolkit and cryptographic software written by -Eric Young and UPnP software written by Thomas Bernard. diff --git a/doc/man/gen-manpages.sh b/doc/man/gen-manpages.sh new file mode 100755 index 000000000..e1e4938f5 --- /dev/null +++ b/doc/man/gen-manpages.sh @@ -0,0 +1,60 @@ +#!/usr/bin/env bash + +export LC_ALL=C + +set -euxo pipefail + +usage() { + cat << EOF +Usage: $0 bitcoind binary manpage + bitcoind: path to bitcoind executable + binary: path to the binary to generate the man pages from + manpage: output path for the man page +EOF +} + +if [ $# -ne 3 ] +then + usage + exit 1 +fi + +if ! command -v help2man +then + echo "help2man is required to run $0, please install it" + exit 2 +fi + +BITCOIND="$1" +BIN="$2" +MANPAGE="$3" + +if [ ! -x "${BITCOIND}" ] +then + echo "${BITCOIND} not found or not executable." + exit 3 +fi +if [ ! -x "${BIN}" ] +then + echo "${BIN} not found or not executable." + exit 3 +fi + +mkdir -p "$(dirname ${MANPAGE})" + +# The autodetected version git tag can screw up manpage output a little bit +read -r -a VERSION <<< "$(${BITCOIND} --version | head -n1 | awk -F'[ -]' '{ print $5, $6 }')" + +# Create a footer file with copyright content. +# This gets autodetected fine for bitcoind if --version-string is not set, +# but has different outcomes for bitcoin-qt and bitcoin-cli. +FOOTER="$(basename ${BIN})_footer.h2m" +cleanup() { + rm -f "${FOOTER}" +} +trap "cleanup" EXIT +echo "[COPYRIGHT]" > "${FOOTER}" +"${BITCOIND}" --version | sed -n '1!p' >> "${FOOTER}" + +help2man -N --version-string="${VERSION[0]}" --include="${FOOTER}" -o "${MANPAGE}" "${BIN}" +sed -i "s/\\\-${VERSION[1]}//g" "${MANPAGE}" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 567701ea4..e4454bf05 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,663 +1,667 @@ # Copyright (c) 2017 The Bitcoin developers project(bitcoind) set(CMAKE_CXX_STANDARD 14) # Default visibility is hidden on all targets. set(CMAKE_C_VISIBILITY_PRESET hidden) set(CMAKE_CXX_VISIBILITY_PRESET hidden) option(BUILD_BITCOIN_WALLET "Activate the wallet functionality" ON) option(BUILD_BITCOIN_ZMQ "Activate the ZeroMQ functionalities" ON) option(BUILD_BITCOIN_CLI "Build bitcoin-cli" ON) option(BUILD_BITCOIN_TX "Build bitcoin-tx" ON) option(BUILD_BITCOIN_QT "Build bitcoin-qt" ON) option(BUILD_BITCOIN_SEEDER "Build bitcoin-seeder" ON) option(BUILD_LIBBITCOINCONSENSUS "Build the bitcoinconsenus shared library" ON) option(ENABLE_BIP70 "Enable BIP70 (payment protocol) support in GUI" ON) option(ENABLE_HARDENING "Harden the executables" ON) option(ENABLE_REDUCE_EXPORTS "Reduce the amount of exported symbols" OFF) option(ENABLE_STATIC_LIBSTDCXX "Statically link libstdc++" OFF) option(ENABLE_GLIBC_BACK_COMPAT "Enable Glibc compatibility features" OFF) option(ENABLE_QRCODE "Enable QR code display" ON) option(ENABLE_UPNP "Enable UPnP support" ON) option(START_WITH_UPNP "Make UPnP the default to map ports" OFF) option(ENABLE_CLANG_TIDY "Enable clang-tidy checks for Bitcoin ABC" OFF) option(ENABLE_PROFILING "Select the profiling tool to use" OFF) option(USE_LD_GOLD "Try to use gold as a linker if available" ON) set(OS_WITH_JEMALLOC_AS_SYSTEM_DEFAULT "Android" "FreeBSD" "NetBSD" ) if(NOT CMAKE_SYSTEM_NAME IN_LIST OS_WITH_JEMALLOC_AS_SYSTEM_DEFAULT) set(USE_JEMALLOC_DEFAULT ON) endif() option(USE_JEMALLOC "Use jemalloc as an allocation library" ${USE_JEMALLOC_DEFAULT}) if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") set(DEFAULT_ENABLE_DBUS_NOTIFICATIONS ON) endif() option(ENABLE_DBUS_NOTIFICATIONS "Enable DBus desktop notifications. Linux only." ${DEFAULT_ENABLE_DBUS_NOTIFICATIONS}) # If ccache is available, then use it. find_program(CCACHE ccache) if(CCACHE) message(STATUS "Using ccache: ${CCACHE}") set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE}) set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE}) endif(CCACHE) # Disable what we do not need for the native build. include(NativeExecutable) native_add_cmake_flags( "-DBUILD_BITCOIN_WALLET=OFF" "-DBUILD_BITCOIN_QT=OFF" "-DBUILD_BITCOIN_ZMQ=OFF" "-DENABLE_QRCODE=OFF" "-DENABLE_UPNP=OFF" "-DUSE_JEMALLOC=OFF" # Forward the current setting for clang-tidy "-DENABLE_CLANG_TIDY=${ENABLE_CLANG_TIDY}" ) if(ENABLE_CLANG_TIDY) include(ClangTidy) endif() if(ENABLE_SANITIZERS) include(Sanitizers) enable_sanitizers(${ENABLE_SANITIZERS}) endif() include(AddCompilerFlags) if(USE_LD_GOLD) add_linker_flags(-fuse-ld=gold) endif() # Prefer -g3, defaults to -g if unavailable foreach(LANGUAGE C CXX) set(COMPILER_DEBUG_LEVEL -g) check_compiler_flags(G3_IS_SUPPORTED ${LANGUAGE} -g3) if(${G3_IS_SUPPORTED}) set(COMPILER_DEBUG_LEVEL -g3) endif() add_compile_options_to_configuration_for_language(Debug ${LANGUAGE} ${COMPILER_DEBUG_LEVEL}) endforeach() # Define the debugging symbols DEBUG and DEBUG_LOCKORDER when the Debug build # type is selected. add_compile_definitions_to_configuration(Debug DEBUG DEBUG_LOCKORDER) # Add -ftrapv when building in Debug add_compile_options_to_configuration(Debug -ftrapv) # All versions of gcc that we commonly use for building are subject to bug # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90348. To work around that, set # -fstack-reuse=none for all gcc builds. (Only gcc understands this flag) if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") add_compiler_flags(-fstack-reuse=none) endif() # Ensure that WINDRES_PREPROC is enabled when using windres. if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") # Ensure that WINDRES_PREPROC is enabled when using windres. list(APPEND CMAKE_RC_FLAGS "-DWINDRES_PREPROC") # Build all static so there is no dll file to distribute. add_linker_flags(-static) endif() if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") add_compile_definitions(MAC_OSX OBJC_OLD_DISPATCH_PROTOTYPES=0) add_linker_flags(-Wl,-dead_strip_dylibs) endif() if(ENABLE_REDUCE_EXPORTS) # Default visibility is set by CMAKE__VISIBILITY_PRESET, but this # doesn't tell if the visibility set is effective. # Check if the flag -fvisibility=hidden is supported, as using the hidden # visibility is a requirement to reduce exports. check_compiler_flags(HAS_CXX_FVISIBILITY CXX -fvisibility=hidden) if(NOT HAS_CXX_FVISIBILITY) message(FATAL_ERROR "Cannot set default symbol visibility. Use -DENABLE_REDUCE_EXPORTS=OFF.") endif() # Also hide symbols from static libraries add_linker_flags(-Wl,--exclude-libs,libstdc++) endif() # Enable statically linking libstdc++ if(ENABLE_STATIC_LIBSTDCXX) add_linker_flags(-static-libstdc++) endif() set(CMAKE_POSITION_INDEPENDENT_CODE ON) if(ENABLE_HARDENING) # Enable stack protection add_cxx_compiler_flags(-fstack-protector-all -Wstack-protector) # Enable some buffer overflow checking, except in -O0 builds which # do not support them add_compiler_flags(-U_FORTIFY_SOURCE) add_compile_options($<$>:-D_FORTIFY_SOURCE=2>) # Enable ASLR (these flags are primarily targeting MinGw) add_linker_flags(-Wl,--dynamicbase -Wl,--nxcompat -Wl,--high-entropy-va) # Make the relocated sections read-only add_linker_flags(-Wl,-z,relro -Wl,-z,now) # CMake provides the POSITION_INDEPENDENT_CODE property to set PIC/PIE. cmake_policy(SET CMP0083 NEW) include(CheckPIESupported) check_pie_supported() if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") # MinGw provides its own libssp for stack smashing protection link_libraries(ssp) endif() endif() if(ENABLE_PROFILING MATCHES "gprof") message(STATUS "Enable profiling with gprof") # -pg is incompatible with -pie. Since hardening and profiling together # doesn't make sense, we simply make them mutually exclusive here. # Additionally, hardened toolchains may force -pie by default, in which # case it needs to be turned off with -no-pie. if(ENABLE_HARDENING) message(FATAL_ERROR "Profiling with gprof requires disabling hardening with -DENABLE_HARDENING=OFF.") endif() add_linker_flags(-no-pie) add_compiler_flags(-pg) add_linker_flags(-pg) endif() # Enable warning add_c_compiler_flags(-Wnested-externs -Wstrict-prototypes) add_compiler_flags( -Wall -Wextra -Wformat -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wthread-safety-analysis -Wshadow -Wshadow-field -Wrange-loop-analysis -Wredundant-decls ) add_compiler_flag_group(-Wformat -Wformat-security) add_cxx_compiler_flags( -Wredundant-move ) option(EXTRA_WARNINGS "Enable extra warnings" OFF) if(EXTRA_WARNINGS) add_cxx_compiler_flags(-Wsuggest-override) else() add_compiler_flags(-Wno-unused-parameter) add_compiler_flags(-Wno-implicit-fallthrough) endif() # libtool style configure add_subdirectory(config) # Enable LFS (Large File Support) on targets that don't have it natively. # This should be defined before the libraries are included as leveldb need the # definition to be set. if(NOT HAVE_LARGE_FILE_SUPPORT) add_compile_definitions(_FILE_OFFSET_BITS=64) add_linker_flags(-Wl,--large-address-aware) endif() if(ENABLE_GLIBC_BACK_COMPAT) # Wrap some glibc functions with ours add_linker_flags(-Wl,--wrap=__divmoddi4) add_linker_flags(-Wl,--wrap=log2f) if(NOT HAVE_LARGE_FILE_SUPPORT) add_linker_flags(-Wl,--wrap=fcntl -Wl,--wrap=fcntl64) endif() endif() if(USE_JEMALLOC) # Most of the sanitizers require their instrumented allocation functions to # be fully functional. This is obviously the case for all the memory related # sanitizers (asan, lsan, msan) but not only. if(ENABLE_SANITIZERS) message(WARNING "Jemalloc is incompatible with the sanitizers and has been disabled.") else() find_package(Jemalloc 3.6.0 REQUIRED) link_libraries(Jemalloc::jemalloc) endif() endif() # Make sure that all the global compiler and linker flags are set BEFORE # including the libraries so they apply as needed. # libraries add_subdirectory(crypto) add_subdirectory(leveldb) add_subdirectory(secp256k1) add_subdirectory(univalue) # Find the git root, and returns the full path to the .git/logs/HEAD file if # it exists. function(find_git_head_logs_file RESULT) find_package(Git) if(GIT_FOUND) execute_process( COMMAND "${GIT_EXECUTABLE}" "rev-parse" "--show-toplevel" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" OUTPUT_VARIABLE GIT_ROOT RESULT_VARIABLE GIT_RESULT OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET ) if(GIT_RESULT EQUAL 0) set(GIT_LOGS_DIR "${GIT_ROOT}/.git/logs") set(GIT_HEAD_LOGS_FILE "${GIT_LOGS_DIR}/HEAD") # If the .git/logs/HEAD does not exist, create it if(NOT EXISTS "${GIT_HEAD_LOGS_FILE}") file(MAKE_DIRECTORY "${GIT_LOGS_DIR}") file(TOUCH "${GIT_HEAD_LOGS_FILE}") endif() set(${RESULT} "${GIT_HEAD_LOGS_FILE}" PARENT_SCOPE) endif() endif() endfunction() find_git_head_logs_file(GIT_HEAD_LOGS_FILE) set(OBJ_DIR "${CMAKE_CURRENT_BINARY_DIR}/obj") file(MAKE_DIRECTORY "${OBJ_DIR}") set(BUILD_HEADER "${OBJ_DIR}/build.h") set(BUILD_HEADER_TMP "${BUILD_HEADER}.tmp") add_custom_command( DEPENDS "${GIT_HEAD_LOGS_FILE}" "${CMAKE_SOURCE_DIR}/share/genbuild.sh" OUTPUT "${BUILD_HEADER}" COMMAND "${CMAKE_SOURCE_DIR}/share/genbuild.sh" "${BUILD_HEADER_TMP}" "${CMAKE_SOURCE_DIR}" COMMAND ${CMAKE_COMMAND} -E copy_if_different "${BUILD_HEADER_TMP}" "${BUILD_HEADER}" COMMAND ${CMAKE_COMMAND} -E remove "${BUILD_HEADER_TMP}" ) # Because the Bitcoin ABc source code is disorganised, we # end up with a bunch of libraries without any apparent # cohesive structure. This is inherited from Bitcoin Core # and reflecting this. # TODO: Improve the structure once cmake is rocking. # Various completely unrelated features shared by all executables. add_library(util chainparamsbase.cpp clientversion.cpp compat/glibcxx_sanity.cpp compat/strnlen.cpp fs.cpp interfaces/handler.cpp logging.cpp random.cpp randomenv.cpp rcu.cpp rpc/request.cpp support/cleanse.cpp support/lockedpool.cpp sync.cpp threadinterrupt.cpp uint256.cpp util/bip32.cpp util/bytevectorhash.cpp util/error.cpp util/moneystr.cpp util/settings.cpp util/spanparsing.cpp util/strencodings.cpp util/string.cpp util/system.cpp util/threadnames.cpp util/time.cpp util/url.cpp util/validation.cpp # obj/build.h "${BUILD_HEADER}" ) target_compile_definitions(util PUBLIC HAVE_CONFIG_H HAVE_BUILD_INFO) target_include_directories(util PUBLIC . # To access the config/ and obj/ directories ${CMAKE_CURRENT_BINARY_DIR} ) if(ENABLE_GLIBC_BACK_COMPAT) target_sources(util PRIVATE compat/glibc_compat.cpp) endif() # Target specific configs if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") set(Boost_USE_STATIC_LIBS ON) set(Boost_USE_STATIC_RUNTIME ON) set(Boost_THREADAPI win32) find_package(SHLWAPI REQUIRED) target_link_libraries(util SHLWAPI::shlwapi) find_library(WS2_32_LIBRARY NAMES ws2_32) target_link_libraries(util ${WS2_32_LIBRARY}) target_compile_definitions(util PUBLIC BOOST_THREAD_USE_LIB) endif() # Boost packages set(BOOST_PACKAGES_REQUIRED chrono filesystem thread) function(prepend var prefix) set(listVar "") foreach(f ${ARGN}) list(APPEND listVar "${prefix}${f}") endforeach(f) set(${var} "${listVar}" PARENT_SCOPE) endfunction(prepend) prepend(BOOST_LIBRARIES "Boost::" ${BOOST_PACKAGES_REQUIRED}) find_package(Boost 1.59 REQUIRED ${BOOST_PACKAGES_REQUIRED}) # This require libevent set(EVENT_MIN_VERSION 2.0.22) find_package(Event ${EVENT_MIN_VERSION} REQUIRED COMPONENTS event) target_link_libraries(util univalue crypto Event::event ${BOOST_LIBRARIES}) # Make sure boost uses std::atomic (it doesn't before 1.63) target_compile_definitions(util PUBLIC BOOST_SP_USE_STD_ATOMIC BOOST_AC_USE_STD_ATOMIC) # More completely unrelated features shared by all executables. # Because nothing says this is different from util than "common" add_library(common amount.cpp base58.cpp bloom.cpp cashaddr.cpp cashaddrenc.cpp chainparams.cpp config.cpp consensus/merkle.cpp coins.cpp compressor.cpp eventloop.cpp feerate.cpp core_read.cpp core_write.cpp key.cpp key_io.cpp merkleblock.cpp net_permissions.cpp netaddress.cpp netbase.cpp outputtype.cpp policy/policy.cpp primitives/block.cpp protocol.cpp psbt.cpp rpc/rawtransaction_util.cpp rpc/util.cpp scheduler.cpp salteduint256hasher.cpp versionbitsinfo.cpp warnings.cpp ) target_link_libraries(common util secp256k1 script) # script library add_library(script script/bitfield.cpp script/descriptor.cpp script/interpreter.cpp script/script.cpp script/script_error.cpp script/sigencoding.cpp script/sign.cpp script/signingprovider.cpp script/standard.cpp ) target_link_libraries(script common) # libbitcoinconsensus add_library(bitcoinconsensus arith_uint256.cpp hash.cpp primitives/transaction.cpp pubkey.cpp uint256.cpp util/strencodings.cpp consensus/tx_check.cpp ) target_link_libraries(bitcoinconsensus script) include(InstallationHelper) if(BUILD_LIBBITCOINCONSENSUS) target_compile_definitions(bitcoinconsensus PUBLIC BUILD_BITCOIN_INTERNAL HAVE_CONSENSUS_LIB ) install_shared_library(bitcoinconsensus script/bitcoinconsensus.cpp PUBLIC_HEADER script/bitcoinconsensus.h ) endif() # Bitcoin server facilities add_library(server addrdb.cpp addrman.cpp avalanche/peermanager.cpp avalanche/processor.cpp avalanche/proof.cpp avalanche/proofbuilder.cpp banman.cpp blockencodings.cpp blockfilter.cpp blockindex.cpp chain.cpp checkpoints.cpp config.cpp consensus/activation.cpp consensus/tx_verify.cpp dbwrapper.cpp flatfile.cpp httprpc.cpp httpserver.cpp index/base.cpp index/blockfilterindex.cpp index/txindex.cpp init.cpp interfaces/chain.cpp interfaces/node.cpp miner.cpp minerfund.cpp net.cpp net_processing.cpp node/coin.cpp node/coinstats.cpp node/context.cpp node/psbt.cpp node/transaction.cpp noui.cpp policy/fees.cpp policy/settings.cpp pow/aserti32d.cpp pow/daa.cpp pow/eda.cpp pow/pow.cpp rest.cpp rpc/abc.cpp rpc/avalanche.cpp rpc/blockchain.cpp rpc/command.cpp rpc/mining.cpp rpc/misc.cpp rpc/net.cpp rpc/rawtransaction.cpp rpc/server.cpp script/scriptcache.cpp script/sigcache.cpp shutdown.cpp timedata.cpp torcontrol.cpp txdb.cpp txmempool.cpp ui_interface.cpp validation.cpp validationinterface.cpp versionbits.cpp ) target_include_directories(server PRIVATE leveldb/helpers/memenv) target_link_libraries(server Event::event bitcoinconsensus leveldb memenv ) if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows") find_package(Event ${EVENT_MIN_VERSION} REQUIRED COMPONENTS pthreads) target_link_libraries(server Event::pthreads) endif() if(ENABLE_UPNP) find_package(MiniUPnPc 1.5 REQUIRED) target_link_libraries(server MiniUPnPc::miniupnpc) if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") # TODO: check if we are really using a static library. Assume this is # the one from the depends for now since the native windows build is not # supported. target_compile_definitions(server PUBLIC -DSTATICLIB PUBLIC -DMINIUPNP_STATICLIB ) endif() endif() # Test suites. add_subdirectory(test) add_subdirectory(avalanche/test) add_subdirectory(pow/test) # Benchmark suite. add_subdirectory(bench) include(BinaryTest) # Wallet if(BUILD_BITCOIN_WALLET) add_subdirectory(wallet) target_link_libraries(server wallet) # bitcoin-wallet add_executable(bitcoin-wallet bitcoin-wallet.cpp) if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") target_sources(bitcoin-wallet PRIVATE bitcoin-wallet-res.rc) endif() target_link_libraries(bitcoin-wallet wallet-tool common util) add_to_symbols_check(bitcoin-wallet) add_to_security_check(bitcoin-wallet) install_target(bitcoin-wallet) + install_manpage(bitcoin-wallet) else() target_sources(server PRIVATE dummywallet.cpp) endif() # ZeroMQ if(BUILD_BITCOIN_ZMQ) add_subdirectory(zmq) target_link_libraries(server zmq) endif() # RPC client support add_library(rpcclient rpc/client.cpp) target_link_libraries(rpcclient univalue util) # bitcoin-seeder if(BUILD_BITCOIN_SEEDER) add_subdirectory(seeder) endif() # bitcoin-cli if(BUILD_BITCOIN_CLI) add_executable(bitcoin-cli bitcoin-cli.cpp) if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") target_sources(bitcoin-cli PRIVATE bitcoin-cli-res.rc) endif() target_link_libraries(bitcoin-cli common rpcclient Event::event) add_to_symbols_check(bitcoin-cli) add_to_security_check(bitcoin-cli) install_target(bitcoin-cli) + install_manpage(bitcoin-cli) endif() # bitcoin-tx if(BUILD_BITCOIN_TX) add_executable(bitcoin-tx bitcoin-tx.cpp) if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") target_sources(bitcoin-tx PRIVATE bitcoin-tx-res.rc) endif() target_link_libraries(bitcoin-tx bitcoinconsensus) add_to_symbols_check(bitcoin-tx) add_to_security_check(bitcoin-tx) install_target(bitcoin-tx) + install_manpage(bitcoin-tx) endif() # bitcoind add_executable(bitcoind bitcoind.cpp) target_link_libraries(bitcoind server) if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") target_sources(bitcoind PRIVATE bitcoind-res.rc) endif() add_to_symbols_check(bitcoind) add_to_security_check(bitcoind) install_target(bitcoind) +install_manpage(bitcoind) # Bitcoin-qt if(BUILD_BITCOIN_QT) add_subdirectory(qt) endif() diff --git a/src/qt/CMakeLists.txt b/src/qt/CMakeLists.txt index 0fe2dc356..5bdaa7b24 100644 --- a/src/qt/CMakeLists.txt +++ b/src/qt/CMakeLists.txt @@ -1,625 +1,626 @@ # Copyright (c) 2018 The Bitcoin developers project(bitcoin-qt) include(BrewHelper) find_brew_prefix(QT5_PREFIX qt5) set(QT_REQUIRED_COMPONENTS Core Widgets Network Test) if(ENABLE_DBUS_NOTIFICATIONS) list(APPEND QT_REQUIRED_COMPONENTS DBus) endif() find_package(Qt5 5.5.1 COMPONENTS ${QT_REQUIRED_COMPONENTS} REQUIRED HINTS "${QT5_PREFIX}") # Localisation add_subdirectory(locale) add_custom_command(OUTPUT temp_bitcoin_locale.qrc COMMAND cmake ARGS -E copy "${CMAKE_CURRENT_SOURCE_DIR}/bitcoin_locale.qrc" temp_bitcoin_locale.qrc MAIN_DEPENDENCY bitcoin_locale.qrc VERBATIM ) add_custom_command(OUTPUT qrc_bitcoin_locale.cpp COMMAND Qt5::rcc ARGS temp_bitcoin_locale.qrc -name bitcoin_locale -o qrc_bitcoin_locale.cpp MAIN_DEPENDENCY temp_bitcoin_locale.qrc DEPENDS locales VERBATIM ) # UI elements # qt5_wrap_ui() generates the files in the CMAKE_CURRENT_BINARY_DIR. As there # is no option to change the output directory, moving the files to the forms # subdirectory requires to override the variable. It is reset to its actual # value after the call so it does not impact the other sections of this # CMakeLists.txt file. set(SAVE_CMAKE_CURRENT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) set(CMAKE_CURRENT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/forms") # It seems that some generators (at least the Unix Makefiles one) doesn't create # the build directory required by a custom command, so do it manually. file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) qt5_wrap_ui(UI_GENERATED_HEADERS forms/addressbookpage.ui forms/askpassphrasedialog.ui forms/coincontroldialog.ui forms/createwalletdialog.ui forms/editaddressdialog.ui forms/helpmessagedialog.ui forms/intro.ui forms/modaloverlay.ui forms/openuridialog.ui forms/optionsdialog.ui forms/overviewpage.ui forms/receivecoinsdialog.ui forms/receiverequestdialog.ui forms/debugwindow.ui forms/sendcoinsdialog.ui forms/sendcoinsentry.ui forms/signverifymessagedialog.ui forms/transactiondescdialog.ui ) set(CMAKE_CURRENT_BINARY_DIR ${SAVE_CMAKE_CURRENT_BINARY_DIR}) # Qt MOC set(CMAKE_AUTOMOC ON) # Handle qrc resources qt5_add_resources(QRC_BITCOIN_CPP bitcoin.qrc) add_library(bitcoin-qt-base bantablemodel.cpp bitcoin.cpp bitcoinaddressvalidator.cpp bitcoinamountfield.cpp bitcoingui.cpp bitcoinunits.cpp clientmodel.cpp csvmodelwriter.cpp guiutil.cpp intro.cpp modaloverlay.cpp networkstyle.cpp notificator.cpp optionsdialog.cpp optionsmodel.cpp peertablemodel.cpp platformstyle.cpp qvalidatedlineedit.cpp qvaluecombobox.cpp rpcconsole.cpp splashscreen.cpp trafficgraphwidget.cpp utilitydialog.cpp # Handle ui files ${UI_GENERATED_HEADERS} # Translations ${BITCOIN_QM_FILES} # Handle qrc files ${QRC_BITCOIN_CPP} qrc_bitcoin_locale.cpp ) # Add the minimal integration plugin, and other plugins according to the target # platform. set(QT_PLUGIN_COMPONENTS QMinimalIntegrationPlugin) set(QT_PLUGIN_PLATFORM_DEFINITIONS -DQT_QPA_PLATFORM_MINIMAL=1) # Linux support if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") list(APPEND QT_PLUGIN_COMPONENTS QXcbIntegrationPlugin) list(APPEND QT_PLUGIN_PLATFORM_DEFINITIONS -DQT_QPA_PLATFORM_XCB=1) endif() # Windows support if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") list(APPEND QT_PLUGIN_COMPONENTS QWindowsIntegrationPlugin) list(APPEND QT_PLUGIN_PLATFORM_DEFINITIONS -DQT_QPA_PLATFORM_WINDOWS=1) target_sources(bitcoin-qt-base PRIVATE winshutdownmonitor.cpp) endif() # OSX support if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") list(APPEND QT_PLUGIN_COMPONENTS QCocoaIntegrationPlugin) list(APPEND QT_PLUGIN_PLATFORM_DEFINITIONS -DQT_QPA_PLATFORM_COCOA=1) target_sources(bitcoin-qt-base PRIVATE macdockiconhandler.mm macnotificationhandler.mm ) set_property(TARGET bitcoin-qt-base PROPERTY AUTOMOC_MOC_OPTIONS "-DQ_OS_MAC") target_link_libraries(bitcoin-qt-base "-framework Foundation" "-framework ApplicationServices" "-framework AppKit" ) endif() # Find out more about Qt. This is similar to # http://code.qt.io/cgit/qt/qtwebkit.git/tree/Source/cmake/OptionsQt.cmake get_target_property(QT_CORE_TYPE Qt5::Core TYPE) if(QT_CORE_TYPE MATCHES STATIC) set(QT_STATIC_BUILD ON) endif() # Determine the Qt libraries directory from the QT5::Core library location get_target_property(QT_CORE_LIB_LOCATION Qt5::Core LOCATION) get_filename_component(QT5_LIB_DIR "${QT_CORE_LIB_LOCATION}" DIRECTORY) set(STATIC_DEPENDENCIES_CMAKE_FILE "${CMAKE_BINARY_DIR}/QtStaticDependencies.cmake") if(EXISTS ${STATIC_DEPENDENCIES_CMAKE_FILE}) file(REMOVE ${STATIC_DEPENDENCIES_CMAKE_FILE}) endif() set(CONVERT_PRL_PATH "${CONTRIB_PATH}/qt/convert-prl-libs-to-cmake.pl") macro(CONVERT_PRL_LIBS_TO_CMAKE _qt_component) if(TARGET Qt5::${_qt_component}) get_target_property(_lib_location Qt5::${_qt_component} LOCATION) execute_process(COMMAND ${PERL_EXECUTABLE} "${CONVERT_PRL_PATH}" --lib "${_lib_location}" --qt_lib_install_dir "${QT5_LIB_DIR}" --out "${STATIC_DEPENDENCIES_CMAKE_FILE}" --component "${_qt_component}" --compiler "${CMAKE_CXX_COMPILER_ID}" ) endif() endmacro() if(QT_STATIC_BUILD) list(APPEND QT_REQUIRED_COMPONENTS ${QT_PLUGIN_COMPONENTS}) foreach(qt_module ${QT_REQUIRED_COMPONENTS}) CONVERT_PRL_LIBS_TO_CMAKE(${qt_module}) endforeach() # HACK: We must explicitly add LIB path of the Qt installation # to correctly find qtpcre link_directories("${QT5_LIB_DIR}") # Now that we generated the dependencies, import them. set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CONVERT_PRL_PATH}") if(NOT EXISTS ${STATIC_DEPENDENCIES_CMAKE_FILE}) message(FATAL_ERROR "Unable to find ${STATIC_DEPENDENCIES_CMAKE_FILE}") endif() include(${STATIC_DEPENDENCIES_CMAKE_FILE}) list(REMOVE_DUPLICATES STATIC_LIB_DEPENDENCIES) # According to Qt documentation (https://doc.qt.io/qt-5/plugins-howto.html): # "Plugins can be linked statically into your application. # If you build the static version of Qt, this is the only option for # including Qt's predefined plugins." # So if the Qt build is static, the plugins should also be static and we # need to define QT_STATICPLUGIN to tell the code to import . target_compile_definitions(bitcoin-qt-base PUBLIC -DQT_STATICPLUGIN=1) # Add the platform plugin definition if required # Setting this definition tells the code what is the target for Q_IMPORT_PLUGIN(). foreach(qt_platform_definition ${QT_PLUGIN_PLATFORM_DEFINITIONS}) target_compile_definitions(bitcoin-qt-base PUBLIC "${qt_platform_definition}") endforeach() # Link the required plugins foreach(qt_plugin ${QT_PLUGIN_COMPONENTS}) target_link_libraries(bitcoin-qt-base Qt5::${qt_plugin}) endforeach() endif() target_link_libraries(bitcoin-qt-base server rpcclient Qt5::Widgets Qt5::Network ) if(ENABLE_DBUS_NOTIFICATIONS) target_link_libraries(bitcoin-qt-base Qt5::DBus) endif() if(ENABLE_BIP70) # Do protobuf codegen find_package(Protobuf REQUIRED) protobuf_generate_cpp(PROTOBUF_SOURCES PROTOBUF_HEADERS paymentrequest.proto) add_library(bitcoin-qt-protobuf OBJECT # Protobuf codegen ${PROTOBUF_HEADERS} ${PROTOBUF_SOURCES} ) target_include_directories(bitcoin-qt-protobuf PUBLIC ${Protobuf_INCLUDE_DIRS}) target_link_libraries(bitcoin-qt-protobuf ${Protobuf_LIBRARIES}) # Don't run clang-tidy on generated files if(ENABLE_CLANG_TIDY) include(ClangTidy) target_disable_clang_tidy(bitcoin-qt-protobuf) endif() # Message::ByteSize() is deprecated and replaced by ByteSizeLong() since # protobuf 3.1. if(Protobuf_VERSION GREATER_EQUAL "3.1.0") target_compile_definitions(bitcoin-qt-base PRIVATE USE_PROTOBUF_MESSAGE_BYTESIZELONG) endif() # OpenSSL functionality include(BrewHelper) find_brew_prefix(OPENSSL_ROOT_DIR openssl) find_package(OpenSSL REQUIRED) include(CheckSymbolExists) set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY}) check_symbol_exists(EVP_MD_CTX_new "openssl/evp.h" HAVE_DECL_EVP_MD_CTX_NEW) if(HAVE_DECL_EVP_MD_CTX_NEW) target_compile_definitions(bitcoin-qt-base PRIVATE HAVE_DECL_EVP_MD_CTX_NEW=1) endif() target_link_libraries(bitcoin-qt-base OpenSSL::SSL bitcoin-qt-protobuf ) endif() # Wallet if(BUILD_BITCOIN_WALLET) # Automoc option. set(AUTOMOC_MOC_OPTIONS -DENABLE_WALLET=1) # Add wallet functionality to bitcoin-qt target_sources(bitcoin-qt-base PRIVATE addressbookpage.cpp addresstablemodel.cpp askpassphrasedialog.cpp coincontroldialog.cpp coincontroltreewidget.cpp createwalletdialog.cpp editaddressdialog.cpp openuridialog.cpp overviewpage.cpp paymentserver.cpp receivecoinsdialog.cpp receiverequestdialog.cpp recentrequeststablemodel.cpp sendcoinsdialog.cpp sendcoinsentry.cpp signverifymessagedialog.cpp transactiondesc.cpp transactiondescdialog.cpp transactionfilterproxy.cpp transactionrecord.cpp transactiontablemodel.cpp transactionview.cpp walletcontroller.cpp walletframe.cpp walletmodel.cpp walletmodeltransaction.cpp walletview.cpp ) # Add BIP70 functionality to bitcoin-qt if(ENABLE_BIP70) target_sources(bitcoin-qt-base PRIVATE paymentrequestplus.cpp ) endif() target_link_libraries(bitcoin-qt-base wallet) if(ENABLE_QRCODE) find_package(QREncode REQUIRED) target_link_libraries(bitcoin-qt-base QREncode::qrencode) endif() endif() # The executable add_executable(bitcoin-qt WIN32 main.cpp) if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") target_sources(bitcoin-qt PRIVATE res/bitcoin-qt-res.rc) endif() target_link_libraries(bitcoin-qt bitcoin-qt-base) include(BinaryTest) add_to_symbols_check(bitcoin-qt) add_to_security_check(bitcoin-qt) include(InstallationHelper) install_target(bitcoin-qt) +install_manpage(bitcoin-qt) if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(BITCOINQT_BUNDLE_ICON "res/icons/bitcoin.icns") get_filename_component(BITCOINQT_BUNDLE_ICON_NAME "${BITCOINQT_BUNDLE_ICON}" NAME ) set(INFO_PLIST_STRINGS_FILE "Base.lproj/InfoPlist.strings") set(INFO_PLIST_STRINGS_PATH "${CMAKE_CURRENT_BINARY_DIR}/${INFO_PLIST_STRINGS_FILE}") file(WRITE "${INFO_PLIST_STRINGS_PATH}" "{ CFBundleDisplayName = \"${PACKAGE_NAME}\"; CFBundleName = \"${PACKAGE_NAME}\"; }" ) set(EMPTY_LPROJ_FILE "${CMAKE_CURRENT_BINARY_DIR}/empty.lproj") file(TOUCH "${EMPTY_LPROJ_FILE}") target_sources(bitcoin-qt PRIVATE "${BITCOINQT_BUNDLE_ICON}" "${INFO_PLIST_STRINGS_PATH}" "${EMPTY_LPROJ_FILE}" ) string(JOIN ";" BITCOINQT_BUNDLE_RESOURCES "${BITCOINQT_BUNDLE_ICON}" "${EMPTY_LPROJ_FILE}" ) set(BITCOIN_QT_OSX_BUNDLE_NAME "BitcoinABC-Qt") set_target_properties(bitcoin-qt PROPERTIES MACOSX_BUNDLE ON OUTPUT_NAME "${BITCOIN_QT_OSX_BUNDLE_NAME}" MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/share/qt/Info.plist.cmake.in" MACOSX_BUNDLE_BUNDLE_NAME "${BITCOIN_QT_OSX_BUNDLE_NAME}" MACOSX_BUNDLE_BUNDLE_VERSION "${bitcoin-abc_VERSION}" MACOSX_BUNDLE_GUI_IDENTIFIER "org.bitcoinabc.${BITCOIN_QT_OSX_BUNDLE_NAME}" MACOSX_BUNDLE_ICON_FILE "${BITCOINQT_BUNDLE_ICON_NAME}" MACOSX_BUNDLE_INFO_STRING "${bitcoin-abc_VERSION}, Copyright © 2009-${COPYRIGHT_YEAR} ${COPYRIGHT_HOLDERS_FINAL}" MACOSX_BUNDLE_LONG_VERSION_STRING "${bitcoin-abc_VERSION}" MACOSX_BUNDLE_SHORT_VERSION_STRING "${bitcoin-abc_VERSION}" RESOURCE "${BITCOINQT_BUNDLE_RESOURCES}" ) # The InfoPlist.strings files should be located in a resource subdirectory. # This is not supported by the RESOURCE property and require the use of the # MACOSX_PACKAGE_LOCATION property instead. The RESOURCE documentation has # an example demonstrating this behavior (see the appres.txt file): # https://cmake.org/cmake/help/latest/prop_tgt/RESOURCE.html set_source_files_properties( "${INFO_PLIST_STRINGS_PATH}" PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/${INFO_PLIST_STRINGS_FILE}" ) # Create a stripped version of the application bundle to be used in the DMG. # Since the LOCATION property and the BundleUtilities package are deprecated # by cmake, only generator expressions can be used to determine the path to # the bundle and its executable. However the generator expressions are # solved at build time, making them unusable to do path computation at # configuration time. # The paths here are then hard-coded, which is safe since the structure of # an application bundle is well-known and specified by Apple. Note that this # will only work for building MacOS application bundle as the IOS structure # is slightly different. set(STRIPPED_BUNDLE "${CMAKE_CURRENT_BINARY_DIR}/stripped/${BITCOIN_QT_OSX_BUNDLE_NAME}.app") add_custom_command( OUTPUT "${STRIPPED_BUNDLE}" COMMAND ${CMAKE_COMMAND} -E copy_directory "$" "${STRIPPED_BUNDLE}" COMMAND ${CMAKE_STRIP} -u -r "${STRIPPED_BUNDLE}/Contents/MacOS/${BITCOIN_QT_OSX_BUNDLE_NAME}" DEPENDS bitcoin-qt ) include(DoOrFail) find_program_or_fail(CMAKE_INSTALL_NAME_TOOL "install_name_tool") find_program_or_fail(CMAKE_OTOOL "otool") set(QT_INSTALLER_SUPPORTED_LANGUAGES "da" "de" "es" "hu" "ru" "uk" "zh_CN" "zh_TW" ) string(JOIN "," QT_LOCALES ${QT_INSTALLER_SUPPORTED_LANGUAGES}) get_target_property(QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION) execute_process( COMMAND "${QMAKE_EXECUTABLE}" -query QT_INSTALL_TRANSLATIONS OUTPUT_VARIABLE QT_TRANSLATION_DIR OUTPUT_STRIP_TRAILING_WHITESPACE ) function(get_qt_translation_dir QT_TRANSLATION_DIR) foreach(_locale ${ARGN}) find_path(_qt_translation_dir "qt_${_locale}.qm" HINTS "${QT_TRANSLATION_DIR}" PATH_SUFFIXES "translations" ) # Ensure that all the translation files are found, and are located # in the same directory. if(NOT _qt_translation_dir OR (_qt_translation_dir_previous AND (NOT _qt_translation_dir_previous STREQUAL _qt_translation_dir))) return() endif() set(_qt_translation_dir_previous _qt_translation_dir) endforeach() set(QT_TRANSLATION_DIR ${_qt_translation_dir} PARENT_SCOPE) endfunction() get_qt_translation_dir(QT_TRANSLATION_DIR ${QT_INSTALLER_SUPPORTED_LANGUAGES}) if(NOT QT_TRANSLATION_DIR) message(FATAL_ERROR "Qt translation files are not found") endif() set(MACDEPLOY_DIR "${CMAKE_SOURCE_DIR}/contrib/macdeploy") set(MACDEPLOYQTPLUS "${MACDEPLOY_DIR}/macdeployqtplus") set(DMG_DIST "${CMAKE_BINARY_DIR}/dist") add_custom_command( OUTPUT "${DMG_DIST}" COMMAND "INSTALLNAMETOOL=${CMAKE_INSTALL_NAME_TOOL}" "OTOOL=${CMAKE_OTOOL}" "STRIP=${CMAKE_STRIP}" "${Python_EXECUTABLE}" "${MACDEPLOYQTPLUS}" "${STRIPPED_BUNDLE}" -translations-dir "${QT_TRANSLATION_DIR}" -add-qt-tr "${QT_LOCALES}" WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" DEPENDS "${STRIPPED_BUNDLE}" ) # Building the DMG background image requires several steps: # 1/ The SVG file must be edited to display the package name # 2/ The SVG file should be transformed into a couple PNG files, on for # low resolution screens and one for high resolution screens. # 3/ The PNG files must be transformed into a multi-resolution TIFF file. # The names are not set arbitrarily, they follow Apple's guidelines for # resolution independent bitmap images (see `man tiffutil`). set(BACKGROUND_SVG "background.svg") configure_file( "${CMAKE_SOURCE_DIR}/contrib/macdeploy/background.svg.cmake.in" "${BACKGROUND_SVG}" ) include(ImageHelper) set(BACKGROUND_PNG_LOWRES "${CMAKE_CURRENT_BINARY_DIR}/background_temp.png") set(BACKGROUND_PNG_HIRES "${CMAKE_CURRENT_BINARY_DIR}/background_temp@2x.png") set(BACKGROUND_TIFF_LOWRES "${CMAKE_CURRENT_BINARY_DIR}/background_temp.tiff") set(BACKGROUND_TIFF_HIRES "${CMAKE_CURRENT_BINARY_DIR}/background_temp@2x.tiff") set(BACKGROUND_TIFF_NAME "background.tiff") set(BACKGROUND_TIFF_MULTIRES "${CMAKE_BINARY_DIR}/${BACKGROUND_TIFF_NAME}") convert_svg_to_png("${BACKGROUND_SVG}" "${BACKGROUND_PNG_LOWRES}" 36) convert_svg_to_png("${BACKGROUND_SVG}" "${BACKGROUND_PNG_HIRES}" 72) convert_png_to_tiff("${BACKGROUND_PNG_LOWRES}" "${BACKGROUND_TIFF_LOWRES}") convert_png_to_tiff("${BACKGROUND_PNG_HIRES}" "${BACKGROUND_TIFF_HIRES}") cat_multi_resolution_tiff("${BACKGROUND_TIFF_MULTIRES}" "${BACKGROUND_TIFF_LOWRES}" "${BACKGROUND_TIFF_HIRES}") set(BACKGROUND_DIST_DIR "${DMG_DIST}/.background") set(BACKGROUND_DIST_TIFF "${BACKGROUND_DIST_DIR}/${BACKGROUND_TIFF_NAME}") add_custom_command( OUTPUT "${BACKGROUND_DIST_TIFF}" COMMAND ${CMAKE_COMMAND} -E make_directory "${BACKGROUND_DIST_DIR}" COMMAND ${CMAKE_COMMAND} -E copy "${BACKGROUND_TIFF_MULTIRES}" "${BACKGROUND_DIST_TIFF}" DEPENDS "${BACKGROUND_TIFF_MULTIRES}" "${DMG_DIST}" ) string(REPLACE " " "-" OSX_VOLNAME "${PACKAGE_NAME}") file(WRITE "${CMAKE_BINARY_DIR}/osx_volname" "${OSX_VOLNAME}") set(DMG_DSSTORE "${DMG_DIST}/.DS_Store") set(GEN_DSSTORE "${MACDEPLOY_DIR}/custom_dsstore.py") add_custom_command( OUTPUT "${DMG_DSSTORE}" COMMAND "${Python_EXECUTABLE}" "${GEN_DSSTORE}" "${DMG_DSSTORE}" "${OSX_VOLNAME}" DEPENDS "${GEN_DSSTORE}" "${DMG_DIST}" ) set(OSX_APPLICATION_DIR "Applications") set(OSX_APPLICATION_SYMLINK "${DMG_DIST}/${OSX_APPLICATION_DIR}") add_custom_command( OUTPUT "${OSX_APPLICATION_SYMLINK}" COMMAND ${CMAKE_COMMAND} -E create_symlink "/${OSX_APPLICATION_DIR}" "${OSX_APPLICATION_SYMLINK}" DEPENDS "${DMG_DIST}" ) add_custom_target(osx-deploydir DEPENDS "${OSX_APPLICATION_SYMLINK}" "${DMG_DSSTORE}" "${BACKGROUND_DIST_TIFF}" ) if(CMAKE_CROSSCOMPILING) find_program_or_fail(GENISOIMAGE_EXECUTABLE genisoimage) add_custom_target(osx-dmg COMMAND "${GENISOIMAGE_EXECUTABLE}" -no-cache-inodes -D -l -probe -V "${OSX_VOLNAME}" -no-pad -r -dir-mode 0755 -apple -o "${OSX_VOLNAME}.dmg" "${DMG_DIST}" WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" ) add_dependencies(osx-dmg osx-deploydir) else() add_custom_target(osx-dmg COMMAND "${Python_EXECUTABLE}" "${MACDEPLOYQTPLUS}" "${STRIPPED_BUNDLE}" -translations-dir "${QT_TRANSLATION_DIR}" -add-qt-tr "${QT_LOCALES}" -dmg -fancy "${MACDEPLOY_DIR}/fancy.plist" -volname "${OSX_VOLNAME}" WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" DEPENDS "${STRIPPED_BUNDLE}" "${BACKGROUND_TIFF_MULTIRES}" ) endif() endif() configure_file( "${CMAKE_SOURCE_DIR}/cmake/utils/translate.sh.in" "${CMAKE_CURRENT_BINARY_DIR}/translate.sh" @ONLY ) add_custom_target(translate COMMENT "Updating the translations..." COMMAND "${CMAKE_CURRENT_BINARY_DIR}/translate.sh" DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/translate.sh" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/.." ) # Test tests add_subdirectory(test)