2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchurl, unzip }:
|
2017-05-22 22:09:06 +01:00
|
|
|
|
2013-10-20 19:30:40 +01:00
|
|
|
let
|
2021-01-15 09:19:50 +00:00
|
|
|
compileFlags = lib.concatStringsSep " " ([ "-O3" "-DNDEBUG" ]
|
|
|
|
++ lib.optional (stdenv.hostPlatform.isUnix) "-Dunix -pthread"
|
|
|
|
++ lib.optional (!stdenv.hostPlatform.isx86) "-DNOJIT");
|
2013-10-20 19:30:40 +01:00
|
|
|
in
|
2021-12-21 10:50:09 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "zpaqd";
|
|
|
|
version = "715";
|
2015-12-31 03:50:57 +00:00
|
|
|
|
2013-10-20 19:30:40 +01:00
|
|
|
src = fetchurl {
|
2021-12-21 10:50:09 +00:00
|
|
|
url = "http://mattmahoney.net/dc/zpaqd${version}.zip";
|
|
|
|
sha256 = "sha256-Mx87Zt0AASk0ZZCjyTzYbhlYJAXBlb59OpUWsqynyCA=";
|
2013-10-20 19:30:40 +01:00
|
|
|
};
|
2015-12-31 03:50:57 +00:00
|
|
|
|
2013-10-20 19:30:40 +01:00
|
|
|
sourceRoot = ".";
|
2015-12-31 03:50:57 +00:00
|
|
|
|
2021-02-20 21:01:53 +00:00
|
|
|
nativeBuildInputs = [ unzip ];
|
2015-12-31 03:50:57 +00:00
|
|
|
|
2013-10-20 19:30:40 +01:00
|
|
|
buildPhase = ''
|
2022-01-09 01:44:43 +00:00
|
|
|
$CXX ${compileFlags} -fPIC --shared libzpaq.cpp -o libzpaq.so
|
|
|
|
$CXX ${compileFlags} -L. -L"$out/lib" -lzpaq zpaqd.cpp -o zpaqd
|
2013-10-20 19:30:40 +01:00
|
|
|
'';
|
2015-12-31 03:50:57 +00:00
|
|
|
|
2013-10-20 19:30:40 +01:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out"/{bin,include,lib,share/doc/zpaq}
|
|
|
|
cp libzpaq.so "$out/lib"
|
|
|
|
cp zpaqd "$out/bin"
|
|
|
|
cp libzpaq.h "$out/include"
|
|
|
|
cp readme_zpaqd.txt "$out/share/doc/zpaq"
|
|
|
|
'';
|
2015-12-31 03:50:57 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2015-12-31 04:09:13 +00:00
|
|
|
description = "ZPAQ archive (de)compressor and algorithm development tool";
|
2021-12-21 10:50:09 +00:00
|
|
|
license = licenses.gpl3Plus;
|
2018-01-16 21:59:13 +00:00
|
|
|
maintainers = with maintainers; [ raskin ];
|
2015-12-31 03:50:57 +00:00
|
|
|
platforms = platforms.linux;
|
2013-10-20 19:30:40 +01:00
|
|
|
};
|
|
|
|
}
|