~vonfry/omnetpp-nix

564a0c7a97c7a85e5927bb1e00a63104d3e171df — Vonfry 2 years ago 48a32dc + 831c757 master 5.7
Merge branch 'develop'
11 files changed, 104 insertions(+), 36 deletions(-)

M default.nix
A flake.lock
A flake.nix
M inet.nix
M keetchi.nix
M ops.nix
M osgearth.nix
M patch.omnetpp
M pkgs.nix
M readme.org
M todo.org
M default.nix => default.nix +14 -10
@@ 5,7 5,7 @@
  pango, libglvnd, libsecret, withNEDDocGen ? true, graphviz, doxygen,
  with3dVisualization ? false, openscenegraph, osgearth, withParallel ? true,
  openmpi, withPCAP ? true, libpcap, QT_STYLE_OVERRIDE ? "fusion",
  python ? null, R ? null, sqlite, preferSqlite ? true,
  python3, R ? null, sqlite, preferSqlite ? true,
  # not free
  akaroa ? null
}:


@@ 35,11 35,11 @@ let
in
stdenv.mkDerivation rec {
  pname = "omnetpp";
  version = "5.6.2";
  version = "5.7";

  src = fetchurl {
    url = "https://github.com/omnetpp/omnetpp/releases/download/${pname}-${version}/${pname}-${version}-src-linux.tgz";
    sha256 = "0r8vfy90xah7wp49kdlz0a5x0b6nxy2ny9w45cbxr1l4759xdc4p";
    url = "https://github.com/omnetpp/omnetpp/releases/download/${pname}-${version}/${pname}-${version}-linux-x86_64.tgz";
    sha256 = "sha256-BNx7NzG1vVY44fRu8h+virlVLY2rShS9Iil0EeJXM5k=";
  };

  outputs = [ "out" ];


@@ 50,7 50,7 @@ stdenv.mkDerivation rec {

  nativeBuildInputs = optional withIDE [ makeWrapper ];

  propagatedBuildInputs = [ python R sqlite ]
  propagatedBuildInputs = [ python3 R sqlite ]
                       ++ optionals with3dVisualization [ osgearth
                                                          openscenegraph
                                                        ]


@@ 90,15 90,17 @@ stdenv.mkDerivation rec {
                   ++ optional preferSqlite "PREFER_SQLITE_RESULT_FILES=yes";

  preConfigure = ''
    omnetpp_root=`pwd`
    export PATH=$omnetpp_root/bin:$PATH
    export HOSTNAME
    export HOST
    export __omnetpp_root_dir=`pwd`
    export PATH=$__omnetpp_root_dir/bin:$PATH
    export OMNETPP_RELEASE=$(cat $__omnetpp_root_dir/Version)
    export HOSTNAME=
    export HOST=
    export QT_SELECT=5 # on systems with qtchooser, switch to Qt5
    export QT_LOGGING_RULES='*.debug=false;qt.qpa.*=false'
    # use patch instead, becasue of configure script has a problem with space
    # split between ~isystem~ and ~path~.
    export AR="ar cr"
    '';
  '';

  enableParallelBuilding = true;



@@ 175,6 177,8 @@ stdenv.mkDerivation rec {
          --set GTK_THEME Awaita
    '';

  dontPatchShebangs = false;

  meta = with lib; {
    homepage= "https://omnetpp.org";
    description = "OMNeT++ is an extensible, modular, component-based C++ simulation library and framework, primarily for building network simulators.";

A flake.lock => flake.lock +26 -0
@@ 0,0 1,26 @@
{
  "nodes": {
    "nixpkgs": {
      "locked": {
        "lastModified": 1639102062,
        "narHash": "sha256-AmyrAbeIqXtcxsC3UCw2E9i6NhWkcuj9BnzRqko4r3k=",
        "owner": "nixos",
        "repo": "nixpkgs",
        "rev": "24428bb3eabb497ed550bfe3ebf051ac201d7ef3",
        "type": "github"
      },
      "original": {
        "owner": "nixos",
        "repo": "nixpkgs",
        "type": "github"
      }
    },
    "root": {
      "inputs": {
        "nixpkgs": "nixpkgs"
      }
    }
  },
  "root": "root",
  "version": 7
}

A flake.nix => flake.nix +28 -0
@@ 0,0 1,28 @@
{
  inputs.nixpkgs.url = "github:nixos/nixpkgs";
  outputs = { self, nixpkgs }:
    let
      system = "x86_64-linux";
      pkgs = nixpkgs.legacyPackages.${system};

      defaultScope = with pkgs; {
        inherit (qt5) qtbase wrapQtAppsHook;
        inherit (xorg) libX11 libXrender libXtst;
        gtk = gtk3;
      };

      nixPkgs =  rec {
        callPackage = pkgs.newScope (defaultScope // nixPkgs);
        omnetpp = callPackage ./. { };
        keetchi = callPackage ./keetchi.nix { };
        inet = callPackage ./inet.nix { };
        ops = callPackage ./ops.nix { };
        osgearth = callPackage ./osgearth.nix { gdal = pkgs.gdal_2; };
      };
    in {
      packages.${system} = nixPkgs;
      defaultPackage.${system} = nixPkgs.omnetpp;
      defaultApp.${system} = nixPkgs.omnetpp;
      legacyPackages.${system} = nixPkgs;
    };
}

M inet.nix => inet.nix +4 -3
@@ 1,4 1,5 @@
{ stdenv, fetchFromGitHub, perl, omnetpp, wrapQtAppsHook, buildMode ? "release",
{ lib, stdenv, fetchFromGitHub, perl, omnetpp, wrapQtAppsHook,
  buildMode ? "release",
  copyFiles ? {}
}:



@@ 27,14 28,14 @@ let
in mkDerivation rec {

  pname = "INet";
  version = "v4.2.0";
  version = "v4.2.8";

  src = fetchFromGitHub {
    name = "source-inet";
    owner = "inet-framework";
    repo = "inet";
    rev = version;
    sha256 = "1aqbnjbxz05xamkdmfqbqf0vz1z8n5wnkh6k41gg7rri7kjb6453";
    sha256 = "sha256-CBuku6VTl8KtRUzTGbkMZGwcLSyWi6/DOeTRT3o9U6E=";
  };

  nativeBuildInputs = [ wrapQtAppsHook perl ];

M keetchi.nix => keetchi.nix +1 -1
@@ 1,4 1,4 @@
{ stdenv, perl, fetchFromGitHub, autoreconfHook, withDoc ? false
{ lib, stdenv, perl, fetchFromGitHub, autoreconfHook, withDoc ? false
, texlive, doxygen }:

with stdenv;

M ops.nix => ops.nix +5 -5
@@ 1,4 1,4 @@
{ stdenv, fetchFromGitHub, perl, omnetpp, inet, wrapQtAppsHook, keetchi,
{ lib, stdenv, fetchFromGitHub, perl, omnetpp, inet, wrapQtAppsHook, keetchi,
  buildMode ? "release" }:

let


@@ 6,8 6,8 @@ let
    name = "source-ops";
    owner = "ComNets-Bremen";
    repo = "OPS";
    rev = "424d53cfa7da7ebc0bb1f743e4e6aeda426f782a";
    sha256 = "13pryyqb9kv1q1vjgmgmpy9mg68glf8mjmgmhvm0vs5f0iny94vc";
    rev = "693b033ff83690d9c9675774c6d44667691415d2";
    sha256 = "sha256-LRtFeaI4rY2vOiGJbzN3LIcB1mU8okaLQoGnuMQRa2o=";
  };

  inet_ = inet.override {


@@ 35,11 35,11 @@ let
  binSuffix = if buildMode == "debug" then "_dbg" else "";
in

with stdenv.lib;
with lib;
stdenv.mkDerivation {

  pname = "ops";
  version = "20200805";
  version = "20211019";

  inherit src;


M osgearth.nix => osgearth.nix +3 -2
@@ 1,4 1,5 @@
{ stdenv
{ lib
, stdenv
, fetchFromGitHub
, cmake
, curl


@@ 28,7 29,7 @@ stdenv.mkDerivation rec {

  outputs = [ "out" ];

  meta = with stdenv.lib; {
  meta = with lib; {
    homepage = "http://osgearth.org";
    description = "osgEarth is a C++ geospatial SDK and terrain engine. Just create a simple XML file, point it at your map data, and go! osgEarth supports all kinds of data and comes with lots of examples to help you get up and running quickly and easily.";
    license = licenses.lgpl3;

M patch.omnetpp => patch.omnetpp +6 -6
@@ 1,18 1,18 @@
diff --git a/src/utils/omnetpp b/src/utils/omnetpp
index 1f808e4535..ebc8fa9c5f 100755
index a0a5488..c34d84d 100755
--- a/src/utils/omnetpp
+++ b/src/utils/omnetpp
@@ -5,6 +5,8 @@
 IDEDIR=`dirname $0`/../ide
 PLATFORM=`uname -sm`
 LAUNCHER=omnetpp
+TMPDIR=/tmp/omnetpp
+TMPDIR=/tmp
+mkdir -p $TMPDIR
 

 echo Starting the OMNeT++ IDE...
 
@@ -28,16 +30,16 @@ DEFAULT_WORKSPACE_ARGS="-vmargs -Dosgi.instance.area.default=$IDEDIR/../samples"
 

@@ -20,16 +22,16 @@ DEFAULT_WORKSPACE_ARGS="-vmargs -Dosgi.instance.area.default=$IDEDIR/../samples"

 case $PLATFORM in
 *MINGW*)
-	$IDEDIR/${LAUNCHER}.exe "$@" $DEFAULT_WORKSPACE_ARGS 2>$IDEDIR/error.log &

M pkgs.nix => pkgs.nix +1 -2
@@ 6,9 6,8 @@ let
  defaultScope = with pkgs; {
    inherit (qt5) qtbase wrapQtAppsHook;
    inherit (xorg) libX11 libXrender libXtst;
    jdk = jdk11;
    gtk = gtk3;
  } ;
  };

  nixPkgs =  rec {
    callPackage = pkgs.newScope (defaultScope // nixPkgs);

M readme.org => readme.org +11 -7
@@ 6,20 6,24 @@
  but the build binary is not cleaned up.

** Usage

   The [[file:./default.nix][default.nix]] is a packed of omnetpp with IDE. But
   this file is a function instead of a drv directly.
*** Flake
    Add this repo as inputs and import the packages you wanted.
*** Legacy
    N.B. This method will be removed in the future.

    The [[file:./pkgs.nix][pkgs.nix]] is a collection of drvs in this repo. It
    imports `<nixpkgs>` by default. So you can use it simply by nix-env or
    nixpkgs.fetchers with this repo's url.

   The [[file:./pkgs.nix][pkgs.nix]] is a collection of drvs in this repo. It
   imports `<nixpkgs>` by default. So you can use it simply by nix-env or
   nixpkgs.fetchers with this repo's url.
    This package is uploaded on [[https://app.cachix.org/cache/omnetpp-nix][cachix]], you can take a look.

   This package is uploaded on [[https://app.cachix.org/cache/omnetpp-nix][cachix]], you can take a look.

** Package List
   - [[file:default.nix][omnetpp]]
       + [[file:osgearth.nix][osgearth]]
       + akaroa - not free, so it is not packed by default.
     + [[file:osgearth.nix][osgearth]]
     + akaroa - not free, so it is not packed by default.
   - [[file:inet.nix][INET]] - [[https://inet.omnetpp.org/][website]]
   - [[file:keetchi.nix][keetchi]] - [[https://github.com/ComNets-Bremen/KeetchiLib][repo]]
   - [[file:ops.nix][OPS]] - [[https://github.com/ComNets-Bremen/OPS][repo]]

M todo.org => todo.org +5 -0
@@ 9,3 9,8 @@
* TODO check output binary's dynamic libraries, and clean up the buildInputs

* setup hook about wrap
* TODO Migrate to flake[1/3]
** DONE set flake
   CLOSED: [2021-12-10 Fri 10:36]
** TODO use flake in ci
** TODO remove pkgs file