audit: 3.1.2 -> 4.0

This commit is contained in:
isabel roses 2024-08-17 17:38:33 +01:00
parent 9bc38abb64
commit b8af538578
Signed by: isabelroses
GPG key ID: 08A97B9A107A1798

View file

@ -1,55 +1,69 @@
{ lib {
, stdenv lib,
, fetchurl stdenv,
, fetchpatch fetchurl,
, autoreconfHook fetchpatch,
, bash autoreconfHook,
, buildPackages bash,
, libtool buildPackages,
, linuxHeaders linuxHeaders,
, python3 python3,
, swig swig,
pkgsCross,
# Enabling python support while cross compiling would be possible, but the # Enabling python support while cross compiling would be possible, but the
# configure script tries executing python to gather info instead of relying on # configure script tries executing python to gather info instead of relying on
# python3-config exclusively # python3-config exclusively
, enablePython ? stdenv.hostPlatform == stdenv.buildPlatform, enablePython ? stdenv.hostPlatform == stdenv.buildPlatform,
}: }:
stdenv.mkDerivation (finalAttrs: { stdenv.mkDerivation (finalAttrs: {
pname = "audit"; pname = "audit";
version = "3.1.2"; version = "4.0";
src = fetchurl { src = fetchurl {
url = "https://people.redhat.com/sgrubb/audit/audit-${finalAttrs.version}.tar.gz"; url = "https://people.redhat.com/sgrubb/audit/audit-${finalAttrs.version}.tar.gz";
hash = "sha256-wLF5LR8KiMbxgocQUJy7mHBZ/GhxLJdmnKkOrhA9KH0="; hash = "sha256-v0ItQSard6kqTDrDneVHPyeNw941ck0lGKSMe+FdVNg=";
}; };
patches = [
(fetchpatch {
name = "musl.patch";
url = "https://github.com/linux-audit/audit-userspace/commit/64cb48e1e5137b8a389c7528e611617a98389bc7.patch";
hash = "sha256-DN2F5w+2Llm80FZntH9dvdyT00pVBSgRu8DDFILyrlU=";
})
(fetchpatch {
name = "musl.patch";
url = "https://github.com/linux-audit/audit-userspace/commit/4192eb960388458c85d76e5e385cfeef48f02c79.patch";
hash = "sha256-G6CJ9nBJSsTyJ0qq14PVo+YdInAvLLQtXcR25Q8V5/4=";
})
];
postPatch = '' postPatch = ''
substituteInPlace bindings/swig/src/auditswig.i \ substituteInPlace bindings/swig/src/auditswig.i \
--replace "/usr/include/linux/audit.h" \ --replace-fail "/usr/include/linux/audit.h" \
"${linuxHeaders}/include/linux/audit.h" "${linuxHeaders}/include/linux/audit.h"
''; '';
outputs = [ "bin" "dev" "out" "man" ]; outputs = [
"bin"
"dev"
"out"
"man"
];
strictDeps = true; strictDeps = true;
depsBuildBuild = [ depsBuildBuild = [ buildPackages.stdenv.cc ];
buildPackages.stdenv.cc
];
nativeBuildInputs = [ nativeBuildInputs =
autoreconfHook [ autoreconfHook ]
]
++ lib.optionals enablePython [ ++ lib.optionals enablePython [
python3 python3
swig swig
]; ];
buildInputs = [ buildInputs = [ bash ];
bash
];
configureFlags = [ configureFlags = [
# z/OS plugin is not useful on Linux, and pulls in an extra openldap # z/OS plugin is not useful on Linux, and pulls in an extra openldap
@ -62,6 +76,10 @@ stdenv.mkDerivation (finalAttrs: {
enableParallelBuilding = true; enableParallelBuilding = true;
passthru.tests = {
musl = pkgsCross.musl64.audit;
};
meta = { meta = {
homepage = "https://people.redhat.com/sgrubb/audit/"; homepage = "https://people.redhat.com/sgrubb/audit/";
description = "Audit Library"; description = "Audit Library";