diff --git a/.gitignore b/.gitignore index b92988f6a3..25978bdf5e 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ target/ /guix-build-* /ci/scratch/ +Xcode-*.tar diff --git a/cmake/module/GenerateSetupNsi.cmake b/cmake/module/GenerateSetupNsi.cmake index c8d5bd67c5..9a2b3d88d5 100644 --- a/cmake/module/GenerateSetupNsi.cmake +++ b/cmake/module/GenerateSetupNsi.cmake @@ -6,14 +6,14 @@ function(generate_setup_nsi) set(abs_top_srcdir ${PROJECT_SOURCE_DIR}) set(abs_top_builddir ${PROJECT_BINARY_DIR}) set(CLIENT_URL ${PROJECT_HOMEPAGE_URL}) - set(CLIENT_TARNAME "bitcoin") + set(CLIENT_TARNAME "namecoin") set(BITCOIN_WRAPPER_NAME "bitcoin") - set(BITCOIN_GUI_NAME "bitcoin-qt") - set(BITCOIN_DAEMON_NAME "bitcoind") - set(BITCOIN_CLI_NAME "bitcoin-cli") - set(BITCOIN_TX_NAME "bitcoin-tx") - set(BITCOIN_WALLET_TOOL_NAME "bitcoin-wallet") - set(BITCOIN_TEST_NAME "test_bitcoin") + set(BITCOIN_GUI_NAME "namecoin-qt") + set(BITCOIN_DAEMON_NAME "namecoind") + set(BITCOIN_CLI_NAME "namecoin-cli") + set(BITCOIN_TX_NAME "namecoin-tx") + set(BITCOIN_WALLET_TOOL_NAME "namecoin-wallet") + set(BITCOIN_TEST_NAME "test_namecoin") set(EXEEXT ${CMAKE_EXECUTABLE_SUFFIX}) configure_file(${PROJECT_SOURCE_DIR}/share/setup.nsi.in ${PROJECT_BINARY_DIR}/bitcoin-win64-setup.nsi USE_SOURCE_PERMISSIONS @ONLY) endfunction() diff --git a/cmake/module/Maintenance.cmake b/cmake/module/Maintenance.cmake index 15fbf2bea8..7f7528ef27 100644 --- a/cmake/module/Maintenance.cmake +++ b/cmake/module/Maintenance.cmake @@ -18,8 +18,32 @@ function(setup_split_debug_script) endif() endfunction() +function(add_maintenance_targets) + if(NOT TARGET Python3::Interpreter) + return() + endif() + + foreach(target IN ITEMS bitcoin namecoind namecoin-node namecoin-qt namecoin-gui namecoin-cli namecoin-tx namecoin-util namecoin-wallet test_namecoin bench_namecoin) + if(TARGET ${target}) + list(APPEND executables $) + endif() + endforeach() + + add_custom_target(check-symbols + COMMAND ${CMAKE_COMMAND} -E echo "Running symbol and dynamic library checks..." + COMMAND Python3::Interpreter ${PROJECT_SOURCE_DIR}/contrib/guix/symbol-check.py ${executables} + VERBATIM + ) + + add_custom_target(check-security + COMMAND ${CMAKE_COMMAND} -E echo "Checking binary security..." + COMMAND Python3::Interpreter ${PROJECT_SOURCE_DIR}/contrib/guix/security-check.py ${executables} + VERBATIM + ) +endfunction() + function(add_windows_deploy_target) - if(MINGW AND TARGET bitcoin AND TARGET bitcoin-qt AND TARGET bitcoind AND TARGET bitcoin-cli AND TARGET bitcoin-tx AND TARGET bitcoin-wallet AND TARGET bitcoin-util AND TARGET test_bitcoin) + if(MINGW AND TARGET bitcoin AND TARGET namecoin-qt AND TARGET namecoind AND TARGET namecoin-cli AND TARGET namecoin-tx AND TARGET namecoin-wallet AND TARGET namecoin-util AND TARGET test_namecoin) find_program(MAKENSIS_EXECUTABLE makensis) if(NOT MAKENSIS_EXECUTABLE) add_custom_target(deploy @@ -36,13 +60,13 @@ function(add_windows_deploy_target) OUTPUT ${PROJECT_BINARY_DIR}/bitcoin-win64-setup.exe COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/release COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ - COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ - COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ - COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ - COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ - COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ - COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ - COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ + COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ + COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ + COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ + COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ + COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ + COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ + COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ COMMAND ${MAKENSIS_EXECUTABLE} -V2 ${PROJECT_BINARY_DIR}/bitcoin-win64-setup.nsi VERBATIM ) @@ -51,50 +75,50 @@ function(add_windows_deploy_target) endfunction() function(add_macos_deploy_target) - if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND TARGET bitcoin-qt) - set(macos_app "Bitcoin-Qt.app") + if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND TARGET namecoin-qt) + set(macos_app "Namecoin-Qt.app") # Populate Contents subdirectory. configure_file(${PROJECT_SOURCE_DIR}/share/qt/Info.plist.in ${macos_app}/Contents/Info.plist NO_SOURCE_PERMISSIONS) file(CONFIGURE OUTPUT ${macos_app}/Contents/PkgInfo CONTENT "APPL????") # Populate Contents/Resources subdirectory. file(CONFIGURE OUTPUT ${macos_app}/Contents/Resources/empty.lproj CONTENT "") - configure_file(${PROJECT_SOURCE_DIR}/src/qt/res/icons/bitcoin.icns ${macos_app}/Contents/Resources/bitcoin.icns NO_SOURCE_PERMISSIONS COPYONLY) + configure_file(${PROJECT_SOURCE_DIR}/src/qt/res/icons/namecoin.icns ${macos_app}/Contents/Resources/namecoin.icns NO_SOURCE_PERMISSIONS COPYONLY) file(CONFIGURE OUTPUT ${macos_app}/Contents/Resources/Base.lproj/InfoPlist.strings CONTENT "{ CFBundleDisplayName = \"@CLIENT_NAME@\"; CFBundleName = \"@CLIENT_NAME@\"; }" ) add_custom_command( - OUTPUT ${PROJECT_BINARY_DIR}/${macos_app}/Contents/MacOS/Bitcoin-Qt - COMMAND ${CMAKE_COMMAND} --install ${PROJECT_BINARY_DIR} --config $ --component bitcoin-qt --prefix ${macos_app}/Contents/MacOS --strip - COMMAND ${CMAKE_COMMAND} -E rename ${macos_app}/Contents/MacOS/bin/$ ${macos_app}/Contents/MacOS/Bitcoin-Qt + OUTPUT ${PROJECT_BINARY_DIR}/${macos_app}/Contents/MacOS/Namecoin-Qt + COMMAND ${CMAKE_COMMAND} --install ${PROJECT_BINARY_DIR} --config $ --component namecoin-qt --prefix ${macos_app}/Contents/MacOS --strip + COMMAND ${CMAKE_COMMAND} -E rename ${macos_app}/Contents/MacOS/bin/$ ${macos_app}/Contents/MacOS/Namecoin-Qt COMMAND ${CMAKE_COMMAND} -E rm -rf ${macos_app}/Contents/MacOS/bin COMMAND ${CMAKE_COMMAND} -E rm -rf ${macos_app}/Contents/MacOS/share VERBATIM ) - set(macos_zip "bitcoin-macos-app") + string(REPLACE " " "-" osx_volname ${CLIENT_NAME}) if(CMAKE_HOST_APPLE) add_custom_command( - OUTPUT ${PROJECT_BINARY_DIR}/${macos_zip}.zip - COMMAND Python3::Interpreter ${PROJECT_SOURCE_DIR}/contrib/macdeploy/macdeployqtplus ${macos_app} -translations-dir=${QT_TRANSLATIONS_DIR} -zip=${macos_zip} - DEPENDS ${PROJECT_BINARY_DIR}/${macos_app}/Contents/MacOS/Bitcoin-Qt + OUTPUT ${PROJECT_BINARY_DIR}/${osx_volname}.zip + COMMAND Python3::Interpreter ${PROJECT_SOURCE_DIR}/contrib/macdeploy/macdeployqtplus ${macos_app} ${osx_volname} -translations-dir=${QT_TRANSLATIONS_DIR} -zip + DEPENDS ${PROJECT_BINARY_DIR}/${macos_app}/Contents/MacOS/Namecoin-Qt VERBATIM ) add_custom_target(deploydir - DEPENDS ${PROJECT_BINARY_DIR}/${macos_zip}.zip + DEPENDS ${PROJECT_BINARY_DIR}/${osx_volname}.zip ) add_custom_target(deploy - DEPENDS ${PROJECT_BINARY_DIR}/${macos_zip}.zip + DEPENDS ${PROJECT_BINARY_DIR}/${osx_volname}.zip ) else() add_custom_command( - OUTPUT ${PROJECT_BINARY_DIR}/dist/${macos_app}/Contents/MacOS/Bitcoin-Qt - COMMAND ${CMAKE_COMMAND} -E env OBJDUMP=${CMAKE_OBJDUMP} $ ${PROJECT_SOURCE_DIR}/contrib/macdeploy/macdeployqtplus ${macos_app} -translations-dir=${QT_TRANSLATIONS_DIR} - DEPENDS ${PROJECT_BINARY_DIR}/${macos_app}/Contents/MacOS/Bitcoin-Qt + OUTPUT ${PROJECT_BINARY_DIR}/dist/${macos_app}/Contents/MacOS/Namecoin-Qt + COMMAND ${CMAKE_COMMAND} -E env OBJDUMP=${CMAKE_OBJDUMP} $ ${PROJECT_SOURCE_DIR}/contrib/macdeploy/macdeployqtplus ${macos_app} ${osx_volname} -translations-dir=${QT_TRANSLATIONS_DIR} + DEPENDS ${PROJECT_BINARY_DIR}/${macos_app}/Contents/MacOS/Namecoin-Qt VERBATIM ) add_custom_target(deploydir - DEPENDS ${PROJECT_BINARY_DIR}/dist/${macos_app}/Contents/MacOS/Bitcoin-Qt + DEPENDS ${PROJECT_BINARY_DIR}/dist/${macos_app}/Contents/MacOS/Namecoin-Qt ) find_program(ZIP_EXECUTABLE zip) @@ -104,17 +128,17 @@ function(add_macos_deploy_target) ) else() add_custom_command( - OUTPUT ${PROJECT_BINARY_DIR}/dist/${macos_zip}.zip + OUTPUT ${PROJECT_BINARY_DIR}/dist/${osx_volname}.zip WORKING_DIRECTORY dist - COMMAND ${PROJECT_SOURCE_DIR}/cmake/script/macos_zip.sh ${ZIP_EXECUTABLE} ${macos_zip}.zip + COMMAND ${PROJECT_SOURCE_DIR}/cmake/script/macos_zip.sh ${ZIP_EXECUTABLE} ${osx_volname}.zip VERBATIM ) add_custom_target(deploy - DEPENDS ${PROJECT_BINARY_DIR}/dist/${macos_zip}.zip + DEPENDS ${PROJECT_BINARY_DIR}/dist/${osx_volname}.zip ) endif() endif() - add_dependencies(deploydir bitcoin-qt) + add_dependencies(deploydir namecoin-qt) add_dependencies(deploy deploydir) endif() endfunction() diff --git a/contrib/guix/libexec/build.sh b/contrib/guix/libexec/build.sh old mode 100755 new mode 100644 index b63a10c753..bd646a3aba --- a/contrib/guix/libexec/build.sh +++ b/contrib/guix/libexec/build.sh @@ -377,7 +377,7 @@ mkdir -p "$DISTSRC" ;; *darwin*) cmake --build build --target deploy ${V:+--verbose} - mv build/dist/bitcoin-macos-app.zip "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.zip" + mv build/dist/Namecoin-Core.zip "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.zip" mkdir -p "unsigned-app-${HOST}" cp --target-directory="unsigned-app-${HOST}" \ contrib/macdeploy/detached-sig-create.sh diff --git a/depends/Makefile b/depends/Makefile index fde108d2c2..f7a7cf869d 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -217,6 +217,7 @@ $(host_prefix)/toolchain.cmake : toolchain.cmake.in $(host_prefix)/.stamp_$(fina -e 's|@STRIP@|$(host_STRIP)|' \ -e 's|@OBJCOPY@|$(host_OBJCOPY)|' \ -e 's|@OBJDUMP@|$(host_OBJDUMP)|' \ + -e 's|@INSTALL_NAME_TOOL@|$(host_INSTALL_NAME_TOOL)|' \ -e 's|@CFLAGS@|$(strip $(host_CFLAGS))|' \ -e 's|@CFLAGS_RELEASE@|$(strip $(host_release_CFLAGS))|' \ -e 's|@CFLAGS_DEBUG@|$(strip $(host_debug_CFLAGS))|' \ diff --git a/depends/funcs.mk b/depends/funcs.mk index 60e7889a4e..4952af7182 100644 --- a/depends/funcs.mk +++ b/depends/funcs.mk @@ -234,6 +234,9 @@ ifneq ($(host),$(build)) $(1)_cmake += -DCMAKE_SYSTEM_NAME=$($(host_os)_cmake_system_name) $(1)_cmake += -DCMAKE_C_COMPILER_TARGET=$(host) $(1)_cmake += -DCMAKE_CXX_COMPILER_TARGET=$(host) +ifneq ($(findstring darwin,$(host)),) +$(1)_cmake += -DCMAKE_INSTALL_NAME_TOOL=`which llvm-install-name-tool` +endif endif endif endef diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index 71fac7cc89..c83f342bd3 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -86,3 +86,5 @@ darwin_cmake_system_name=Darwin # Darwin version, which corresponds to OSX_MIN_VERSION. # See https://en.wikipedia.org/wiki/Darwin_(operating_system) darwin_cmake_system_version=20.1 + +darwin_INSTALL_NAME_TOOL=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-install-name-tool") diff --git a/depends/hosts/default.mk b/depends/hosts/default.mk index 22409c4004..fa197e6492 100644 --- a/depends/hosts/default.mk +++ b/depends/hosts/default.mk @@ -10,6 +10,7 @@ default_host_STRIP = $(host_toolchain)strip default_host_NM = $(host_toolchain)nm default_host_OBJCOPY = $(host_toolchain)objcopy default_host_OBJDUMP = $(host_toolchain)objdump +default_host_INSTALL_NAME_TOOL = $(host_toolchain)install_name_tool define add_host_tool_func ifneq ($(filter $(origin $1),undefined default),) @@ -39,5 +40,5 @@ host_$1 = $$($(host_arch)_$(host_os)_$1) host_$(release_type)_$1 = $$($(host_arch)_$(host_os)_$(release_type)_$1) endef -$(foreach tool,CC CXX AR RANLIB STRIP NM OBJCOPY OBJDUMP DSYMUTIL,$(eval $(call add_host_tool_func,$(tool)))) +$(foreach tool,CC CXX AR RANLIB STRIP NM OBJCOPY OBJDUMP DSYMUTIL INSTALL_NAME_TOOL,$(eval $(call add_host_tool_func,$(tool)))) $(foreach flags,CFLAGS CXXFLAGS CPPFLAGS LDFLAGS, $(eval $(call add_host_flags_func,$(flags)))) diff --git a/depends/toolchain.cmake.in b/depends/toolchain.cmake.in index 87189efa1c..11ae8a701b 100644 --- a/depends/toolchain.cmake.in +++ b/depends/toolchain.cmake.in @@ -81,6 +81,10 @@ set(CMAKE_STRIP "@STRIP@") set(CMAKE_OBJCOPY "@OBJCOPY@") set(CMAKE_OBJDUMP "@OBJDUMP@") +if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + set(CMAKE_INSTALL_NAME_TOOL "@INSTALL_NAME_TOOL@") +endif() + # Using our own built dependencies should not be # affected by a potentially random environment. set(CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH OFF) diff --git a/share/qt/Info.plist.in b/share/qt/Info.plist.in index 0aa1c2c706..bd37566af7 100644 --- a/share/qt/Info.plist.in +++ b/share/qt/Info.plist.in @@ -11,7 +11,7 @@ CFBundleIconFile - bitcoin.icns + namecoin.icns CFBundlePackageType APPL diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3e50ae0af2..76c7766a96 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -312,7 +312,7 @@ if(BUILD_BITCOIN_BIN) add_windows_resources(namecoin bitcoin-res.rc) add_windows_application_manifest(namecoin) target_link_libraries(namecoin core_interface bitcoin_common bitcoin_util) - install_binary_component(namecoin HAS_MANPAGE) + install_binary_component(namecoin) endif() # Bitcoin Core bitcoind. diff --git a/src/qt/CMakeLists.txt b/src/qt/CMakeLists.txt index 12ba688a7a..f88eede5a2 100644 --- a/src/qt/CMakeLists.txt +++ b/src/qt/CMakeLists.txt @@ -294,7 +294,7 @@ if(ENABLE_IPC) bitcoin_node bitcoin_ipc ) - import_plugins(bitcoin-gui) + import_plugins(namecoin-gui) install_binary_component(namecoin-gui INTERNAL) if(WIN32) set_target_properties(namecoin-gui PROPERTIES WIN32_EXECUTABLE TRUE) diff --git a/src/qt/forms/debugwindow.ui b/src/qt/forms/debugwindow.ui index 884e7f0273..dfaa1bad74 100644 --- a/src/qt/forms/debugwindow.ui +++ b/src/qt/forms/debugwindow.ui @@ -279,7 +279,7 @@ Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - Network addresses that your Bitcoin node is currently using to communicate with other nodes. + Network addresses that your Namecoin node is currently using to communicate with other nodes. diff --git a/src/qt/forms/optionsdialog.ui b/src/qt/forms/optionsdialog.ui index 0ce08efc6e..f1fc422c94 100644 --- a/src/qt/forms/optionsdialog.ui +++ b/src/qt/forms/optionsdialog.ui @@ -318,7 +318,7 @@ - Automatically open the Bitcoin client port on the router. This only works when your router supports PCP or NAT-PMP and it is enabled. The external port could be random. + Automatically open the Namecoin client port on the router. This only works when your router supports PCP or NAT-PMP and it is enabled. The external port could be random. Map port using PCP or NA&T-PMP @@ -525,7 +525,7 @@ - Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor onion services. + Connect to the Namecoin network through a separate SOCKS5 proxy for Tor onion services. Use separate SOCKS&5 proxy to reach peers via Tor onion services: diff --git a/src/qt/forms/receivecoinsdialog.ui b/src/qt/forms/receivecoinsdialog.ui index 7590dd524d..5a690cf4b8 100644 --- a/src/qt/forms/receivecoinsdialog.ui +++ b/src/qt/forms/receivecoinsdialog.ui @@ -47,7 +47,7 @@ - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. + An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Namecoin network. &Message: diff --git a/src/qt/macnotificationhandler.mm b/src/qt/macnotificationhandler.mm index 0a066c9fb8..567af1499b 100644 --- a/src/qt/macnotificationhandler.mm +++ b/src/qt/macnotificationhandler.mm @@ -13,7 +13,7 @@ @implementation NSBundle(returnCorrectIdentifier) - (NSString *)__bundleIdentifier { if (self == [NSBundle mainBundle]) { - return @"org.bitcoinfoundation.Bitcoin-Qt"; + return @"org.namecoin.Namecoin-Qt"; } else { return [self __bundleIdentifier]; } diff --git a/src/qt/res/icons/namecoin.icns b/src/qt/res/icons/namecoin.icns new file mode 100644 index 0000000000..a7bdf4136d Binary files /dev/null and b/src/qt/res/icons/namecoin.icns differ