Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ios: curl !macos !js !windows #19

Merged
merged 2 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions patches/openssl.patch
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,16 @@ index cba57b4127..bab71b2d93 100644

"linux-ia64" => {
inherit_from => [ "linux-generic64" ],
diff --git a/crypto/build.info b/crypto/build.info
index 2642d30754..920935b0a0 100644
--- a/crypto/build.info
+++ b/crypto/build.info
@@ -115,7 +115,7 @@ DEFINE[../libcrypto]=$UPLINKDEF

DEPEND[info.o]=buildinf.h
DEPEND[cversion.o]=buildinf.h
-GENERATE[buildinf.h]=../util/mkbuildinf.pl "$(CC) $(LIB_CFLAGS) $(CPPFLAGS_Q)" "$(PLATFORM)"
+GENERATE[buildinf.h]=../util/mkbuildinf.pl "$(LIB_CFLAGS) $(CPPFLAGS_Q)" "$(PLATFORM)"

GENERATE[uplink-x86.S]=../ms/uplink-x86.pl
GENERATE[uplink-x86_64.s]=../ms/uplink-x86_64.pl
5 changes: 4 additions & 1 deletion scripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@


def sort_projects(projects: list[str]) -> list[str]:
in_degree = {project: len(dag.get(project, [])) for project in projects}
in_degree = {project: len([dep for dep in dag.get(project, []) if dep in projects]) for project in projects}
adjacency_list = defaultdict(list)

for project, deps in dag.items():
if project not in projects:
continue
for dep in deps:
# openssl is not needed for curl on iOS.
if dep not in projects:
continue
adjacency_list[dep].append(project)

zero_in_degree = deque(sorted([p for p in projects if in_degree[p] == 0]))
Expand Down
3 changes: 2 additions & 1 deletion scripts/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def cache(url: str):
print(f'Using cached {file}')
return
ensure('wget', [
'-nv', # boost progress bar produces too many lines.
'-P',
'cache',
url
Expand Down Expand Up @@ -257,7 +258,7 @@ def build(self):

def install(self):
os.environ['DESTDIR'] = self.dest_dir
ensure('cmake', ['--install', self.build_])
ensure('cmake', ['--install', self.build_, *(['> /dev/null'] if self.name == 'boost' else [])])


class MesonBuilder(Builder):
Expand Down
7 changes: 5 additions & 2 deletions scripts/curl.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
'-DBUILD_LIBCURL_DOCS=OFF',
'-DBUILD_MISC_DOCS=OFF',
'-DBUILD_TESTING=OFF',
'-DCURL_CA_BUNDLE="/etc/ssl/certs/cacert.pem"',
'-DCURL_CA_PATH="/etc/ssl/certs/"',
'-DCURL_BROTLI=OFF',
'-DCURL_DISABLE_ALTSVC=ON',
'-DCURL_DISABLE_AWS=ON',
'-DCURL_DISABLE_BASIC_AUTH=ON',
Expand Down Expand Up @@ -45,4 +44,8 @@
'-DHTTP_ONLY=ON',
'-DUSE_LIBIDN2=OFF',
'-DUSE_NGHTTP2=OFF',
], ios=['-DCURL_USE_SECTRANSP=ON'],
harmony=[
'-DCURL_CA_BUNDLE="/etc/ssl/certs/cacert.pem"',
'-DCURL_CA_PATH="/etc/ssl/certs/"'
]).exec()
1 change: 1 addition & 0 deletions scripts/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@

ios = [
'boost',
'curl',
'fmt',
'glog',
'json-c',
Expand Down
4 changes: 3 additions & 1 deletion scripts/openssl.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@

import os
from common import HARMONY_NATIVE, INSTALL_PREFIX, OHOS_ARCH, OHOS_TARGET, PLATFORM, Builder, ensure, patch

project = 'openssl'

patch(project)

os.environ['SOURCE_DATE_EPOCH'] = '0' # Reproducible: crypto/buildinf.h

class OpenSSLBuilder(Builder):
def configure(self):
arch = 'ohos-aarch64' if OHOS_ARCH == 'arm64-v8a' else 'ohos-x86_64'
Expand Down