blob: 14918449ebe69d7dc2d9f28fded3a39f3077a5a8 (
plain)
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
# Maintainer: bgme <i@bgme.me>
# Contributor: navigaid <navigaid@gmail.com>
pkgname=naiveproxy
pkgdesc="A Proxy using Chrome's network stack to camouflage traffic with strong censorship resistence and low detectablility."
pkgver=127.0.6533.64_2
pkgrel=1
_pkgver=127.0.6533.64
_pkgrel=2
arch=('x86_64')
url='https://github.com/klzgrad/naiveproxy'
license=('BSD-3-Clause')
depends=("gcc-libs" "glibc")
makedepends=("ninja" "gn" "ccache" "python")
checkdepends=("python" "openssl")
_PGO_PATH='chrome-linux-6533-1721647559-b59d3252e50dcc0e34a9d5ca3790d80421583ca4-419f07950174cbcea67e9a8035fcc0a2ced2ff1e.profdata'
_clang_path='clang-llvmorg-19-init-10646-g084e2b53-57.tgz'
source=(
"naiveproxy.service"
"naiveproxy@.service"
"naiveproxy.sysusers"
"${pkgname}-${_pkgver}-${_pkgrel}.tar.gz::https://github.com/klzgrad/naiveproxy/archive/refs/tags/v${_pkgver}-${_pkgrel}.tar.gz"
"${_PGO_PATH}::https://storage.googleapis.com/chromium-optimization-profiles/pgo_profiles/${_PGO_PATH}"
"${_clang_path}::https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64/${_clang_path}"
)
noextract=(
"${_clang_path}"
)
sha1sums=('4c18f44ba51d40bfd7e6ae8ecb30b8e812acb8e8'
'013b31ae43e309bc6560b61e8b4196f8f14f738f'
'3727d7da81b1480d60e593a7d6878d981b35c4f6'
'84a65658ce9d28a09ad6b75fe6fa71c7864d3ed6'
'b59d3252e50dcc0e34a9d5ca3790d80421583ca4'
'dfe7e4e0070de12463ea519488b86640d22a41f6')
sha256sums=('c05026423ca08e2c712745b717c23395e344f2c99b2dad30beed8e26922d268f'
'daa0f591233625730168f3ea006f1d5a7e439e26b35a1051d957e394aa8a4440'
'5bc9ef361e6303e151b6e63deb31b47e24a4f34ade4d8f092a04bc98e89a2edb'
'1eeb7c9cfc5ec36d100c559285ec0946cc5a032a9d178b61ec7b15402e5f8d16'
'4cc810ce3d9f9979a6dbcd6df1c65c8070ab7635f399af3b0bfc7df3f17083c3'
'256569cef49a1a955570a3026b8910689cac106a1336238f592296c544f6b8c3')
backup=('etc/naiveproxy/config.json')
provides=('naiveproxy')
conflicts=('naiveproxy-git' 'naiveproxy-bin')
prepare() {
SRC_DIR="${srcdir}/${pkgname}-${_pkgver}-${_pkgrel}/src"
mkdir -p "${SRC_DIR}/chrome/build/pgo_profiles"
cp ${_PGO_PATH} "${SRC_DIR}/chrome/build/pgo_profiles/"
mkdir -p "${SRC_DIR}/third_party/llvm-build/Release+Asserts"
tar xzf ${_clang_path} -C "${SRC_DIR}/third_party/llvm-build/Release+Asserts/"
}
build() {
SRC_DIR="${srcdir}/${pkgname}-${_pkgver}-${_pkgrel}/src"
cd "${SRC_DIR}"
export TMPDIR="$PWD/tmp"
rm -rf "$TMPDIR"
mkdir -p "$TMPDIR"
out=out/Release
flags="
is_official_build=true
exclude_unwind_tables=true
enable_resource_allowlist_generation=false
symbol_level=0"
PYTHON=$(which python3 2>/dev/null)
export CCACHE_SLOPPINESS=time_macros
export CCACHE_BASEDIR="$PWD"
export CCACHE_CPP2=yes
CCACHE=ccache
pushd "tools/clang/scripts"
CLANG_REVISION=$($PYTHON -c 'import update; print(update.PACKAGE_VERSION)')
popd
echo "$CLANG_REVISION" >third_party/llvm-build/Release+Asserts/cr_build_revision
flags="$flags
cc_wrapper=\"$CCACHE\""
flags="$flags"'
is_clang=true
use_sysroot=false
fatal_linker_warnings=false
treat_warnings_as_errors=false
enable_base_tracing=false
use_udev=false
use_aura=false
use_ozone=false
use_gio=false
use_gtk=false
use_platform_icu_alternatives=true
use_glib=false
enable_js_protobuf=false
disable_file_support=true
enable_websockets=false
use_kerberos=false
enable_mdns=false
enable_reporting=false
include_transport_security_state_preload_list=false
use_nss_certs=false
enable_backup_ref_ptr_support=false
enable_dangling_raw_ptr_checks=false
'
# Disable CFI icall for linux x64
# See https://github.com/llvm/llvm-project/issues/86430
flags="$flags"'
use_cfi_icall=false'
rm -rf "./$out"
mkdir -p out
export DEPOT_TOOLS_WIN_TOOLCHAIN=0
gn gen "$out" "--args=$flags $EXTRA_FLAGS"
ninja -C "$out" naive
}
check() {
SRC_DIR="${srcdir}/${pkgname}-${_pkgver}-${_pkgrel}"
script_dir="${SRC_DIR}/tests"
naive="${SRC_DIR}/src/out/Release/naive"
cd /tmp
python "${script_dir}/basic.py" --naive="$naive"
}
package() {
pushd "${srcdir}"
install -Dm644 naiveproxy.service "${pkgdir}/usr/lib/systemd/system/naiveproxy.service"
install -Dm644 naiveproxy@.service "${pkgdir}/usr/lib/systemd/system/naiveproxy@.service"
install -Dm644 naiveproxy.sysusers "${pkgdir}/usr/lib/sysusers.d/naiveproxy.conf"
popd
pushd "${srcdir}/${pkgname}-${_pkgver}-${_pkgrel}"
install -d -m750 -o 0 -g 287 "${pkgdir}/etc/naiveproxy"
install -Dm644 src/config.json "${pkgdir}/etc/naiveproxy/config.json"
install -Dm755 src/out/Release/naive "${pkgdir}/usr/bin/naiveproxy"
install -Dm644 README.md "${pkgdir}/usr/share/doc/naiveproxy/README.md"
install -Dm644 USAGE.txt "${pkgdir}/usr/share/doc/naiveproxy/USAGE.txt"
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/naiveproxy/LICENSE"
popd
}
|