10 downloadVersion = lib.replaceStrings [ "." ] [ "" ] version;
11 # Use `./update.sh` to generate the entries below
14 url = "https://www.rarlab.com/rar/rarlinux-x32-${downloadVersion}.tar.gz";
15 hash = "sha256-1CSbxM7arGpn4Yj5fHEFKcDURFPrC2+XptLoaDH8LDs=";
18 url = "https://www.rarlab.com/rar/rarlinux-x64-${downloadVersion}.tar.gz";
19 hash = "sha256-34iWajylsSmIOuAT6kV7c2537qWFHc+gT+JT/trWrw8=";
22 url = "https://www.rarlab.com/rar/rarmacos-arm-${downloadVersion}.tar.gz";
23 hash = "sha256-BjEJFzKyRpN4XL6KYW7ykQcSxqF4tYr2dCFf50JHH38=";
26 url = "https://www.rarlab.com/rar/rarmacos-x64-${downloadVersion}.tar.gz";
27 hash = "sha256-1ExnVDre49wWwB/BKP/L9xdYOMx8qkeZfmObJ7xm4dY=";
31 url = "https://aur.archlinux.org/cgit/aur.git/plain/rar.1?h=rar&id=8e39a12e88d8a3b168c496c44c18d443c876dd10";
33 hash = "sha256-93cSr9oAsi+xHUtMsUvICyHJe66vAImS2tLie7nt8Uw=";
40 src = fetchurl (srcs.${stdenv.hostPlatform.system} or (throw "unsupported system ${stdenv.hostPlatform.system}"));
44 buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ (lib.getLib stdenv.cc.cc) ];
46 nativeBuildInputs = [ installShellFiles ]
47 ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ];
52 install -Dm755 {rar,unrar} -t "$out/bin"
53 install -Dm755 default.sfx -t "$out/lib"
54 install -Dm644 {acknow.txt,license.txt} -t "$out/share/doc/rar"
55 install -Dm644 rarfiles.lst -t "$out/etc"
61 installManPage ${manSrc}
64 passthru.updateScript = ./update.sh;
67 description = "Utility for RAR archives";
68 homepage = "https://www.rarlab.com/";
69 license = licenses.unfree;
71 maintainers = with maintainers; [ thiagokokada ];
72 platforms = lib.attrNames srcs;
73 sourceProvenance = with sourceTypes; [ binaryNativeCode ];