Bug 1898748 - Set RNP PACKAGE_STRING during configure. r=kaie

Differential Revision: https://phabricator.services.mozilla.com/D211863

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Rob Lemley 2024-06-05 17:06:05 +00:00
Родитель 4f0f3f5f53
Коммит 6715112acb
3 изменённых файлов: 11 добавлений и 8 удалений

Просмотреть файл

@ -18,7 +18,7 @@ from mozbuild.util import FileAvoidWrite, ensureParentDir
from thirdroc.cmake_define_files import define_type, process_cmake_define_file
def rnp_version(version_file, thunderbird_version):
def rnp_version(version_file, thunderbird_version, crypto_backend):
"""
Update RNP source files: generate version.h
:param string version_file:
@ -31,7 +31,7 @@ def rnp_version(version_file, thunderbird_version):
version_minor = version.minor
version_patch = version.micro
version_full = f"{version_str}.MZLA.{thunderbird_version}"
version_full = f"{version_str}.MZLA.{thunderbird_version}.{crypto_backend}"
defines = dict(
RNP_VERSION_MAJOR=version_major,
@ -83,6 +83,9 @@ def main(output, *argv):
parser.add_argument("config_h_in", help="config.h.in")
parser.add_argument("-m", type=str, dest="thunderbird_version", help="Thunderbird version")
parser.add_argument("-V", type=str, dest="version_file", help="Path to RNP version.txt")
parser.add_argument(
"-c", type=str, dest="crypto_backend", help="Crypto backend (botan|openssl)"
)
parser.add_argument(
"-D",
type=define_type,
@ -94,7 +97,7 @@ def main(output, *argv):
args = parser.parse_args(argv)
defines = rnp_version(args.version_file, args.thunderbird_version)
defines = rnp_version(args.version_file, args.thunderbird_version, args.crypto_backend)
# "output" is an open filedescriptor for version.h
generate_version_h(output, args.version_h_in, defines)

6
third_party/openpgp.configure поставляемый
Просмотреть файл

@ -165,9 +165,9 @@ with only_when(in_tree_librnp):
set_config("MZLA_BZIP2_LIBS", bzip2_flags.ldflags)
# librnp crypto backend selection
@depends(target_has_linux_kernel)
def librnp_backend_choices(is_linux):
if is_linux:
@depends(target_has_linux_kernel, "--help")
def librnp_backend_choices(is_linux, is_help):
if is_linux or is_help:
return ("botan", "openssl")
else:
return ("botan",)

4
third_party/rnp/moz.build поставляемый
Просмотреть файл

@ -94,7 +94,6 @@ elif CONFIG["MZLA_LIBRNP_BACKEND"] == "openssl":
# Supported, but not with RHEL's OpenSSL, disabled for now;
"ENABLE_BRAINPOOL": False,
})
rnp_defines["PACKAGE_STRING"] = rnp_defines["PACKAGE_STRING"][:-1] + '-openssl"'
if CONFIG["MZLA_LIBRNP_OPENSSL_VERSION"][0] == "3":
rnp_defines["CRYPTO_BACKEND_OPENSSL3"] = True
@ -106,7 +105,8 @@ GeneratedFile(
script="/comm/python/thirdroc/rnp_generated.py",
inputs=["src/lib/version.h.in", "src/lib/config.h.in"],
flags=["-V", f"{SRCDIR}/version.txt",
"-m", CONFIG["MOZ_APP_VERSION_DISPLAY"]] + gen_files_flags
"-m", CONFIG["MOZ_APP_VERSION_DISPLAY"],
"-c", CONFIG["MZLA_LIBRNP_BACKEND"]] + gen_files_flags
)
if CONFIG["MOZ_SYSTEM_ZLIB"]: