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