2021-06-08 20:33:35 +01:00
|
|
|
|
{ lib
|
|
|
|
|
, stdenv
|
|
|
|
|
, fetchFromGitHub
|
2022-09-20 23:25:24 +01:00
|
|
|
|
, fetchpatch
|
2021-12-22 21:41:46 +00:00
|
|
|
|
|
|
|
|
|
# build time
|
2021-06-08 20:33:35 +01:00
|
|
|
|
, autoreconfHook
|
2021-12-22 21:41:46 +00:00
|
|
|
|
, flex
|
|
|
|
|
, bison
|
2021-06-08 20:33:35 +01:00
|
|
|
|
, perl
|
|
|
|
|
, pkg-config
|
2021-12-22 21:41:46 +00:00
|
|
|
|
, texinfo
|
|
|
|
|
|
|
|
|
|
# runtime
|
2021-06-08 20:33:35 +01:00
|
|
|
|
, c-ares
|
2021-12-22 21:41:46 +00:00
|
|
|
|
, json_c
|
|
|
|
|
, libcap
|
|
|
|
|
, libelf
|
|
|
|
|
, libunwind
|
2021-06-08 20:33:35 +01:00
|
|
|
|
, libyang
|
2021-12-22 21:41:46 +00:00
|
|
|
|
, net-snmp
|
2021-06-08 20:33:35 +01:00
|
|
|
|
, openssl
|
2021-12-22 21:41:46 +00:00
|
|
|
|
, pam
|
|
|
|
|
, pcre2
|
|
|
|
|
, python3
|
|
|
|
|
, readline
|
2022-05-09 03:27:22 +01:00
|
|
|
|
, rtrlib
|
2021-12-22 21:41:46 +00:00
|
|
|
|
|
|
|
|
|
# tests
|
|
|
|
|
, nettools
|
2021-06-08 20:33:35 +01:00
|
|
|
|
, nixosTests
|
|
|
|
|
}:
|
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
pname = "frr";
|
2022-09-03 11:58:53 +01:00
|
|
|
|
version = "8.3.1";
|
2021-06-08 20:33:35 +01:00
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "FRRouting";
|
|
|
|
|
repo = pname;
|
|
|
|
|
rev = "${pname}-${version}";
|
2022-09-03 11:58:53 +01:00
|
|
|
|
hash = "sha256-+M4xTdjCp5TJh0U8ZfUmw84Y7O0TZ9mmUXhh2J/QOE0=";
|
2021-06-08 20:33:35 +01:00
|
|
|
|
};
|
|
|
|
|
|
2022-09-20 23:25:24 +01:00
|
|
|
|
patches = [
|
|
|
|
|
(fetchpatch {
|
|
|
|
|
name = "CVE-2022-37032.patch";
|
|
|
|
|
url = "https://github.com/FRRouting/frr/commit/ff6db1027f8f36df657ff2e5ea167773752537ed.patch";
|
|
|
|
|
sha256 = "sha256-b3nT6xco620hMSqlj/nTWTJCegf3ARAGaQbii4Yq6Ag=";
|
|
|
|
|
})
|
|
|
|
|
];
|
|
|
|
|
|
2021-12-22 21:41:46 +00:00
|
|
|
|
nativeBuildInputs = [
|
|
|
|
|
autoreconfHook
|
|
|
|
|
bison
|
|
|
|
|
flex
|
|
|
|
|
perl
|
|
|
|
|
pkg-config
|
2022-05-15 14:50:30 +01:00
|
|
|
|
python3.pkgs.sphinx
|
2021-12-22 21:41:46 +00:00
|
|
|
|
texinfo
|
|
|
|
|
];
|
2021-06-08 20:33:35 +01:00
|
|
|
|
|
2021-12-22 21:41:46 +00:00
|
|
|
|
buildInputs = [
|
|
|
|
|
c-ares
|
|
|
|
|
json_c
|
|
|
|
|
libelf
|
|
|
|
|
libunwind
|
|
|
|
|
libyang
|
|
|
|
|
net-snmp
|
|
|
|
|
openssl
|
|
|
|
|
pam
|
|
|
|
|
pcre2
|
|
|
|
|
python3
|
|
|
|
|
readline
|
2022-05-09 03:27:22 +01:00
|
|
|
|
rtrlib
|
2021-12-22 21:41:46 +00:00
|
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
|
libcap
|
|
|
|
|
];
|
2021-06-08 20:33:35 +01:00
|
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
|
"--disable-exampledir"
|
|
|
|
|
"--enable-configfile-mask=0640"
|
2022-05-15 14:50:30 +01:00
|
|
|
|
"--enable-group=frr"
|
2021-06-08 20:33:35 +01:00
|
|
|
|
"--enable-logfile-mask=0640"
|
|
|
|
|
"--enable-multipath=64"
|
2022-05-15 14:50:30 +01:00
|
|
|
|
"--enable-snmp"
|
|
|
|
|
"--enable-user=frr"
|
|
|
|
|
"--enable-vty-group=frrvty"
|
|
|
|
|
"--localstatedir=/run/frr"
|
|
|
|
|
"--sbindir=$(out)/libexec/frr"
|
|
|
|
|
"--sysconfdir=/etc/frr"
|
2022-05-09 03:27:22 +01:00
|
|
|
|
"--enable-rpki"
|
2021-06-08 20:33:35 +01:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
postPatch = ''
|
2022-05-15 14:50:30 +01:00
|
|
|
|
substituteInPlace tools/frr-reload \
|
|
|
|
|
--replace /usr/lib/frr/ $out/libexec/frr/
|
2021-06-08 20:33:35 +01:00
|
|
|
|
'';
|
|
|
|
|
|
2021-12-22 21:41:46 +00:00
|
|
|
|
doCheck = true;
|
2022-05-15 14:50:30 +01:00
|
|
|
|
|
2021-12-22 21:41:46 +00:00
|
|
|
|
checkInputs = [
|
|
|
|
|
nettools
|
2022-05-15 14:50:30 +01:00
|
|
|
|
python3.pkgs.pytest
|
2021-12-22 21:41:46 +00:00
|
|
|
|
];
|
|
|
|
|
|
2021-06-08 20:33:35 +01:00
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
|
|
meta = with lib; {
|
2022-05-15 14:50:30 +01:00
|
|
|
|
homepage = "https://frrouting.org/";
|
2021-06-08 20:33:35 +01:00
|
|
|
|
description = "FRR BGP/OSPF/ISIS/RIP/RIPNG routing daemon suite";
|
|
|
|
|
longDescription = ''
|
|
|
|
|
FRRouting (FRR) is a free and open source Internet routing protocol suite
|
|
|
|
|
for Linux and Unix platforms. It implements BGP, OSPF, RIP, IS-IS, PIM,
|
|
|
|
|
LDP, BFD, Babel, PBR, OpenFabric and VRRP, with alpha support for EIGRP
|
|
|
|
|
and NHRP.
|
|
|
|
|
|
|
|
|
|
FRR’s seamless integration with native Linux/Unix IP networking stacks
|
|
|
|
|
makes it a general purpose routing stack applicable to a wide variety of
|
|
|
|
|
use cases including connecting hosts/VMs/containers to the network,
|
|
|
|
|
advertising network services, LAN switching and routing, Internet access
|
|
|
|
|
routers, and Internet peering.
|
|
|
|
|
|
|
|
|
|
FRR has its roots in the Quagga project. In fact, it was started by many
|
|
|
|
|
long-time Quagga developers who combined their efforts to improve on
|
|
|
|
|
Quagga’s well-established foundation in order to create the best routing
|
|
|
|
|
protocol stack available. We invite you to participate in the FRRouting
|
|
|
|
|
community and help shape the future of networking.
|
|
|
|
|
|
|
|
|
|
Join the ranks of network architects using FRR for ISPs, SaaS
|
|
|
|
|
infrastructure, web 2.0 businesses, hyperscale services, and Fortune 500
|
|
|
|
|
private clouds.
|
|
|
|
|
'';
|
|
|
|
|
license = with licenses; [ gpl2Plus lgpl21Plus ];
|
|
|
|
|
maintainers = with maintainers; [ woffs ];
|
2022-05-15 14:50:30 +01:00
|
|
|
|
platforms = platforms.unix;
|
2021-06-08 20:33:35 +01:00
|
|
|
|
};
|
2022-05-15 14:50:30 +01:00
|
|
|
|
|
|
|
|
|
passthru.tests = { inherit (nixosTests) frr; };
|
2021-06-08 20:33:35 +01:00
|
|
|
|
}
|