Merge pull request #1928 from 'cross-win-osx'.
This includes a lot of fixes for cross-building to Windows and Mac OS X and could possibly fix things even for non-cross-builds, like for example OpenSSL on Windows. The main reason for merging this in 14.04 already is that we already have runInWindowsVM in master and it doesn't work until we actually cross-build Cygwin's setup binary as the upstream version is a fast moving target which gets _overwritten_ on every new release. Conflicts: pkgs/top-level/all-packages.nix
This commit is contained in:
@@ -12,7 +12,7 @@ diff -ru -x '*~' openssl-1.0.0e-orig/crypto/x509/x509_def.c openssl-1.0.0e/crypt
|
||||
#include "cryptlib.h"
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/x509.h>
|
||||
@@ -71,7 +75,19 @@
|
||||
@@ -71,7 +75,25 @@
|
||||
{ return(X509_CERT_DIR); }
|
||||
|
||||
const char *X509_get_default_cert_file(void)
|
||||
@@ -23,9 +23,15 @@ diff -ru -x '*~' openssl-1.0.0e-orig/crypto/x509/x509_def.c openssl-1.0.0e/crypt
|
||||
+ if (!init) {
|
||||
+ init = 1;
|
||||
+ char * s = getenv("OPENSSL_X509_CERT_FILE");
|
||||
+ if (s && getuid() == geteuid()) {
|
||||
+ strncpy(buf, s, sizeof(buf));
|
||||
+ buf[sizeof(buf) - 1] = 0;
|
||||
+ if (s) {
|
||||
+#ifndef OPENSSL_SYS_WINDOWS
|
||||
+ if (getuid() == geteuid()) {
|
||||
+#endif
|
||||
+ strncpy(buf, s, sizeof(buf));
|
||||
+ buf[sizeof(buf) - 1] = 0;
|
||||
+#ifndef OPENSSL_SYS_WINDOWS
|
||||
+ }
|
||||
+#endif
|
||||
+ }
|
||||
+ }
|
||||
+ return buf;
|
||||
|
||||
@@ -8,7 +8,9 @@ let
|
||||
(throw "openssl needs its platform name cross building" null)
|
||||
stdenv.cross;
|
||||
|
||||
patchesCross = isCross:
|
||||
patchesCross = isCross: let
|
||||
isDarwin = stdenv.isDarwin || (isCross && stdenv.cross.libc == "libSystem");
|
||||
in
|
||||
[ # 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
|
||||
@@ -29,7 +31,7 @@ let
|
||||
./kfreebsd-gnu.patch
|
||||
]
|
||||
|
||||
++ stdenv.lib.optional stdenv.isDarwin ./darwin-arch.patch;
|
||||
++ stdenv.lib.optional isDarwin ./darwin-arch.patch;
|
||||
|
||||
in
|
||||
|
||||
@@ -91,6 +93,8 @@ stdenv.mkDerivation {
|
||||
rm $out/bin/c_rehash $out/ssl/misc/CA.pl $out/ssl/misc/tsget
|
||||
'';
|
||||
configureScript = "./Configure";
|
||||
} // stdenv.lib.optionalAttrs (opensslCrossSystem == "darwin64-x86_64-cc") {
|
||||
CC = "gcc";
|
||||
};
|
||||
|
||||
meta = {
|
||||
|
||||
Reference in New Issue
Block a user