123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- import os.path as P
- from devtools.yamaker.fileutil import subcopy
- from devtools.yamaker.modules import Linkable, Switch
- from devtools.yamaker.project import NixProject
- def post_install(self):
- def d(s):
- return self.dstdir + "/" + s
- # Move asm sources to asm/linux.
- subcopy(self.dstdir, d("asm/linux"), ["**/*.s"], move=True)
- with self.yamakes["crypto"] as m:
- asm = {s for s in m.SRCS if s.endswith(".s")}
- m.SRCS -= asm
- m.after(
- "SRCS",
- Switch(
- dict(
- {
- "OS_LINUX AND ARCH_X86_64": Linkable(
- SRCS={"../asm/linux/" + s for s in asm},
- )
- }
- )
- ),
- )
- # Shorten paths.
- m.SRCDIR = []
- m.SRCS = {P.relpath(s, "crypto") for s in m.SRCS}
- m.SRCS -= {"dso/dso_dlfcn.c", "rand/rand_vms.c"}
- # Add suppression for ubsan, see also https://github.com/openssl/openssl/issues/22896
- with self.yamakes["crypto"] as m:
- m.after("NO_RUNTIME", "SUPPRESSIONS(ubsan.supp)")
- self.yamakes["crypto"].PEERDIR.add("library/cpp/sanitizer/include")
- self.yamakes["apps"].PEERDIR.add("library/cpp/sanitizer/include")
- with self.yamakes["."] as m:
- m.after(
- "ORIGINAL_SOURCE",
- """IF (OPENSOURCE_REPLACE_OPENSSL AND EXPORT_CMAKE)
- OPENSOURCE_EXPORT_REPLACEMENT(
- CMAKE OpenSSL
- CMAKE_TARGET OpenSSL::OpenSSL
- CONAN openssl/${OPENSOURCE_REPLACE_OPENSSL}
- )
- ELSE()
- ADDINCL(
- GLOBAL contrib/libs/openssl/include
- )
- ENDIF()
- """,
- )
- m.ADDINCL = []
- with self.yamakes["crypto"] as m:
- m.after(
- "LICENSE_TEXTS",
- """IF (OPENSOURCE_REPLACE_OPENSSL)
- OPENSOURCE_EXPORT_REPLACEMENT(
- CMAKE OpenSSL
- CMAKE_PACKAGE_COMPONENT Crypto
- CMAKE_TARGET OpenSSL::Crypto
- CONAN openssl/${OPENSOURCE_REPLACE_OPENSSL}
- )
- ENDIF() # IF (OPENSOURCE_REPLACE_OPENSSL)
- """,
- )
- m.ADDINCL = []
- openssl = NixProject(
- license="OpenSSL AND SSLeay",
- owners=["g:cpp-contrib"],
- arcdir="contrib/libs/openssl",
- nixattr="openssl",
- ignore_commands=["bash", "perl"],
- put_with={"openssl": ["apps"]},
- install_targets=["crypto", "openssl", "ssl"],
- put={"ssl": "."},
- disable_includes=[
- "efndef.h",
- "iosbdef.h",
- "rmidef.h",
- "sys/ldr.h",
- # if defined(OPENSSL_SYS_VXWORKS)
- "ioLib.h",
- "sockLib.h",
- "sysLib.h",
- "taskLib.h",
- "tickLib.h",
- "vxWorks.h",
- # if defined(OPENSSL_SYS_VMS)
- "descrip.h",
- "dvidef.h",
- "gen64def.h",
- "iledef.h",
- "iodef.h",
- "jpidef.h",
- "lib$routines.h",
- "libfildef.h",
- "libfisdef.h",
- "rms.h",
- "rmsdef.h",
- "times.h",
- "ssdef.h",
- "starlet.h",
- "str$routines.h",
- "stsdef.h",
- "syidef.h",
- "unixio.h",
- ],
- copy_sources=[
- "apps/**/*.c",
- "apps/**/*.h",
- "crypto/**/*.asm",
- "crypto/**/*.c",
- "crypto/**/*.h",
- "engines/**/*.c",
- "engines/**/*.h",
- "include/**/*.h",
- ],
- platform_dispatchers=[
- "apps/progs.h",
- "crypto/buildinf.h",
- "include/crypto/bn_conf.h",
- "include/crypto/dso_conf.h",
- "include/openssl/opensslconf.h",
- ],
- keep_paths=[
- "asm/aarch64/",
- "asm/android/",
- "asm/darwin/",
- "asm/darwin-arm64/",
- "asm/ios/",
- "asm/ppc64le/",
- "asm/windows/",
- "openssl.package.json",
- "sanitizers.h",
- "crypto/ubsan.supp",
- ],
- post_install=post_install,
- )
|