summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Haupert <mail@vincent-haupert.de>2021-11-19 01:04:18 +0100
committerVincent Haupert <mail@vincent-haupert.de>2021-11-21 01:01:44 +0100
commitd6a0da1e5dff14feb3b783eb1590f92f9725847a (patch)
tree3bb7f140f603d5bf507a19795be6a5e7a639d505
parenta25482ffa725d306558d0a88db9aaac29cc54759 (diff)
downloadnixpkgs-d6a0da1e5dff14feb3b783eb1590f92f9725847a.tar
nixpkgs-d6a0da1e5dff14feb3b783eb1590f92f9725847a.tar.gz
nixpkgs-d6a0da1e5dff14feb3b783eb1590f92f9725847a.tar.bz2
nixpkgs-d6a0da1e5dff14feb3b783eb1590f92f9725847a.tar.lz
nixpkgs-d6a0da1e5dff14feb3b783eb1590f92f9725847a.tar.xz
nixpkgs-d6a0da1e5dff14feb3b783eb1590f92f9725847a.tar.zst
nixpkgs-d6a0da1e5dff14feb3b783eb1590f92f9725847a.zip
sgx-sdk: use full version
Actually, 2.14 isn't the full version the Makefile uses for the Debian
and RPM packages. Also, pkg-config files contain the version 2.14.100.2.
-rw-r--r--pkgs/os-specific/linux/sgx-sdk/default.nix17
1 files changed, 12 insertions, 5 deletions
diff --git a/pkgs/os-specific/linux/sgx-sdk/default.nix b/pkgs/os-specific/linux/sgx-sdk/default.nix
index 7544ac0fed3..c490ead23b0 100644
--- a/pkgs/os-specific/linux/sgx-sdk/default.nix
+++ b/pkgs/os-specific/linux/sgx-sdk/default.nix
@@ -22,19 +22,26 @@
 , writeShellScript
 , writeText
 }:
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "sgx-sdk";
-  version = "2.14";
+  version = "2.14.100.2";
 
   src = fetchFromGitHub {
     owner = "intel";
     repo = "linux-sgx";
-    rev = "sgx_${version}";
+    rev = "sgx_${concatStringsSep "." (take 2 (splitVersion version))}";
     sha256 = "1cr2mkk459s270ng0yddgcryi0zc3dfmg9rmdrdh9mhy2mc1kx0g";
     fetchSubmodules = true;
   };
 
+  postUnpack = ''
+    # Make sure this is the right version
+    grep -q '"${version}"' "$src/common/inc/internal/se_version.h" \
+      || (echo "Could not find expected version ${version} in linux-sgx source" >&2 && exit 1)
+  '';
+
   postPatch = ''
     # https://github.com/intel/linux-sgx/pull/730
     substituteInPlace buildenv.mk --replace '/bin/cp' 'cp'
@@ -123,14 +130,14 @@ stdenv.mkDerivation rec {
   ];
 
   postBuild = ''
-    patchShebangs linux/installer/bin/sgx_linux_x64_sdk_*.bin
+    patchShebangs linux/installer/bin/sgx_linux_x64_sdk_${version}.bin
   '';
 
   installPhase = ''
     runHook preInstall
 
     installDir=$TMPDIR
-    ./linux/installer/bin/sgx_linux_x64_sdk_*.bin -prefix $installDir
+    ./linux/installer/bin/sgx_linux_x64_sdk_${version}.bin -prefix $installDir
     installDir=$installDir/sgxsdk
 
     header "Move files created by installer"
@@ -242,7 +249,7 @@ stdenv.mkDerivation rec {
 
   passthru.tests = callPackage ./samples.nix { };
 
-  meta = with lib; {
+  meta = {
     description = "Intel SGX SDK for Linux built with IPP Crypto Library";
     homepage = "https://github.com/intel/linux-sgx";
     maintainers = with maintainers; [ sbellem arturcygan veehaitch ];