libselinux: fix build with musl (#119472)

Co-authored-by: Kasper Gałkowski <kpg@posteo.net>
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
This commit is contained in:
Kasper 2021-04-15 23:18:51 +02:00 committed by GitHub
parent 38c8ae9bbe
commit fc141a889d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -44,6 +44,11 @@ stdenv.mkDerivation rec {
"PYTHONLIBDIR=$(py)/${python3.sitePackages}"
];
postPatch = lib.optionalString stdenv.hostPlatform.isMusl ''
substituteInPlace src/procattr.c \
--replace "#include <unistd.h>" ""
'';
preInstall = optionalString enablePython ''
mkdir -p $py/${python3.sitePackages}/selinux
'';