summary refs log tree commit diff
path: root/pkgs/tools/graphics/pngout/default.nix
blob: ff2a18c9fedc65f154e1ef92ae2020872f6e6122 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{stdenv, fetchurl}:

let
  folder = if stdenv.system == "i686-linux" then "i686"
  else if stdenv.system == "x86_64-linux" then "x86_64"
  else throw "Unsupported system: ${stdenv.system}";
in
stdenv.mkDerivation {
  name = "pngout-20130221";

  src = fetchurl {
    url = http://static.jonof.id.au/dl/kenutils/pngout-20130221-linux.tar.gz;
    sha256 = "1qdzmgx7si9zr7wjdj8fgf5dqmmqw4zg19ypg0pdz7521ns5xbvi";
  };

  installPhase = ''
    mkdir -p $out/bin
    cp ${folder}/pngout $out/bin
    
    ${if stdenv.system == "i686-linux" then ''
        patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux.so.2 $out/bin/pngout
      '' else if stdenv.system == "x86_64-linux" then ''
        patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux-x86-64.so.2 $out/bin/pngout
      '' else ""}
  '';

  meta = {
    description = "A tool that agressively optimizes the sizes of PNG images";
    license = stdenv.lib.licenses.unfree;
    homepage = http://advsys.net/ken/utils.htm;
    maintainers = [ stdenv.lib.maintainers.sander ];
  };
}