feat: fixed pcap linking and added nix packages

This commit is contained in:
Andrew Rioux
2025-01-20 20:39:26 -05:00
parent ad8cad56e7
commit af2e832762
23 changed files with 1220 additions and 81 deletions
+37 -2
View File
@@ -9,6 +9,7 @@ let
mkdir -p $out
tar xvJpf ${freebsd-libs-packed} -C $out ./usr/lib
tar xvJpf ${freebsd-libs-packed} -C $out ./usr/include
tar xvJpf ${freebsd-libs-packed} -C $out ./lib
'';
};
@@ -80,8 +81,42 @@ in {
'';
};
libpcap-linux = pkgs.stdenv.mkDerivation {
name = "libpcap-static-linux";
libpcap-linux-gnu = pkgs.stdenv.mkDerivation {
name = "libpcap-static-linux-gnu";
buildInputs = with pkgs; [ clang automake bison cmake flex glibc.static ];
src = libpcap-src;
configurePhase = ''
cmake \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DBUILD_SHARED_LIBS=OFF \
-DDISABLE_BLUETOOTH=ON \
-DDISABLE_DAG=ON \
-DDISABLE_DBUS=ON \
-DDISABLE_DPDK=ON \
-DDISABLE_NETMAP=ON \
-DDISABLE_RDMA=ON \
-DDISABLE_LINUX_USBMON=ON \
-DDISABLE_SNF=ON \
-DPCAP_TYPE=linux \
.
'';
buildPhase = ''
cmake --build . --target pcap_static
'';
installPhase = ''
mkdir -p $out/lib
cp libpcap.a $out/lib
'';
};
libpcap-linux-musl = pkgs.stdenv.mkDerivation {
name = "libpcap-static-linux-musl";
buildInputs = with pkgs; [ clang automake bison cmake flex musl ];