fix(nix): remove onnxruntime overlay, use nixpkgs native package (#1149)
This commit is contained in:
parent
552ebe5378
commit
892658ee89
3 changed files with 8 additions and 40 deletions
7
.github/workflows/nix-check.yml
vendored
7
.github/workflows/nix-check.yml
vendored
|
|
@ -108,9 +108,12 @@ jobs:
|
|||
- name: Check if nix files changed
|
||||
if: github.event_name == 'pull_request'
|
||||
id: nix-files
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
git fetch origin ${{ github.base_ref }} --depth=1
|
||||
if git diff --name-only origin/${{ github.base_ref }}...HEAD | grep -qE '^(flake\.(nix|lock)|\.nix/|bun\.lock|src-tauri/(Cargo\.(toml|lock)|tauri\.conf\.json|build\.rs))'; then
|
||||
if gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files \
|
||||
--paginate --jq '.[].filename' | \
|
||||
grep -qE '^(flake\.(nix|lock)|\.nix/|bun\.lock|src-tauri/(Cargo\.(toml|lock)|tauri\.conf\.json|build\.rs))'; then
|
||||
echo "changed=true" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -60,11 +60,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1770562336,
|
||||
"narHash": "sha256-ub1gpAONMFsT/GU2hV6ZWJjur8rJ6kKxdm9IlCT0j84=",
|
||||
"lastModified": 1774386573,
|
||||
"narHash": "sha256-4hAV26quOxdC6iyG7kYaZcM3VOskcPUrdCQd/nx8obc=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "d6c71932130818840fc8fe9509cf50be8c64634f",
|
||||
"rev": "46db2e09e1d3f113a13c0d7b81e2f221c63b8ce9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
|||
35
flake.nix
35
flake.nix
|
|
@ -67,39 +67,6 @@
|
|||
GST_PLUGIN_SYSTEM_PATH_1_0 = "${lib.makeSearchPathOutput "lib" "lib/gstreamer-1.0" (gstPlugins pkgs)}";
|
||||
};
|
||||
|
||||
# TODO: Remove this overlay once nixpkgs ships onnxruntime ≥ 1.24.
|
||||
# Tracking PR: https://github.com/NixOS/nixpkgs/pull/499389
|
||||
# ort-sys 2.0.0-rc.12 requires ONNX Runtime 1.24 (API v24);
|
||||
# nixpkgs only ships 1.23.2, so use MS prebuilt binaries.
|
||||
onnxruntimeOverlay = (final: prev: {
|
||||
onnxruntime = let
|
||||
onnxVersion = "1.24.2";
|
||||
platform = {
|
||||
x86_64-linux = { name = "linux-x64"; hash = "sha256-Q3JUdLpWY2QuF2hHF5Rmk4UOIAXvvXJKxy2ieP6tJeY="; };
|
||||
aarch64-linux = { name = "linux-aarch64"; hash = "sha256-spla8PQ3xOAi/YAcV/tcJf0f5mDNM9JutHGUSQpbRsQ="; };
|
||||
}.${final.system};
|
||||
in prev.stdenv.mkDerivation {
|
||||
pname = "onnxruntime";
|
||||
version = onnxVersion;
|
||||
src = prev.fetchurl {
|
||||
url = "https://github.com/microsoft/onnxruntime/releases/download/v${onnxVersion}/onnxruntime-${platform.name}-${onnxVersion}.tgz";
|
||||
hash = platform.hash;
|
||||
};
|
||||
sourceRoot = "onnxruntime-${platform.name}-${onnxVersion}";
|
||||
nativeBuildInputs = [ prev.autoPatchelfHook ];
|
||||
buildInputs = [ prev.stdenv.cc.cc.lib ];
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/lib $out/include
|
||||
cp -r lib/* $out/lib/
|
||||
cp -r include/* $out/include/
|
||||
runHook postInstall
|
||||
'';
|
||||
meta = prev.onnxruntime.meta // {
|
||||
description = "ONNX Runtime ${onnxVersion} (prebuilt by Microsoft)";
|
||||
};
|
||||
};
|
||||
});
|
||||
in
|
||||
{
|
||||
packages = forAllSystems (
|
||||
|
|
@ -109,7 +76,6 @@
|
|||
inherit system;
|
||||
overlays = [
|
||||
bun2nix.overlays.default
|
||||
onnxruntimeOverlay
|
||||
];
|
||||
};
|
||||
lib = pkgs.lib;
|
||||
|
|
@ -257,7 +223,6 @@
|
|||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ onnxruntimeOverlay ];
|
||||
};
|
||||
in
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue