@@ -12,4 +12,53 @@ self: super: super.lib.optionalAttrs (super.lib.versions.majorMinor super.lib.ve
1212 export TMPDIR=/tmp
1313 '';
1414 });
15+ # Avoid dependency on perl for windows as it fails to build.
16+ openssl = if self.stdenv.hostPlatform.isWindows
17+ then let static = false; # TODO check that it is ok to assume this (or find a way to detect without instanciating perl)
18+ in super.openssl.overrideAttrs (attrs: {
19+ # This is the `postInstall` from 19.03 nixpkgs but with the line
20+ # substituteInPlace $out/bin/c_rehash --replace ${buildPackages.perl} ${perl}
21+ # removed (as including it requires perl to build).
22+ # (code is copied here because modifying `attrs.postInstall` would still
23+ # introducing the same dependency)
24+ postInstall = self.stdenv.lib.optionalString (!static) ''
25+ # If we're building dynamic libraries, then don't install static
26+ # libraries.
27+ if [ -n "$(echo $out/lib/*.so $out/lib/*.dylib $out/lib/*.dll)" ]; then
28+ rm "$out/lib/"*.a
29+ fi
30+
31+ '' +
32+ ''
33+ mkdir -p $bin
34+ mv $out/bin $bin/
35+
36+ mkdir $dev
37+ mv $out/include $dev/
38+
39+ # remove dependency on Perl at runtime
40+ rm -r $out/etc/ssl/misc
41+
42+ rmdir $out/etc/ssl/{certs,private}
43+ '';
44+ # Skip this step on windows as it checks for references to buildPackages.perl
45+ # and we are keeping them.
46+ postFixup = "";
47+ })
48+ else super.openssl;
49+ winePackages = super.winePackages // {
50+ minimal = super.winePackages.minimal.overrideAttrs (oldAttrs: {
51+ # Needed for CFNotificationCenterAddObserver symbols.
52+ buildInputs = oldAttrs.buildInputs ++ self.lib.optional self.stdenv.isDarwin
53+ self.buildPackages.darwin.cf-private;
54+ # the relevant check in configure.ac will fail under nix as we are not
55+ # using the system supplied compiler tools. We will subsequently *not*
56+ # pass `-mmacosx-version-min` in the LDFLAGS, and end up with a linked
57+ # binary against 10.14 which *does* contain a __DATA,__dyld section and
58+ # then horribly fail to run on Mojave.
59+ postConfigure = self.lib.optional (self.stdenv.hostPlatform.isDarwin) ''
60+ sed -i 's|-nostartfiles -nodefaultlibs|-nostartfiles -nodefaultlibs -mmacosx-version-min=10.7|g' loader/Makefile
61+ '';
62+ });
63+ };
1564}