Merge pull request #318187 from rhelmot/freebsd-dhcpcd

dhcpcd: add support for FreeBSD
This commit is contained in:
kirillrdy 2024-06-09 08:32:20 +00:00 committed by GitHub
commit 31b089e277
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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";