···36 # TODO: Remove the musl patches when
37 # https://github.com/linux-audit/audit-userspace/pull/25
38 # is available with the next release.
39- patches = stdenv.lib.optional stdenv.hostPlatform.isMusl [
040 (
41 let patch = fetchpatch {
42 url = "https://github.com/linux-audit/audit-userspace/commit/d579a08bb1cde71f939c13ac6b2261052ae9f77e.patch";
···5556 prePatch = ''
57 sed -i 's,#include <sys/poll.h>,#include <poll.h>\n#include <limits.h>,' audisp/audispd.c
000000058 '';
59 meta = {
60 description = "Audit Library";
···36 # TODO: Remove the musl patches when
37 # https://github.com/linux-audit/audit-userspace/pull/25
38 # is available with the next release.
39+ patches = [ ./patches/weak-symbols.patch ] ++
40+ stdenv.lib.optional stdenv.hostPlatform.isMusl [
41 (
42 let patch = fetchpatch {
43 url = "https://github.com/linux-audit/audit-userspace/commit/d579a08bb1cde71f939c13ac6b2261052ae9f77e.patch";
···5657 prePatch = ''
58 sed -i 's,#include <sys/poll.h>,#include <poll.h>\n#include <limits.h>,' audisp/audispd.c
59+ ''
60+ # According to https://stackoverflow.com/questions/13089166
61+ # --whole-archive linker flag is required to be sure that linker
62+ # correctly chooses strong version of symbol regardless of order of
63+ # object files at command line.
64+ + stdenv.lib.optionalString stdenv.targetPlatform.isStatic ''
65+ export LDFLAGS=-Wl,--whole-archive
66 '';
67 meta = {
68 description = "Audit Library";