2017-11-29 15:10:25 +00:00
|
|
|
{ stdenv, fetchFromGitHub, fetchpatch, cmake }:
|
2015-06-06 16:18:04 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "zopfli-${version}";
|
2018-08-08 22:42:35 +01:00
|
|
|
version = "1.0.2";
|
2015-06-06 16:18:04 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = "zopfli";
|
|
|
|
rev = name;
|
|
|
|
name = "${name}-src";
|
2018-08-08 22:42:35 +01:00
|
|
|
sha256 = "1l551hx2p4qi0w9lk96qklbv6ll68gxbah07fhqx1ly28rv5wy9y";
|
2015-06-06 16:18:04 +01:00
|
|
|
};
|
|
|
|
|
2016-01-02 13:52:08 +00:00
|
|
|
patches = [
|
2017-11-29 15:10:25 +00:00
|
|
|
(fetchpatch {
|
|
|
|
name = "zopfli-cmake.patch";
|
|
|
|
url = "https://github.com/google/zopfli/commit/7554e4d34e7000b0595aa606e7d72357cf46ba86.patch";
|
|
|
|
sha256 = "1pvfhir2083v1l042a4dy5byqdmad7sxnd4jrprl2hzzb2avxbbn";
|
|
|
|
})
|
2016-01-02 13:52:08 +00:00
|
|
|
];
|
|
|
|
|
2017-11-29 15:10:25 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2016-01-02 13:52:08 +00:00
|
|
|
|
2017-11-29 15:10:25 +00:00
|
|
|
cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" "-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON" ];
|
2016-01-02 13:54:23 +00:00
|
|
|
|
2017-11-29 15:10:25 +00:00
|
|
|
installPhase = ''
|
|
|
|
install -D -t $out/bin zopfli*
|
|
|
|
install -d $out/lib
|
|
|
|
cp -d libzopfli* $out/lib
|
|
|
|
install -Dm444 -t $out/share/doc/zopfli ../README*
|
2015-06-06 16:18:04 +01:00
|
|
|
'';
|
|
|
|
|
2017-11-29 15:10:25 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2015-06-06 16:18:04 +01:00
|
|
|
meta = with stdenv.lib; {
|
2016-01-02 13:52:08 +00:00
|
|
|
inherit (src.meta) homepage;
|
|
|
|
description = "Very good, but slow, deflate or zlib compression";
|
|
|
|
longDescription = ''
|
|
|
|
Zopfli Compression Algorithm is a compression library programmed
|
|
|
|
in C to perform very good, but slow, deflate or zlib compression.
|
2015-06-06 16:18:04 +01:00
|
|
|
|
2016-01-02 13:52:08 +00:00
|
|
|
This library can only compress, not decompress. Existing zlib or
|
|
|
|
deflate libraries can decompress the data.
|
|
|
|
'';
|
2017-11-29 15:10:25 +00:00
|
|
|
platforms = platforms.unix;
|
2016-01-02 13:52:08 +00:00
|
|
|
license = licenses.asl20;
|
2018-01-16 21:59:13 +00:00
|
|
|
maintainers = with maintainers; [ bobvanderlinden ];
|
2015-06-06 16:18:04 +01:00
|
|
|
};
|
|
|
|
}
|