nixpkgs/pkgs/os-specific/linux/audit/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

80 lines
1.9 KiB
Nix
Raw Normal View History

2023-05-20 23:44:20 +00:00
{ lib
, stdenv
, fetchurl
, fetchpatch
, autoreconfHook
, bash
, buildPackages
, libtool
, linuxHeaders
, python3
, swig
# Enabling python support while cross compiling would be possible, but the
# configure script tries executing python to gather info instead of relying on
# python3-config exclusively
, enablePython ? stdenv.hostPlatform == stdenv.buildPlatform,
}:
2023-05-20 23:44:20 +00:00
stdenv.mkDerivation (finalAttrs: {
pname = "audit";
2023-05-20 23:44:20 +00:00
version = "3.1.1";
src = fetchurl {
2023-05-20 23:44:20 +00:00
url = "https://people.redhat.com/sgrubb/audit/audit-${finalAttrs.version}.tar.gz";
hash = "sha256-RuRrN2I8zgnm7hNOeNZor8NPThyHDIU+8S5BkweM/oc=";
};
2023-05-20 23:44:20 +00:00
patches = [
./000-fix-static-attribute-malloc.diff
./001-ignore-flexible-array.patch
];
postPatch = ''
sed -i 's,#include <sys/poll.h>,#include <poll.h>\n#include <limits.h>,' audisp/audispd.c
substituteInPlace bindings/swig/src/auditswig.i \
--replace "/usr/include/linux/audit.h" \
"${linuxHeaders}/include/linux/audit.h"
'';
outputs = [ "bin" "dev" "out" "man" ];
2016-08-20 22:55:21 +00:00
strictDeps = true;
2023-05-20 23:44:20 +00:00
depsBuildBuild = [
buildPackages.stdenv.cc
];
nativeBuildInputs = [
autoreconfHook
]
++ lib.optionals enablePython [
python3
swig
];
buildInputs = [
bash
];
configureFlags = [
2023-05-20 23:44:20 +00:00
# z/OS plugin is not useful on Linux, and pulls in an extra openldap
# dependency otherwise
"--disable-zos-remote"
"--with-arm"
"--with-aarch64"
2023-05-20 23:44:20 +00:00
(if enablePython then "--with-python" else "--without-python")
];
enableParallelBuilding = true;
2017-04-17 02:10:39 +00:00
meta = {
homepage = "https://people.redhat.com/sgrubb/audit/";
2023-05-20 23:44:20 +00:00
description = "Audit Library";
changelog = "https://github.com/linux-audit/audit-userspace/releases/tag/v${finalAttrs.version}";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ AndersonTorres ];
2021-01-15 14:45:37 +00:00
platforms = lib.platforms.linux;
};
2023-05-20 23:44:20 +00:00
})