optee-client: init at 4.6.0

OP-TEE client provides libraries, headers, and a userspace supplicant
for interacting with OP-TEE OS, a trusted execution environment for ARM.
This commit is contained in:
Jared Baur 2023-06-13 11:26:55 -07:00
parent 166dd6f3da
commit 1a5d1358b7
No known key found for this signature in database

View File

@ -0,0 +1,72 @@
{
fetchFromGitHub,
isNixOS ? true,
lib,
libuuid,
pkg-config,
stdenv,
which,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "optee-client";
version = "4.6.0";
src = fetchFromGitHub {
owner = "OP-TEE";
repo = "optee_client";
rev = finalAttrs.version;
hash = "sha256-hHEIn0WU4XfqwZbOdg9kwSDxDcvK7Tvxtelamfc3IRM=";
};
outputs = [
"out"
"lib"
"dev"
];
strictDeps = true;
enableParallelBuilding = true;
nativeBuildInputs = [
which
pkg-config
];
buildInputs = [ libuuid ];
makeFlags =
[
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
"DESTDIR=$(out)"
"SBINDIR=/bin"
"INCLUDEDIR=/include"
"LIBDIR=/lib"
]
++
# If we are building for NixOS, change default optee config to use paths
# that will work well with NixOS.
lib.optionals isNixOS [
"CFG_TEE_CLIENT_LOAD_PATH=/run/current-system/sw/lib"
"CFG_TEE_PLUGIN_LOAD_PATH=/run/current-system/sw/lib/tee-supplicant/plugins"
"CFG_TEE_FS_PARENT_PATH=/var/lib/tee"
];
preFixup = ''
mkdir -p "$lib" "$dev"
mv "$out/lib" "$lib"
mv "$out/include" "$dev"
'';
meta = {
description = "Normal world client for OPTEE OS";
homepage = "https://github.com/OP-TEE/optee_client";
changelog = "https://github.com/OP-TEE/optee_client/releases/tag/${finalAttrs.version}";
license = lib.licenses.bsd2;
maintainers = [ lib.maintainers.jmbaur ];
platforms = [
"aarch64-linux"
"armv7l-linux"
];
};
})