diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/boost')
22 files changed, 716 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/boost/1.55.nix b/nixpkgs/pkgs/development/libraries/boost/1.55.nix new file mode 100644 index 000000000000..bcb452ea4f86 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/boost/1.55.nix @@ -0,0 +1,12 @@ +{ callPackage, fetchurl, ... } @ args: + +callPackage ./generic.nix (args // { + version = "1.55.0"; + + patches = [ ./clang-math.patch ./clang-math-2.patch ./gcc-5.patch ]; + + src = fetchurl { + url = "mirror://sourceforge/boost/boost_1_55_0.tar.bz2"; + sha256 = "0lkv5dzssbl5fmh2nkaszi8x9qbj80pr4acf9i26sj3rvlih1w7z"; + }; +}) diff --git a/nixpkgs/pkgs/development/libraries/boost/1.59.nix b/nixpkgs/pkgs/development/libraries/boost/1.59.nix new file mode 100644 index 000000000000..fb65e49c500c --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/boost/1.59.nix @@ -0,0 +1,10 @@ +{ stdenv, callPackage, fetchurl, ... } @ args: + +callPackage ./generic.nix (args // { + version = "1.59.0"; + + src = fetchurl { + url = "mirror://sourceforge/boost/boost_1_59_0.tar.bz2"; + sha256 = "1jj1aai5rdmd72g90a3pd8sw9vi32zad46xv5av8fhnr48ir6ykj"; + }; +}) diff --git a/nixpkgs/pkgs/development/libraries/boost/1.60.nix b/nixpkgs/pkgs/development/libraries/boost/1.60.nix new file mode 100644 index 000000000000..646f4652f77d --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/boost/1.60.nix @@ -0,0 +1,11 @@ +{ stdenv, callPackage, fetchurl, ... } @ args: + +callPackage ./generic.nix (args // { + version = "1.60.0"; + + src = fetchurl { + url = "mirror://sourceforge/boost/boost_1_60_0.tar.bz2"; + sha256 = "0fzx6dwqbrkd4bcd8pjv0fpapwmrxxwr8yx9g67lihlsk3zzysk8"; + }; + +}) diff --git a/nixpkgs/pkgs/development/libraries/boost/1.65.nix b/nixpkgs/pkgs/development/libraries/boost/1.65.nix new file mode 100644 index 000000000000..922c09ba7fe9 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/boost/1.65.nix @@ -0,0 +1,12 @@ +{ stdenv, callPackage, fetchurl, ... } @ args: + +callPackage ./generic.nix (args // { + version = "1.65.1"; + + src = fetchurl { + url = "mirror://sourceforge/boost/boost_1_65_1.tar.bz2"; + # SHA256 from http://www.boost.org/users/history/version_1_65_1.html + sha256 = "9807a5d16566c57fd74fb522764e0b134a8bbe6b6e8967b83afefd30dcd3be81"; + }; + +}) diff --git a/nixpkgs/pkgs/development/libraries/boost/1.66.nix b/nixpkgs/pkgs/development/libraries/boost/1.66.nix new file mode 100644 index 000000000000..0a99717a7997 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/boost/1.66.nix @@ -0,0 +1,11 @@ +{ stdenv, callPackage, fetchurl, ... } @ args: + +callPackage ./generic.nix (args // { + version = "1.66.0"; + + src = fetchurl { + url = "mirror://sourceforge/boost/boost_1_66_0.tar.bz2"; + # SHA256 from http://www.boost.org/users/history/version_1_66_0.html + sha256 = "5721818253e6a0989583192f96782c4a98eb6204965316df9f5ad75819225ca9"; + }; +}) diff --git a/nixpkgs/pkgs/development/libraries/boost/1.67.nix b/nixpkgs/pkgs/development/libraries/boost/1.67.nix new file mode 100644 index 000000000000..31f545ab12be --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/boost/1.67.nix @@ -0,0 +1,39 @@ +{ stdenv, callPackage, fetchurl, fetchpatch, ... } @ args: + +callPackage ./generic.nix (args // { + version = "1.67.0"; + + patches = [ + (fetchpatch { + url = "https://github.com/boostorg/lockfree/commit/12726cda009a855073b9bedbdce57b6ce7763da2.patch"; + sha256 = "0x65nkwzv8fdacj8sw5njl3v63jj19dirrpklbwy6qpsncw7fc7h"; + stripLen = 1; + }) + ] ++ stdenv.lib.optionals stdenv.cc.isClang [ + # Fixes https://github.com/boostorg/atomic/issues/15 + (fetchpatch { + url = "https://github.com/boostorg/atomic/commit/6e14ca24dab50ad4c1fa8c27c7dd6f1cb791b534.patch"; + sha256 = "102g35ygvv8cxagp9651284xk4vybk93q2fm577y4mdxf5k46b7a"; + stripLen = 1; + }) + + # Needed for the next patch + (fetchpatch { + url = "https://github.com/boostorg/asio/commit/38cb19719748ad56b14d73ca1fff5828f36e5894.patch"; + sha256 = "0cj9cxz9rfbsx8p8f5alxx00dq3r7g0vh23j68bbxbs9gq1arq2n"; + stripLen = 1; + }) + # Fixes https://github.com/boostorg/asio/pull/91 + (fetchpatch { + url = "https://github.com/boostorg/asio/commit/43874d5497414c67655d901e48c939ef01337edb.patch"; + sha256 = "1c2ds164s2ygvpb4785p4ncv8ywbpm08cphirb99xp4mqvb693is"; + stripLen = 1; + }) + ]; + + src = fetchurl { + url = "mirror://sourceforge/boost/boost_1_67_0.tar.bz2"; + # SHA256 from http://www.boost.org/users/history/version_1_66_0.html + sha256 = "2684c972994ee57fc5632e03bf044746f6eb45d4920c343937a465fd67a5adba"; + }; +}) diff --git a/nixpkgs/pkgs/development/libraries/boost/1.68.nix b/nixpkgs/pkgs/development/libraries/boost/1.68.nix new file mode 100644 index 000000000000..4d98172c6d05 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/boost/1.68.nix @@ -0,0 +1,11 @@ +{ stdenv, callPackage, fetchurl, fetchpatch, ... } @ args: + +callPackage ./generic.nix (args // { + version = "1.68.0"; + + src = fetchurl { + url = "mirror://sourceforge/boost/boost_1_68_0.tar.bz2"; + # SHA256 from http://www.boost.org/users/history/version_1_68_0.html + sha256 = "7f6130bc3cf65f56a618888ce9d5ea704fa10b462be126ad053e80e553d6d8b7"; + }; +}) diff --git a/nixpkgs/pkgs/development/libraries/boost/1.69.nix b/nixpkgs/pkgs/development/libraries/boost/1.69.nix new file mode 100644 index 000000000000..95c4aa854a46 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/boost/1.69.nix @@ -0,0 +1,11 @@ +{ stdenv, callPackage, fetchurl, fetchpatch, ... } @ args: + +callPackage ./generic.nix (args // { + version = "1.69.0"; + + src = fetchurl { + url = "mirror://sourceforge/boost/boost_1_69_0.tar.bz2"; + # SHA256 from http://www.boost.org/users/history/version_1_69_0.html + sha256 = "8f32d4617390d1c2d16f26a27ab60d97807b35440d45891fa340fc2648b04406"; + }; +}) diff --git a/nixpkgs/pkgs/development/libraries/boost/1.70.nix b/nixpkgs/pkgs/development/libraries/boost/1.70.nix new file mode 100644 index 000000000000..45a8bdb93185 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/boost/1.70.nix @@ -0,0 +1,11 @@ +{ stdenv, callPackage, fetchurl, fetchpatch, ... } @ args: + +callPackage ./generic.nix (args // { + version = "1.70.0"; + + src = fetchurl { + url = "mirror://sourceforge/boost/boost_1_70_0.tar.bz2"; + # SHA256 from http://www.boost.org/users/history/version_1_70_0.html + sha256 = "430ae8354789de4fd19ee52f3b1f739e1fba576f0aded0897c3c2bc00fb38778"; + }; +}) diff --git a/nixpkgs/pkgs/development/libraries/boost/1.71.nix b/nixpkgs/pkgs/development/libraries/boost/1.71.nix new file mode 100644 index 000000000000..f66bd4cd6fb1 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/boost/1.71.nix @@ -0,0 +1,15 @@ +{ stdenv, callPackage, fetchurl, fetchpatch, ... } @ args: + +callPackage ./generic.nix (args // rec { + version = "1.71.0"; + + src = fetchurl { + #url = "mirror://sourceforge/boost/boost_1_71_0.tar.bz2"; + urls = [ + "mirror://sourceforge/boost/boost_1_71_0.tar.bz2" + "https://dl.bintray.com/boostorg/release/1.71.0/source/boost_1_71_0.tar.bz2" + ]; + # SHA256 from http://www.boost.org/users/history/version_1_71_0.html + sha256 = "d73a8da01e8bf8c7eda40b4c84915071a8c8a0df4a6734537ddde4a8580524ee"; + }; +}) diff --git a/nixpkgs/pkgs/development/libraries/boost/1.72.nix b/nixpkgs/pkgs/development/libraries/boost/1.72.nix new file mode 100644 index 000000000000..680afe8bcb87 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/boost/1.72.nix @@ -0,0 +1,16 @@ +{ stdenv, callPackage, fetchurl, fetchpatch, ... } @ args: + +callPackage ./generic.nix (args // rec { + version = "1.72.0"; + + src = fetchurl { + #url = "mirror://sourceforge/boost/boost_1_72_0.tar.bz2"; + urls = [ + "mirror://sourceforge/boost/boost_1_72_0.tar.bz2" + "https://dl.bintray.com/boostorg/release/1.72.0/source/boost_1_72_0.tar.bz2" + ]; + # SHA256 from http://www.boost.org/users/history/version_1_72_0.html + sha256 = "59c9b274bc451cf91a9ba1dd2c7fdcaf5d60b1b3aa83f2c9fa143417cc660722"; + }; +}) + diff --git a/nixpkgs/pkgs/development/libraries/boost/1.73.nix b/nixpkgs/pkgs/development/libraries/boost/1.73.nix new file mode 100644 index 000000000000..99a5486f197e --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/boost/1.73.nix @@ -0,0 +1,16 @@ +{ stdenv, callPackage, fetchurl, fetchpatch, ... } @ args: + +callPackage ./generic.nix (args // rec { + version = "1.73.0"; + + src = fetchurl { + #url = "mirror://sourceforge/boost/boost_1_73_0.tar.bz2"; + urls = [ + "mirror://sourceforge/boost/boost_1_73_0.tar.bz2" + "https://dl.bintray.com/boostorg/release/1.73.0/source/boost_1_73_0.tar.bz2" + ]; + # SHA256 from http://www.boost.org/users/history/version_1_73_0.html + sha256 = "4eb3b8d442b426dc35346235c8733b5ae35ba431690e38c6a8263dce9fcbb402"; + }; +}) + diff --git a/nixpkgs/pkgs/development/libraries/boost/1.74.nix b/nixpkgs/pkgs/development/libraries/boost/1.74.nix new file mode 100644 index 000000000000..35b4013dcb36 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/boost/1.74.nix @@ -0,0 +1,15 @@ +{ stdenv, callPackage, fetchurl, fetchpatch, ... } @ args: + +callPackage ./generic.nix (args // rec { + version = "1.74.0"; + + src = fetchurl { + urls = [ + "mirror://sourceforge/boost/boost_1_74_0.tar.bz2" + "https://dl.bintray.com/boostorg/release/1.74.0/source/boost_1_74_0.tar.bz2" + ]; + # SHA256 from http://www.boost.org/users/history/version_1_74_0.html + sha256 = "83bfc1507731a0906e387fc28b7ef5417d591429e51e788417fe9ff025e116b1"; + }; +}) + diff --git a/nixpkgs/pkgs/development/libraries/boost/1.75.nix b/nixpkgs/pkgs/development/libraries/boost/1.75.nix new file mode 100644 index 000000000000..9912032c7774 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/boost/1.75.nix @@ -0,0 +1,15 @@ +{ stdenv, callPackage, fetchurl, fetchpatch, ... } @ args: + +callPackage ./generic.nix (args // rec { + version = "1.75.0"; + + src = fetchurl { + urls = [ + "mirror://sourceforge/boost/boost_1_75_0.tar.bz2" + "https://dl.bintray.com/boostorg/release/1.75.0/source/boost_1_75_0.tar.bz2" + ]; + # SHA256 from http://www.boost.org/users/history/version_1_75_0.html + sha256 = "953db31e016db7bb207f11432bef7df100516eeb746843fa0486a222e3fd49cb"; + }; +}) + diff --git a/nixpkgs/pkgs/development/libraries/boost/clang-math-2.patch b/nixpkgs/pkgs/development/libraries/boost/clang-math-2.patch new file mode 100644 index 000000000000..f819e9bec623 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/boost/clang-math-2.patch @@ -0,0 +1,45 @@ +From 6bb71fdd8f7cc346d90fb14beb38b7297fc1ffd9 Mon Sep 17 00:00:00 2001 +From: Andrey Semashev <andrey.semashev@gmail.com> +Date: Sun, 26 Jan 2014 13:58:48 +0400 +Subject: [PATCH] Fixed incorrect initialization of 128-bit values, when no + native support for 128-bit integers is available. + +--- + boost/atomic/detail/cas128strong.hpp | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/boost/atomic/detail/cas128strong.hpp b/boost/atomic/detail/cas128strong.hpp +index 906c13e..dcb4d7d 100644 +--- a/boost/atomic/detail/cas128strong.hpp ++++ b/boost/atomic/detail/cas128strong.hpp +@@ -196,15 +196,17 @@ class base_atomic<T, void, 16, Sign> + + public: + BOOST_DEFAULTED_FUNCTION(base_atomic(void), {}) +- explicit base_atomic(value_type const& v) BOOST_NOEXCEPT : v_(0) ++ explicit base_atomic(value_type const& v) BOOST_NOEXCEPT + { ++ memset(&v_, 0, sizeof(v_)); + memcpy(&v_, &v, sizeof(value_type)); + } + + void + store(value_type const& value, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT + { +- storage_type value_s = 0; ++ storage_type value_s; ++ memset(&value_s, 0, sizeof(value_s)); + memcpy(&value_s, &value, sizeof(value_type)); + platform_fence_before_store(order); + platform_store128(value_s, &v_); +@@ -247,7 +249,9 @@ class base_atomic<T, void, 16, Sign> + memory_order success_order, + memory_order failure_order) volatile BOOST_NOEXCEPT + { +- storage_type expected_s = 0, desired_s = 0; ++ storage_type expected_s, desired_s; ++ memset(&expected_s, 0, sizeof(expected_s)); ++ memset(&desired_s, 0, sizeof(desired_s)); + memcpy(&expected_s, &expected, sizeof(value_type)); + memcpy(&desired_s, &desired, sizeof(value_type)); + diff --git a/nixpkgs/pkgs/development/libraries/boost/clang-math.patch b/nixpkgs/pkgs/development/libraries/boost/clang-math.patch new file mode 100644 index 000000000000..aa3d76af28b2 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/boost/clang-math.patch @@ -0,0 +1,65 @@ +From e4bde20f2eec0a51be14533871d2123bd2ab9cf3 Mon Sep 17 00:00:00 2001 +From: Andrey Semashev <andrey.semashev@gmail.com> +Date: Fri, 28 Feb 2014 12:43:11 +0400 +Subject: [PATCH] More compilation fixes for the case when 128-bit integers are + not supported. + +--- + boost/atomic/detail/gcc-atomic.hpp | 17 ++++++++++++----- + 1 file changed, 12 insertions(+), 5 deletions(-) + +diff --git a/boost/atomic/detail/gcc-atomic.hpp b/boost/atomic/detail/gcc-atomic.hpp +index a130590..4af99a1 100644 +--- a/boost/atomic/detail/gcc-atomic.hpp ++++ b/boost/atomic/detail/gcc-atomic.hpp +@@ -958,14 +958,16 @@ class base_atomic<T, void, 16, Sign> + + public: + BOOST_DEFAULTED_FUNCTION(base_atomic(void), {}) +- explicit base_atomic(value_type const& v) BOOST_NOEXCEPT : v_(0) ++ explicit base_atomic(value_type const& v) BOOST_NOEXCEPT + { ++ memset(&v_, 0, sizeof(v_)); + memcpy(&v_, &v, sizeof(value_type)); + } + + void store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT + { +- storage_type tmp = 0; ++ storage_type tmp; ++ memset(&tmp, 0, sizeof(tmp)); + memcpy(&tmp, &v, sizeof(value_type)); + __atomic_store_n(&v_, tmp, atomics::detail::convert_memory_order_to_gcc(order)); + } +@@ -980,7 +982,8 @@ class base_atomic<T, void, 16, Sign> + + value_type exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT + { +- storage_type tmp = 0; ++ storage_type tmp; ++ memset(&tmp, 0, sizeof(tmp)); + memcpy(&tmp, &v, sizeof(value_type)); + tmp = __atomic_exchange_n(&v_, tmp, atomics::detail::convert_memory_order_to_gcc(order)); + value_type res; +@@ -994,7 +997,9 @@ class base_atomic<T, void, 16, Sign> + memory_order success_order, + memory_order failure_order) volatile BOOST_NOEXCEPT + { +- storage_type expected_s = 0, desired_s = 0; ++ storage_type expected_s, desired_s; ++ memset(&expected_s, 0, sizeof(expected_s)); ++ memset(&desired_s, 0, sizeof(desired_s)); + memcpy(&expected_s, &expected, sizeof(value_type)); + memcpy(&desired_s, &desired, sizeof(value_type)); + const bool success = __atomic_compare_exchange_n(&v_, &expected_s, desired_s, false, +@@ -1010,7 +1015,9 @@ class base_atomic<T, void, 16, Sign> + memory_order success_order, + memory_order failure_order) volatile BOOST_NOEXCEPT + { +- storage_type expected_s = 0, desired_s = 0; ++ storage_type expected_s, desired_s; ++ memset(&expected_s, 0, sizeof(expected_s)); ++ memset(&desired_s, 0, sizeof(desired_s)); + memcpy(&expected_s, &expected, sizeof(value_type)); + memcpy(&desired_s, &desired, sizeof(value_type)); + const bool success = __atomic_compare_exchange_n(&v_, &expected_s, desired_s, true, diff --git a/nixpkgs/pkgs/development/libraries/boost/cmake-paths-173.patch b/nixpkgs/pkgs/development/libraries/boost/cmake-paths-173.patch new file mode 100644 index 000000000000..7b88da0e42a9 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/boost/cmake-paths-173.patch @@ -0,0 +1,22 @@ +diff --git a/tools/boost_install/boost-install.jam b/tools/boost_install/boost-install.jam +index 4238f921e..8fc1ea269 100644 +--- a/tools/boost_install/boost-install.jam ++++ b/tools/boost_install/boost-install.jam +@@ -649,7 +649,7 @@ rule generate-cmake-config- ( target : sources * : properties * ) + "" + "# Compute the include and library directories relative to this file." + "" +- "get_filename_component(_BOOST_CMAKEDIR \"${CMAKE_CURRENT_LIST_DIR}/../\" REALPATH)" ++ "get_filename_component(_BOOST_REAL_CMAKEDIR \"${CMAKE_CURRENT_LIST_DIR}/../\" REALPATH)" + : true ; + + if [ path.is-rooted $(cmakedir) ] +@@ -668,6 +668,8 @@ rule generate-cmake-config- ( target : sources * : properties * ) + " unset(_BOOST_CMAKEDIR_ORIGINAL)" + "endif()" + "" ++ "# Assume that the installer actually did know where the libs were to be installed" ++ "get_filename_component(_BOOST_CMAKEDIR \"$(cmakedir-native)\" REALPATH)" + : true ; + } + diff --git a/nixpkgs/pkgs/development/libraries/boost/cmake-paths.patch b/nixpkgs/pkgs/development/libraries/boost/cmake-paths.patch new file mode 100644 index 000000000000..b7f90148f9dc --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/boost/cmake-paths.patch @@ -0,0 +1,21 @@ +diff --git a/tools/boost_install/boost-install.jam b/tools/boost_install/boost-install.jam +index ad19f7b55..ec6bf57ff 100644 +--- a/tools/boost_install/boost-install.jam ++++ b/tools/boost_install/boost-install.jam +@@ -587,6 +587,7 @@ rule generate-cmake-config- ( target : sources * : properties * ) + "# Compute the include and library directories relative to this file." + "" + "get_filename_component(_BOOST_CMAKEDIR \"${CMAKE_CURRENT_LIST_DIR}/../\" ABSOLUTE)" ++ "get_filename_component(_BOOST_REAL_CMAKEDIR \"${CMAKE_CURRENT_LIST_DIR}/../\" ABSOLUTE)" + : true ; + + if [ path.is-rooted $(cmakedir) ] +@@ -607,6 +608,8 @@ rule generate-cmake-config- ( target : sources * : properties * ) + " unset(_BOOST_CMAKEDIR_ORIGINAL)" + "endif()" + "" ++ "# Assume that the installer actually did know where the libs were to be installed" ++ "get_filename_component(_BOOST_CMAKEDIR \"$(cmakedir-native)\" REALPATH)" + : true ; + } + diff --git a/nixpkgs/pkgs/development/libraries/boost/darwin-1.55-no-system-python.patch b/nixpkgs/pkgs/development/libraries/boost/darwin-1.55-no-system-python.patch new file mode 100644 index 000000000000..f8163f6d2718 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/boost/darwin-1.55-no-system-python.patch @@ -0,0 +1,45 @@ +diff --git a/tools/build/src/tools/python.jam b/tools/build/src/tools/python.jam +index 273b28a..2d2031e 100644 +--- a/tools/build/v2/tools/python.jam ++++ b/tools/build/v2/tools/python.jam +@@ -428,13 +428,7 @@ local rule windows-installed-pythons ( version ? ) + + local rule darwin-installed-pythons ( version ? ) + { +- version ?= $(.version-countdown) ; +- +- local prefix +- = [ GLOB /System/Library/Frameworks /Library/Frameworks +- : Python.framework ] ; +- +- return $(prefix)/Versions/$(version)/bin/python ; ++ return ; + } + + +@@ -890,25 +884,6 @@ local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? : + + # See if we can find a framework directory on darwin. + local framework-directory ; +- if $(target-os) = darwin +- { +- # Search upward for the framework directory. +- local framework-directory = $(libraries[-1]) ; +- while $(framework-directory:D=) && $(framework-directory:D=) != Python.framework +- { +- framework-directory = $(framework-directory:D) ; +- } +- +- if $(framework-directory:D=) = Python.framework +- { +- debug-message framework directory is \"$(framework-directory)\" ; +- } +- else +- { +- debug-message "no framework directory found; using library path" ; +- framework-directory = ; +- } +- } + + local dll-path = $(libraries) ; + diff --git a/nixpkgs/pkgs/development/libraries/boost/darwin-no-system-python.patch b/nixpkgs/pkgs/development/libraries/boost/darwin-no-system-python.patch new file mode 100644 index 000000000000..73e0910336a1 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/boost/darwin-no-system-python.patch @@ -0,0 +1,45 @@ +diff --git a/tools/build/src/tools/python.jam b/tools/build/src/tools/python.jam +index 273b28a..2d2031e 100644 +--- a/tools/build/src/tools/python.jam ++++ b/tools/build/src/tools/python.jam +@@ -428,13 +428,7 @@ local rule windows-installed-pythons ( version ? ) + + local rule darwin-installed-pythons ( version ? ) + { +- version ?= $(.version-countdown) ; +- +- local prefix +- = [ GLOB /System/Library/Frameworks /Library/Frameworks +- : Python.framework ] ; +- +- return $(prefix)/Versions/$(version)/bin/python ; ++ return ; + } + + +@@ -890,25 +884,6 @@ local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? : + + # See if we can find a framework directory on darwin. + local framework-directory ; +- if $(target-os) = darwin +- { +- # Search upward for the framework directory. +- local framework-directory = $(libraries[-1]) ; +- while $(framework-directory:D=) && $(framework-directory:D=) != Python.framework +- { +- framework-directory = $(framework-directory:D) ; +- } +- +- if $(framework-directory:D=) = Python.framework +- { +- debug-message framework directory is \"$(framework-directory)\" ; +- } +- else +- { +- debug-message "no framework directory found; using library path" ; +- framework-directory = ; +- } +- } + + local dll-path = $(libraries) ; + diff --git a/nixpkgs/pkgs/development/libraries/boost/gcc-5.patch b/nixpkgs/pkgs/development/libraries/boost/gcc-5.patch new file mode 100644 index 000000000000..2b2713590ca7 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/boost/gcc-5.patch @@ -0,0 +1,64 @@ +https://svn.boost.org/trac/boost/ticket/10125 + + boost/thread/pthread/once.hpp | 6 +++--- + boost/thread/pthread/once_atomic.hpp | 2 +- + boost/thread/win32/once.hpp | 2 +- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/boost/thread/pthread/once.hpp b/boost/thread/pthread/once.hpp +index ccfb051..0bef038 100644 +--- a/boost/thread/pthread/once.hpp ++++ b/boost/thread/pthread/once.hpp +@@ -42,7 +42,7 @@ namespace boost + } + + #ifdef BOOST_THREAD_PROVIDES_ONCE_CXX11 +-#ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES ++#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) + template<typename Function, class ...ArgTypes> + inline void call_once(once_flag& flag, BOOST_THREAD_RV_REF(Function) f, BOOST_THREAD_RV_REF(ArgTypes)... args); + #else +@@ -65,7 +65,7 @@ namespace boost + private: + volatile thread_detail::uintmax_atomic_t epoch; + +-#ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES ++#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) + template<typename Function, class ...ArgTypes> + friend void call_once(once_flag& flag, BOOST_THREAD_RV_REF(Function) f, BOOST_THREAD_RV_REF(ArgTypes)... args); + #else +@@ -118,7 +118,7 @@ namespace boost + // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2444.html + + +-#ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES ++#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) + + + template<typename Function, class ...ArgTypes> +diff --git a/boost/thread/pthread/once_atomic.hpp b/boost/thread/pthread/once_atomic.hpp +index 9e2f876..923f07b 100644 +--- a/boost/thread/pthread/once_atomic.hpp ++++ b/boost/thread/pthread/once_atomic.hpp +@@ -115,7 +115,7 @@ namespace boost + #endif + + +-#ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES ++#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) + + template<typename Function, class ...ArgTypes> + inline void call_once(once_flag& flag, BOOST_THREAD_RV_REF(Function) f, BOOST_THREAD_RV_REF(ArgTypes)... args) +diff --git a/boost/thread/win32/once.hpp b/boost/thread/win32/once.hpp +index cafcfd4..9b37b31 100644 +--- a/boost/thread/win32/once.hpp ++++ b/boost/thread/win32/once.hpp +@@ -227,7 +227,7 @@ namespace boost + } + } + +-#ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES ++#if !defined BOOST_NO_CXX11_VARIADIC_TEMPLATES && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) + //#if defined(BOOST_THREAD_RVALUE_REFERENCES_DONT_MATCH_FUNTION_PTR) + inline void call_once(once_flag& flag, void (*f)()) + { diff --git a/nixpkgs/pkgs/development/libraries/boost/generic.nix b/nixpkgs/pkgs/development/libraries/boost/generic.nix new file mode 100644 index 000000000000..ec3a28e2b1a3 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/boost/generic.nix @@ -0,0 +1,204 @@ +{ stdenv, icu, expat, zlib, bzip2, python, fixDarwinDylibNames, libiconv +, fetchpatch +, which +, buildPackages +, toolset ? /**/ if stdenv.cc.isClang then "clang" + else null +, enableRelease ? true +, enableDebug ? false +, enableSingleThreaded ? false +, enableMultiThreaded ? true +, enableShared ? !(with stdenv.hostPlatform; isStatic || libc == "msvcrt") # problems for now +, enableStatic ? !enableShared +, enablePython ? false +, enableNumpy ? false +, taggedLayout ? ((enableRelease && enableDebug) || (enableSingleThreaded && enableMultiThreaded) || (enableShared && enableStatic)) +, patches ? [] +, mpi ? null +, extraB2Args ? [] + +# Attributes inherit from specific versions +, version, src +, ... +}: + +# We must build at least one type of libraries +assert enableShared || enableStatic; + +# Python isn't supported when cross-compiling +assert enablePython -> stdenv.hostPlatform == stdenv.buildPlatform; +assert enableNumpy -> enablePython; + +# Boost <1.69 can't be build with clang >8, because pth was removed +assert with stdenv.lib; ((toolset == "clang" && !(versionOlder stdenv.cc.version "8.0.0")) -> !(versionOlder version "1.69")); + +with stdenv.lib; +let + + variant = concatStringsSep "," + (optional enableRelease "release" ++ + optional enableDebug "debug"); + + threading = concatStringsSep "," + (optional enableSingleThreaded "single" ++ + optional enableMultiThreaded "multi"); + + link = concatStringsSep "," + (optional enableShared "shared" ++ + optional enableStatic "static"); + + runtime-link = if enableShared then "shared" else "static"; + + # To avoid library name collisions + layout = if taggedLayout then "tagged" else "system"; + + # Versions of b2 before 1.65 have job limits; specifically: + # - Versions before 1.58 support up to 64 jobs[0] + # - Versions before 1.65 support up to 256 jobs[1] + # + # [0]: https://github.com/boostorg/build/commit/0ef40cb86728f1cd804830fef89a6d39153ff632 + # [1]: https://github.com/boostorg/build/commit/316e26ca718afc65d6170029284521392524e4f8 + jobs = + if versionOlder version "1.58" then + "$(($NIX_BUILD_CORES<=64 ? $NIX_BUILD_CORES : 64))" + else if versionOlder version "1.65" then + "$(($NIX_BUILD_CORES<=256 ? $NIX_BUILD_CORES : 256))" + else + "$NIX_BUILD_CORES"; + + b2Args = concatStringsSep " " ([ + "--includedir=$dev/include" + "--libdir=$out/lib" + "-j${jobs}" + "--layout=${layout}" + "variant=${variant}" + "threading=${threading}" + "link=${link}" + "-sEXPAT_INCLUDE=${expat.dev}/include" + "-sEXPAT_LIBPATH=${expat.out}/lib" + + # TODO: make this unconditional + ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "address-model=${toString stdenv.hostPlatform.parsed.cpu.bits}" + "architecture=${toString stdenv.hostPlatform.parsed.cpu.family}" + "binary-format=${toString stdenv.hostPlatform.parsed.kernel.execFormat.name}" + "target-os=${toString stdenv.hostPlatform.parsed.kernel.name}" + + # adapted from table in boost manual + # https://www.boost.org/doc/libs/1_66_0/libs/context/doc/html/context/architectures.html + "abi=${if stdenv.hostPlatform.parsed.cpu.family == "arm" then "aapcs" + else if stdenv.hostPlatform.isWindows then "ms" + else if stdenv.hostPlatform.isMips then "o32" + else "sysv"}" + ] ++ optional (link != "static") "runtime-link=${runtime-link}" + ++ optional (variant == "release") "debug-symbols=off" + ++ optional (toolset != null) "toolset=${toolset}" + ++ optional (!enablePython) "--without-python" + ++ optional (mpi != null || stdenv.hostPlatform != stdenv.buildPlatform) "--user-config=user-config.jam" + ++ optionals (stdenv.hostPlatform.libc == "msvcrt") [ + "threadapi=win32" + ] ++ extraB2Args + ); + +in + +stdenv.mkDerivation { + pname = "boost"; + + inherit src version; + + patchFlags = []; + + patches = patches + ++ optional stdenv.isDarwin ( + if version == "1.55.0" + then ./darwin-1.55-no-system-python.patch + else ./darwin-no-system-python.patch) + # Fix boost-context segmentation faults on ppc64 due to ABI violation + ++ optional (versionAtLeast version "1.61" && + versionOlder version "1.71") (fetchpatch { + url = "https://github.com/boostorg/context/commit/2354eca9b776a6739112833f64754108cc0d1dc5.patch"; + sha256 = "067m4bjpmcanqvg28djax9a10avmdwhlpfx6gn73kbqqq70dnz29"; + stripLen = 1; + extraPrefix = "libs/context/"; + }) + ++ optional (and (versionAtLeast version "1.70") (!versionAtLeast version "1.73")) ./cmake-paths.patch + ++ optional (versionAtLeast version "1.73") ./cmake-paths-173.patch; + + meta = { + homepage = "http://boost.org/"; + description = "Collection of C++ libraries"; + license = licenses.boost; + platforms = platforms.unix ++ platforms.windows; + badPlatforms = optional (versionOlder version "1.59") "aarch64-linux" + ++ optional ((versionOlder version "1.57") || version == "1.58") "x86_64-darwin"; + maintainers = with maintainers; [ peti ]; + }; + + preConfigure = '' + if test -f tools/build/src/tools/clang-darwin.jam ; then + substituteInPlace tools/build/src/tools/clang-darwin.jam \ + --replace '@rpath/$(<[1]:D=)' "$out/lib/\$(<[1]:D=)"; + fi; + '' + optionalString (mpi != null) '' + cat << EOF >> user-config.jam + using mpi : ${mpi}/bin/mpiCC ; + EOF + '' + optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + cat << EOF >> user-config.jam + using gcc : cross : ${stdenv.cc.targetPrefix}c++ ; + EOF + ''; + + NIX_CFLAGS_LINK = stdenv.lib.optionalString stdenv.isDarwin + "-headerpad_max_install_names"; + + enableParallelBuilding = true; + + nativeBuildInputs = [ which ] + ++ optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; + depsBuildBuild = [ buildPackages.stdenv.cc ]; + buildInputs = [ expat zlib bzip2 libiconv ] + ++ optional (stdenv.hostPlatform == stdenv.buildPlatform) icu + ++ optional enablePython python + ++ optional enableNumpy python.pkgs.numpy; + + configureScript = "./bootstrap.sh"; + configurePlatforms = []; + configureFlags = [ + "--includedir=$(dev)/include" + "--libdir=$(out)/lib" + ] ++ optional enablePython "--with-python=${python.interpreter}" + ++ [ (if stdenv.hostPlatform == stdenv.buildPlatform then "--with-icu=${icu.dev}" else "--without-icu") ] + ++ optional (toolset != null) "--with-toolset=${toolset}"; + + buildPhase = '' + runHook preBuild + ./b2 ${b2Args} + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + # boostbook is needed by some applications + mkdir -p $dev/share/boostbook + cp -a tools/boostbook/{xsl,dtd} $dev/share/boostbook/ + + # Let boost install everything else + ./b2 ${b2Args} install + + runHook postInstall + ''; + + postFixup = '' + # Make boost header paths relative so that they are not runtime dependencies + cd "$dev" && find include \( -name '*.hpp' -or -name '*.h' -or -name '*.ipp' \) \ + -exec sed '1s/^\xef\xbb\xbf//;1i#line 1 "{}"' -i '{}' \; + '' + optionalString (stdenv.hostPlatform.libc == "msvcrt") '' + $RANLIB "$out/lib/"*.a + ''; + + outputs = [ "out" "dev" ]; + setOutputFlags = false; +} |