summary refs log tree commit diff
path: root/pkgs/development/libraries/science
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/science')
-rw-r--r--pkgs/development/libraries/science/biology/elastix/default.nix1
-rw-r--r--pkgs/development/libraries/science/math/cudnn/generic.nix2
-rw-r--r--pkgs/development/libraries/science/math/lcalc/makefile.patch4
-rw-r--r--pkgs/development/libraries/science/math/or-tools/build.patch5
-rw-r--r--pkgs/development/libraries/science/math/or-tools/default.nix11
-rw-r--r--pkgs/development/libraries/science/math/or-tools/protobuf.patch10
-rw-r--r--pkgs/development/libraries/science/math/tensorflow/bin.nix7
-rw-r--r--pkgs/development/libraries/science/networking/ns-3/default.nix (renamed from pkgs/development/libraries/science/networking/ns3/default.nix)72
8 files changed, 76 insertions, 36 deletions
diff --git a/pkgs/development/libraries/science/biology/elastix/default.nix b/pkgs/development/libraries/science/biology/elastix/default.nix
index 5f4cbbaa567..9105b1c52ac 100644
--- a/pkgs/development/libraries/science/biology/elastix/default.nix
+++ b/pkgs/development/libraries/science/biology/elastix/default.nix
@@ -19,5 +19,6 @@ stdenv.mkDerivation rec {
     maintainers = with maintainers; [ bcdarwin ];
     platforms = platforms.linux;
     license = licenses.asl20;
+    broken = true;
   };
 }
