zopfli: build on macos

This commit is contained in:
Kosta Welke 2017-11-29 16:10:25 +01:00 committed by Orivej Desh
parent 2dfbc5f8ed
commit bfd4eae7a2

View File

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