3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/archivers/zpaq/zpaqd.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

41 lines
1.1 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, unzip }:
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";
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
};
2013-10-20 19:30:40 +01:00
sourceRoot = ".";
nativeBuildInputs = [ unzip ];
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
'';
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"
'';
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;
maintainers = with maintainers; [ raskin ];
platforms = platforms.linux;
2013-10-20 19:30:40 +01:00
};
}