nixpkgs-suyu/pkgs/tools/archivers/rar/default.nix

60 lines
1.7 KiB
Nix
Raw Normal View History

2021-09-29 04:39:51 +02:00
{ lib, stdenv, fetchurl, autoPatchelfHook, installShellFiles }:
let
version = "6.0.2";
2021-09-30 04:52:18 +02:00
srcUrl = {
i686-linux = {
2021-09-29 04:39:51 +02:00
url = "https://www.rarlab.com/rar/rarlinux-${version}.tar.gz";
2021-09-30 04:52:18 +02:00
sha256 = "sha256-5iqk7eoo+hgltgscquob+wofzhuqz0m/8jf7bxdf9qa=";
};
x86_64-linux = {
2021-09-29 04:39:51 +02:00
url = "https://www.rarlab.com/rar/rarlinux-x64-${version}.tar.gz";
sha256 = "sha256-WAvrUGCgfwI51Mo/RYSSF0OLPPrTegUCuDEsnBeR9uQ=";
2021-09-30 04:52:18 +02:00
};
x86_64-darwin = {
url = "https://www.rarlab.com/rar/rarosx-${version}.tar.gz";
sha256 = "sha256-baZ71vYXIGs25f7PJ0ujoGUrsWZRmFLhvDI0KoVktsg=";
};
}.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}");
2021-09-29 04:39:51 +02:00
manSrc = fetchurl {
url = "https://aur.archlinux.org/cgit/aur.git/plain/rar.1?h=rar&id=8e39a12e88d8a3b168c496c44c18d443c876dd10";
name = "rar.1";
sha256 = "sha256-93cSr9oAsi+xHUtMsUvICyHJe66vAImS2tLie7nt8Uw=";
};
in
stdenv.mkDerivation rec {
pname = "rar";
inherit version;
src = fetchurl srcUrl;
dontBuild = true;
buildInputs = [ stdenv.cc.cc.lib ];
nativeBuildInputs = [ autoPatchelfHook installShellFiles ];
installPhase = ''
runHook preInstall
install -Dm755 {rar,unrar} -t "$out/bin"
install -Dm755 default.sfx -t "$out/lib"
install -Dm644 {acknow.txt,license.txt} -t "$out/share/doc/rar"
install -Dm644 rarfiles.lst -t "$out/etc"
runHook postInstall
'';
postInstall = ''
installManPage ${manSrc}
'';
meta = with lib; {
description = "Utility for RAR archives";
homepage = "https://www.rarlab.com/";
license = licenses.unfree;
maintainers = with maintainers; [ thiagokokada ];
2021-09-30 04:52:18 +02:00
platforms = with platforms; linux ++ darwin;
2021-09-29 04:39:51 +02:00
};
}