1 { lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, m4, bison }:
5 "OPENBSD_6_8"; # This has to be equal to ${src}/OPENBSD_BRANCH
6 openbsd = fetchFromGitHub {
8 owner = "openbgpd-portable";
9 repo = "openbgpd-openbsd";
10 rev = openbsd_version;
11 sha256 = "sha256-vCVK5k4g6aW2z2fg7Kv0uvkX7f34aRc8K2myb3jjl6w=";
13 in stdenv.mkDerivation rec {
17 src = fetchFromGitHub {
18 owner = "openbgpd-portable";
19 repo = "openbgpd-portable";
21 sha256 = "sha256-TKs6tt/SCWes6kYAGIrSShZgOLf7xKh26xG3Zk7wCCw=";
24 nativeBuildInputs = [ autoconf automake libtool m4 bison ];
28 cp -r ${openbsd}/* ./openbsd/
30 openbsd_version=$(cat ./OPENBSD_BRANCH)
31 if [ "$openbsd_version" != "${openbsd_version}" ]; then
32 echo "OPENBSD VERSION does not match"
38 # Workaround build failure on -fno-common toolchains like upstream
39 # gcc-10. Otherwise build fails as:
40 # ld: bgpd-rde_peer.o:/build/source/src/bgpd/bgpd.h:133: multiple definition of `bgpd_process';
41 # bgpd-bgpd.o:/build/source/src/bgpd/bgpd.h:133: first defined here
42 env.NIX_CFLAGS_COMPILE = "-fcommon";
46 "A free implementation of the Border Gateway Protocol, Version 4. It allows ordinary machines to be used as routers exchanging routes with other systems speaking the BGP protocol";
47 license = licenses.isc;
48 homepage = "http://www.openbgpd.org/";
49 maintainers = with maintainers; [ kloenk ];
50 platforms = platforms.linux;