diff --git a/pkgs/development/libraries/science/math/cudnn/generic.nix b/pkgs/development/libraries/science/math/cudnn/generic.nix
index f0f5829ce46..5a17e807bd4 100644
--- a/pkgs/development/libraries/science/math/cudnn/generic.nix
+++ b/pkgs/development/libraries/science/math/cudnn/generic.nix
@@ -46,7 +46,7 @@ stdenv.mkDerivation {
 
   passthru = {
     inherit cudatoolkit;
-    majorVersion = lib.head (lib.splitString "." version);
+    majorVersion = lib.versions.major version;
   };
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/science/math/lcalc/makefile.patch b/pkgs/development/libraries/science/math/lcalc/makefile.patch
index f55bbe3f24f..5c22cf0b84e 100644
--- a/pkgs/development/libraries/science/math/lcalc/makefile.patch
+++ b/pkgs/development/libraries/science/math/lcalc/makefile.patch
@@ -104,10 +104,10 @@ index 84e4e88..56ca676 100644
 -	cp -rf ../include $(INSTALL_DIR)/include/Lfunction
 +	install -d $(INSTALL_DIR)/bin
 +	install -d $(INSTALL_DIR)/$(LIB_DIR)
-+	install -d $(INSTALL_DIR)/include/libLfunction
++	install -d $(INSTALL_DIR)/include/Lfunction
 +	install lcalc $(INSTALL_DIR)/bin
 +	install libLfunction.so $(INSTALL_DIR)/$(LIB_DIR)
-+	install -m 644 -t $(INSTALL_DIR)/include/libLfunction ../include/*.h
++	install -m 644 -t $(INSTALL_DIR)/include/Lfunction ../include/*.h
  
  
  SRCS = Lcommandline.cc Lcommandline_elliptic.cc Lcommandline_globals.cc Lcommandline_misc.cc Lcommandline_numbertheory.cc Lcommandline_twist.cc Lcommandline_values_zeros.cc Lgamma.cc Lglobals.cc Lmisc.cc Lriemannsiegel.cc Lriemannsiegel_blfi.cc cmdline.c
diff --git a/pkgs/development/libraries/science/math/or-tools/build.patch b/pkgs/development/libraries/science/math/or-tools/build.patch
new file mode 100644
index 00000000000..a67e137ff4a
--- /dev/null
+++ b/pkgs/development/libraries/science/math/or-tools/build.patch
@@ -0,0 +1,5 @@
+--- a/makefiles/Makefile.python.mk
++++ b/makefiles/Makefile.python.mk
+@@ -1070 +1070 @@ $(PYPI_ARCHIVE_TEMP_DIR)/ortools/ortools/data: $(PYDATA_LIBS) | $(PYPI_ARCHIVE_T
+-$(PYPI_ARCHIVE_TEMP_DIR)/ortools/ortools/util: $(PYUTIL_LIBS) | $(PYPI_ARCHIVE_TEMP_DIR)/ortools/ortools
++$(PYPI_ARCHIVE_TEMP_DIR)/ortools/ortools/util: $(PYSORTED_INTERVAL_LIST_LIBS) | $(PYPI_ARCHIVE_TEMP_DIR)/ortools/ortools
diff --git a/pkgs/development/libraries/science/math/or-tools/default.nix b/pkgs/development/libraries/science/math/or-tools/default.nix
index c6e065320a2..224f4239a22 100644
--- a/pkgs/development/libraries/science/math/or-tools/default.nix
+++ b/pkgs/development/libraries/science/math/or-tools/default.nix
@@ -5,15 +5,20 @@
 
 stdenv.mkDerivation rec {
   pname = "or-tools";
-  version = "v7.0";
+  version = "7.3";
 
   src = fetchFromGitHub {
     owner = "google";
     repo = "or-tools";
-    rev = version;
-    sha256 = "09rs2j3w4ljw9qhhnsjlvfii297njjszwvkbgj1i6kns3wnlr7cp";
+    rev = "v${version}";
+    sha256 = "0q06vxmds6nm3dpjw4y5jzr8j98qgfb9i8pbm9pfhmqigv791hwc";
   };
 
+  patches = [
+    ./build.patch # https://github.com/google/or-tools/pull/1619
+    ./protobuf.patch # Otherwise it tries to install protobuf from pypi.
+  ];
+
   # The original build system uses cmake which does things like pull
   # in dependencies through git and Makefile creation time. We
   # obviously don't want to do this so instead we provide the
diff --git a/pkgs/development/libraries/science/math/or-tools/protobuf.patch b/pkgs/development/libraries/science/math/or-tools/protobuf.patch
new file mode 100644
index 00000000000..b0cce40434c
--- /dev/null
+++ b/pkgs/development/libraries/science/math/or-tools/protobuf.patch
@@ -0,0 +1,10 @@
+--- a/makefiles/Makefile.third_party.unix.mk
++++ b/makefiles/Makefile.third_party.unix.mk
+@@ -24,1 +24,1 @@ GLOG_TAG = 0.4.0
+-PROTOBUF_TAG = 3.9.0
++PROTOBUF_TAG = 3.7.0
+--- a/makefiles/Makefile.third_party.win.mk
++++ b/makefiles/Makefile.third_party.win.mk
+@@ -40 +40 @@ GLOG_TAG = 0.4.0
+-PROTOBUF_TAG = 3.9.0
++PROTOBUF_TAG = 3.7.0
diff --git a/pkgs/development/libraries/science/math/tensorflow/bin.nix b/pkgs/development/libraries/science/math/tensorflow/bin.nix
index 3db7a6f1d1e..f9f300883a1 100644
--- a/pkgs/development/libraries/science/math/tensorflow/bin.nix
+++ b/pkgs/development/libraries/science/math/tensorflow/bin.nix
@@ -1,6 +1,6 @@
 { stdenv
 , fetchurl
-, patchelf
+, addOpenGLRunpath
 , cudaSupport ? false, symlinkJoin, cudatoolkit, cudnn, nvidia_x11
 }:
 
@@ -35,6 +35,9 @@ let
     else ''
       patchelf --set-rpath "${rpath}:$out/lib" $out/lib/libtensorflow.so
       patchelf --set-rpath "${rpath}" $out/lib/libtensorflow_framework.so
+      ${optionalString cudaSupport ''
+        addOpenGLRunpath $out/lib/libtensorflow.so $out/lib/libtensorflow_framework.so
+      ''}
     '';
 
 in stdenv.mkDerivation rec {
@@ -43,6 +46,8 @@ in stdenv.mkDerivation rec {
 
   src = fetchurl url;
 
+  nativeBuildInputs = optional cudaSupport addOpenGLRunpath;
+
   # Patch library to use our libc, libstdc++ and others
   buildCommand = ''
     mkdir -pv $out
diff --git a/pkgs/development/libraries/science/networking/ns3/default.nix b/pkgs/development/libraries/science/networking/ns-3/default.nix
index 5218de07509..73be2a8ca6c 100644
--- a/pkgs/development/libraries/science/networking/ns3/default.nix
+++ b/pkgs/development/libraries/science/networking/ns-3/default.nix
@@ -1,5 +1,5 @@
 { stdenv
-, fetchFromGitHub
+, fetchFromGitLab
 , python
 , wafHook
 
@@ -22,75 +22,89 @@
 , dia, tetex ? null, ghostscript ? null, texlive ? null
 
 # generates python bindings
-, generateBindings ? false, ncurses ? null
+, pythonSupport ? false, ncurses ? null
 
 # All modules can be enabled by choosing 'all_modules'.
 # we include here the DCE mandatory ones
 , modules ? [ "core" "network" "internet" "point-to-point" "fd-net-device" "netanim"]
-, gcc6
 , lib
 }:
 
 let
   pythonEnv = python.withPackages(ps:
     stdenv.lib.optional withManual ps.sphinx
-    ++ stdenv.lib.optionals generateBindings (with ps;[ pybindgen pygccxml ])
+    ++ stdenv.lib.optionals pythonSupport (with ps;[ pybindgen pygccxml ])
   );
 in
 stdenv.mkDerivation rec {
-
-  name = "ns-3.${version}";
-  version = "28";
-
-  # the all in one https://www.nsnam.org/release/ns-allinone-3.27.tar.bz2;
-  # fetches everything (netanim, etc), this package focuses on ns3-core
-  src = fetchFromGitHub {
-    owner  = "nsnam";
-    repo   = "ns-3-dev-git";
-    rev    = name;
-    sha256 = "17kzfjpgw2mvyx1c9bxccnvw67jpk09fxmcnlkqx9xisk10qnhng";
+  pname = "ns-3";
+  version = "30";
+
+  src = fetchFromGitLab {
+    owner = "nsnam";
+    repo   = "ns-3-dev";
+    rev    = "ns-3.${version}";
+    sha256 = "0smdi3gglmafpc7a20hj2lbmwks3d5fpsicpn39lmm3svazw0bvp";
   };
 
   nativeBuildInputs = [ wafHook ];
+
+  outputs = [ "out" ] ++ lib.optional pythonSupport "py";
+
   # ncurses is a hidden dependency of waf when checking python
-  buildInputs = lib.optionals generateBindings [ castxml ncurses ]
-    ++ stdenv.lib.optional enableDoxygen [ doxygen graphviz imagemagick ]
-    ++ stdenv.lib.optional withManual [ dia tetex ghostscript texlive.combined.scheme-medium ];
+  buildInputs = lib.optionals pythonSupport [ castxml ncurses ]
+    ++ lib.optional enableDoxygen [ doxygen graphviz imagemagick ]
+    ++ lib.optional withManual [ dia tetex ghostscript texlive.combined.scheme-medium ];
 
-  propagatedBuildInputs = [ gcc6 pythonEnv ];
+  propagatedBuildInputs = [ pythonEnv ];
 
   postPatch = ''
     patchShebangs doc/ns3_html_theme/get_version.sh
   '';
 
   wafConfigureFlags = with stdenv.lib; [
-      "--enable-modules=${stdenv.lib.concatStringsSep "," modules}"
+      "--enable-modules=${concatStringsSep "," modules}"
       "--with-python=${pythonEnv.interpreter}"
   ]
   ++ optional (build_profile != null) "--build-profile=${build_profile}"
-  ++ optional generateBindings [  ]
   ++ optional withExamples " --enable-examples "
   ++ optional doCheck " --enable-tests "
   ;
 
+  doCheck = true;
+
   buildTargets = "build"
     + lib.optionalString enableDoxygen " doxygen"
     + lib.optionalString withManual "sphinx";
 
-  doCheck = true;
+  # to prevent fatal error: 'backward_warning.h' file not found
+  CXXFLAGS = "-D_GLIBCXX_PERMIT_BACKWARD_HASH";
+
+  postBuild = with stdenv.lib; let flags = concatStringsSep ";" (
+      optional enableDoxygen "./waf doxygen"
+      ++ optional withManual "./waf sphinx"
+    );
+    in "${flags}"
+  ;
+
+  postInstall = ''
+    moveToOutput "${pythonEnv.libPrefix}" "$py"
+  '';
 
   # we need to specify the proper interpreter else ns3 can check against a
-  # different version even though we
+  # different version
   checkPhase =  ''
-    ${pythonEnv.interpreter} ./test.py
+    ${pythonEnv.interpreter} ./test.py --nowaf
   '';
 
-  hardeningDisable = [ "fortify" ];
+  # strictoverflow prevents clang from discovering pyembed when bindings
+  hardeningDisable = [ "fortify" "strictoverflow"];
 
-  meta = {
-    homepage = http://www.nsnam.org;
-    license = stdenv.lib.licenses.gpl3;
+  meta = with stdenv.lib; {
+    homepage = "http://www.nsnam.org";
+    license = licenses.gpl3;
     description = "A discrete time event network simulator";
-    platforms = with stdenv.lib.platforms; unix;
+    platforms = with platforms; unix;
+    maintainers = with maintainers; [ teto ];
   };
 }