From 8bfc662c08baf9357d31b44d9b24742e6b7e055e Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Mon, 19 Feb 2024 06:14:38 +0100 Subject: [PATCH] 7zz: add setup hook script to unpack DMG files --- pkgs/tools/archivers/7zz/default.nix | 2 ++ pkgs/tools/archivers/7zz/setup-hook.sh | 5 +++++ 2 files changed, 7 insertions(+) create mode 100644 pkgs/tools/archivers/7zz/setup-hook.sh diff --git a/pkgs/tools/archivers/7zz/default.nix b/pkgs/tools/archivers/7zz/default.nix index 48b072b0cf4b..a10283dc59f8 100644 --- a/pkgs/tools/archivers/7zz/default.nix +++ b/pkgs/tools/archivers/7zz/default.nix @@ -99,6 +99,8 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = lib.optionals useUasm [ uasm ]; + setupHook = ./setup-hook.sh; + enableParallelBuilding = true; preBuild = "cd CPP/7zip/Bundles/Alone2"; diff --git a/pkgs/tools/archivers/7zz/setup-hook.sh b/pkgs/tools/archivers/7zz/setup-hook.sh new file mode 100644 index 000000000000..97f2cc8a7694 --- /dev/null +++ b/pkgs/tools/archivers/7zz/setup-hook.sh @@ -0,0 +1,5 @@ +unpackCmdHooks+=(_tryUnpackDmg) +_tryUnpackDmg() { + if ! [[ "$curSrc" =~ \.dmg$ ]]; then return 1; fi + 7zz x "$curSrc" +}