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

50 lines
1.3 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, perl, unzip }:
2013-03-09 12:30:22 +00:00
let
s = # Generated upstream information
rec {
baseName="zpaq";
2016-04-17 16:43:44 +00:00
version="711";
2013-03-09 12:30:22 +00:00
name="${baseName}-${version}";
2016-04-17 16:43:44 +00:00
hash="0kva9xn3rhm2xpbbq3yrx3c9y150fw434ayd82fzhr24nsjjaxsf";
url="http://mattmahoney.net/dc/zpaq711.zip";
sha256="0kva9xn3rhm2xpbbq3yrx3c9y150fw434ayd82fzhr24nsjjaxsf";
2013-03-09 12:30:22 +00:00
};
in
stdenv.mkDerivation {
inherit (s) name version;
2013-03-09 12:30:22 +00:00
src = fetchurl {
inherit (s) url sha256;
};
2013-03-09 12:30:22 +00:00
sourceRoot = ".";
nativeBuildInputs = [ perl /* for pod2man */ ];
buildInputs = [ unzip ];
preBuild = let
CPPFLAGS = with stdenv; ""
+ (lib.optionalString (!isi686 && !isx86_64) "-DNOJIT ")
+ "-Dunix";
CXXFLAGS = with stdenv; ""
+ (lib.optionalString (isi686) "-march=i686 ")
+ (lib.optionalString (isx86_64) "-march=nocona ")
+ "-O3 -mtune=generic -DNDEBUG";
in ''
buildFlagsArray=( "CPPFLAGS=${CPPFLAGS}" "CXXFLAGS=${CXXFLAGS}" )
2013-03-09 12:30:22 +00:00
'';
enableParallelBuilding = true;
installFlags = [ "PREFIX=$(out)" ];
meta = with stdenv.lib; {
2013-03-09 12:30:22 +00:00
inherit (s) version;
description = "Incremental journaling backup utility and archiver";
license = licenses.gpl3Plus ;
maintainers = with maintainers; [ raskin nckx ];
platforms = platforms.linux;
2013-03-09 12:30:22 +00:00
homepage = "http://mattmahoney.net/dc/zpaq.html";
};
}