Commit b8031896 authored by Colin's avatar Colin
Browse files

pam: packaging cleanups

- don't set null postPatch
- remove unnecessary musl patch

null postPatch breaks common override idioms like
```nix
pam.overrideAttrs (attrs: {
  postPatch = (attrs.postPatch or "") + "...";
});
```

the musl patch was upstreamed into pam
<https://github.com/linux-pam/linux-pam/commit/1d1d3b59af50c40efcc74f9c3f37b446a921e83e>
and subsequently removed from Alpine (where we took it from)
<https://gitlab.alpinelinux.org/alpine/aports/-/commit/e51f5c2997fd7a2140d417b6ddad1cec2cec9952>
parent c087a46e
Loading
Loading
Loading
Loading
+2 −10
Original line number Diff line number Diff line
@@ -18,10 +18,10 @@ stdenv.mkDerivation rec {
  ];

  # Case-insensitivity workaround for https://github.com/linux-pam/linux-pam/issues/569
  postPatch = if stdenv.buildPlatform.isDarwin && stdenv.buildPlatform != stdenv.hostPlatform then ''
  postPatch = lib.optionalString (stdenv.buildPlatform.isDarwin && stdenv.buildPlatform != stdenv.hostPlatform) ''
    rm CHANGELOG
    touch ChangeLog
  '' else null;
  '';

  outputs = [ "out" "doc" "man" /* "modules" */ ];

@@ -36,14 +36,6 @@ stdenv.mkDerivation rec {

  enableParallelBuilding = true;

  preConfigure = lib.optionalString (stdenv.hostPlatform.libc == "musl") ''
      # export ac_cv_search_crypt=no
      # (taken from Alpine linux, apparently insecure but also doesn't build O:))
      # disable insecure modules
      # sed -e 's/pam_rhosts//g' -i modules/Makefile.am
      sed -e 's/pam_rhosts//g' -i modules/Makefile.in
  '';

  configureFlags = [
    "--includedir=${placeholder "out"}/include/security"
    "--enable-sconfigdir=/etc/security"