zpaq: cleanup and fix cross compilation

This commit is contained in:
Nick Cao 2022-01-09 09:39:13 +08:00
parent 8aeafc25c9
commit c9f08ace52
No known key found for this signature in database
GPG Key ID: 068A56CEF48FA2C1

View File

@ -13,17 +13,13 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ perl /* for pod2man */ ];
preBuild = let
CPPFLAGS = with stdenv; ""
+ (lib.optionalString (!isi686 && !isx86_64) "-DNOJIT ")
+ "-Dunix";
CXXFLAGS = "-O3 -DNDEBUG";
in ''
buildFlagsArray=( "CPPFLAGS=${CPPFLAGS}" "CXXFLAGS=${CXXFLAGS}" )
'';
CPPFLAGS = [ "-Dunix" ] ++
lib.optional (!stdenv.isi686 && !stdenv.isx86_64) "-DNOJIT";
CXXFLAGS = [ "-O3" "-DNDEBUG" ];
enableParallelBuilding = true;
makeFlags = [ "CXX=${stdenv.cc.targetPrefix}c++" ];
installFlags = [ "PREFIX=$(out)" ];
meta = with lib; {