-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathbuild
More file actions
executable file
·77 lines (60 loc) · 2.22 KB
/
build
File metadata and controls
executable file
·77 lines (60 loc) · 2.22 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
#!/usr/bin/env python3
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Build ldns package."""
import logging
import os
import sys
FILESDIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(FILESDIR, '..', '..', 'bin'))
import ssh_client # pylint: disable=wrong-import-position
ARCHIVES = ('%(p)s.tar.gz',)
PATCHES = (
'%(pn)s-no-getproto.patch',
'%(pn)s-CVE-2017-1000231.patch',
'%(pn)s-CVE-2017-1000232.patch',
'%(pn)s-ssl-engine.patch',
'%(pn)s-ssl-headers.patch',
)
def src_configure(metadata):
"""Configure the source."""
if os.path.exists('Makefile'):
logging.info('Makefile exists; skipping ./configure step')
return
tc = metadata['toolchain']
EXTRA_CFLAGS = [
# The configure script tests these structs (and finds them), but then
# forgets to create the right defines for them. Force the logic when
# we build to avoid failures.
'-DHAVE_STRUCT_SOCKADDR_STORAGE',
'-DHAVE_STRUCT_IN6_ADDR',
'-DHAVE_STRUCT_SOCKADDR_IN6',
]
cmd = [
'./configure',
'--build=%s' % (tc.cbuild,),
'--host=%s' % (tc.chost,),
# The prefix path matches what is used at runtime.
'--prefix=/',
'--cache-file=../config.cache',
'CFLAGS=%s' % (' '.join(EXTRA_CFLAGS),),
'--disable-dane-verify',
'--disable-gost',
# The ldns configure logic is quite poor and searches the filesystem
# instead of querying the compiler. Force it to our sysroot.
'--with-ssl=%s' % (tc.sysroot,),
]
ssh_client.run(cmd)
def src_compile(_metadata):
"""Compile the source."""
ssh_client.emake('setup-builddir')
ssh_client.emake('lib')
def src_install(metadata):
"""Install the package."""
tc = metadata['toolchain']
# List install targets ourselves to avoid installing man pages.
# This package has a lot (~500) and can be a little slow.
ssh_client.emake('install-h', 'install-lib', 'install-config',
'DESTDIR=%s' % (tc.sysroot,))
ssh_client.build_package(sys.modules[__name__], 'pnacl')