-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathsqueasel.py
42 lines (37 loc) · 1.81 KB
/
squeasel.py
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
#
# Copyright (c) YugaByte, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations
# under the License.
#
import os
import sys
from yugabyte_db_thirdparty.build_definition_helpers import * # noqa
class SqueaselDependency(Dependency):
def __init__(self) -> None:
super(SqueaselDependency, self).__init__(
name='squeasel',
version='d83cf6d9af0e2c98c16467a6a035ae0d7ca21cb1-yb-4',
url_pattern='https://github.com/yugabyte/squeasel/archive/squeasel-{0}.tar.gz',
build_group=BuildGroup.COMMON)
self.copy_sources = True
self.patches = ['squeasel_bound_addrs_ipv6.patch']
self.patch_version = 1
self.patch_strip = 0
def build(self, builder: BuilderInterface) -> None:
log_prefix = builder.log_prefix(self)
compile_command = [
builder.compiler_choice.get_c_compiler(), '-std=c99', '-O3', '-DNDEBUG', '-DUSE_IPV6',
'-fPIC', '-c', 'squeasel.c']
compile_command += builder.preprocessor_flags + builder.compiler_flags + builder.c_flags
builder.log_output(log_prefix, compile_command)
builder.log_output(log_prefix, ['ar', 'rs', 'libsqueasel.a', 'squeasel.o'])
builder.log_output(log_prefix, ['cp', 'libsqueasel.a', builder.prefix_lib])
builder.log_output(log_prefix, ['cp', 'squeasel.h', builder.prefix_include])