anchor.diff:        if [ -n "$(echo $out/lib/*.so $out/lib/*.dylib $out/lib/*.dll)" ]; then
             rm "$out/lib/"*.a
         fi
  +
  +      # 'etc' is a separate output on static builds only.
  +      etc=$out
       '') + lib.optionalString (!stdenv.hostPlatform.isWindows)
         # Fix bin/c_rehash's perl interpreter line
         #
  
positive.code:       mv $out/include $dev/
  
        # remove dependency on Perl at runtime
        rm -r $out/etc/ssl/misc
  
        rmdir $out/etc/ssl/{certs,private}
      '';
  
      postFixup = lib.optionalString (!stdenv.hostPlatform.isWindows) ''
        # Check to make sure the main output doesn't depend on perl
        if grep -r '${buildPackages.perl}' $out; then
          echo "Found an erroneous dependency on perl ^^^" >&2
          exit 1
        fi
  
negative.code:       substituteInPlace crypto/async/arch/async_posix.h \
          --replace '!defined(__ANDROID__) && !defined(__OpenBSD__)' \
                    '!defined(__ANDROID__) && !defined(__OpenBSD__) && 0'
      ''
      # Move ENGINESDIR into OPENSSLDIR for static builds, in order to move
      # it to the separate etc output.
      + lib.optionalString static ''
        substituteInPlace Configurations/unix-Makefile.tmpl \
          --replace 'ENGINESDIR=$(libdir)/engines-{- $sover_dirname -}' \
                    'ENGINESDIR=$(OPENSSLDIR)/engines-{- $sover_dirname -}'
      '';
  
      outputs = [ "bin" "dev" "out" "man" ]
        ++ lib.optional withDocs "doc"
        # Separate output for the runtime dependencies of the static build.
        # Specifically, move OPENSSLDIR into this output, as its path will be
        # compiled into 'libcrypto.a'. This makes it a runtime dependency of
        # any package that statically links openssl, so we want to keep that
        # output minimal.
        ++ lib.optional static "etc";
      setOutputFlags = false;
      separateDebugInfo =
        !stdenv.hostPlatform.isDarwin &&
  