forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move
CopyrightHolders()
and LicenseInfo()
into libbitcoin_common
After bitcoin#26645, this change is required to be able to `#include clientversion.h` in the `libbitcoinconsensus` code without dependency on `util/translation.h`.
- Loading branch information
Showing
14 changed files
with
68 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright (c) 2015-2022 The Bitcoin Core developers | ||
// Distributed under the MIT software license, see the accompanying | ||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
#include <common/license.h> | ||
|
||
#if defined(HAVE_CONFIG_H) | ||
#include <config/bitcoin-config.h> | ||
#endif // HAVE_CONFIG_H | ||
|
||
#include <tinyformat.h> | ||
#include <util/translation.h> | ||
|
||
#include <string> | ||
|
||
std::string CopyrightHolders(const std::string& strPrefix) | ||
{ | ||
const auto copyright_devs = strprintf(_(COPYRIGHT_HOLDERS).translated, COPYRIGHT_HOLDERS_SUBSTITUTION); | ||
std::string strCopyrightHolders = strPrefix + copyright_devs; | ||
|
||
// Make sure Bitcoin Core copyright is not removed by accident | ||
if (copyright_devs.find("Bitcoin Core") == std::string::npos) { | ||
strCopyrightHolders += "\n" + strPrefix + "The Bitcoin Core developers"; | ||
} | ||
return strCopyrightHolders; | ||
} | ||
|
||
std::string LicenseInfo() | ||
{ | ||
const std::string URL_SOURCE_CODE = "<https://github.com/bitcoin/bitcoin>"; | ||
|
||
return CopyrightHolders(strprintf(_("Copyright (C) %i-%i").translated, 2009, COPYRIGHT_YEAR) + " ") + "\n" + | ||
"\n" + | ||
strprintf(_("Please contribute if you find %s useful. " | ||
"Visit %s for further information about the software.").translated, PACKAGE_NAME, "<" PACKAGE_URL ">") + | ||
"\n" + | ||
strprintf(_("The source code is available from %s.").translated, URL_SOURCE_CODE) + | ||
"\n" + | ||
"\n" + | ||
_("This is experimental software.").translated + "\n" + | ||
strprintf(_("Distributed under the MIT software license, see the accompanying file %s or %s").translated, "COPYING", "<https://opensource.org/licenses/MIT>") + | ||
"\n"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright (c) 2015-2022 The Bitcoin Core developers | ||
// Distributed under the MIT software license, see the accompanying | ||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
#ifndef BITCOIN_COMMON_LICENSE_H | ||
#define BITCOIN_COMMON_LICENSE_H | ||
|
||
#include <string> | ||
|
||
std::string CopyrightHolders(const std::string& strPrefix); | ||
|
||
/** Returns licensing information (for -version) */ | ||
std::string LicenseInfo(); | ||
|
||
#endif // BITCOIN_COMMON_LICENSE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters