unrar-free: add setupHook

This adds a setupHook to unrar-free which is parallel to the one in
unrar. This enables the unpackPhase to automatically use unrar-free to
unpack RAR files.
This commit is contained in:
George Macon
2024-09-28 11:16:37 -04:00
committed by George Macon
parent 668c45925f
commit 76f6b5efdf
2 changed files with 7 additions and 0 deletions
+2
View File
@@ -21,6 +21,8 @@ stdenv.mkDerivation (finalAttrs: {
buildInputs = [ libarchive ];
setupHook = ./setup-hook.sh;
meta = {
description = "Free utility to extract files from RAR archives";
longDescription = ''
+5
View File
@@ -0,0 +1,5 @@
unpackCmdHooks+=(_tryUnrarFree)
_tryUnrarFree() {
if ! [[ "$curSrc" =~ \.rar$ ]]; then return 1; fi
unrar-free -x "$curSrc" >/dev/null
}