lol

Merge pull request #144958 from reckenrode/update-pngout

pngout: 20150319 → 20200115

authored by

Pavol Rusnak and committed by
GitHub
26751d3f 8d197bff

+30 -15
+30 -15
pkgs/tools/graphics/pngout/default.nix
··· 1 - {lib, stdenv, fetchurl}: 1 + { lib 2 + , stdenv 3 + , fetchurl 4 + , unzip 5 + }: 2 6 3 7 let 4 - folder = if stdenv.hostPlatform.system == "i686-linux" then "i686" 5 - else if stdenv.hostPlatform.system == "x86_64-linux" then "x86_64" 6 - else throw "Unsupported system: ${stdenv.hostPlatform.system}"; 8 + platforms = { 9 + aarch64-linux = { folder = "aarch64"; ld-linux = "ld-linux-aarch64.so.1"; }; 10 + armv7l-linux = { folder = "armv7"; ld-linux = "ld-linux-armhf.so.3"; }; 11 + i686-linux = { folder = "i686"; ld-linux = "ld-linux.so.2"; }; 12 + x86_64-darwin = { folder = "."; }; 13 + x86_64-linux = { folder = "amd64"; ld-linux = "ld-linux-x86-64.so.2"; }; 14 + }; 15 + platform = platforms."${stdenv.hostPlatform.system}" 16 + or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); 17 + download = if stdenv.isDarwin 18 + then { extension = "macos.zip"; hash = "sha256-MnL6lH7q/BrACG4fFJNfnvoh0JClVeaJIlX+XIj2aG4="; } 19 + else { extension = "linux.tar.gz"; hash = "sha256-rDi7pvDeKQM96GZTjDr6ZDQTGbaVu+OI77xf2egw6Sg="; }; 7 20 in 8 21 stdenv.mkDerivation rec { 9 22 pname = "pngout"; 10 - version = "20150319"; 23 + version = "20200115"; 11 24 12 25 src = fetchurl { 13 - url = "http://static.jonof.id.au/dl/kenutils/pngout-${version}-linux.tar.gz"; 14 - sha256 = "0iwv941hgs2g7ljpx48fxs24a70m2whrwarkrb77jkfcd309x2h7"; 26 + inherit (download) hash; 27 + url = "http://static.jonof.id.au/dl/kenutils/pngout-${version}-${download.extension}"; 15 28 }; 16 29 30 + nativeBuildInputs = lib.optionals stdenv.isDarwin [ unzip ]; 31 + 32 + # pngout is code-signed on Darwin, so don’t alter the binary to avoid breaking the signature. 33 + dontFixup = stdenv.isDarwin; 34 + 17 35 installPhase = '' 18 36 mkdir -p $out/bin 19 - cp ${folder}/pngout $out/bin 20 - 21 - ${if stdenv.hostPlatform.system == "i686-linux" then '' 22 - patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux.so.2 $out/bin/pngout 23 - '' else if stdenv.hostPlatform.system == "x86_64-linux" then '' 24 - patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux-x86-64.so.2 $out/bin/pngout 25 - '' else ""} 37 + cp ${platform.folder}/pngout $out/bin 38 + '' + lib.optionalString stdenv.isLinux '' 39 + patchelf --set-interpreter ${stdenv.glibc.out}/lib/${platform.ld-linux} $out/bin/pngout 26 40 ''; 27 41 28 42 meta = { 29 43 description = "A tool that aggressively optimizes the sizes of PNG images"; 30 - license = lib.licenses.unfree; 44 + license = lib.licenses.unfreeRedistributable; 31 45 homepage = "http://advsys.net/ken/utils.htm"; 46 + platforms = lib.attrNames platforms; 32 47 maintainers = [ lib.maintainers.sander ]; 33 48 }; 34 49 }