nixpkgs/pkgs/tools/archivers/7zz/default.nix

49 lines
1.3 KiB
Nix
Raw Normal View History

{ stdenv, lib, fetchurl, p7zip }:
2021-03-12 13:44:32 +01:00
# https://sourceforge.net/p/sevenzip/discussion/45797/thread/7fe6c21efa/
stdenv.mkDerivation rec {
pname = "7zz";
version = "21.04";
2021-03-12 13:44:32 +01:00
src = fetchurl {
url = "https://7-zip.org/a/7z${lib.replaceStrings ["." ] [""] version}-src.7z";
sha256 = "sha256-XmuEyIJAJQM0ZbgrW02lQ2rp4KFDBjLXKRaTfY+VCOg=";
};
2021-03-12 13:44:32 +01:00
sourceRoot = "CPP/7zip/Bundles/Alone2";
2021-03-12 13:44:32 +01:00
# we need https://github.com/nidud/asmc/tree/master/source/asmc/linux in order
# to build with the optimized assembler but that doesn't support building with
# GCC: https://github.com/nidud/asmc/issues/8
makefile = "../../cmpl_gcc.mak"; # "../../cmpl_gcc_x64.mak";
2021-03-12 13:44:32 +01:00
NIX_CFLAGS_COMPILE = [ "-Wno-error=maybe-uninitialized" ];
2021-03-12 13:44:32 +01:00
nativeBuildInputs = [ p7zip ];
2021-03-12 13:44:32 +01:00
enableParallelBuilding = true;
2021-03-12 13:44:32 +01:00
installPhase = ''
runHook preInstall
install -Dm555 -t $out/bin b/g/7zz
install -Dm444 -t $out/share/doc/${pname} ../../../../DOC/*.txt
2021-03-12 13:44:32 +01:00
runHook postInstall
'';
doInstallCheck = true;
2021-03-12 13:44:32 +01:00
installCheckPhase = ''
$out/bin/7zz --help | grep ${version}
'';
2021-03-12 13:44:32 +01:00
meta = with lib; {
description = "Command line archiver utility";
homepage = "https://7zip.org";
license = licenses.lgpl21Plus;
maintainers = with maintainers; [ anna328p peterhoeg ];
platforms = platforms.linux;
2021-03-12 13:44:32 +01:00
};
}