Skip to content

Commit 54c4b09

Browse files
committed
Merge bitcoin/bitcoin#31042: build: Rename PACKAGE_* variables to CLIENT_*
7071330 scripted-diff: Rename `PACKAGE_*` variables to `CLIENT_*` (Hennadii Stepanov) 332655c build: Rename `PACKAGE_*` variables to `CLIENT_*` (Hennadii Stepanov) e6e29e3 scripted-diff: Clarify "user agent" variable name (Hennadii Stepanov) Pull request description: The use of `PACKAGE_NAME` for the project's variable name is problematic, as this name is commonly used in CMake's [interface variables](https://cmake.org/cmake/help/latest/command/find_package.html#config-mode-version-selection). If third-party CMake code handles with scopes improperly, our `PACKAGE_NAME` variable could end up with an unexpected value. This PR avoids such conflicts by renaming all `PACKAGE_*` variables to `CLIENT_*`. The code in the master branch works correctly only incidentally. It is definitely broken in bitcoin/bitcoin#30997. ACKs for top commit: TheCharlatan: Re-ACK 7071330 Tree-SHA512: f0992fb9a1ac4a41125b223f97bcaae50f521c813f334e606693dd0113a4732f12451bbcfb158df8bed44f34b37dadac478b2f5661e8b2588b401f43ae4bc1a4
2 parents 1c7ca6e + 7071330 commit 54c4b09

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+151
-151
lines changed

CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ endif()
1616
#=============================
1717
# Project / Package metadata
1818
#=============================
19-
set(PACKAGE_NAME "Bitcoin Core")
19+
set(CLIENT_NAME "Bitcoin Core")
2020
set(CLIENT_VERSION_MAJOR 28)
2121
set(CLIENT_VERSION_MINOR 99)
2222
set(CLIENT_VERSION_BUILD 0)
@@ -47,14 +47,14 @@ project(BitcoinCore
4747
LANGUAGES NONE
4848
)
4949

50-
set(PACKAGE_VERSION ${PROJECT_VERSION})
50+
set(CLIENT_VERSION_STRING ${PROJECT_VERSION})
5151
if(CLIENT_VERSION_RC GREATER 0)
52-
string(APPEND PACKAGE_VERSION "rc${CLIENT_VERSION_RC}")
52+
string(APPEND CLIENT_VERSION_STRING "rc${CLIENT_VERSION_RC}")
5353
endif()
5454

5555
set(COPYRIGHT_HOLDERS "The %s developers")
56-
set(COPYRIGHT_HOLDERS_FINAL "The ${PACKAGE_NAME} developers")
57-
set(PACKAGE_BUGREPORT "https://github.com/bitcoin/bitcoin/issues")
56+
set(COPYRIGHT_HOLDERS_FINAL "The ${CLIENT_NAME} developers")
57+
set(CLIENT_BUGREPORT "https://github.com/bitcoin/bitcoin/issues")
5858

5959
#=============================
6060
# Language setup

cmake/bitcoin-build-config.h.in

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#define COPYRIGHT_HOLDERS_FINAL "@COPYRIGHT_HOLDERS_FINAL@"
2525

2626
/* Replacement for %s in copyright holders string */
27-
#define COPYRIGHT_HOLDERS_SUBSTITUTION "@PACKAGE_NAME@"
27+
#define COPYRIGHT_HOLDERS_SUBSTITUTION "@CLIENT_NAME@"
2828

2929
/* Copyright year */
3030
#define COPYRIGHT_YEAR @COPYRIGHT_YEAR@
@@ -124,16 +124,16 @@
124124
#cmakedefine HAVE_VM_VM_PARAM_H 1
125125

126126
/* Define to the address where bug reports for this package should be sent. */
127-
#define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@"
127+
#define CLIENT_BUGREPORT "@CLIENT_BUGREPORT@"
128128

129129
/* Define to the full name of this package. */
130-
#define PACKAGE_NAME "@PACKAGE_NAME@"
130+
#define CLIENT_NAME "@CLIENT_NAME@"
131131

132132
/* Define to the home page for this package. */
133-
#define PACKAGE_URL "@PROJECT_HOMEPAGE_URL@"
133+
#define CLIENT_URL "@PROJECT_HOMEPAGE_URL@"
134134

135135
/* Define to the version of this package. */
136-
#define PACKAGE_VERSION "@PACKAGE_VERSION@"
136+
#define CLIENT_VERSION_STRING "@CLIENT_VERSION_STRING@"
137137

138138
/* Define to 1 if strerror_r returns char *. */
139139
#cmakedefine STRERROR_R_CHAR_P 1

cmake/module/GenerateSetupNsi.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
function(generate_setup_nsi)
66
set(abs_top_srcdir ${PROJECT_SOURCE_DIR})
77
set(abs_top_builddir ${PROJECT_BINARY_DIR})
8-
set(PACKAGE_URL ${PROJECT_HOMEPAGE_URL})
9-
set(PACKAGE_TARNAME "bitcoin")
8+
set(CLIENT_URL ${PROJECT_HOMEPAGE_URL})
9+
set(CLIENT_TARNAME "bitcoin")
1010
set(BITCOIN_GUI_NAME "bitcoin-qt")
1111
set(BITCOIN_DAEMON_NAME "bitcoind")
1212
set(BITCOIN_CLI_NAME "bitcoin-cli")

cmake/module/Maintenance.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function(add_macos_deploy_target)
9898
file(CONFIGURE OUTPUT ${macos_app}/Contents/Resources/empty.lproj CONTENT "")
9999
configure_file(${PROJECT_SOURCE_DIR}/src/qt/res/icons/bitcoin.icns ${macos_app}/Contents/Resources/bitcoin.icns NO_SOURCE_PERMISSIONS COPYONLY)
100100
file(CONFIGURE OUTPUT ${macos_app}/Contents/Resources/Base.lproj/InfoPlist.strings
101-
CONTENT "{ CFBundleDisplayName = \"@PACKAGE_NAME@\"; CFBundleName = \"@PACKAGE_NAME@\"; }"
101+
CONTENT "{ CFBundleDisplayName = \"@CLIENT_NAME@\"; CFBundleName = \"@CLIENT_NAME@\"; }"
102102
)
103103

104104
add_custom_command(
@@ -109,7 +109,7 @@ function(add_macos_deploy_target)
109109
VERBATIM
110110
)
111111

112-
string(REPLACE " " "-" osx_volname ${PACKAGE_NAME})
112+
string(REPLACE " " "-" osx_volname ${CLIENT_NAME})
113113
if(CMAKE_HOST_APPLE)
114114
add_custom_command(
115115
OUTPUT ${PROJECT_BINARY_DIR}/${osx_volname}.zip

doc/Doxyfile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = "Bitcoin Core"
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = @PACKAGE_VERSION@
41+
PROJECT_NUMBER = @CLIENT_VERSION_STRING@
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

libbitcoinkernel.pc.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ exec_prefix=${prefix}
33
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
44
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
55

6-
Name: @PACKAGE_NAME@ kernel library
6+
Name: @CLIENT_NAME@ kernel library
77
Description: Experimental library for the Bitcoin Core validation engine.
8-
Version: @PACKAGE_VERSION@
8+
Version: @CLIENT_VERSION_STRING@
99
Libs: -L${libdir} -lbitcoinkernel
1010
Libs.private: -L${libdir} @LIBS_PRIVATE@
1111
Cflags: -I${includedir}

share/setup.nsi.in

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Name "@PACKAGE_NAME@ (64-bit)"
1+
Name "@CLIENT_NAME@ (64-bit)"
22

33
RequestExecutionLevel highest
44
SetCompressor /SOLID lzma
@@ -11,8 +11,8 @@ Unicode true
1111

1212
# General Symbol Definitions
1313
!define REGKEY "SOFTWARE\$(^Name)"
14-
!define COMPANY "@PACKAGE_NAME@ project"
15-
!define URL @PACKAGE_URL@
14+
!define COMPANY "@CLIENT_NAME@ project"
15+
!define URL @CLIENT_URL@
1616

1717
# MUI Symbol Definitions
1818
!define MUI_ICON "@abs_top_srcdir@/share/pixmaps/bitcoin.ico"
@@ -24,7 +24,7 @@ Unicode true
2424
!define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM
2525
!define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY}
2626
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup
27-
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "@PACKAGE_NAME@"
27+
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "@CLIENT_NAME@"
2828
!define MUI_FINISHPAGE_RUN "$WINDIR\explorer.exe"
2929
!define MUI_FINISHPAGE_RUN_PARAMETERS $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@
3030
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
@@ -58,12 +58,12 @@ XPStyle on
5858
BrandingText " "
5959
ShowInstDetails show
6060
VIProductVersion @CLIENT_VERSION_MAJOR@.@CLIENT_VERSION_MINOR@.@[email protected]
61-
VIAddVersionKey ProductName "@PACKAGE_NAME@"
62-
VIAddVersionKey ProductVersion "@PACKAGE_VERSION@"
61+
VIAddVersionKey ProductName "@CLIENT_NAME@"
62+
VIAddVersionKey ProductVersion "@CLIENT_VERSION_STRING@"
6363
VIAddVersionKey CompanyName "${COMPANY}"
6464
VIAddVersionKey CompanyWebsite "${URL}"
65-
VIAddVersionKey FileVersion "@PACKAGE_VERSION@"
66-
VIAddVersionKey FileDescription "Installer for @PACKAGE_NAME@"
65+
VIAddVersionKey FileVersion "@CLIENT_VERSION_STRING@"
66+
VIAddVersionKey FileDescription "Installer for @CLIENT_NAME@"
6767
VIAddVersionKey LegalCopyright "Copyright (C) 2009-@COPYRIGHT_YEAR@ @COPYRIGHT_HOLDERS_FINAL@"
6868
InstallDirRegKey HKCU "${REGKEY}" Path
6969
ShowUninstDetails show
@@ -95,23 +95,23 @@ Section -post SEC0001
9595
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
9696
CreateDirectory $SMPROGRAMS\$StartMenuGroup
9797
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\$(^Name).lnk" $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@
98-
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\@PACKAGE_NAME@ (testnet).lnk" "$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" "-testnet" "$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" 1
99-
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\@PACKAGE_NAME@ (test signet).lnk" "$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" "-signet" "$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" 2
100-
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\@PACKAGE_NAME@ (testnet4).lnk" "$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" "-testnet4" "$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" 3
98+
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\@CLIENT_NAME@ (testnet).lnk" "$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" "-testnet" "$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" 1
99+
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\@CLIENT_NAME@ (test signet).lnk" "$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" "-signet" "$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" 2
100+
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\@CLIENT_NAME@ (testnet4).lnk" "$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" "-testnet4" "$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" 3
101101
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk" $INSTDIR\uninstall.exe
102102
!insertmacro MUI_STARTMENU_WRITE_END
103103
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)"
104-
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayVersion "@PACKAGE_VERSION@"
104+
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayVersion "@CLIENT_VERSION_STRING@"
105105
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" Publisher "${COMPANY}"
106106
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" URLInfoAbout "${URL}"
107107
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\bitcoin-qt.exe
108108
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\uninstall.exe
109109
WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1
110110
WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1
111-
WriteRegStr HKCR "@PACKAGE_TARNAME@" "URL Protocol" ""
112-
WriteRegStr HKCR "@PACKAGE_TARNAME@" "" "URL:Bitcoin"
113-
WriteRegStr HKCR "@PACKAGE_TARNAME@\DefaultIcon" "" $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@
114-
WriteRegStr HKCR "@PACKAGE_TARNAME@\shell\open\command" "" '"$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" "%1"'
111+
WriteRegStr HKCR "@CLIENT_TARNAME@" "URL Protocol" ""
112+
WriteRegStr HKCR "@CLIENT_TARNAME@" "" "URL:Bitcoin"
113+
WriteRegStr HKCR "@CLIENT_TARNAME@\DefaultIcon" "" $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@
114+
WriteRegStr HKCR "@CLIENT_TARNAME@\shell\open\command" "" '"$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" "%1"'
115115
SectionEnd
116116

117117
# Macro for selecting uninstaller sections
@@ -142,9 +142,9 @@ Section -un.post UNSEC0001
142142
DeleteRegKey HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)"
143143
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk"
144144
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\$(^Name).lnk"
145-
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\@PACKAGE_NAME@ (testnet).lnk"
146-
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\@PACKAGE_NAME@ (testnet4).lnk"
147-
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\@PACKAGE_NAME@ (test signet).lnk"
145+
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\@CLIENT_NAME@ (testnet).lnk"
146+
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\@CLIENT_NAME@ (testnet4).lnk"
147+
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\@CLIENT_NAME@ (test signet).lnk"
148148
Delete /REBOOTOK "$SMSTARTUP\Bitcoin.lnk"
149149
Delete /REBOOTOK $INSTDIR\uninstall.exe
150150
Delete /REBOOTOK $INSTDIR\debug.log
@@ -153,7 +153,7 @@ Section -un.post UNSEC0001
153153
DeleteRegValue HKCU "${REGKEY}" Path
154154
DeleteRegKey /IfEmpty HKCU "${REGKEY}\Components"
155155
DeleteRegKey /IfEmpty HKCU "${REGKEY}"
156-
DeleteRegKey HKCR "@PACKAGE_TARNAME@"
156+
DeleteRegKey HKCR "@CLIENT_TARNAME@"
157157
RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup
158158
RmDir /REBOOTOK $INSTDIR
159159
Push $R0

