zpaqd: Modernize derivation

- Simplified platform-specific options
- Almost ready for cross-compilation

+13 -12
+1
lib/systems/inspect.nix
··· 7 "64bit" = { cpu = { bits = 64; }; }; 8 i686 = { cpu = cpuTypes.i686; }; 9 x86_64 = { cpu = cpuTypes.x86_64; }; 10 Arm = { cpu = { family = "arm"; }; }; 11 Mips = { cpu = { family = "mips"; }; }; 12 BigEndian = { cpu = { significantByte = significantBytes.bigEndian; }; };
··· 7 "64bit" = { cpu = { bits = 64; }; }; 8 i686 = { cpu = cpuTypes.i686; }; 9 x86_64 = { cpu = cpuTypes.x86_64; }; 10 + x86 = { cpu = { family = "x86"; }; }; 11 Arm = { cpu = { family = "arm"; }; }; 12 Mips = { cpu = { family = "mips"; }; }; 13 BigEndian = { cpu = { significantByte = significantBytes.bigEndian; }; };
+12 -12
pkgs/tools/archivers/zpaq/zpaqd.nix
··· 1 - { stdenv, fetchurl, unzip }: 2 let 3 - s = # Generated upstream information 4 - rec { 5 baseName="zpaqd"; 6 version="715"; 7 name="${baseName}-${version}"; ··· 9 url="http://mattmahoney.net/dc/zpaqd715.zip"; 10 sha256="0868lynb45lm79yvx5f10lj5h6bfv0yck8whcls2j080vmk3n7rk"; 11 }; 12 - isUnix = with stdenv; isLinux || isGNU || isDarwin || isFreeBSD || isOpenBSD; 13 - isx86 = stdenv.isi686 || stdenv.isx86_64; 14 - compileFlags = with stdenv; "" 15 - + (lib.optionalString (isUnix) " -Dunix -pthread") 16 - + (lib.optionalString (isi686) " -march=i686") 17 - + (lib.optionalString (isx86_64) " -march=nocona") 18 - + (lib.optionalString (!isx86) " -DNOJIT") 19 - + " -O3 -mtune=generic -DNDEBUG" 20 - ; 21 in 22 stdenv.mkDerivation { 23 inherit (s) name version;
··· 1 + { stdenv, fetchurl, unzip 2 + , buildPlatform, hostPlatform 3 + }: 4 + 5 let 6 + # Generated upstream information 7 + s = rec { 8 baseName="zpaqd"; 9 version="715"; 10 name="${baseName}-${version}"; ··· 12 url="http://mattmahoney.net/dc/zpaqd715.zip"; 13 sha256="0868lynb45lm79yvx5f10lj5h6bfv0yck8whcls2j080vmk3n7rk"; 14 }; 15 + 16 + compileFlags = stdenv.lib.concatStringsSep " " ([ "-O3" "-mtune=generic" "-DNDEBUG" ] 17 + ++ stdenv.lib.optional (hostPlatform.isUnix) "-Dunix -pthread" 18 + ++ stdenv.lib.optional (hostPlatform.isi686) "-march=i686" 19 + ++ stdenv.lib.optional (hostPlatform.isx86_64) "-march=nocona" 20 + ++ stdenv.lib.optional (!hostPlatform.isx86) "-DNOJIT"); 21 in 22 stdenv.mkDerivation { 23 inherit (s) name version;