-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable openssl test on too old nixpkgs
There on nixpkgs 22 and lower, there is too old Rust to build OpenSSL
- Loading branch information
1 parent
c46c694
commit 909f97a
Showing
1 changed file
with
30 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,33 @@ | ||
# OpenSSL needs `pkg-config` and `openssl` buildInputs. This tests whether we correctly supply them automatically. | ||
|
||
{ naersk, ... }: | ||
{ naersk, pkgs, ... }: | ||
|
||
naersk.buildPackage { | ||
src = ./fixtures; | ||
doCheck = true; | ||
} | ||
let | ||
# Whether the nixpkgs is version 23 or newer, because in older nixpkgs, rustc is too old to build openssl. | ||
buildIt = with pkgs.lib; | ||
(strings.toInt ((builtins.elemAt (splitString "." trivial.version) 0)) >= 23); | ||
in | ||
|
||
if buildIt then | ||
naersk.buildPackage { | ||
src = ./fixtures; | ||
doCheck = true; | ||
} | ||
else | ||
builtins.trace '' | ||
Not building OpenSSL test, because Rust from nixpkgs under major version 23 cannot build OpenSSL | ||
Current nixpkgs version: ${pkgs.lib.trivial.version} | ||
'' | ||
|
||
pkgs.stdenv.mkDerivation { | ||
name = "not-building-openssl-test"; | ||
|
||
dontUnpack = true; | ||
|
||
buildPhase = '' | ||
echo Not building OpenSSL test, because Rust from nixpkgs under major version 23 cannot build OpenSSL | ||
echo Current nixpkgs version: ${pkgs.lib.trivial.version} | ||
''; | ||
|
||
installPhase = "mkdir $out"; | ||
} |