src/addrdb.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ bool CBanDB::Write(const banmap_t& banSet)
150150
bool CBanDB::Read(banmap_t& banSet)
151151
{
152152
if (fs::exists(m_banlist_dat)) {
153-
LogPrintf("banlist.dat ignored because it can only be read by " PACKAGE_NAME " version 22.x. Remove %s to silence this warning.\n", fs::quoted(fs::PathToString(m_banlist_dat)));
153+
LogPrintf("banlist.dat ignored because it can only be read by " CLIENT_NAME " version 22.x. Remove %s to silence this warning.\n", fs::quoted(fs::PathToString(m_banlist_dat)));
154154
}
155155
// If the JSON banlist does not exist, then recreate it
156156
if (!fs::exists(m_banlist_json)) {
@@ -215,7 +215,7 @@ util::Result<std::unique_ptr<AddrMan>> LoadAddrman(const NetGroupManager& netgro
215215
DumpPeerAddresses(args, *addrman);
216216
} catch (const std::exception& e) {
217217
return util::Error{strprintf(_("Invalid or corrupt peers.dat (%s). If you believe this is a bug, please report it to %s. As a workaround, you can move the file (%s) out of the way (rename, move, or delete) to have a new one created on the next start."),
218-
e.what(), PACKAGE_BUGREPORT, fs::quoted(fs::PathToString(path_addr)))};
218+
e.what(), CLIENT_BUGREPORT, fs::quoted(fs::PathToString(path_addr)))};
219219
}
220220
return addrman;
221221
}

