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
+7 -5
View File
@@ -13,10 +13,8 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
use fs_extra::dir::{copy, CopyOptions};
fn main() {
include!("../build_freebsd.rs");
include!("../build_common.rs");
if std::env::var("CARGO_CFG_TARGET_OS").unwrap() == "windows" {
let libdir = std::env::var("SPARSE_BUILD_WINPCAP_LIBS").unwrap();
@@ -27,8 +25,12 @@ fn main() {
let libdir = std::env::var("SPARSE_BUILD_LIBPCAP_FREEBSD").unwrap();
println!("cargo:rustc-link-search=native={libdir}/lib");
println!("cargo:rustc-link-lib=static=pcap");
} else {
let libdir = std::env::var("SPARSE_BUILD_LIBPCAP_LINUX").unwrap();
} else if std::env::var("CARGO_CFG_TARGET_ENV").unwrap() == "musl" {
let libdir = std::env::var("SPARSE_BUILD_LIBPCAP_LINUX_MUSL").unwrap();
println!("cargo:rustc-link-search=native={libdir}/lib");
println!("cargo:rustc-link-lib=static=pcap");
} else if std::env::var("CARGO_CFG_TARGET_ENV").unwrap() == "gnu" {
let libdir = std::env::var("SPARSE_BUILD_LIBPCAP_LINUX_GNU").unwrap();
println!("cargo:rustc-link-search=native={libdir}/lib");
println!("cargo:rustc-link-lib=static=pcap");
}