diff options
author | Alyssa Ross <hi@alyssa.is> | 2023-11-21 16:12:21 +0100 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2023-11-21 16:12:48 +0100 |
commit | 048a4cd441a59cbf89defb18bb45c9f0b4429b35 (patch) | |
tree | f8f5850ff05521ab82d65745894714a8796cbfb6 /pkgs/tools/archivers/unrar/default.nix | |
parent | 030c5028b07afcedce7c5956015c629486cc79d9 (diff) | |
parent | 4c2d05dd6435d449a3651a6dd314d9411b5f8146 (diff) | |
download | nixpkgs-rootfs.tar nixpkgs-rootfs.tar.gz nixpkgs-rootfs.tar.bz2 nixpkgs-rootfs.tar.lz nixpkgs-rootfs.tar.xz nixpkgs-rootfs.tar.zst nixpkgs-rootfs.zip |
Signed-off-by: Alyssa Ross <hi@alyssa.is>
Diffstat (limited to 'pkgs/tools/archivers/unrar/default.nix')
-rw-r--r-- | pkgs/tools/archivers/unrar/default.nix | 55 |
1 files changed, 31 insertions, 24 deletions
diff --git a/pkgs/tools/archivers/unrar/default.nix b/pkgs/tools/archivers/unrar/default.nix index 74f1bcfe9b8..9350a6fd1ee 100644 --- a/pkgs/tools/archivers/unrar/default.nix +++ b/pkgs/tools/archivers/unrar/default.nix @@ -1,45 +1,51 @@ -{lib, stdenv, fetchurl}: +{ lib +, stdenv +, fetchzip +}: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "unrar"; - version = "6.2.5"; + version = "6.2.12"; - src = fetchurl { - url = "https://www.rarlab.com/rar/unrarsrc-${version}.tar.gz"; - hash = "sha256-mjl0QQ0dNA45mN0qb5j6776DjK1VYmbnFK37Doz5N3w="; + src = fetchzip { + url = "https://www.rarlab.com/rar/unrarsrc-${finalAttrs.version}.tar.gz"; + stripRoot = false; + hash = "sha256-VAL3o9JGmkAcEssa/P/SL9nyxnigb7dX9YZBHrG9f0A="; }; + sourceRoot = finalAttrs.src.name; + postPatch = '' - substituteInPlace makefile \ + substituteInPlace unrar/makefile \ --replace "CXX=" "#CXX=" \ --replace "STRIP=" "#STRIP=" \ --replace "AR=" "#AR=" ''; + outputs = [ "out" "dev" ]; + + # `make {unrar,lib}` call `make clean` implicitly + # separate build into different dirs to avoid deleting them buildPhase = '' - # `make {unrar,lib}` call `make clean` implicitly - # move build results to another dir to avoid deleting them - mkdir -p bin + runHook preBuild - make unrar - mv unrar bin + cp -a unrar libunrar + make -C libunrar lib + make -C unrar -j1 - make lib - mv libunrar.so bin + runHook postBuild ''; - outputs = [ "out" "dev" ]; - installPhase = '' - install -Dt "$out/bin" bin/unrar + runHook preInstall - mkdir -p $out/share/doc/unrar - cp acknow.txt license.txt \ - $out/share/doc/unrar + install -Dm755 unrar/unrar -t $out/bin/ + install -Dm644 unrar/{acknow.txt,license.txt} -t $out/share/doc/unrar/ - install -Dm755 bin/libunrar.so $out/lib/libunrar.so + install -Dm755 libunrar/libunrar.so -t $out/lib/ + install -Dm644 libunrar/dll.hpp -t $dev/include/unrar/ - install -Dt $dev/include/unrar/ *.hpp + runHook postInstall ''; setupHook = ./setup-hook.sh; @@ -48,7 +54,8 @@ stdenv.mkDerivation rec { description = "Utility for RAR archives"; homepage = "https://www.rarlab.com/"; license = licenses.unfreeRedistributable; - maintainers = [ maintainers.ehmry ]; + mainProgram = "unrar"; + maintainers = with maintainers; [ ehmry wegank ]; platforms = platforms.all; }; -} +}) |