uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
207
pkgs/servers/http/trafficserver/default.nix
Normal file
207
pkgs/servers/http/trafficserver/default.nix
Normal file
|
|
@ -0,0 +1,207 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchzip
|
||||
, fetchpatch
|
||||
, makeWrapper
|
||||
, nixosTests
|
||||
, pkg-config
|
||||
, file
|
||||
, linuxHeaders
|
||||
, openssl
|
||||
, pcre
|
||||
, perlPackages
|
||||
, python3
|
||||
, xz
|
||||
, zlib
|
||||
, catch2
|
||||
# recommended dependencies
|
||||
, withHwloc ? true
|
||||
, hwloc
|
||||
, withCurl ? true
|
||||
, curl
|
||||
, withCurses ? true
|
||||
, ncurses
|
||||
, withCap ? stdenv.isLinux
|
||||
, libcap
|
||||
, withUnwind ? stdenv.isLinux
|
||||
, libunwind
|
||||
# optional dependencies
|
||||
, withBrotli ? false
|
||||
, brotli
|
||||
, withCjose ? false
|
||||
, cjose
|
||||
, withGeoIP ? false
|
||||
, geoip
|
||||
, withHiredis ? false
|
||||
, hiredis
|
||||
, withImageMagick ? false
|
||||
, imagemagick
|
||||
, withJansson ? false
|
||||
, jansson
|
||||
, withKyotoCabinet ? false
|
||||
, kyotocabinet
|
||||
, withLuaJIT ? false
|
||||
, luajit
|
||||
, withMaxmindDB ? false
|
||||
, libmaxminddb
|
||||
# optional features
|
||||
, enableWCCP ? false
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "trafficserver";
|
||||
version = "9.1.2";
|
||||
|
||||
src = fetchzip {
|
||||
url = "mirror://apache/trafficserver/trafficserver-${version}.tar.bz2";
|
||||
sha256 = "sha256-eRpyTdwwO5EzrVpt9fF6VEYGZjHb905nQJd065wY5RU=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Adds support for NixOS
|
||||
# https://github.com/apache/trafficserver/pull/7697
|
||||
(fetchpatch {
|
||||
url = "https://github.com/apache/trafficserver/commit/19d3af481cf74c91fbf713fc9d2f8b138ed5fbaf.diff";
|
||||
sha256 = "0z1ikgpp00rzrrcqh97931586yn9wbksgai9xlkcjd5cg8gq0150";
|
||||
})
|
||||
|
||||
./fix-catch2-version-incompatibility.patch
|
||||
];
|
||||
|
||||
# NOTE: The upstream README indicates that flex is needed for some features,
|
||||
# but it actually seems to be unnecessary as of this commit[1]. The detection
|
||||
# logic for bison and flex is still present in the build script[2], but no
|
||||
# other code seems to depend on it. This situation is susceptible to change
|
||||
# though, so it's a good idea to inspect the build scripts periodically.
|
||||
#
|
||||
# [1]: https://github.com/apache/trafficserver/pull/5617
|
||||
# [2]: https://github.com/apache/trafficserver/blob/3fd2c60/configure.ac#L742-L788
|
||||
nativeBuildInputs = [ makeWrapper pkg-config file python3 ]
|
||||
++ (with perlPackages; [ perl ExtUtilsMakeMaker ])
|
||||
++ lib.optionals stdenv.isLinux [ linuxHeaders ];
|
||||
|
||||
buildInputs = [
|
||||
openssl
|
||||
pcre
|
||||
perlPackages.perl
|
||||
] ++ lib.optional withBrotli brotli
|
||||
++ lib.optional withCap libcap
|
||||
++ lib.optional withCjose cjose
|
||||
++ lib.optional withCurl curl
|
||||
++ lib.optional withGeoIP geoip
|
||||
++ lib.optional withHiredis hiredis
|
||||
++ lib.optional withHwloc hwloc
|
||||
++ lib.optional withImageMagick imagemagick
|
||||
++ lib.optional withJansson jansson
|
||||
++ lib.optional withKyotoCabinet kyotocabinet
|
||||
++ lib.optional withCurses ncurses
|
||||
++ lib.optional withLuaJIT luajit
|
||||
++ lib.optional withUnwind libunwind
|
||||
++ lib.optional withMaxmindDB libmaxminddb;
|
||||
|
||||
outputs = [ "out" "man" ];
|
||||
|
||||
postPatch = ''
|
||||
patchShebangs \
|
||||
iocore/aio/test_AIO.sample \
|
||||
src/traffic_via/test_traffic_via \
|
||||
src/traffic_logstats/tests \
|
||||
tools/check-unused-dependencies
|
||||
|
||||
substituteInPlace configure --replace '/usr/bin/file' '${file}/bin/file'
|
||||
|
||||
# TODO: remove after the following change has been released
|
||||
# https://github.com/apache/trafficserver/pull/8683
|
||||
cp ${catch2}/include/catch2/catch.hpp tests/include/catch.hpp
|
||||
'' + lib.optionalString stdenv.isLinux ''
|
||||
substituteInPlace configure \
|
||||
--replace '/usr/include/linux' '${linuxHeaders}/include/linux'
|
||||
'' + lib.optionalString stdenv.isDarwin ''
|
||||
# 'xcrun leaks' probably requires non-free XCode
|
||||
substituteInPlace iocore/net/test_certlookup.cc \
|
||||
--replace 'xcrun leaks' 'true'
|
||||
'';
|
||||
|
||||
configureFlags = [
|
||||
"--enable-layout=NixOS"
|
||||
"--enable-experimental-plugins"
|
||||
(lib.enableFeature enableWCCP "wccp")
|
||||
|
||||
# the configure script can't auto-locate the following from buildInputs
|
||||
"--with-lzma=${xz.dev}"
|
||||
"--with-zlib=${zlib.dev}"
|
||||
(lib.withFeatureAs withHiredis "hiredis" hiredis)
|
||||
];
|
||||
|
||||
installFlags = [
|
||||
"pkgsysconfdir=${placeholder "out"}/etc/trafficserver"
|
||||
|
||||
# replace runtime directories with an install-time placeholder directory
|
||||
"pkgcachedir=${placeholder "out"}/.install-trafficserver"
|
||||
"pkglocalstatedir=${placeholder "out"}/.install-trafficserver"
|
||||
"pkglogdir=${placeholder "out"}/.install-trafficserver"
|
||||
"pkgruntimedir=${placeholder "out"}/.install-trafficserver"
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
substituteInPlace rc/trafficserver.service --replace "syslog.target" ""
|
||||
install -Dm644 rc/trafficserver.service $out/lib/systemd/system/trafficserver.service
|
||||
|
||||
wrapProgram $out/bin/tspush \
|
||||
--set PERL5LIB '${with perlPackages; makePerlPath [ URI ]}' \
|
||||
--prefix PATH : "${lib.makeBinPath [ file ]}"
|
||||
|
||||
find "$out" -name '*.la' -delete
|
||||
|
||||
# ensure no files actually exist in this directory
|
||||
rmdir $out/.install-trafficserver
|
||||
'';
|
||||
|
||||
installCheckPhase = let
|
||||
expected = ''
|
||||
Via header is [uScMsEf p eC:t cCMp sF], Length is 22
|
||||
Via Header Details:
|
||||
Request headers received from client :simple request (not conditional)
|
||||
Result of Traffic Server cache lookup for URL :miss (a cache "MISS")
|
||||
Response information received from origin server :error in response
|
||||
Result of document write-to-cache: :no cache write performed
|
||||
Proxy operation result :unknown
|
||||
Error codes (if any) :connection to server failed
|
||||
Tunnel info :no tunneling
|
||||
Cache Type :cache
|
||||
Cache Lookup Result :cache miss (url not in cache)
|
||||
Parent proxy connection status :no parent proxy or unknown
|
||||
Origin server connection status :connection open failed
|
||||
'';
|
||||
in ''
|
||||
runHook preInstallCheck
|
||||
diff -Naur <($out/bin/traffic_via '[uScMsEf p eC:t cCMp sF]') - <<EOF
|
||||
${lib.removeSuffix "\n" expected}
|
||||
EOF
|
||||
runHook postInstallCheck
|
||||
'';
|
||||
|
||||
doCheck = true;
|
||||
doInstallCheck = true;
|
||||
enableParallelBuilding = true;
|
||||
|
||||
passthru.tests = { inherit (nixosTests) trafficserver; };
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://trafficserver.apache.org";
|
||||
changelog = "https://raw.githubusercontent.com/apache/trafficserver/${version}/CHANGELOG-${version}";
|
||||
description = "Fast, scalable, and extensible HTTP caching proxy server";
|
||||
longDescription = ''
|
||||
Apache Traffic Server is a high-performance web proxy cache that improves
|
||||
network efficiency and performance by caching frequently-accessed
|
||||
information at the edge of the network. This brings content physically
|
||||
closer to end users, while enabling faster delivery and reduced bandwidth
|
||||
use. Traffic Server is designed to improve content delivery for
|
||||
enterprises, Internet service providers (ISPs), backbone providers, and
|
||||
large intranets by maximizing existing and available bandwidth.
|
||||
'';
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ midchildan ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
diff --git a/src/tscore/unit_tests/test_History.cc b/src/tscore/unit_tests/test_History.cc
|
||||
index 3e699139da0..7505f10aa4c 100644
|
||||
--- a/src/tscore/unit_tests/test_History.cc
|
||||
+++ b/src/tscore/unit_tests/test_History.cc
|
||||
@@ -59,10 +59,10 @@ TEST_CASE("History", "[libts][History]")
|
||||
REQUIRE(history[2].reentrancy == static_cast<short>(NO_REENTRANT));
|
||||
|
||||
history[0].location.str(buf, sizeof(buf));
|
||||
- REQUIRE(string_view{buf} == "test_History.cc:48 (____C_A_T_C_H____T_E_S_T____0)");
|
||||
+ REQUIRE(string_view{buf} == "test_History.cc:48 (C_A_T_C_H_T_E_S_T_0)");
|
||||
|
||||
history[1].location.str(buf, sizeof(buf));
|
||||
- REQUIRE(string_view{buf} == "test_History.cc:49 (____C_A_T_C_H____T_E_S_T____0)");
|
||||
+ REQUIRE(string_view{buf} == "test_History.cc:49 (C_A_T_C_H_T_E_S_T_0)");
|
||||
|
||||
ts::LocalBufferWriter<128> w;
|
||||
SM<HISTORY_DEFAULT_SIZE> *sm = new SM<HISTORY_DEFAULT_SIZE>;
|
||||
@@ -71,10 +71,10 @@ TEST_CASE("History", "[libts][History]")
|
||||
SM_REMEMBER(sm, 3, NO_REENTRANT);
|
||||
|
||||
w.print("{}", sm->history[0].location);
|
||||
- REQUIRE(w.view() == "test_History.cc:69 (____C_A_T_C_H____T_E_S_T____0)");
|
||||
+ REQUIRE(w.view() == "test_History.cc:69 (C_A_T_C_H_T_E_S_T_0)");
|
||||
|
||||
w.reset().print("{}", sm->history[1].location);
|
||||
- REQUIRE(w.view() == "test_History.cc:70 (____C_A_T_C_H____T_E_S_T____0)");
|
||||
+ REQUIRE(w.view() == "test_History.cc:70 (C_A_T_C_H_T_E_S_T_0)");
|
||||
|
||||
REQUIRE(sm->history[0].event == 1);
|
||||
REQUIRE(sm->history[0].reentrancy == 1);
|
||||
@@ -106,10 +106,10 @@ TEST_CASE("History", "[libts][History]")
|
||||
REQUIRE(sm2->history.overflowed() == true);
|
||||
|
||||
w.reset().print("{}", sm2->history[0].location);
|
||||
- REQUIRE(w.view() == "test_History.cc:103 (____C_A_T_C_H____T_E_S_T____0)");
|
||||
+ REQUIRE(w.view() == "test_History.cc:103 (C_A_T_C_H_T_E_S_T_0)");
|
||||
|
||||
w.reset().print("{}", sm2->history[1].location);
|
||||
- REQUIRE(w.view() == "test_History.cc:98 (____C_A_T_C_H____T_E_S_T____0)");
|
||||
+ REQUIRE(w.view() == "test_History.cc:98 (C_A_T_C_H_T_E_S_T_0)");
|
||||
|
||||
sm2->history.clear();
|
||||
REQUIRE(sm2->history.size() == 0);
|
||||
Loading…
Add table
Add a link
Reference in a new issue