Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openssl: fix mingw cross build by disabling patch #97

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 9 additions & 4 deletions pkgs/development/libraries/openssl/default.nix
Expand Up @@ -3,20 +3,22 @@
let
name = "openssl-1.0.0i";

inherit (stdenv.lib) elem optional optionals attrByPath;

opensslCrossSystem = stdenv.lib.attrByPath [ "openssl" "system" ]
(throw "openssl needs its platform name cross building" null)
(throw "openssl needs its platform name when cross building" null)
stdenv.cross;

patchesCross = isCross:
[ # Allow the location of the X509 certificate file (the CA
(optional (!isCross || !elem opensslCrossSystem ["mingw" "mingw64"])
# Allow the location of the X509 certificate file (the CA
# bundle) to be set through the environment variable
# ‘OPENSSL_X509_CERT_FILE’. This is necessary because the
# default location ($out/ssl/cert.pem) doesn't exist, and
# hardcoding something like /etc/ssl/cert.pem is impure and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the build error you get when using this patch?
It might be better to fix it, rather than to omit it in order to have consistent behavior across architectures.

# cannot be overriden per-process. For security, the
# environment variable is ignored for setuid binaries.
./cert-file.patch
]
./cert-file.patch)

++ stdenv.lib.optionals (isCross && opensslCrossSystem == "hurd-x86")
[ ./cert-file-path-max.patch # merge with `cert-file.patch' eventually
Expand All @@ -38,6 +40,9 @@ stdenv.mkDerivation {
sha1 = "b7aa11cbd7d264c2b1f44e3d55b334fb33f7b674";
};

# doesn't make a difference:
# enableParalellBuilding = true;

patches = patchesCross false;

buildNativeInputs = [ perl ];
Expand Down
8 changes: 7 additions & 1 deletion pkgs/top-level/all-packages.nix
Expand Up @@ -1917,7 +1917,13 @@ let
cross = assert crossSystem != null; crossSystem;
});

gcc_realCross = gcc46_realCross;
gcc_realCross =
if crossSystem.config == "i686-pc-mingw32"
then
# gcc46 targeting 32bit builds executables, but they segfault
# gcc45 which seems to work
gcc45_realCross
else gcc46_realCross;

gccCrossStageStatic = let
isMingw = (stdenv.cross.libc == "msvcrt");
Expand Down
2 changes: 2 additions & 0 deletions pkgs/top-level/release-cross.nix
Expand Up @@ -150,6 +150,7 @@ let
arch = "x86";
libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
platform = {};
openssl.system = "mingw";
};
in {
crossMingw32 = mapTestOnCross crossSystem {
Expand All @@ -173,6 +174,7 @@ let
arch = "x86_64"; # Irrelevant
libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
platform = {};
openssl.system = "mingw64";
};
in {
crossMingwW64 = mapTestOnCross crossSystem {
Expand Down