forked from libapps/libapps-mirror
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild
More file actions
executable file
·107 lines (88 loc) · 2.55 KB
/
build
File metadata and controls
executable file
·107 lines (88 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/usr/bin/env python3
# Copyright 2018 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Build openssl package."""
import logging
import os
from pathlib import Path
import sys
FILESDIR = Path(__file__).resolve().parent
sys.path.insert(0, str(FILESDIR.parent.parent / "bin"))
import ssh_client # pylint: disable=wrong-import-position
ARCHIVES = ("%(p)s.tar.gz",)
PATCHES = (
"openssl-1.1.1w-wasm-configure.patch",
"openssl-1.1.1w-wasm-random.patch",
"openssl-1.1.1w-wasm-syslog.patch",
)
def src_configure(metadata):
"""Configure the source."""
tc = metadata["toolchain"]
machine = tc.chost.split("-")[0]
# See if configure passed.
try:
with open("Makefile", encoding="utf-8") as fp:
if machine in fp.read():
logging.info("Makefile exists; skipping ./configure step")
return
except FileNotFoundError:
pass
f = metadata["S"] / "Configurations" / "unix-Makefile.tmpl"
data = f.read_text()
new_data = data.replace(
"$(DESTDIR)$(INSTALLTOP)/include/openssl",
f"$(DESTDIR)$(INSTALLTOP)/{tc.relincdir}/openssl",
)
if data != new_data:
f.write_text(new_data)
env = os.environ.copy()
env.update(
{
"SYSTEM": tc.chost,
"MACHINE": machine,
"RELEASE": "0",
}
)
cmd = (
[
"./config",
"--prefix=/",
f"--libdir=/{tc.rellibdir}",
"no-asm",
"no-async",
"no-deprecated",
"no-dso",
"no-ec2m",
"no-egd",
"no-engine",
"no-fuzz-afl",
"no-fuzz-libfuzzer",
"no-gost",
"no-heartbeats",
"no-hw",
"no-rfc3779",
"no-scrypt",
"no-sctp",
"no-siphash",
"no-sock",
"no-srp",
"no-sse2",
"no-ssl2",
"no-ssl3",
"no-threads",
"no-unit-test",
]
+ env.get("CFLAGS", "").split()
+ env["CPPFLAGS"].split()
)
ssh_client.run(cmd, env=env)
ssh_client.emake("depend", "DIRS=crypto ssl", env=env)
def src_compile(_metadata):
"""Compile the source."""
ssh_client.emake("build_libs")
def src_install(metadata):
"""Install the package."""
tc = metadata["toolchain"]
ssh_client.emake("install_dev", f"DESTDIR={tc.sysroot}")
ssh_client.build_package(sys.modules[__name__], "wasm")