2017-08-21 02:40:43 +02:00
|
|
|
{
|
2021-01-15 15:45:37 +01:00
|
|
|
lib, stdenv, buildPackages, fetchurl, fetchpatch,
|
2019-05-16 02:07:36 +02:00
|
|
|
runCommand,
|
|
|
|
autoconf, automake, libtool,
|
2017-08-21 02:40:43 +02:00
|
|
|
enablePython ? false, python ? null,
|
2013-11-28 10:09:28 +01:00
|
|
|
}:
|
|
|
|
|
2015-06-01 21:35:08 +02:00
|
|
|
assert enablePython -> python != null;
|
2013-11-28 10:09:28 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-05-16 02:07:36 +02:00
|
|
|
name = "audit-2.8.5"; # at the next release, remove the patches below!
|
2013-11-28 10:09:28 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-06-28 20:43:35 +02:00
|
|
|
url = "https://people.redhat.com/sgrubb/audit/${name}.tar.gz";
|
2019-03-21 06:32:51 +01:00
|
|
|
sha256 = "1dzcwb2q78q7x41shcachn7f4aksxbxd470yk38zh03fch1l2p8f";
|
2013-11-28 10:09:28 +01:00
|
|
|
};
|
|
|
|
|
2017-08-21 02:40:43 +02:00
|
|
|
outputs = [ "bin" "dev" "out" "man" ];
|
2016-08-21 00:55:21 +02:00
|
|
|
|
2019-06-09 15:59:13 +02:00
|
|
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
2021-01-15 15:45:37 +01:00
|
|
|
nativeBuildInputs = lib.optionals stdenv.hostPlatform.isMusl
|
2019-06-09 15:59:13 +02:00
|
|
|
[ autoconf automake libtool ];
|
2021-01-15 15:45:37 +01:00
|
|
|
buildInputs = lib.optional enablePython python;
|
2013-11-28 10:09:28 +01:00
|
|
|
|
2017-08-21 02:40:43 +02:00
|
|
|
configureFlags = [
|
|
|
|
# z/OS plugin is not useful on Linux,
|
|
|
|
# and pulls in an extra openldap dependency otherwise
|
|
|
|
"--disable-zos-remote"
|
|
|
|
(if enablePython then "--with-python" else "--without-python")
|
2019-03-25 09:14:16 +01:00
|
|
|
"--with-arm"
|
|
|
|
"--with-aarch64"
|
2017-08-21 02:40:43 +02:00
|
|
|
];
|
2013-11-28 10:09:28 +01:00
|
|
|
|
2016-09-05 14:37:43 +02:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2019-05-16 02:07:36 +02:00
|
|
|
# TODO: Remove the musl patches when
|
|
|
|
# https://github.com/linux-audit/audit-userspace/pull/25
|
|
|
|
# is available with the next release.
|
2021-01-15 15:45:37 +01:00
|
|
|
patches = lib.optional stdenv.hostPlatform.isMusl [
|
2019-05-16 02:07:36 +02:00
|
|
|
(
|
|
|
|
let patch = fetchpatch {
|
|
|
|
url = "https://github.com/linux-audit/audit-userspace/commit/d579a08bb1cde71f939c13ac6b2261052ae9f77e.patch";
|
|
|
|
name = "Add-substitue-functions-for-strndupa-rawmemchr.patch";
|
|
|
|
sha256 = "015bvzflg1s1k5viap30nznlpjj44a66khyc8yq0waa68qwvdlsd";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
runCommand "Add-substitue-functions-for-strndupa-rawmemchr.patch-fix-copyright-merge-conflict" {} ''
|
|
|
|
cp ${patch} $out
|
|
|
|
substituteInPlace $out --replace \
|
|
|
|
'-* Copyright (c) 2007-09,2011-16,2018 Red Hat Inc., Durham, North Carolina.' \
|
|
|
|
'-* Copyright (c) 2007-09,2011-16 Red Hat Inc., Durham, North Carolina.'
|
|
|
|
''
|
|
|
|
)
|
2017-04-17 04:10:39 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
prePatch = ''
|
|
|
|
sed -i 's,#include <sys/poll.h>,#include <poll.h>\n#include <limits.h>,' audisp/audispd.c
|
|
|
|
'';
|
2013-11-28 10:09:28 +01:00
|
|
|
meta = {
|
|
|
|
description = "Audit Library";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://people.redhat.com/sgrubb/audit/";
|
2021-01-15 15:45:37 +01:00
|
|
|
license = lib.licenses.gpl2;
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
maintainers = with lib.maintainers; [ ];
|
2013-11-28 10:09:28 +01:00
|
|
|
};
|
|
|
|
}
|