@@ -1,4 +1,4 @@
1−{ stdenv, fetchFromGitHub, fetchpatch }:
1+{ stdenv, fetchFromGitHub, fetchpatch, cmake }:
3stdenv.mkDerivation rec {
3stdenv.mkDerivation rec {
4 name = "zopfli-${version}";
4 name = "zopfli-${version}";
@@ -23,27 +23,26 @@ stdenv.mkDerivation rec {
23 name = "zopfli-bug-and-typo-fixes.patch";
23 name = "zopfli-bug-and-typo-fixes.patch";
24 url = "https://github.com/google/zopfli/commit/7190e08ecac2446c7c9157cfbdb7157b18912a92.patch";
24 url = "https://github.com/google/zopfli/commit/7190e08ecac2446c7c9157cfbdb7157b18912a92.patch";
27+ name = "zopfli-cmake.patch";
28+ url = "https://github.com/google/zopfli/commit/7554e4d34e7000b0595aa606e7d72357cf46ba86.patch";
29+ sha256 = "1pvfhir2083v1l042a4dy5byqdmad7sxnd4jrprl2hzzb2avxbbn";
28− enableParallelBuilding = false; # problems, easily reproducible
33+ nativeBuildInputs = [ cmake ];
36− installPhase = ''
35+ cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" "-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON" ];
38− install -m755 zopfli{,png} $out/bin
40− mkdir -p $out/lib
37+ installPhase = ''
38+ install -D -t $out/bin zopfli*
41− install -m755 libzopfli{,png}.so* $out/lib
40+ cp -d libzopfli* $out/lib
43− mkdir -p $out/share/doc/zopfli
41+ install -Dm444 -t $out/share/doc/zopfli ../README*
44− install -m644 README* $out/share/doc/zopfli
44+ enableParallelBuilding = true;
47 meta = with stdenv.lib; {
46 meta = with stdenv.lib; {
48 inherit (src.meta) homepage;
47 inherit (src.meta) homepage;
49 description = "Very good, but slow, deflate or zlib compression";
48 description = "Very good, but slow, deflate or zlib compression";
@@ -54,7 +53,7 @@ stdenv.mkDerivation rec {
54 This library can only compress, not decompress. Existing zlib or
53 This library can only compress, not decompress. Existing zlib or
55 deflate libraries can decompress the data.
54 deflate libraries can decompress the data.
57− platforms = platforms.linux;
56+ platforms = platforms.unix;
58 license = licenses.asl20;
57 license = licenses.asl20;
59 maintainers = with maintainers; [ bobvanderlinden nckx ];
58 maintainers = with maintainers; [ bobvanderlinden nckx ];