Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 37 additions & 3 deletions pkgs/by-name/au/audit/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
autoreconfHook,
bash,
buildPackages,
linuxHeaders,
python3,
swig,
pkgsCross,
libcap_ng,

# 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,
nix-update-script,
testers,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "audit";
Expand All @@ -26,6 +30,24 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-SgMt1MmcH7r7O6bmJCetRg3IdoZXAXjVJyeu0HRfyf8=";
};

patches = [
# nix configures most stuff by symlinks, e.g. in /etc
# thus, for plugins to be picked up, symlinks must be allowed
# https://github.com/linux-audit/audit-userspace/pull/467
(fetchpatch {
url = "https://github.com/linux-audit/audit-userspace/pull/467/commits/dbefc642b3bd0cafe599fcd18c6c88cb672397ee.patch?full_index=1";
hash = "sha256-Ksn/qKBQYFAjvs1OVuWhgWCdf4Bdp9/a+MrhyJAT+Bw=";
})
(fetchpatch {
url = "https://github.com/linux-audit/audit-userspace/pull/467/commits/50094f56fefc0b9033ef65e8c4f108ed52ef5de5.patch?full_index=1";
hash = "sha256-CJKDLdlpsCd+bG6j5agcnxY1+vMCImHwHGN6BXURa4c=";
})
(fetchpatch {
url = "https://github.com/linux-audit/audit-userspace/pull/467/commits/5e75091abd297807b71b3cfe54345c2ef223939a.patch?full_index=1";
hash = "sha256-LPpO4PH/3MyCJq2xhmhhcnFeK3yh7LK6Mjypuvhacu4=";
})
];

postPatch = ''
substituteInPlace bindings/swig/src/auditswig.i \
--replace-fail "/usr/include/linux/audit.h" \
Expand Down Expand Up @@ -57,6 +79,7 @@ stdenv.mkDerivation (finalAttrs: {

buildInputs = [
bash
libcap_ng
];

configureFlags = [
Expand All @@ -65,21 +88,32 @@ stdenv.mkDerivation (finalAttrs: {
"--disable-zos-remote"
"--with-arm"
"--with-aarch64"
# capability dropping, currently mostly for plugins as those get spawned as root
# see auditd-plugins(5)
"--with-libcap-ng=yes"
(if enablePython then "--with-python" else "--without-python")
];

enableParallelBuilding = true;

passthru.tests = {
musl = pkgsCross.musl64.audit;
passthru = {
updateScript = nix-update-script { };
tests = {
musl = pkgsCross.musl64.audit;
pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
};
};

meta = {
homepage = "https://people.redhat.com/sgrubb/audit/";
description = "Audit Library";
changelog = "https://github.com/linux-audit/audit-userspace/releases/tag/v${finalAttrs.version}";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ ];
maintainers = with lib.maintainers; [ grimmauld ];
pkgConfigModules = [
"audit"
"auparse"
];
platforms = lib.platforms.linux;
};
})