2024-11-09 23:37:56 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchzip,
|
2023-09-27 07:31:50 +00:00
|
|
|
}:
|
2014-04-07 21:13:24 +00:00
|
|
|
|
2023-09-27 07:31:50 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "unrar";
|
2024-12-05 12:43:31 +00:00
|
|
|
version = "7.1.2";
|
2007-06-24 15:34:44 +00:00
|
|
|
|
2023-09-27 07:31:50 +00:00
|
|
|
src = fetchzip {
|
|
|
|
url = "https://www.rarlab.com/rar/unrarsrc-${finalAttrs.version}.tar.gz";
|
|
|
|
stripRoot = false;
|
2024-12-05 12:43:31 +00:00
|
|
|
hash = "sha256-6xqAik10YSXh2pm/j0dSeQXDWAGVnOf6eOD7Od9+LZA=";
|
2007-06-24 15:34:44 +00:00
|
|
|
};
|
|
|
|
|
2023-09-27 07:31:50 +00:00
|
|
|
sourceRoot = finalAttrs.src.name;
|
|
|
|
|
2016-03-11 09:42:16 +00:00
|
|
|
postPatch = ''
|
2023-09-27 07:31:50 +00:00
|
|
|
substituteInPlace unrar/makefile \
|
2024-11-09 23:37:56 +00:00
|
|
|
--replace-fail "CXX=" "#CXX=" \
|
|
|
|
--replace-fail "STRIP=" "#STRIP=" \
|
|
|
|
--replace-fail "AR=" "#AR="
|
2016-03-11 09:42:16 +00:00
|
|
|
'';
|
|
|
|
|
2024-11-09 23:37:56 +00:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"dev"
|
|
|
|
];
|
2023-09-27 07:31:50 +00:00
|
|
|
|
|
|
|
# `make {unrar,lib}` call `make clean` implicitly
|
|
|
|
# separate build into different dirs to avoid deleting them
|
2016-03-05 06:15:46 +00:00
|
|
|
buildPhase = ''
|
2023-09-27 07:31:50 +00:00
|
|
|
runHook preBuild
|
2021-09-30 23:49:42 +00:00
|
|
|
|
2023-09-27 07:31:50 +00:00
|
|
|
cp -a unrar libunrar
|
|
|
|
make -C libunrar lib
|
|
|
|
make -C unrar -j1
|
2021-09-30 23:49:42 +00:00
|
|
|
|
2023-09-27 07:31:50 +00:00
|
|
|
runHook postBuild
|
2014-12-17 18:11:30 +00:00
|
|
|
'';
|
|
|
|
|
2010-01-07 22:42:25 +00:00
|
|
|
installPhase = ''
|
2023-09-27 07:31:50 +00:00
|
|
|
runHook preInstall
|
2014-09-05 14:14:36 +00:00
|
|
|
|
2023-09-27 07:31:50 +00:00
|
|
|
install -Dm755 unrar/unrar -t $out/bin/
|
|
|
|
install -Dm644 unrar/{acknow.txt,license.txt} -t $out/share/doc/unrar/
|
2016-03-05 06:15:46 +00:00
|
|
|
|
2023-09-27 07:31:50 +00:00
|
|
|
install -Dm755 libunrar/libunrar.so -t $out/lib/
|
|
|
|
install -Dm644 libunrar/dll.hpp -t $dev/include/unrar/
|
2020-01-23 17:31:23 +00:00
|
|
|
|
2023-09-27 07:31:50 +00:00
|
|
|
runHook postInstall
|
2010-01-07 22:42:25 +00:00
|
|
|
'';
|
2007-06-24 15:34:44 +00: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 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;
|
2023-11-09 13:21:35 +00:00
|
|
|
mainProgram = "unrar";
|
2024-02-09 11:39:43 +00:00
|
|
|
maintainers = with maintainers; [ wegank ];
|
2014-09-05 14:14:36 +00:00
|
|
|
platforms = platforms.all;
|
2014-04-07 21:13:24 +00:00
|
|
|
};
|
2023-09-27 07:31:50 +00:00
|
|
|
})
|