dhcpcd: add support for FreeBSD

This commit is contained in:
Artemis Tosini 2024-06-06 22:34:54 -07:00 committed by Audrey Dutcher
parent 2542605888
commit 9fe8517bdb

View File

@ -3,6 +3,7 @@
, fetchFromGitHub
, pkg-config
, udev
, freebsd
, runtimeShellPackage
, runtimeShell
, nixosTests
@ -22,8 +23,12 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkg-config ];
buildInputs = [
udev
runtimeShellPackage # So patchShebangs finds a bash suitable for the installed scripts
] ++ lib.optionals stdenv.isLinux [
udev
] ++ lib.optionals stdenv.isFreeBSD [
freebsd.libcapsicum
freebsd.libcasper
];
postPatch = ''
@ -52,7 +57,7 @@ stdenv.mkDerivation rec {
installFlags = [ "DBDIR=$(TMPDIR)/db" "SYSCONFDIR=${placeholder "out"}/etc" ];
# Check that the udev plugin got built.
postInstall = lib.optionalString (udev != null) "[ -e ${placeholder "out"}/lib/dhcpcd/dev/udev.so ]";
postInstall = lib.optionalString (udev != null && stdenv.isLinux) "[ -e ${placeholder "out"}/lib/dhcpcd/dev/udev.so ]";
passthru = {
inherit enablePrivSep;
@ -62,7 +67,7 @@ stdenv.mkDerivation rec {
meta = with lib; {
description = "A client for the Dynamic Host Configuration Protocol (DHCP)";
homepage = "https://roy.marples.name/projects/dhcpcd";
platforms = platforms.linux;
platforms = platforms.linux ++ platforms.freebsd;
license = licenses.bsd2;
maintainers = with maintainers; [ eelco ];
mainProgram = "dhcpcd";