diff options
author | Andreas Stührk <andy@hammerhartes.de> | 2022-11-25 17:40:42 +0100 |
---|---|---|
committer | Vincent Haupert <mail@vincent-haupert.de> | 2022-12-04 20:12:50 +0100 |
commit | 7de32b0ce90bc507479ce6a4d83602c51e9eeb47 (patch) | |
tree | 640fcd08eb5a0cddf7734bd2898a19a78eb254cd /pkgs/os-specific/linux/sgx/azure-dcap-client | |
parent | 93de6bf9ed923bf2d0991db61c2fd127f6e984ae (diff) | |
download | nixpkgs-7de32b0ce90bc507479ce6a4d83602c51e9eeb47.tar nixpkgs-7de32b0ce90bc507479ce6a4d83602c51e9eeb47.tar.gz nixpkgs-7de32b0ce90bc507479ce6a4d83602c51e9eeb47.tar.bz2 nixpkgs-7de32b0ce90bc507479ce6a4d83602c51e9eeb47.tar.lz nixpkgs-7de32b0ce90bc507479ce6a4d83602c51e9eeb47.tar.xz nixpkgs-7de32b0ce90bc507479ce6a4d83602c51e9eeb47.tar.zst nixpkgs-7de32b0ce90bc507479ce6a4d83602c51e9eeb47.zip |
sgx-azure-dcap-client: init at 1.11.2
Diffstat (limited to 'pkgs/os-specific/linux/sgx/azure-dcap-client')
-rw-r--r-- | pkgs/os-specific/linux/sgx/azure-dcap-client/default.nix | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/sgx/azure-dcap-client/default.nix b/pkgs/os-specific/linux/sgx/azure-dcap-client/default.nix new file mode 100644 index 00000000000..ce0a20de329 --- /dev/null +++ b/pkgs/os-specific/linux/sgx/azure-dcap-client/default.nix @@ -0,0 +1,88 @@ +{ stdenv +, fetchFromGitHub +, fetchurl +, lib +, curl +, nlohmann_json +, openssl +, pkg-config +, linkFarmFromDrvs +}: + +let + # Although those headers are also included in the source of `sgx-psw`, the `azure-dcap-client` build needs specific versions + filterSparse = list: '' + cp -r "$out"/. . + find "$out" -mindepth 1 -delete + cp ${lib.concatStringsSep " " list} "$out/" + ''; + headers = linkFarmFromDrvs "azure-dcpa-client-intel-headers" [ + (fetchFromGitHub rec { + name = "${repo}-headers"; + owner = "intel"; + repo = "SGXDataCenterAttestationPrimitives"; + rev = "0436284f12f1bd5da7e7a06f6274d36b4c8d39f9"; + sparseCheckout = [ "QuoteGeneration/quote_wrapper/common/inc/sgx_ql_lib_common.h" ]; + hash = "sha256-ipKpYHbiwjCUXF/pCArJZy5ko1YX2wqMMdSnMUzhkgY="; + postFetch = filterSparse sparseCheckout; + }) + (fetchFromGitHub rec { + name = "${repo}-headers"; + owner = "intel"; + repo = "linux-sgx"; + rev = "1ccf25b64abd1c2eff05ead9d14b410b3c9ae7be"; + hash = "sha256-WJRoS6+NBVJrFmHABEEDpDhW+zbWFUl65AycCkRavfs="; + sparseCheckout = [ + "common/inc/sgx_report.h" + "common/inc/sgx_key.h" + "common/inc/sgx_attributes.h" + ]; + postFetch = filterSparse sparseCheckout; + }) + ]; +in +stdenv.mkDerivation rec { + pname = "azure-dcap-client"; + version = "1.11.2"; + + src = fetchFromGitHub { + owner = "microsoft"; + repo = pname; + rev = version; + hash = "sha256-EYj3jnzTyJRl6N7avNf9VrB8r9U6zIE6wBNeVsMtWCA="; + }; + + nativeBuildInputs = [ + pkg-config + ]; + + buildInputs = [ + curl + nlohmann_json + openssl + ]; + + postPatch = '' + mkdir -p src/Linux/ext/intel + find -L '${headers}' -type f -exec ln -s {} src/Linux/ext/intel \; + + substitute src/Linux/Makefile{.in,} \ + --replace '##CURLINC##' '${curl.dev}/include/curl/' \ + --replace '$(TEST_SUITE): $(PROVIDER_LIB) $(TEST_SUITE_OBJ)' '$(TEST_SUITE): $(TEST_SUITE_OBJ)' + ''; + + NIX_CFLAGS_COMPILE = "-Wno-deprecated-declarations"; + + makeFlags = [ + "-C src/Linux" + "prefix=$(out)" + ]; + + meta = with lib; { + description = "Interfaces between SGX SDKs and the Azure Attestation SGX Certification Cache"; + homepage = "https://github.com/microsoft/azure-dcap-client"; + maintainers = with maintainers; [ trundle veehaitch ]; + platforms = [ "x86_64-linux" ]; + license = [ licenses.mit ]; + }; +} |