nixpkgs/pkgs/tools/archivers/unrar/default.nix

55 lines
1.2 KiB
Nix
Raw Normal View History

{lib, stdenv, fetchurl}:
2014-04-07 21:13:24 +00:00
stdenv.mkDerivation rec {
pname = "unrar";
2021-12-12 09:20:20 +00:00
version = "6.1.3";
src = fetchurl {
2017-10-12 17:17:22 +00:00
url = "https://www.rarlab.com/rar/unrarsrc-${version}.tar.gz";
2021-12-12 09:20:20 +00:00
sha256 = "sha256-0FAiRCAJICp5LliL7FiSHBI/8Eb8dV9/InKHGlvXljY=";
};
2016-03-11 09:42:16 +00:00
postPatch = ''
substituteInPlace makefile \
--replace "CXX=" "#CXX=" \
--replace "STRIP=" "#STRIP=" \
--replace "AR=" "#AR="
2016-03-11 09:42:16 +00:00
'';
buildPhase = ''
2021-09-30 23:49:42 +00:00
# `make {unrar,lib}` call `make clean` implicitly
# move build results to another dir to avoid deleting them
mkdir -p bin
make unrar
2021-09-30 23:49:42 +00:00
mv unrar bin
make lib
2021-09-30 23:49:42 +00:00
mv libunrar.so bin
'';
outputs = [ "out" "dev" ];
installPhase = ''
2021-09-30 23:49:42 +00:00
install -Dt "$out/bin" bin/unrar
mkdir -p $out/share/doc/unrar
cp acknow.txt license.txt \
$out/share/doc/unrar
2021-09-30 23:49:42 +00:00
install -Dm755 bin/libunrar.so $out/lib/libunrar.so
install -Dt $dev/include/unrar/ *.hpp
'';
2015-03-27 20:22:51 +00:00
setupHook = ./setup-hook.sh;
meta = with lib; {
2014-04-07 21:13:24 +00:00
description = "Utility for RAR archives";
2020-04-07 21:36:22 +00:00
homepage = "https://www.rarlab.com/";
2016-01-02 11:30:28 +00:00
license = licenses.unfreeRedistributable;
maintainers = [ maintainers.ehmry ];
platforms = platforms.all;
2014-04-07 21:13:24 +00:00
};
}