2023-08-04 22:07:22 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2024-02-07 01:22:34 +00:00
|
|
|
, fetchpatch
|
2023-08-04 22:07:22 +00:00
|
|
|
, cmake
|
|
|
|
, openssl
|
2023-11-16 04:20:00 +00:00
|
|
|
, protobuf_21
|
2023-08-04 22:07:22 +00:00
|
|
|
, catch2
|
|
|
|
, boost181
|
|
|
|
, icu
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
boost = boost181.override { enableStatic = true; };
|
2023-11-16 04:20:00 +00:00
|
|
|
protobuf = protobuf_21.override { enableShared = false; };
|
2023-08-04 22:07:22 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
|
|
pname = "localproxy";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "3.1.1";
|
2023-08-04 22:07:22 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "aws-samples";
|
|
|
|
repo = "aws-iot-securetunneling-localproxy";
|
|
|
|
rev = "v${finalAttrs.version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-voUKfXa43mOltePQEXgmJ2EBaN06E6R/2Zz6O09ogyY=";
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
2023-08-04 22:07:22 +00:00
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
patches = [
|
|
|
|
# gcc-13 compatibility fix:
|
|
|
|
# https://github.com/aws-samples/aws-iot-securetunneling-localproxy/pull/136
|
|
|
|
(fetchpatch {
|
|
|
|
name = "gcc-13-part-1.patch";
|
|
|
|
url = "https://github.com/aws-samples/aws-iot-securetunneling-localproxy/commit/f6ba73eaede61841534623cdb01b69d793124f4b.patch";
|
|
|
|
hash = "sha256-sB9GuEuHLyj6DXNPuYAMibUJXdkThKbS/fxvnJU3rS4=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "gcc-13-part-2.patch";
|
|
|
|
url = "https://github.com/aws-samples/aws-iot-securetunneling-localproxy/commit/de8779630d14e4f4969c9b171d826acfa847822b.patch";
|
|
|
|
hash = "sha256-11k6mRvCx72+5G/5LZZx2qnx10yfKpcAZofn8t8BD3E=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
buildInputs = [ openssl protobuf catch2 boost icu ];
|
2023-08-04 22:07:22 +00:00
|
|
|
|
|
|
|
# causes redefinition of _FORTIFY_SOURCE
|
|
|
|
hardeningDisable = [ "fortify3" ];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "AWS IoT Secure Tunneling Local Proxy Reference Implementation C++";
|
|
|
|
homepage = "https://github.com/aws-samples/aws-iot-securetunneling-localproxy";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ spalf ];
|
|
|
|
platforms = platforms.unix;
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "localproxy";
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
})
|