Expect the C headers in a different location
This should be compatible with a non Nix install of onnxruntime, and easily fixable in nix.
This commit is contained in:
parent
829ce1fd9e
commit
2b0c01830d
@ -1 +1 @@
|
||||
#include <onnxruntime/core/session/onnxruntime_c_api.h>
|
||||
#include <onnxruntime_c_api.h>
|
||||
|
20
default.nix
20
default.nix
@ -14,14 +14,28 @@ let filterSource = with lib; builtins.filterSource (path: type:
|
||||
(baseNameOf path == "build" -> type != "directory") &&
|
||||
(baseNameOf path == "nix" -> type != "directory")
|
||||
);
|
||||
in
|
||||
naersk.buildPackage {
|
||||
|
||||
# Version of onnxruntime.dev with include directory set up the same way as
|
||||
# a released version from microsoft/onnxruntime GitHub release.
|
||||
onnxruntime-headers = stdenv.mkDerivation {
|
||||
name = "onnxruntime-headers";
|
||||
src = onnxruntime.dev;
|
||||
installPhase = ''
|
||||
mkdir -p $out/include
|
||||
|
||||
cp include/onnxruntime/core/session/onnxruntime_c_api.h $out/include/onnxruntime_c_api.h
|
||||
'';
|
||||
};
|
||||
|
||||
in naersk.buildPackage {
|
||||
root = filterSource ./.;
|
||||
|
||||
LIBCLANG_PATH = "${llvmPackages.libclang}/lib";
|
||||
buildInputs = [ onnxruntime.dev ];
|
||||
buildInputs = [ onnxruntime onnxruntime-headers ];
|
||||
nativeBuildInputs = [ pkg-config clang ];
|
||||
|
||||
# Note: This creates a doc attribute (nested derivation)
|
||||
doDoc = true;
|
||||
|
||||
doCheck = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user