75 lines
2.2 KiB
Nix
75 lines
2.2 KiB
Nix
# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
{ pkgs, ... }:
|
|
with pkgs;
|
|
(buildBazelPackage rec {
|
|
pname = "envoy";
|
|
version = "1.16.2";
|
|
src = fetchFromGitHub {
|
|
owner = "envoyproxy";
|
|
repo = "envoy";
|
|
rev = "v${version}";
|
|
hash = "sha256:1b6nplf0pby1yjnsawbr5a6cnvs2ss38kxccgs4fvxv4b1m8h5d9";
|
|
|
|
extraPostFetch = ''
|
|
chmod -R +w $out
|
|
rm $out/.bazelversion
|
|
echo e98e41a8e168af7acae8079fc0cd68155f699aa3 > $out/SOURCE_VERSION
|
|
sed -i 's/GO_VERSION = ".*"/GO_VERSION = "host"/g' $out/bazel/dependency_imports.bzl
|
|
sed -i 's,#!/usr/bin/env python3,#!${python3}/bin/python,' $out/bazel/foreign_cc/luajit.patch
|
|
'';
|
|
};
|
|
|
|
patches = [
|
|
./0001-quiche-update-QUICHE-tar-13949.patch
|
|
];
|
|
|
|
nativeBuildInputs = [
|
|
cmake
|
|
python3
|
|
go
|
|
ninja
|
|
];
|
|
|
|
fetchAttrs = {
|
|
sha256 = "sha256:0s8gzfmpwjrv5v1l9spbkpa03x561n98qwli7qbbq4rvdsq1j45p";
|
|
dontUseCmakeConfigure = true;
|
|
};
|
|
buildAttrs = {
|
|
dontUseCmakeConfigure = true;
|
|
dontUseNinjaInstall = true;
|
|
preConfigure = ''
|
|
sed -i 's,#!/usr/bin/env bash,#!${stdenv.shell},' $bazelOut/external/rules_foreign_cc/tools/build_defs/framework.bzl
|
|
'';
|
|
installPhase = ''
|
|
install -Dm0755 bazel-bin/source/exe/envoy-static $out/bin/envoy
|
|
'';
|
|
};
|
|
|
|
fetchConfigured = true;
|
|
removeRulesCC = false;
|
|
removeLocalConfigCc = false;
|
|
removeLocal = false;
|
|
bazelTarget = "//source/exe:envoy-static";
|
|
bazelBuildFlags = [ "-c opt" "--spawn_strategy=standalone" "--verbose_failures" "--noexperimental_strict_action_env" ''--cxxopt=-Wno-maybe-uninitialized'' ];
|
|
|
|
meta = with stdenv.lib; {
|
|
homepage = "https://envoyproxy.io";
|
|
description = "Cloud-native edge and service proxy";
|
|
license = licenses.asl20;
|
|
maintainers = with maintainers; [ lukegb ];
|
|
};
|
|
}).overrideAttrs (old: {
|
|
preConfigure = (builtins.replaceStrings
|
|
[''ln -sf $(readlink "$symlink" | sed "s,NIX_BUILD_TOP,$NIX_BUILD_TOP,") "$symlink"'']
|
|
[
|
|
''
|
|
if readlink "$symlink" | grep -q "NIX_BUILD_TOP"; then
|
|
ln -sf $(readlink "$symlink" | sed "s,NIX_BUILD_TOP,$NIX_BUILD_TOP,") "$symlink"
|
|
fi
|
|
''
|
|
]
|
|
old.preConfigure);
|
|
})
|