diff options
author | John Ericson <Ericson2314@Yahoo.com> | 2017-05-22 17:09:06 -0400 |
---|---|---|
committer | John Ericson <Ericson2314@Yahoo.com> | 2017-05-22 18:52:50 -0400 |
commit | fedcda6cdaafc91a03c3aafac087aedf03ae8ae0 (patch) | |
tree | 881491650623b6e93dc2f97668ac3935d684a4f8 /pkgs/tools/archivers/zpaq | |
parent | c443033be325f0f39d621d28407ea00af2b45631 (diff) |
zpaqd: Modernize derivation
- Simplified platform-specific options
- Almost ready for cross-compilation
Diffstat (limited to 'pkgs/tools/archivers/zpaq')
-rw-r--r-- | pkgs/tools/archivers/zpaq/zpaqd.nix | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/pkgs/tools/archivers/zpaq/zpaqd.nix b/pkgs/tools/archivers/zpaq/zpaqd.nix index 499bccaa425b..5e63c7cfaabf 100644 --- a/pkgs/tools/archivers/zpaq/zpaqd.nix +++ b/pkgs/tools/archivers/zpaq/zpaqd.nix @@ -1,7 +1,10 @@ -{ stdenv, fetchurl, unzip }: +{ stdenv, fetchurl, unzip +, buildPlatform, hostPlatform +}: + let - s = # Generated upstream information - rec { + # Generated upstream information + s = rec { baseName="zpaqd"; version="715"; name="${baseName}-${version}"; @@ -9,15 +12,12 @@ let url="http://mattmahoney.net/dc/zpaqd715.zip"; sha256="0868lynb45lm79yvx5f10lj5h6bfv0yck8whcls2j080vmk3n7rk"; }; - isUnix = with stdenv; isLinux || isGNU || isDarwin || isFreeBSD || isOpenBSD; - isx86 = stdenv.isi686 || stdenv.isx86_64; - compileFlags = with stdenv; "" - + (lib.optionalString (isUnix) " -Dunix -pthread") - + (lib.optionalString (isi686) " -march=i686") - + (lib.optionalString (isx86_64) " -march=nocona") - + (lib.optionalString (!isx86) " -DNOJIT") - + " -O3 -mtune=generic -DNDEBUG" - ; + + compileFlags = stdenv.lib.concatStringsSep " " ([ "-O3" "-mtune=generic" "-DNDEBUG" ] + ++ stdenv.lib.optional (hostPlatform.isUnix) "-Dunix -pthread" + ++ stdenv.lib.optional (hostPlatform.isi686) "-march=i686" + ++ stdenv.lib.optional (hostPlatform.isx86_64) "-march=nocona" + ++ stdenv.lib.optional (!hostPlatform.isx86) "-DNOJIT"); in stdenv.mkDerivation { inherit (s) name version; |