summary refs log tree commit diff
path: root/pkgs/development/libraries/crypto++/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/crypto++/default.nix')
-rw-r--r--pkgs/development/libraries/crypto++/default.nix11
1 files changed, 11 insertions, 0 deletions
diff --git a/pkgs/development/libraries/crypto++/default.nix b/pkgs/development/libraries/crypto++/default.nix
index f1c5db1caf1..a609e43b775 100644
--- a/pkgs/development/libraries/crypto++/default.nix
+++ b/pkgs/development/libraries/crypto++/default.nix
@@ -24,6 +24,17 @@ stdenv.mkDerivation rec {
     sourceRoot="$PWD/${name}"
   '';
 
+  cxxflags = if stdenv.isi686 then "-march=i686" else
+             if stdenv.isx86_64 then "-march=nocona" else
+             "";
+
+  configurePhase = ''
+    sed -i GNUmakefile \
+      -e 's|-march=native|${cxxflags}|g' \
+      -e 's|-mtune=native||g' \
+      -e '/^CXXFLAGS =/s|-g -O2|-O3|'
+  '';
+
   # Deal with one of the crappiest build system around there.
   buildPhase = ''
     # These guys forgot a file or something.