This repository has been archived by the owner on Feb 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Hydrunfile
executable file
·40 lines (30 loc) · 1.91 KB
/
Hydrunfile
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
#!/bin/bash
set -e
# Install native dependencies
apt update
apt install -y curl
# Clients
if [ "$1" = "clients" ]; then
# Install bagop
curl -L -o /tmp/bagop "https://github.com/pojntfx/bagop/releases/latest/download/bagop.linux-$(uname -m)"
install /tmp/bagop /usr/local/bin
# Install dependencies
apt update
apt install -y zlib1g-dev protobuf-compiler build-essential automake file
# Generate bindings
make depend
# Build
CGO_ENABLED=0 bagop -j "$(nproc)" -b dhclientctl -x '(android/*|ios/*|aix/ppc64|plan9/386|plan9/amd64|plan9/arm)' -p 'make build/dhclientctl DST=$DST' -d out
CGO_ENABLED=0 bagop -j "$(nproc)" -b dhcpdctl -x '(android/*|ios/*|aix/ppc64|plan9/386|plan9/amd64|plan9/arm)' -p 'make build/dhcpdctl DST=$DST' -d out
exit 0
fi
# Servers
if [ "$1" = "servers" ]; then
# Install bagccgop
curl -L -o /tmp/bagccgop "https://github.com/pojntfx/bagccgop/releases/latest/download/bagccgop.linux-$(uname -m)"
install /tmp/bagccgop /usr/local/bin
# Build
GOFLAGS='-gccgoflags=-static' bagccgop -x '(linux/alpha|linux/mipsle|linux/ppc$|linux/riscv64|linux/arm$)' -j1 -b dhclientd -r 'make depend' -s 'protobuf-compiler,build-essential,automake,file' -m 'zlib1g-dev' -p 'chmod +w /root/go/pkg/mod/google.golang.org/grpc@*/internal/channelz/types_linux.go && sed -i "s/SO_SNDTIMEO/SO_RCVTIMEO/" /root/go/pkg/mod/google.golang.org/grpc@*/internal/channelz/types_linux.go && make build/dhclientd DST=$DST' -d out
GOFLAGS='-gccgoflags=-static' bagccgop -x '(linux/alpha|linux/mipsle|linux/ppc$|linux/riscv64|linux/arm$)' -j1 -b dhcpdd -r 'make depend' -s 'protobuf-compiler,build-essential,automake,file' -m 'zlib1g-dev' -p 'chmod +w /root/go/pkg/mod/google.golang.org/grpc@*/internal/channelz/types_linux.go && sed -i "s/SO_SNDTIMEO/SO_RCVTIMEO/" /root/go/pkg/mod/google.golang.org/grpc@*/internal/channelz/types_linux.go && make build/dhcpdd DST=$DST' -d out
exit 0
fi