14 # Although those headers are also included in the source of `sgx-psw`, the `azure-dcap-client` build needs specific versions
15 filterSparse = list: ''
17 find "$out" -mindepth 1 -delete
18 cp ${lib.concatStringsSep " " list} "$out/"
20 headers = linkFarmFromDrvs "azure-dcap-client-intel-headers" [
21 (fetchFromGitHub rec {
22 name = "${repo}-headers";
25 # See: <src/Linux/configure> for the revision `azure-dcap-client` uses.
26 rev = "1ccf25b64abd1c2eff05ead9d14b410b3c9ae7be";
27 hash = "sha256-WJRoS6+NBVJrFmHABEEDpDhW+zbWFUl65AycCkRavfs=";
29 "common/inc/sgx_report.h"
30 "common/inc/sgx_key.h"
31 "common/inc/sgx_attributes.h"
33 postFetch = filterSparse sparseCheckout;
37 stdenv.mkDerivation rec {
38 pname = "azure-dcap-client";
41 src = fetchFromGitHub {
45 hash = "sha256-zTDaICsSPXctgFRCZBiZwXV9dLk2pFL9kp5a8FkiTZA=";
50 # https://github.com/microsoft/Azure-DCAP-Client/pull/197
52 name = "gcc-13.patch";
53 url = "https://github.com/microsoft/Azure-DCAP-Client/commit/fbcae7b3c8f1155998248cf5b5f4c1df979483f5.patch";
54 hash = "sha256-ezEuQql3stn58N1ZPKMlhPpUOBkDpCcENpGwFAmWtHc=";
69 mkdir -p src/Linux/ext/intel
70 find -L '${headers}' -type f -exec ln -s {} src/Linux/ext/intel \;
72 substitute src/Linux/Makefile{.in,} \
73 --replace-fail '##CURLINC##' '${curl.dev}/include/curl/' \
74 --replace-fail '$(TEST_SUITE): $(PROVIDER_LIB) $(TEST_SUITE_OBJ)' '$(TEST_SUITE): $(TEST_SUITE_OBJ)'
77 env.NIX_CFLAGS_COMPILE = "-Wno-deprecated-declarations";
84 # Online test suite; run with
85 # $(nix-build -A sgx-azure-dcap-client.tests.suite)/bin/tests
86 passthru.tests.suite = callPackage ./test-suite.nix { };
89 description = "Interfaces between SGX SDKs and the Azure Attestation SGX Certification Cache";
90 homepage = "https://github.com/microsoft/azure-dcap-client";
91 maintainers = with lib.maintainers; [
96 platforms = [ "x86_64-linux" ];
97 license = [ lib.licenses.mit ];