summary refs log tree commit diff
path: root/pkgs/development/libraries/boost
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/boost')
-rw-r--r--pkgs/development/libraries/boost/1.47.nix (renamed from pkgs/development/libraries/boost/default.nix)14
-rw-r--r--pkgs/development/libraries/boost/boost_filesystem.patch24
2 files changed, 36 insertions, 2 deletions
diff --git a/pkgs/development/libraries/boost/default.nix b/pkgs/development/libraries/boost/1.47.nix
index bd3ddd2ba738..4b0c4d3f1409 100644
--- a/pkgs/development/libraries/boost/default.nix
+++ b/pkgs/development/libraries/boost/1.47.nix
@@ -6,6 +6,7 @@
 , enableShared ? true
 , enableStatic ? false
 , enablePIC ? false
+, enableExceptions ? false
 }:
 
 let
@@ -28,8 +29,14 @@ let
     (enableShared && enableStatic)) then
     "tagged" else "system";
 
-  cflags = if (enablePIC) then "cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC" else "";
-
+  cflags = if (enablePIC && enableExceptions) then
+             "cflags=-fPIC -fexceptions cxxflags=-fPIC linkflags=-fPIC"
+           else if (enablePIC) then
+             "cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC"
+           else if (enableExceptions) then
+             "cflags=-fexceptions"
+           else
+             "";
 in
 
 stdenv.mkDerivation {
@@ -48,6 +55,9 @@ stdenv.mkDerivation {
     sha256 = "815a5d9faac4dbd523fbcf3fe1065e443c0bbf43427c44aa423422c6ec4c2e31";
   };
 
+  # See <http://svn.boost.org/trac/boost/ticket/4688>.
+  patches = [ ./boost_filesystem.patch ];
+
   enableParallelBuilding = true;
 
   buildInputs = [icu expat zlib bzip2 python];
diff --git a/pkgs/development/libraries/boost/boost_filesystem.patch b/pkgs/development/libraries/boost/boost_filesystem.patch
new file mode 100644
index 000000000000..f32e9ed572d3
--- /dev/null
+++ b/pkgs/development/libraries/boost/boost_filesystem.patch
@@ -0,0 +1,24 @@
+diff -ubr boost_1_47_0/libs/filesystem/v2/src/v2_path.cpp boost_1_47_0-patched/libs/filesystem/v2/src/v2_path.cpp
+--- boost_1_47_0/libs/filesystem/v2/src/v2_path.cpp	2011-01-11 22:39:33.000000000 +0100
++++ boost_1_47_0-patched/libs/filesystem/v2/src/v2_path.cpp	2011-07-21 01:06:26.000000000 +0200
+@@ -45,7 +45,7 @@
+   {
+ #if !defined(macintosh) && !defined(__APPLE__) && !defined(__APPLE_CC__) 
+     // ISO C calls this "the locale-specific native environment":
+-    static std::locale lc("");
++    static std::locale lc;
+ #else  // Mac OS
+     // "All BSD system functions expect their string parameters to be in UTF-8 encoding
+     // and nothing else."
+diff -ubr boost_1_47_0/libs/filesystem/v3/src/path.cpp boost_1_47_0-patched/libs/filesystem/v3/src/path.cpp
+--- boost_1_47_0/libs/filesystem/v3/src/path.cpp	2011-07-05 16:49:42.000000000 +0200
++++ boost_1_47_0-patched/libs/filesystem/v3/src/path.cpp	2011-07-21 01:06:26.000000000 +0200
+@@ -767,7 +767,7 @@
+     // or LANG are wrong, for example), so dynamic initialization is used to ensure
+     // that exceptions can be caught.
+ 
+-    return std::locale("");
++    return std::locale();
+ 
+ #   endif
+   }