Unverified Commit bde4bc11 authored by Audrey Dutcher's avatar Audrey Dutcher Committed by GitHub
Browse files

basu: fix build for FreeBSD (#492499)

parents 784d01b6 575f11cc
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -29,9 +29,8 @@ stdenv.mkDerivation (finalAttrs: {
    "lib"
  ];

  buildInputs = [
  buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
    audit
    gperf
    libcap
  ];

@@ -41,8 +40,18 @@ stdenv.mkDerivation (finalAttrs: {
    ninja
    python3
    getent
    gperf
  ];

  mesonFlags = lib.optionals (!stdenv.hostPlatform.isLinux) [
    "-Daudit=disabled"
    "-Dlibcap=disabled"
  ];

  env = lib.optionalAttrs stdenv.hostPlatform.useLLVM {
    NIX_LDFLAGS = "--undefined-version";
  };

  preConfigure = ''
    pushd src/basic
    patchShebangs \
@@ -56,6 +65,6 @@ stdenv.mkDerivation (finalAttrs: {
    mainProgram = "basuctl";
    license = lib.licenses.lgpl21Only;
    maintainers = [ ];
    platforms = lib.platforms.linux;
    platforms = lib.platforms.linux ++ lib.platforms.freebsd;
  };
})