mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 06:45:16 +01:00
WIP: optipng: cc-wrapper can be relied on to export these env vars
This commit is contained in:
parent
f16ee76ca8
commit
895c361480
1 changed files with 12 additions and 14 deletions
|
@ -1,4 +1,6 @@
|
|||
{ stdenv, fetchurl, libpng, static ? false }:
|
||||
{ stdenv, fetchurl, libpng, static ? false
|
||||
, buildPlatform, hostPlatform
|
||||
}:
|
||||
|
||||
# This package comes with its own copy of zlib, libpng and pngxtern
|
||||
|
||||
|
@ -15,20 +17,16 @@ stdenv.mkDerivation rec {
|
|||
buildInputs = [ libpng ];
|
||||
|
||||
LDFLAGS = optional static "-static";
|
||||
configureFlags = "--with-system-zlib --with-system-libpng";
|
||||
configureFlags = [
|
||||
"--with-system-zlib"
|
||||
"--with-system-libpng"
|
||||
] ++ stdenv.lib.optionals (hostPlatform != buildPlatform) [
|
||||
#"-prefix=$out"
|
||||
];
|
||||
|
||||
crossAttrs = {
|
||||
CC="${stdenv.cross.config}-gcc";
|
||||
LD="${stdenv.cross.config}-gcc";
|
||||
AR="${stdenv.cross.config}-ar";
|
||||
RANLIB="${stdenv.cross.config}-ranlib";
|
||||
configurePhase = ''
|
||||
./configure -prefix="$out" --with-system-zlib --with-system-libpng
|
||||
'';
|
||||
postInstall = optional (stdenv.cross.libc == "msvcrt") ''
|
||||
mv "$out"/bin/optipng "$out"/bin/optipng.exe
|
||||
'';
|
||||
};
|
||||
postInstall = if hostPlatform != buildPlatform && hostPlatform.isWindows then ''
|
||||
mv "$out"/bin/optipng{,.exe}
|
||||
'' else null;
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
homepage = http://optipng.sourceforge.net/;
|
||||
|
|
Loading…
Reference in a new issue