···3636 # TODO: Remove the musl patches when
3737 # https://github.com/linux-audit/audit-userspace/pull/25
3838 # is available with the next release.
3939- patches = stdenv.lib.optional stdenv.hostPlatform.isMusl [
3939+ patches = [ ./patches/weak-symbols.patch ] ++
4040+ stdenv.lib.optional stdenv.hostPlatform.isMusl [
4041 (
4142 let patch = fetchpatch {
4243 url = "https://github.com/linux-audit/audit-userspace/commit/d579a08bb1cde71f939c13ac6b2261052ae9f77e.patch";
···55565657 prePatch = ''
5758 sed -i 's,#include <sys/poll.h>,#include <poll.h>\n#include <limits.h>,' audisp/audispd.c
5959+ ''
6060+ # According to https://stackoverflow.com/questions/13089166
6161+ # --whole-archive linker flag is required to be sure that linker
6262+ # correctly chooses strong version of symbol regardless of order of
6363+ # object files at command line.
6464+ + stdenv.lib.optionalString stdenv.targetPlatform.isStatic ''
6565+ export LDFLAGS=-Wl,--whole-archive
5866 '';
5967 meta = {
6068 description = "Audit Library";