diff options
author | navigaid | 2019-09-30 16:20:45 +0000 |
---|---|---|
committer | navigaid | 2019-09-30 16:20:45 +0000 |
commit | 87e1a7cc9be306d9f9dd9ca2a2bf0c7f44cf3925 (patch) | |
tree | e64f2e7db9f8965cd2bcc33aa15324f5ceebbe99 | |
parent | 51bf67239f6976bbd76b3b25fbb212a3772a1249 (diff) | |
download | aur-87e1a7cc9be306d9f9dd9ca2a2bf0c7f44cf3925.tar.gz |
build with system toolchain
-rw-r--r-- | .SRCINFO | 9 | ||||
-rw-r--r-- | PKGBUILD | 18 | ||||
-rwxr-xr-x | build.sh | 75 |
3 files changed, 92 insertions, 10 deletions
@@ -3,8 +3,13 @@ pkgbase = naiveproxy-git pkgver = 77.0.3865.90.r33.7929e0850 pkgrel = 1 url = https://github.com/klzgrad/naiveproxy - arch = x86_64 + arch = any license = BSD + makedepends = clang + makedepends = lld + makedepends = gn + makedepends = unzip + makedepends = python2 depends = nspr depends = nss optdepends = ccache: Speed up compilation @@ -13,7 +18,9 @@ pkgbase = naiveproxy-git conflicts = naiveproxy-bin backup = etc/naiveproxy/config.json source = git+https://github.com/klzgrad/naiveproxy.git + source = build.sh md5sums = SKIP + md5sums = 39e64c1967684ff2966eedc2f2d8decf pkgname = naiveproxy-git @@ -5,14 +5,17 @@ _pkgname=naiveproxy pkgdesc='Make a fortune quietly' pkgver=77.0.3865.90.r33.7929e0850 pkgrel=1 -arch=('x86_64') +arch=('any') url='https://github.com/klzgrad/naiveproxy' license=('BSD') depends=('nspr' 'nss') -source=(git+https://github.com/klzgrad/naiveproxy.git) +source=('git+https://github.com/klzgrad/naiveproxy.git' + 'build.sh') +makedepends=("clang" "lld" "gn" "unzip" "python2") optdepends=("ccache: Speed up compilation") backup=(etc/naiveproxy/config.json) -md5sums=('SKIP') +md5sums=('SKIP' + '39e64c1967684ff2966eedc2f2d8decf') provides=('naiveproxy') conflicts=('naiveproxy' 'naiveproxy-bin') @@ -22,18 +25,15 @@ pkgver(){ } build(){ - pushd ${srcdir}/${_pkgname}/src - ./get-clang.sh - ./build.sh - popd + cd ${srcdir}/${_pkgname}/src + env EXTRA_FLAGS='clang_base_path="" clang_use_chrome_plugins=false clang_use_default_sample_profile=false' ../../build.sh } package(){ - pushd ${srcdir}/${_pkgname} + cd ${srcdir}/${_pkgname} install -Dm755 src/out/Release/naive ${pkgdir}/usr/bin/naiveproxy install -Dm644 src/config.json ${pkgdir}/etc/naiveproxy/config.json 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 } diff --git a/build.sh b/build.sh new file mode 100755 index 000000000000..5e9d318e87bd --- /dev/null +++ b/build.sh @@ -0,0 +1,75 @@ +#!/bin/sh +set -e + +export TMPDIR="$PWD/tmp" +mkdir -p "$TMPDIR" + +if [ "$1" = debug ]; then + out=out/Debug + flags="$EXTRA_FLAGS + is_debug=true + is_component_build=true" +else + out=out/Release + flags="$EXTRA_FLAGS + is_official_build=true + use_jumbo_build=true + exclude_unwind_tables=true + enable_resource_whitelist_generation=false + symbol_level=0" +fi + +if which ccache >/dev/null 2>&1; then + export CCACHE_SLOPPINESS=time_macros + export CCACHE_BASEDIR="$PWD" + export CCACHE_CPP2=yes + flags="$flags"' + cc_wrapper="ccache"' +elif [ -f "$HOME"/.cargo/bin/sccache* ]; then + export PATH="$PATH:$HOME/.cargo/bin" + flags="$flags"' + cc_wrapper="sccache"' +fi + +flags="$flags"' + is_clang=true + linux_use_bundled_binutils=false + + fatal_linker_warnings=false + treat_warnings_as_errors=false + use_sysroot=false + + fieldtrial_testing_like_official_build=true + + use_cups=false + use_dbus=false + use_gio=false + use_platform_icu_alternatives=true + + disable_file_support=true + enable_websockets=false + disable_ftp_support=true + use_kerberos=false + disable_brotli_filter=true + enable_mdns=false + enable_reporting=false + include_transport_security_state_preload_list=false +' + +if [ "$(uname)" = Linux ]; then + flags="$flags"' + use_ozone=true + ozone_auto_platforms=false + ozone_platform="headless" + ozone_platform_headless=true' +fi + +rm -rf "./$out" +mkdir -p out + +python2=$(which python2 2>/dev/null || which python 2>/dev/null) +export DEPOT_TOOLS_WIN_TOOLCHAIN=0 + +gn gen "$out" --args="$flags" --script-executable=$python2 + +ninja -C "$out" naive |