From 3b97e45b81a0dd3f6ff3261124f58fc82bc44d0f Mon Sep 17 00:00:00 2001 From: Jamie Magee Date: Tue, 17 Feb 2026 19:42:42 -0800 Subject: [PATCH] avdump3: fix runtime on .NET 8 (was broken on EOL .NET 6) The app targets net6.0, but dotnet-runtime in nixpkgs points to .NET 8. This made the package fail at runtime unless the user also set NIXPKGS_ALLOW_INSECURE=1 to pull in the EOL dotnet-runtime_6. Patch the runtimeconfig.json to set rollForward=major so the app runs on whatever dotnet-runtime version nixpkgs provides. Other fixes while here: - Use autoPatchelfHook instead of LD_LIBRARY_PATH + dontPatchELF - Add libzen (needed by the bundled MediaInfo .so) - Add symlinks for native libs so DllImport resolves them - Use makeBinaryWrapper instead of a hand-written shell wrapper --- pkgs/by-name/av/avdump3/package.nix | 36 +++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/pkgs/by-name/av/avdump3/package.nix b/pkgs/by-name/av/avdump3/package.nix index 06bbb5a6149d..b1b850c9da1a 100644 --- a/pkgs/by-name/av/avdump3/package.nix +++ b/pkgs/by-name/av/avdump3/package.nix @@ -2,9 +2,12 @@ lib, stdenv, fetchzip, + autoPatchelfHook, + makeBinaryWrapper, + jq, dotnet-runtime, zlib, - runtimeShell, + libzen, }: stdenv.mkDerivation { @@ -17,21 +20,36 @@ stdenv.mkDerivation { stripRoot = false; }; + nativeBuildInputs = [ + autoPatchelfHook + makeBinaryWrapper + jq + ]; + + buildInputs = [ + zlib + libzen + stdenv.cc.cc.lib + ]; + installPhase = '' runHook preInstall + mkdir -p $out/share/avdump3 $out/bin mv * $out/share/avdump3 - cat > $out/bin/avdump3 < tmp.json + mv tmp.json $out/share/avdump3/AVDump3CL.runtimeconfig.json + + makeBinaryWrapper ${dotnet-runtime}/bin/dotnet $out/bin/avdump3 \ + --add-flags $out/share/avdump3/AVDump3CL.dll + runHook postInstall ''; - dontPatchELF = true; - meta = { mainProgram = "avdump3"; description = "Tool for extracting audio/video metadata from media files and uploading it to AniDB";