Merge pull request #145229 from Artturin/unrarwrapper

unrar-wrapper: init at 1.0.0
This commit is contained in:
Thiago Kenji Okada 2021-11-10 11:55:57 -03:00 committed by GitHub
commit 65ab754a1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,36 @@
{ lib, buildPythonApplication, fetchFromGitHub, unar }:
buildPythonApplication rec {
pname = "unrar-wrapper";
version = "1.0.0";
src = fetchFromGitHub {
owner = "openSUSE";
repo = "unrar_wrapper";
rev = "unrar_wrapper-${version}";
sha256 = "sha256-HjrUif8MrbtLjRQMAPZ/Y2o43rGSDj0HHY4fZQfKz5w=";
};
makeWrapperArgs = [
"--prefix" "PATH" ":" "${lib.makeBinPath [ unar ]}"
];
postFixup = ''
ln -s $out/bin/unrar_wrapper $out/bin/unrar
rm -rf $out/nix-support/propagated-build-inputs
'';
setupHook = ./setup-hook.sh;
meta = with lib; {
homepage = "https://github.com/openSUSE/unrar_wrapper";
description = "Backwards compatibility between unar and unrar";
longDescription = ''
unrar_wrapper is a wrapper python script that transforms the basic UnRAR commands
to unar and lsar calls in order to provide a backwards compatibility.
'';
license = licenses.gpl3Only;
platforms = platforms.unix;
maintainers = with maintainers; [ artturin ];
};
}

View File

@ -0,0 +1,5 @@
unpackCmdHooks+=(_tryUnrar)
_tryUnrar() {
if ! [[ "$curSrc" =~ \.rar$ ]]; then return 1; fi
unrar x "$curSrc" >/dev/null
}

View File

@ -10616,6 +10616,8 @@ with pkgs;
unrar = callPackage ../tools/archivers/unrar { };
unrar-wrapper = python3Packages.callPackage ../tools/archivers/unrar-wrapper { };
vul = callPackage ../applications/misc/vul { };
xar = callPackage ../tools/compression/xar { };