summary refs log tree commit diff
path: root/pkgs/development/libraries/science
diff options
context:
space:
mode:
authorFrederik Rietdijk <fridh@fridh.nl>2018-04-08 10:54:17 +0200
committerFrederik Rietdijk <fridh@fridh.nl>2018-04-08 10:54:17 +0200
commit595a72589f038e4512ca12232009c97a47fba044 (patch)
tree079cdeab0e7722d19292fb7532adc42d77533d1f /pkgs/development/libraries/science
parentf9e17ca3f68b040bd0cf68c26104e4a5c9bc7b4f (diff)
parent62dc989963c67fe5564b30a2b4bf21ba49446eee (diff)
downloadnixlib-595a72589f038e4512ca12232009c97a47fba044.tar
nixlib-595a72589f038e4512ca12232009c97a47fba044.tar.gz
nixlib-595a72589f038e4512ca12232009c97a47fba044.tar.bz2
nixlib-595a72589f038e4512ca12232009c97a47fba044.tar.lz
nixlib-595a72589f038e4512ca12232009c97a47fba044.tar.xz
nixlib-595a72589f038e4512ca12232009c97a47fba044.tar.zst
nixlib-595a72589f038e4512ca12232009c97a47fba044.zip
Merge master into staging
Diffstat (limited to 'pkgs/development/libraries/science')
-rw-r--r--pkgs/development/libraries/science/math/caffe2/default.nix2
-rw-r--r--pkgs/development/libraries/science/networking/ns3/default.nix98
2 files changed, 99 insertions, 1 deletions
diff --git a/pkgs/development/libraries/science/math/caffe2/default.nix b/pkgs/development/libraries/science/math/caffe2/default.nix
index af7078599db5..916bf122b3c2 100644
--- a/pkgs/development/libraries/science/math/caffe2/default.nix
+++ b/pkgs/development/libraries/science/math/caffe2/default.nix
@@ -137,7 +137,7 @@ stdenv.mkDerivation rec {
       algorithms. You can bring your creations to scale using the power of GPUs in the
       cloud or to the masses on mobile with Caffe2's cross-platform libraries.
     '';
-    platforms = with stdenv.lib.platforms; linux ++ darwin;
+    platforms = with stdenv.lib.platforms; linux;
     license = stdenv.lib.licenses.asl20;
     maintainers = with stdenv.lib.maintainers; [ yuriaisaka ];
   };
diff --git a/pkgs/development/libraries/science/networking/ns3/default.nix b/pkgs/development/libraries/science/networking/ns3/default.nix
new file mode 100644
index 000000000000..9fc72f18e5d7
--- /dev/null
+++ b/pkgs/development/libraries/science/networking/ns3/default.nix
@@ -0,0 +1,98 @@
+{ stdenv
+, fetchFromGitHub, fetchurl
+, python
+
+# for binding generation
+, castxml ? null
+
+# can take a long time, generates > 30000 images/graphs
+, enableDoxygen ? false
+
+# e.g. "optimized" or "debug". If not set, use default one
+, build_profile ? null
+
+# --enable-examples
+, withExamples ? false
+
+# very long
+, withManual ? false, doxygen ? null, graphviz ? null, imagemagick ? null
+# for manual, tetex is used to get the eps2pdf binary
+# texlive to get latexmk. building manual still fails though
+, dia, tetex ? null, ghostscript ? null, texlive ? null
+
+# generates python bindings
+, generateBindings ? 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 ])
+  );
+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";
+  };
+
+  # 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 ];
+
+  propagatedBuildInputs = [ gcc6 pythonEnv ];
+
+  postPatch = ''
+    patchShebangs ./waf
+    patchShebangs doc/ns3_html_theme/get_version.sh
+  '';
+
+  configureScript = "${python.interpreter} ./waf configure";
+
+  configureFlags = with stdenv.lib; [
+      "--enable-modules=${stdenv.lib.concatStringsSep "," modules}"
+      "--with-python=${pythonEnv.interpreter}"
+  ]
+  ++ optional (build_profile != null) "--build-profile=${build_profile}"
+  ++ optional generateBindings [  ]
+  ++ optional withExamples " --enable-examples "
+  ++ optional doCheck " --enable-tests "
+  ;
+
+  postBuild = with stdenv.lib; let flags = concatStringsSep ";" (
+      optional enableDoxygen "./waf doxygen"
+      ++ optional withManual "./waf sphinx"
+    );
+    in "${flags}"
+  ;
+
+  doCheck = true;
+
+  # we need to specify the proper interpreter else ns3 can check against a
+  # different version even though we
+  checkPhase =  ''
+    ${pythonEnv.interpreter} ./test.py
+  '';
+
+  meta = {
+    homepage = http://www.nsnam.org;
+    license = stdenv.lib.licenses.gpl3;
+    description = "A discrete time event network simulator";
+    platforms = with stdenv.lib.platforms; unix;
+  };
+}