summaryrefslogtreecommitdiff
path: root/ns3-simulations/nix/ns3
diff options
context:
space:
mode:
authorLoic Guegan <manzerberdes@gmx.com>2019-05-04 10:32:19 +0200
committerLoic Guegan <manzerberdes@gmx.com>2019-05-04 10:32:19 +0200
commitf6d01996eb72fc71681efd4aacd8d8cb903be753 (patch)
tree0a83ce1a2d0648aaab84680a7e5b75acee585542 /ns3-simulations/nix/ns3
parent89a5ee979d18e3897bd96f3341f97720a4655f7a (diff)
Nix integration
Diffstat (limited to 'ns3-simulations/nix/ns3')
-rw-r--r--ns3-simulations/nix/ns3/default.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/ns3-simulations/nix/ns3/default.nix b/ns3-simulations/nix/ns3/default.nix
new file mode 100644
index 0000000..ed58501
--- /dev/null
+++ b/ns3-simulations/nix/ns3/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchurl, python, gsl }:
+
+stdenv.mkDerivation rec {
+ ##### Configure NIX #####
+ name="ns3";
+ sourceRoot="ns-allinone-3.29/ns-3.29/"; # Since we have 2 source tarball (ns-3 & ECOFEN) nix need to know which one to use
+
+ ##### Fetch ns-3 And ECOFEN #####
+ src = [
+ (fetchurl {
+ url = https://www.nsnam.org/releases/ns-allinone-3.29.tar.bz2;
+ sha256 = "0m9dpmby116qk1m4x645i1p92syn30yzn9dgxxji5i25g30abpsd";
+ })
+
+ (fetchurl {
+ url = http://people.irisa.fr/Anne-Cecile.Orgerie/ECOFEN/ecofen-v2.tar.bz2;
+ sha256 = "1dnmm20ihas6hwwb8qbx8sr3h66nrg8h55x6f2aqpf3xima29dyh";
+ })
+ ];
+
+ ##### Configure Dependencies #####
+ buildInputs= [ python gsl ];
+
+ ##### Configure Phases #####
+ postUnpack=''mv ecofen-module-v2 ${sourceRoot}/contrib/ecofen'';
+ configurePhase=''
+ export CXXFLAGS="-Wall -g -O0" # Don't treat warning as error when compiling ns-3
+ python2 waf configure
+ '';
+ buildPhase=''python2 waf'';
+ installPhase=''
+ mkdir -p $out/include
+ cp -r ./build/lib $out/
+ cp -r ./build/ns3 $out/include
+ '';
+}