src/addrman.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ void AddrManImpl::Unserialize(Stream& s_)
253253
throw InvalidAddrManVersionError(strprintf(
254254
"Unsupported format of addrman database: %u. It is compatible with formats >=%u, "
255255
"but the maximum supported by this version of %s is %u.",
256-
uint8_t{format}, lowest_compatible, PACKAGE_NAME, uint8_t{FILE_FORMAT}));
256+
uint8_t{format}, lowest_compatible, CLIENT_NAME, uint8_t{FILE_FORMAT}));
257257
}
258258

259259
s >> nKey;

src/bitcoin-cli-res.rc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ BEGIN
1515
BLOCK "040904E4" // U.S. English - multilingual (hex)
1616
BEGIN
1717
VALUE "CompanyName", "Bitcoin"
18-
VALUE "FileDescription", "bitcoin-cli (JSON-RPC client for " PACKAGE_NAME ")"
19-
VALUE "FileVersion", PACKAGE_VERSION
18+
VALUE "FileDescription", "bitcoin-cli (JSON-RPC client for " CLIENT_NAME ")"
19+
VALUE "FileVersion", CLIENT_VERSION_STRING
2020
VALUE "InternalName", "bitcoin-cli"
2121
VALUE "LegalCopyright", COPYRIGHT_STR
2222
VALUE "LegalTrademarks1", "Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php."
2323
VALUE "OriginalFilename", "bitcoin-cli.exe"
2424
VALUE "ProductName", "bitcoin-cli"
25-
VALUE "ProductVersion", PACKAGE_VERSION
25+
VALUE "ProductVersion", CLIENT_VERSION_STRING
2626
END
2727
END
2828

0 commit comments

Comments
 (0)