summary refs log tree commit diff
path: root/pkgs/applications/science/misc/openmodelica/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/science/misc/openmodelica/default.nix')
-rw-r--r--pkgs/applications/science/misc/openmodelica/default.nix70
1 files changed, 17 insertions, 53 deletions
diff --git a/pkgs/applications/science/misc/openmodelica/default.nix b/pkgs/applications/science/misc/openmodelica/default.nix
index cab0fa5ff5c..10fccfdf6da 100644
--- a/pkgs/applications/science/misc/openmodelica/default.nix
+++ b/pkgs/applications/science/misc/openmodelica/default.nix
@@ -1,53 +1,17 @@
-{lib, stdenv, fetchgit, fetchsvn, autoconf, automake, libtool, gfortran, clang, cmake, gnumake,
-hwloc, jre, lapack, blas, hdf5, expat, ncurses, readline, qt4, webkitgtk, which,
-lp_solve, omniorb, sqlite, libatomic_ops, pkg-config, file, gettext, flex, bison,
-doxygen, boost, openscenegraph, gnome2, xorg, git, bash, gtk2, makeWrapper }:
-
-let
-
-  fakegit = import ./fakegit.nix { inherit lib stdenv fetchgit fetchsvn bash; };
-
-in
-
-stdenv.mkDerivation {
-  name = "openmodelica";
-
-  src = fetchgit (import ./src-main.nix);
-
-  buildInputs = [autoconf cmake automake libtool gfortran clang gnumake
-    hwloc jre lapack blas hdf5 expat ncurses readline qt4 webkitgtk which
-    lp_solve omniorb sqlite libatomic_ops pkg-config file gettext flex bison
-    doxygen boost openscenegraph gnome2.gtkglext xorg.libXmu
-    git gtk2 makeWrapper];
-
-  hardeningDisable = [ "format" ];
-
-  patchPhase = ''
-    cp -fv ${fakegit}/bin/checkout-git.sh libraries/checkout-git.sh
-    cp -fv ${fakegit}/bin/checkout-svn.sh libraries/checkout-svn.sh
-  '';
-
-  configurePhase = ''
-    export NIX_LDFLAGS="$NIX_LDFLAGS -L${gfortran.cc.lib}/lib"
-
-    autoconf
-    ./configure CC=${clang}/bin/clang CXX=${clang}/bin/clang++ --prefix=$out
-  '';
-
-  postFixup = ''
-    for e in $(cd $out/bin && ls); do
-      wrapProgram $out/bin/$e \
-        --prefix PATH : "${gnumake}/bin" \
-        --prefix LIBRARY_PATH : "${lib.makeLibraryPath [ lapack blas ]}"
-    done
-  '';
-
-  meta = with lib; {
-    description = "An open-source Modelica-based modeling and simulation environment";
-    homepage    = "https://openmodelica.org";
-    license     = licenses.gpl3;
-    maintainers = with maintainers; [ smironov ];
-    platforms   = platforms.linux;
-    broken      = true;
-  };
-}
+{ lib, newScope, libsForQt5, clangStdenv }:
+lib.makeScope newScope (self:
+  let
+    callPackage = self.newScope { stdenv = clangStdenv; };
+    callQtPackage = self.newScope (libsForQt5 // { stdenv = clangStdenv; });
+  in
+  {
+    mkOpenModelicaDerivation = callPackage ./mkderivation { };
+    omcompiler = callPackage ./omcompiler { };
+    omplot = callQtPackage ./omplot { };
+    omsimulator = callPackage ./omsimulator { };
+    omparser = callPackage ./omparser { };
+    omedit = callQtPackage ./omedit { };
+    omlibrary = callPackage ./omlibrary { };
+    omshell = callQtPackage ./omshell { };
+    combined = callPackage ./combined { };
+  })