anchor.diff:      sha256 = "a63b8724c36c29ed438c9e3ca403bfeeb6c998a45990e300aa1b10faa23a0a22";
     };
   
  +  prePatchCommon = ''
  +    substituteInPlace ./common/Make.rules --replace "/usr/bin/pod2man" "${perl}/bin/pod2man"
  +    substituteInPlace ./common/Make.rules --replace "/usr/bin/pod2html" "${perl}/bin/pod2html"
  +    substituteInPlace ./common/Make.rules --replace "/usr/include/linux/capability.h" "${glibc}/include/linux/capability.h"
  +  '';
  +
     libapparmor = stdenv.mkDerivation {
       name = "libapparmor-${apparmor-version}";
       src = apparmor-sources;
  
positive.code:       which
      ];
  
      prePatch = ''
        substituteInPlace ./common/Make.rules --replace "/usr/bin/pod2man" "${perl}/bin/pod2man"
        substituteInPlace ./common/Make.rules --replace "/usr/bin/pod2html" "${perl}/bin/pod2html"
        substituteInPlace ./common/Make.rules --replace "/usr/include/linux/capability.h" "${glibc}/include/linux/capability.h"
  
        substituteInPlace ./parser/Makefile --replace "/usr/bin/bison" "${bison}/bin/bison"
        substituteInPlace ./parser/Makefile --replace "/usr/bin/flex" "${flex}/bin/flex"
        substituteInPlace ./parser/Makefile --replace "/usr/include/linux/capability.h" "${glibc}/include/linux/capability.h"
  
negative.code:       which
      ];
  
      prePatch = prePatchCommon + ''
        substituteInPlace ./libraries/libapparmor/src/Makefile.am --replace "/usr/include/netinet/in.h" "${glibc}/include/netinet/in.h"
        substituteInPlace ./libraries/libapparmor/src/Makefile.in --replace "/usr/include/netinet/in.h" "${glibc}/include/netinet/in.h"
        '';
  