uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
109
pkgs/os-specific/linux/sgx/samples/default.nix
Normal file
109
pkgs/os-specific/linux/sgx/samples/default.nix
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
{ stdenv
|
||||
, lib
|
||||
, makeWrapper
|
||||
, sgx-sdk
|
||||
, sgx-psw
|
||||
, which
|
||||
# "SIM" or "HW"
|
||||
, sgxMode
|
||||
}:
|
||||
let
|
||||
isSimulation = sgxMode == "SIM";
|
||||
buildSample = name: stdenv.mkDerivation {
|
||||
pname = name;
|
||||
version = sgxMode;
|
||||
|
||||
src = sgx-sdk.out;
|
||||
sourceRoot = "${sgx-sdk.name}/share/SampleCode/${name}";
|
||||
|
||||
nativeBuildInputs = [
|
||||
makeWrapper
|
||||
which
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
sgx-sdk
|
||||
];
|
||||
|
||||
# The samples don't have proper support for parallel building
|
||||
# causing them to fail randomly.
|
||||
enableParallelBuilding = false;
|
||||
|
||||
buildFlags = [
|
||||
"SGX_MODE=${sgxMode}"
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/{bin,lib}
|
||||
install -m 755 app $out/bin
|
||||
install *.so $out/lib
|
||||
|
||||
wrapProgram "$out/bin/app" \
|
||||
--chdir "$out/lib" \
|
||||
${lib.optionalString (!isSimulation)
|
||||
''--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ sgx-psw ]}"''}
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
# Breaks the signature of the enclaves
|
||||
dontFixup = true;
|
||||
|
||||
# We don't have access to real SGX hardware during the build
|
||||
doInstallCheck = isSimulation;
|
||||
installCheckPhase = ''
|
||||
runHook preInstallCheck
|
||||
|
||||
pushd /
|
||||
echo a | $out/bin/app
|
||||
popd
|
||||
|
||||
runHook preInstallCheck
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
cxx11SGXDemo = buildSample "Cxx11SGXDemo";
|
||||
localAttestation = (buildSample "LocalAttestation").overrideAttrs (oldAttrs: {
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/{bin,lib}
|
||||
install -m 755 bin/app* $out/bin
|
||||
install bin/*.so $out/lib
|
||||
|
||||
for bin in $out/bin/*; do
|
||||
wrapProgram $bin \
|
||||
--chdir "$out/lib" \
|
||||
${lib.optionalString (!isSimulation)
|
||||
''--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ sgx-psw ]}"''}
|
||||
done
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
});
|
||||
powerTransition = buildSample "PowerTransition";
|
||||
protobufSGXDemo = buildSample "ProtobufSGXDemo";
|
||||
remoteAttestation = (buildSample "RemoteAttestation").overrideAttrs (oldAttrs: {
|
||||
# Makefile sets rpath to point to $TMPDIR
|
||||
preFixup = ''
|
||||
patchelf --remove-rpath $out/bin/app
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
install sample_libcrypto/*.so $out/lib
|
||||
'';
|
||||
});
|
||||
sampleEnclave = buildSample "SampleEnclave";
|
||||
sampleEnclavePCL = buildSample "SampleEnclavePCL";
|
||||
sampleEnclaveGMIPP = buildSample "SampleEnclaveGMIPP";
|
||||
sealUnseal = (buildSample "SealUnseal").overrideAttrs (oldAttrs: {
|
||||
prePatch = ''
|
||||
substituteInPlace App/App.cpp \
|
||||
--replace '"sealed_data_blob.txt"' '"/tmp/sealed_data_blob.txt"'
|
||||
'';
|
||||
});
|
||||
switchless = buildSample "Switchless";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue