git.iko.soy/typeable/nixpkgs
on master help sign in
lib, openssl: Get rid of openssl.system

We compute it on the fly, careful to avoid any mass rebuilds for now.

commit57b01b1bcf77fc86b82f84e3c0d4904e2464a1b1 authorJohn Ericson <John.Ericson@Obsidian.Systems> dateFri 26 Jan 2018, 20:40 (9 years ago) parent16a50f5
3 files changed+22−36
lib/systems/examples.nix+1−9 pkgs/build-support/vm/windows/cygwin-iso/default.nix−1 pkgs/development/libraries/openssl/default.nix+21−26
lib/systems/examples.nix+1−9
@@ -15,7 +15,6 @@ rec {
1515 float = "soft";
1616 libc = "glibc";
1717 platform = platforms.sheevaplug;
18− openssl.system = "linux-generic32";
1918 };
2019
2120 raspberryPi = rec {
@@ -25,7 +24,6 @@ rec {
2524 fpu = "vfp";
2625 libc = "glibc";
2726 platform = platforms.raspberrypi;
28− openssl.system = "linux-generic32";
2927 };
3028
3129 armv7l-hf-multiplatform = rec {
@@ -35,7 +33,6 @@ rec {
3533 fpu = "vfpv3-d16";
3634 libc = "glibc";
3735 platform = platforms.armv7l-hf-multiplatform;
38− openssl.system = "linux-generic32";
3936 };
4037
4138 aarch64-multiplatform = rec {
@@ -54,12 +51,8 @@ rec {
5451 arch = "armv5tel";
5552 config = "armv5tel-unknown-linux-gnueabi";
5653 float = "soft";
57−
58− platform = platforms.pogoplug4;
59−
6054 libc = "glibc";
61−
62− openssl.system = "linux-generic32";
55+ platform = platforms.pogoplug4;
6356 };
6457
6558 fuloongminipc = rec {
@@ -68,7 +61,6 @@ rec {
6861 float = "hard";
6962 libc = "glibc";
7063 platform = platforms.fuloong2f_n32;
71− openssl.system = "linux-generic32";
7264 };
7365
7466 #
pkgs/build-support/vm/windows/cygwin-iso/default.nix−1
@@ -21,7 +21,6 @@ let
2121 crossSystem = {
2222 libc = "msvcrt";
2323 platform = {};
24− openssl.system = "mingw64";
2524 inherit arch;
2625 config = "${arch}-w64-mingw32";
2726 };
pkgs/development/libraries/openssl/default.nix+21−26
@@ -1,5 +1,5 @@
11{ stdenv, fetchurl, buildPackages, perl
2−, hostPlatform
2+, buildPlatform, hostPlatform
33, fetchpatch
44, withCryptodev ? false, cryptodevHeaders
55, enableSSL2 ? false
@@ -8,10 +8,6 @@
88with stdenv.lib;
99
1010let
11−
12− opensslCrossSystem = hostPlatform.openssl.system or
13− (throw "openssl needs its platform name cross building");
14−
1511 common = args@{ version, sha256, patches ? [] }: stdenv.mkDerivation rec {
1612 name = "openssl-${version}";
1713
@@ -24,23 +20,34 @@ let
2420 (args.patches or [])
2521 ++ [ ./nix-ssl-cert-file.patch ]
2622 ++ optional (versionOlder version "1.1.0")
27− (if stdenv.isDarwin then ./use-etc-ssl-certs-darwin.patch else ./use-etc-ssl-certs.patch)
23+ (if hostPlatform.isDarwin then ./use-etc-ssl-certs-darwin.patch else ./use-etc-ssl-certs.patch)
2824 ++ optional (versionOlder version "1.0.2" && hostPlatform.isDarwin)
2925 ./darwin-arch.patch;
3026
3127 outputs = [ "bin" "dev" "out" "man" ];
3228 setOutputFlags = false;
33− separateDebugInfo = stdenv.isLinux;
29+ separateDebugInfo = hostPlatform.isLinux;
3430
3531 nativeBuildInputs = [ perl ];
3632 buildInputs = stdenv.lib.optional withCryptodev cryptodevHeaders;
3733
38− # On x86_64-darwin, "./config" misdetects the system as
39− # "darwin-i386-cc". So specify the system type explicitly.
40− configureScript =
41− if stdenv.system == "x86_64-darwin" then "./Configure darwin64-x86_64-cc"
42− else if stdenv.system == "x86_64-solaris" then "./Configure solaris64-x86_64-gcc"
43− else "./config";
34+ # TODO(@Ericson2314): Improve with mass rebuild
35+ configureScript = {
36+ "x86_64-darwin" = "./Configure darwin64-x86_64-cc";
37+ "x86_64-solaris" = "./Configure solaris64-x86_64-gcc";
38+ }.${hostPlatform.system} or (
39+ if hostPlatform == buildPlatform
40+ then "./config"
41+ else if hostPlatform.isMinGW
42+ then "./Configure mingw${toString hostPlatform.parsed.cpu.bits}"
43+ else if hostPlatform.isLinux
44+ then "./Configure linux-generic${toString hostPlatform.parsed.cpu.bits}"
45+ else
46+ throw "Not sure what configuration to use for ${hostPlatform.config}"
47+ );
48+
49+ # TODO(@Ericson2314): Make unconditional on mass rebuild
50+ ${if buildPlatform != hostPlatform then "configurePlatforms" else null} = [];
4451
4552 configureFlags = [
4653 "shared"
@@ -50,7 +57,7 @@ let
5057 "-DHAVE_CRYPTODEV"
5158 "-DUSE_CRYPTODEV_DIGESTS"
5259 ] ++ stdenv.lib.optional enableSSL2 "enable-ssl2"
53− ++ stdenv.lib.optional (versionAtLeast version "1.1.0" && stdenv.isAarch64) "no-afalgeng";
60+ ++ stdenv.lib.optional (versionAtLeast version "1.1.0" && hostPlatform.isAarch64) "no-afalgeng";
5461
5562 makeFlags = [ "MANDIR=$(man)/share/man" ];
5663
@@ -84,18 +91,6 @@ let
8491 fi
8592 '';
8693
87− crossAttrs = {
88− # upstream patch: https://rt.openssl.org/Ticket/Display.html?id=2558
89− postPatch = ''
90− sed -i -e 's/[$][(]CROSS_COMPILE[)]windres/$(WINDRES)/' Makefile.shared
91− '';
92− preConfigure=''
93− # It's configure does not like --build or --host
94− export configureFlags="${concatStringsSep " " (configureFlags ++ [ opensslCrossSystem ])}"
95− '';
96− configureScript = "./Configure";
97− };
98−
9994 meta = {
10095 homepage = https://www.openssl.org/;
10196 description = "A cryptographic library that implements the SSL and TLS protocols";