git.iko.soy/typeable/nixpkgs
on master help sign in
zopfli: build on macos
bfd4eaeKosta Welke
pkgs/tools/compression/zopfli/default.nix+16−17
@@ -1,4 +1,4 @@
1−{ stdenv, fetchFromGitHub, fetchpatch }:
1+{ stdenv, fetchFromGitHub, fetchpatch, cmake }:
2
2
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";
25 })
25 })
26+ (fetchpatch {
27+ name = "zopfli-cmake.patch";
28+ url = "https://github.com/google/zopfli/commit/7554e4d34e7000b0595aa606e7d72357cf46ba86.patch";
29+ sha256 = "1pvfhir2083v1l042a4dy5byqdmad7sxnd4jrprl2hzzb2avxbbn";
30+ })
26 ];
31 ];
27
32
28− enableParallelBuilding = false; # problems, easily reproducible
33+ nativeBuildInputs = [ cmake ];
29− buildFlags = [
30− "zopfli"
31− "libzopfli"
32− "zopflipng"
33− "libzopflipng"
34− ];
35
34
36− installPhase = ''
35+ cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" "-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON" ];
37− mkdir -p $out/bin
38− install -m755 zopfli{,png} $out/bin
39
36
40− mkdir -p $out/lib
37+ installPhase = ''
38+ install -D -t $out/bin zopfli*
39+ install -d $out/lib
41− install -m755 libzopfli{,png}.so* $out/lib
40+ cp -d libzopfli* $out/lib
42−
43− mkdir -p $out/share/doc/zopfli
41+ install -Dm444 -t $out/share/doc/zopfli ../README*
44− install -m644 README* $out/share/doc/zopfli
45 '';
42 '';
46
43
44+ enableParallelBuilding = true;
45+
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.
56 '';
55 '';
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 ];
60 };
59 };