|
5 | 5 | withSQLite ? true, |
6 | 6 | withSSL ? true, |
7 | 7 | withTemporal ? false, |
| 8 | + opensslVersion ? "3.5", |
8 | 9 | }: |
9 | 10 | { |
10 | 11 | inherit (pkgs) |
|
46 | 47 | // (pkgs.lib.optionalAttrs withSQLite { |
47 | 48 | inherit (pkgs) sqlite; |
48 | 49 | }) |
49 | | -// (pkgs.lib.optionalAttrs withSSL ( |
| 50 | +// (pkgs.lib.optionalAttrs (withSSL && opensslVersion != null) ( |
50 | 51 | let |
51 | | - version = "3.5.5"; |
| 52 | + opensslVersions = { |
| 53 | + "1.1" = { |
| 54 | + base = pkgs.openssl_1_1; |
| 55 | + version = "1.1.1w"; |
| 56 | + hash = "sha256-zzCYlQy02FOtlcCEHx+cbT3BAtzPys1SHZOSUgi3asg="; |
| 57 | + configureFlags = [ "no-tests" ]; |
| 58 | + }; |
| 59 | + "3.0" = { |
| 60 | + base = pkgs.openssl_3; |
| 61 | + version = "3.0.19"; |
| 62 | + hash = "sha256-+lpBQ7iq4YvlPvLzyvKaLgdHQwuLx00y2IM1uUq2MHI="; |
| 63 | + configureFlags = [ "no-tests" ]; |
| 64 | + }; |
| 65 | + "3.5" = { |
| 66 | + base = pkgs.openssl_3_5; |
| 67 | + version = "3.5.5"; |
| 68 | + hash = "sha256-soyRUyqLZaH5g7TCi3SIF05KAQCOKc6Oab14nyi8Kok="; |
| 69 | + configureFlags = [ "no-docs" "no-tests" ]; |
| 70 | + }; |
| 71 | + "3.6" = { |
| 72 | + base = pkgs.openssl_3_6; |
| 73 | + version = "3.6.1"; |
| 74 | + hash = "sha256-sb/tzVson/Iq7ofJ1gD1FXZ+v0X3cWjLbWTyMfUYqC4="; |
| 75 | + configureFlags = [ "no-docs" "no-tests" ]; |
| 76 | + }; |
| 77 | + }; |
| 78 | + selected = |
| 79 | + opensslVersions.${opensslVersion} |
| 80 | + or (throw "Unsupported opensslVersion: ${opensslVersion}. Use \"1.1\", \"3.0\", \"3.5\", \"3.6\", or null for bundled."); |
52 | 81 | in |
53 | 82 | { |
54 | | - openssl = pkgs.openssl_3_6.overrideAttrs (old: { |
55 | | - inherit version; |
| 83 | + openssl = selected.base.overrideAttrs (old: { |
| 84 | + version = selected.version; |
56 | 85 | src = pkgs.fetchurl { |
57 | | - url = builtins.replaceStrings [ old.version ] [ version ] old.src.url; |
58 | | - hash = "sha256-soyRUyqLZaH5g7TCi3SIF05KAQCOKc6Oab14nyi8Kok="; |
| 86 | + url = builtins.replaceStrings [ old.version ] [ selected.version ] old.src.url; |
| 87 | + hash = selected.hash; |
59 | 88 | }; |
60 | 89 | doCheck = false; |
61 | | - configureFlags = (old.configureFlags or [ ]) ++ [ |
62 | | - "no-docs" |
63 | | - "no-tests" |
64 | | - ]; |
| 90 | + configureFlags = (old.configureFlags or [ ]) ++ selected.configureFlags; |
65 | 91 | outputs = [ |
66 | 92 | "bin" |
67 | 93 | "out" |
|
0 commit comments