3
0
Fork 0
forked from mirrors/nixpkgs

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.
This commit is contained in:
Vincent Haupert 2021-11-19 01:04:18 +01:00
parent a25482ffa7
commit d6a0da1e5d

View file

@ -22,19 +22,26 @@
, writeShellScript , writeShellScript
, writeText , writeText
}: }:
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "sgx-sdk"; pname = "sgx-sdk";
version = "2.14"; version = "2.14.100.2";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "intel"; owner = "intel";
repo = "linux-sgx"; repo = "linux-sgx";
rev = "sgx_${version}"; rev = "sgx_${concatStringsSep "." (take 2 (splitVersion version))}";
sha256 = "1cr2mkk459s270ng0yddgcryi0zc3dfmg9rmdrdh9mhy2mc1kx0g"; sha256 = "1cr2mkk459s270ng0yddgcryi0zc3dfmg9rmdrdh9mhy2mc1kx0g";
fetchSubmodules = true; 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 = '' postPatch = ''
# https://github.com/intel/linux-sgx/pull/730 # https://github.com/intel/linux-sgx/pull/730
substituteInPlace buildenv.mk --replace '/bin/cp' 'cp' substituteInPlace buildenv.mk --replace '/bin/cp' 'cp'
@ -123,14 +130,14 @@ stdenv.mkDerivation rec {
]; ];
postBuild = '' postBuild = ''
patchShebangs linux/installer/bin/sgx_linux_x64_sdk_*.bin patchShebangs linux/installer/bin/sgx_linux_x64_sdk_${version}.bin
''; '';
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall
installDir=$TMPDIR 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 installDir=$installDir/sgxsdk
header "Move files created by installer" header "Move files created by installer"
@ -242,7 +249,7 @@ stdenv.mkDerivation rec {
passthru.tests = callPackage ./samples.nix { }; passthru.tests = callPackage ./samples.nix { };
meta = with lib; { meta = {
description = "Intel SGX SDK for Linux built with IPP Crypto Library"; description = "Intel SGX SDK for Linux built with IPP Crypto Library";
homepage = "https://github.com/intel/linux-sgx"; homepage = "https://github.com/intel/linux-sgx";
maintainers = with maintainers; [ sbellem arturcygan veehaitch ]; maintainers = with maintainers; [ sbellem arturcygan veehaitch ];