diff options
Diffstat (limited to 'pkgs/by-name/ch/chatd/package.nix')
-rw-r--r-- | pkgs/by-name/ch/chatd/package.nix | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/pkgs/by-name/ch/chatd/package.nix b/pkgs/by-name/ch/chatd/package.nix index 692e7d752971..28a3f6d5cf3e 100644 --- a/pkgs/by-name/ch/chatd/package.nix +++ b/pkgs/by-name/ch/chatd/package.nix @@ -33,12 +33,11 @@ buildNpmPackage rec { nativeBuildInputs = [ makeWrapper electron - autoPatchelfHook # for onnx libs pkg-config - ]; + ] ++ lib.optional stdenv.isLinux autoPatchelfHook; # for onnx libs buildInputs = [ - stdenv.cc.cc.lib # for libstdc++.so, required by onnxruntime + (lib.getLib stdenv.cc.cc) # for libstdc++.so, required by onnxruntime vips # or it will try to download from the Internet ]; @@ -67,15 +66,17 @@ buildNpmPackage rec { find $out/share/chatd/node_modules -name '*.exe' -or -name '*.dll' -or -name '*.pdb' -delete rm -rf ${ lib.concatStringsSep " " ( - (lib.optional (!stdenv.isx86_64) "$out/share/chatd/node_modules/onnxruntime-node/bin/napi-v3/*/x64") + (lib.optional ( + !stdenv.hostPlatform.isx86_64 + ) "$out/share/chatd/node_modules/onnxruntime-node/bin/napi-v3/*/x64") ++ (lib.optional ( - !stdenv.isAarch64 + !stdenv.hostPlatform.isAarch64 ) "$out/share/chatd/node_modules/onnxruntime-node/bin/napi-v3/*/arm64") ++ (lib.optional ( - !stdenv.isDarwin + !stdenv.hostPlatform.isDarwin ) "$out/share/chatd/node_modules/onnxruntime-node/bin/napi-v3/darwin") ++ (lib.optional ( - !stdenv.isLinux + !stdenv.hostPlatform.isLinux ) "$out/share/chatd/node_modules/onnxruntime-node/bin/napi-v3/linux") ) } |