1 { lib, stdenv, fetchurl, unzip }:
4 compileFlags = lib.concatStringsSep " " ([ "-O3" "-DNDEBUG" ]
5 ++ lib.optional (stdenv.hostPlatform.isUnix) "-Dunix -pthread"
6 ++ lib.optional (!stdenv.hostPlatform.isx86) "-DNOJIT");
8 stdenv.mkDerivation rec {
13 url = "http://mattmahoney.net/dc/zpaqd${version}.zip";
14 sha256 = "sha256-Mx87Zt0AASk0ZZCjyTzYbhlYJAXBlb59OpUWsqynyCA=";
19 nativeBuildInputs = [ unzip ];
22 $CXX ${compileFlags} -fPIC --shared libzpaq.cpp -o libzpaq.so
23 $CXX ${compileFlags} -L. -L"$out/lib" -lzpaq zpaqd.cpp -o zpaqd
27 mkdir -p "$out"/{bin,include,lib,share/doc/zpaq}
28 cp libzpaq.so "$out/lib"
30 cp libzpaq.h "$out/include"
31 cp readme_zpaqd.txt "$out/share/doc/zpaq"
35 description = "ZPAQ archive (de)compressor and algorithm development tool";
36 mainProgram = "zpaqd";
37 license = licenses.gpl3Plus;
38 maintainers = with maintainers; [ raskin ];
39 platforms = platforms.linux;