2022-01-29 18:54:41 +00:00
|
|
|
{ stdenv, lib, fetchurl, p7zip, uasm, useUasm ? stdenv.isx86_64 }:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (stdenv.hostPlatform) system;
|
|
|
|
platformSuffix =
|
|
|
|
if useUasm then
|
|
|
|
{
|
|
|
|
x86_64-linux = "_x64";
|
|
|
|
}.${system} or (throw "`useUasm` is not supported for system ${system}")
|
|
|
|
else "";
|
|
|
|
in
|
2021-11-12 02:57:14 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "7zz";
|
2022-01-04 23:36:24 +00:00
|
|
|
version = "21.07";
|
2021-03-12 12:44:32 +00:00
|
|
|
|
2021-11-12 02:57:14 +00:00
|
|
|
src = fetchurl {
|
2022-01-04 23:36:24 +00:00
|
|
|
url = "https://7-zip.org/a/7z${lib.replaceStrings [ "." ] [ "" ] version}-src.7z";
|
|
|
|
sha256 = "sha256-0QdNVvQVqrmdmeWXp7ZtxFXbpjSa6KTInfdkdbahKEw=";
|
2021-11-12 02:57:14 +00:00
|
|
|
};
|
2021-03-12 12:44:32 +00:00
|
|
|
|
2021-11-12 02:57:14 +00:00
|
|
|
sourceRoot = "CPP/7zip/Bundles/Alone2";
|
2021-03-12 12:44:32 +00:00
|
|
|
|
2022-01-29 18:54:41 +00:00
|
|
|
makeFlags = lib.optionals useUasm [ "MY_ASM=uasm" ];
|
|
|
|
|
|
|
|
makefile = "../../cmpl_gcc${platformSuffix}.mak";
|
2021-03-12 12:44:32 +00:00
|
|
|
|
2022-01-29 18:54:41 +00:00
|
|
|
nativeBuildInputs = [ p7zip ] ++ lib.optionals useUasm [ uasm ];
|
2021-03-12 12:44:32 +00:00
|
|
|
|
2021-11-12 02:57:14 +00:00
|
|
|
enableParallelBuilding = true;
|
2021-03-12 12:44:32 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2021-11-12 02:57:14 +00:00
|
|
|
|
2022-01-29 18:54:41 +00:00
|
|
|
install -Dm555 -t $out/bin b/g${platformSuffix}/7zz
|
2021-11-12 02:57:14 +00:00
|
|
|
install -Dm444 -t $out/share/doc/${pname} ../../../../DOC/*.txt
|
|
|
|
|
2021-03-12 12:44:32 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2021-11-12 02:57:14 +00:00
|
|
|
doInstallCheck = true;
|
2021-03-12 12:44:32 +00:00
|
|
|
|
2021-11-12 02:57:14 +00:00
|
|
|
installCheckPhase = ''
|
|
|
|
$out/bin/7zz --help | grep ${version}
|
|
|
|
'';
|
2021-03-12 12:44:32 +00:00
|
|
|
|
2021-11-12 02:57:14 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Command line archiver utility";
|
2022-01-29 18:54:41 +00:00
|
|
|
homepage = "https://7-zip.org";
|
2021-11-12 02:57:14 +00:00
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
maintainers = with maintainers; [ anna328p peterhoeg ];
|
|
|
|
platforms = platforms.linux;
|
2021-03-12 12:44:32 +00:00
|
|
|
};
|
|
|
|
}
|