rar: allow evaluation in all platforms

This commit is contained in:
Thiago Kenji Okada 2024-01-08 19:27:17 +00:00
parent b2d0d556f1
commit ce262e4287

View file

@ -9,7 +9,7 @@ let
version = "6.24";
downloadVersion = lib.replaceStrings [ "." ] [ "" ] version;
# Use `./update.sh` to generate the entries below
srcUrl = {
srcs = {
i686-linux = {
url = "https://www.rarlab.com/rar/rarlinux-x32-${downloadVersion}.tar.gz";
hash = "sha256-aacgJH0iJLRNEaZuVyzl/FxZgSnW3dIZFUfaqt0l88M=";
@ -26,7 +26,7 @@ let
url = "https://www.rarlab.com/rar/rarmacos-x64-${downloadVersion}.tar.gz";
hash = "sha256-4vENPNfMpQstsm9+8+glHPK9fAlDmnHWbCHW+HUwSX4=";
};
}.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}");
};
manSrc = fetchurl {
url = "https://aur.archlinux.org/cgit/aur.git/plain/rar.1?h=rar&id=8e39a12e88d8a3b168c496c44c18d443c876dd10";
name = "rar.1";
@ -37,7 +37,7 @@ stdenv.mkDerivation {
pname = "rar";
inherit version;
src = fetchurl srcUrl;
src = fetchurl (srcs.${stdenv.hostPlatform.system});
dontBuild = true;
@ -69,7 +69,7 @@ stdenv.mkDerivation {
license = licenses.unfree;
mainProgram = "rar";
maintainers = with maintainers; [ thiagokokada ];
platforms = with platforms; linux ++ darwin;
platforms = lib.attrNames srcs;
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
};
}