diff options
Diffstat (limited to 'nixpkgs/pkgs/applications/science/misc')
57 files changed, 3397 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/science/misc/bada-bib/default.nix b/nixpkgs/pkgs/applications/science/misc/bada-bib/default.nix new file mode 100644 index 000000000000..7ad542402b58 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/bada-bib/default.nix @@ -0,0 +1,81 @@ +{ lib +, meson +, ninja +, fetchFromGitHub +, appstream-glib +, desktop-file-utils +, gdk-pixbuf +, gettext +, glib +, gnome +, gobject-introspection +, gtk4 +, gtksourceview5 +, libadwaita +, libxml2 +, pkg-config +, python3Packages +, wrapGAppsHook4 +}: + +python3Packages.buildPythonApplication rec { + pname = "bada-bib"; + version = "0.8.0"; + format = "other"; + + src = fetchFromGitHub { + owner = "RogerCrocker"; + repo = "BadaBib"; + rev = "refs/tags/v${version}"; + sha256 = "sha256-mdAoJh3qOwtPX8cMCYw7MDDNy10GdhynnS8gtszJROI="; + }; + + nativeBuildInputs = [ + gettext + gobject-introspection + libxml2 + meson + ninja + pkg-config + wrapGAppsHook4 + ]; + + buildInputs = [ + gdk-pixbuf + glib + gtk4 + gtksourceview5 + libadwaita + ]; + + nativeCheckInputs = [ + appstream-glib + desktop-file-utils + ]; + + pythonPath = with python3Packages; [ + bibtexparser + pygobject3 + ]; + + postPatch = '' + patchShebangs build-aux/meson/postinstall.py + ''; + + dontWrapGApps = true; # Needs python wrapper + + preFixup = '' + makeWrapperArgs+=("''${gappsWrapperArgs[@]}") + ''; + + postFixup = '' + wrapPythonProgramsIn "$out/libexec" "$out $pythonPath" + ''; + + meta = with lib; { + homepage = "https://github.com/RogerCrocker/BadaBib"; + description = "A simple BibTeX Viewer and Editor"; + maintainers = [ maintainers.Cogitri ]; + license = licenses.gpl3Plus; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/boinc/default.nix b/nixpkgs/pkgs/applications/science/misc/boinc/default.nix new file mode 100644 index 000000000000..f806be834bca --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/boinc/default.nix @@ -0,0 +1,84 @@ +{ fetchFromGitHub +, lib +, stdenv +, autoconf +, automake +, pkg-config +, m4 +, curl +, libGLU +, libGL +, libXmu +, libXi +, freeglut +, libjpeg +, libtool +, wxGTK32 +, xcbutil +, sqlite +, gtk3 +, patchelf +, libXScrnSaver +, libnotify +, libX11 +, libxcb +, headless ? false +}: + +stdenv.mkDerivation rec { + pname = "boinc"; + version = "7.22.2"; + + src = fetchFromGitHub { + name = "${pname}-${version}-src"; + owner = "BOINC"; + repo = "boinc"; + rev = "client_release/${lib.versions.majorMinor version}/${version}"; + hash = "sha256-9GgvyYiDfppRuDFfxn50e+YZeSX0SLKSfo31lWx2FBs="; + }; + + nativeBuildInputs = [ libtool automake autoconf m4 pkg-config ]; + + buildInputs = [ + curl + sqlite + patchelf + ] ++ lib.optionals (!headless) [ + libGLU + libGL + libXmu + libXi + freeglut + libjpeg + wxGTK32 + gtk3 + libXScrnSaver + libnotify + libX11 + libxcb + xcbutil + ]; + + NIX_LDFLAGS = lib.optionalString (!headless) "-lX11"; + + preConfigure = '' + ./_autosetup + configureFlags="$configureFlags --sysconfdir=$out/etc" + ''; + + enableParallelBuilding = true; + + configureFlags = [ "--disable-server" ] ++ lib.optionals headless [ "--disable-manager" ]; + + postInstall = '' + install --mode=444 -D 'client/scripts/boinc-client.service' "$out/etc/systemd/system/boinc.service" + ''; + + meta = with lib; { + description = "Free software for distributed and grid computing"; + homepage = "https://boinc.berkeley.edu/"; + license = licenses.lgpl2Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ Luflosi ]; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/colmap/default.nix b/nixpkgs/pkgs/applications/science/misc/colmap/default.nix new file mode 100644 index 000000000000..a029f5440b25 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/colmap/default.nix @@ -0,0 +1,54 @@ +{ mkDerivation, lib, fetchFromGitHub, cmake, boost179, ceres-solver, eigen, + freeimage, glog, libGLU, glew, qtbase, + config, + cudaSupport ? config.cudaSupport, cudaPackages }: + +assert cudaSupport -> cudaPackages != { }; + +let + boost_static = boost179.override { enableStatic = true; }; + + # TODO: migrate to redist packages + inherit (cudaPackages) cudatoolkit; +in +mkDerivation rec { + version = "3.7"; + pname = "colmap"; + src = fetchFromGitHub { + owner = "colmap"; + repo = "colmap"; + rev = version; + hash = "sha256-uVAw6qwhpgIpHkXgxttKupU9zU+vD0Za0maw2Iv4x+I="; + }; + + # TODO: rm once the gcc11 issue is closed, https://github.com/colmap/colmap/issues/1418#issuecomment-1049305256 + cmakeFlags = lib.optionals cudaSupport [ + "-DCUDA_ENABLED=ON" + "-DCUDA_NVCC_FLAGS=--std=c++14" + ]; + + buildInputs = [ + boost_static ceres-solver eigen + freeimage glog libGLU glew qtbase + ] ++ lib.optionals cudaSupport [ + cudatoolkit + ]; + + nativeBuildInputs = [ + cmake + ] ++ lib.optionals cudaSupport [ + cudaPackages.autoAddOpenGLRunpathHook + ]; + + meta = with lib; { + description = "COLMAP - Structure-From-Motion and Multi-View Stereo pipeline"; + longDescription = '' + COLMAP is a general-purpose Structure-from-Motion (SfM) and Multi-View Stereo (MVS) pipeline + with a graphical and command-line interface. + ''; + homepage = "https://colmap.github.io/index.html"; + license = licenses.bsd3; + platforms = platforms.linux; + maintainers = with maintainers; [ lebastr ]; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/convertall/default.nix b/nixpkgs/pkgs/applications/science/misc/convertall/default.nix new file mode 100644 index 000000000000..9a7ac2a8b13c --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/convertall/default.nix @@ -0,0 +1,37 @@ +{ lib, stdenv, fetchFromGitHub, python3, wrapQtAppsHook }: + +let + inherit (python3.pkgs) wrapPython pyqt5; +in stdenv.mkDerivation rec { + pname = "convertall"; + version = "0.8.0"; + + src = fetchFromGitHub { + owner = "doug-101"; + repo = "ConvertAll"; + rev = "v${version}"; + sha256 = "02xxasgbjbivsbhyfpn3cpv52lscdx5kc95s6ns1dvnmdg0fpng0"; + }; + + nativeBuildInputs = [ python3 wrapPython wrapQtAppsHook ]; + + propagatedBuildInputs = [ pyqt5 ]; + + installPhase = '' + python3 install.py -p $out -x + ''; + + postFixup = '' + buildPythonPath $out + patchPythonScript $out/share/convertall/convertall.py + makeQtWrapper $out/share/convertall/convertall.py $out/bin/convertall + ''; + + meta = with lib; { + homepage = "https://convertall.bellz.org/"; + description = "Graphical unit converter"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ orivej ]; + platforms = pyqt5.meta.platforms; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/cwltool/default.nix b/nixpkgs/pkgs/applications/science/misc/cwltool/default.nix new file mode 100644 index 000000000000..7c28f65f3bf7 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/cwltool/default.nix @@ -0,0 +1,80 @@ +{ lib +, fetchFromGitHub +, git +, nodejs +, python3 +}: + +python3.pkgs.buildPythonApplication rec { + pname = "cwltool"; + version = "3.1.20230213100550"; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "common-workflow-language"; + repo = pname; + rev = "refs/tags/${version}"; + hash = "sha256-BtHkIVadcccnYYX8lRqiCzO+/qFeBaZfdUuu6qrjysk="; + }; + + postPatch = '' + substituteInPlace setup.py \ + --replace "ruamel.yaml >= 0.15, < 0.17.22" "ruamel.yaml" \ + --replace "prov == 1.5.1" "prov" \ + --replace "setup_requires=PYTEST_RUNNER," "" + ''; + + nativeBuildInputs = [ + git + ]; + + propagatedBuildInputs = with python3.pkgs; [ + argcomplete + bagit + coloredlogs + cwl-utils + mypy-extensions + prov + psutil + pydot + rdflib + requests + ruamel-yaml + schema-salad + shellescape + typing-extensions + ]; + + nativeCheckInputs = with python3.pkgs; [ + mock + nodejs + pytest-mock + pytest-httpserver + pytest-xdist + pytestCheckHook + ]; + + disabledTests = [ + "test_content_types" + "test_env_filtering" + "test_http_path_mapping" + "test_modification_date" + ]; + + disabledTestPaths = [ + "tests/test_udocker.py" + "tests/test_provenance.py" + ]; + + pythonImportsCheck = [ + "cwltool" + ]; + + meta = with lib; { + description = "Common Workflow Language reference implementation"; + homepage = "https://www.commonwl.org"; + changelog = "https://github.com/common-workflow-language/cwltool/releases/tag/${version}"; + license = with licenses; [ asl20 ]; + maintainers = with maintainers; [ veprbl ]; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/cytoscape/default.nix b/nixpkgs/pkgs/applications/science/misc/cytoscape/default.nix new file mode 100644 index 000000000000..52cfc7210c6c --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/cytoscape/default.nix @@ -0,0 +1,44 @@ +{ lib, stdenv, fetchurl, jre, makeWrapper, substituteAll, coreutils }: + +stdenv.mkDerivation rec { + pname = "cytoscape"; + version = "3.10.0"; + + src = fetchurl { + url = "https://github.com/cytoscape/cytoscape/releases/download/${version}/${pname}-unix-${version}.tar.gz"; + sha256 = "sha256-xfEVNOXptMpcrisr+a62JruXki1V0YjA/j4US7X8mXA="; + }; + + patches = [ + # By default, gen_vmoptions.sh tries to store custom options in $out/share + # at run time. This patch makes sure $HOME is used instead. + (substituteAll { + src = ./gen_vmoptions_to_homedir.patch; + inherit coreutils; + }) + ]; + + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ jre ]; + + installPhase = '' + mkdir -pv $out/{share,bin} + cp -Rv * $out/share/ + + ln -s $out/share/cytoscape.sh $out/bin/cytoscape + + wrapProgram $out/share/cytoscape.sh \ + --set JAVA_HOME "${jre}" \ + --set JAVA "${jre}/bin/java" + + chmod +x $out/bin/cytoscape + ''; + + meta = { + homepage = "http://www.cytoscape.org"; + description = "A general platform for complex network analysis and visualization"; + license = lib.licenses.lgpl21; + maintainers = [lib.maintainers.mimame]; + platforms = lib.platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/cytoscape/gen_vmoptions_to_homedir.patch b/nixpkgs/pkgs/applications/science/misc/cytoscape/gen_vmoptions_to_homedir.patch new file mode 100644 index 000000000000..e31681e8541f --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/cytoscape/gen_vmoptions_to_homedir.patch @@ -0,0 +1,19 @@ +diff -Nur a/gen_vmoptions.sh b/gen_vmoptions.sh +--- a/gen_vmoptions.sh 2020-03-30 21:57:47.000000000 +0100 ++++ b/gen_vmoptions.sh 2020-05-05 09:49:57.974989824 +0100 +@@ -1,13 +1,10 @@ + #!/bin/sh + # Generates the Cytoscape.vmoptions file + +-script_path="$(dirname -- $0)" +- +-#vm_options_path="$HOME/.cytoscape" +-vm_options_path=$script_path ++vm_options_path="$HOME/.cytoscape" + + if [ ! -e $vm_options_path ]; then +- /bin/mkdir $vm_options_path ++ @coreutils@/bin/mkdir $vm_options_path + fi + + # Determine amount of physical memory present: diff --git a/nixpkgs/pkgs/applications/science/misc/fityk/default.nix b/nixpkgs/pkgs/applications/science/misc/fityk/default.nix new file mode 100644 index 000000000000..5ec7973065d2 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/fityk/default.nix @@ -0,0 +1,50 @@ +{ lib +, stdenv +, fetchFromGitHub +, autoreconfHook +, wxGTK32 +, boost +, lua +, zlib +, bzip2 +, xylib +, readline +, gnuplot +, swig3 +}: + +stdenv.mkDerivation rec { + pname = "fityk"; + version = "1.3.2"; + + src = fetchFromGitHub { + owner = "wojdyr"; + repo = "fityk"; + rev = "v${version}"; + sha256 = "sha256-m2RaZMYT6JGwa3sOUVsBIzCdZetTbiygaInQWoJ4m1o="; + }; + + nativeBuildInputs = [ autoreconfHook ]; + buildInputs = [ + wxGTK32 + boost + lua + zlib + bzip2 + xylib + readline + gnuplot + swig3 + ]; + + env.NIX_CFLAGS_COMPILE = toString [ + "-std=c++11" + ]; + + meta = { + description = "Curve fitting and peak fitting software"; + license = lib.licenses.gpl2; + homepage = "https://fityk.nieto.pl/"; + platforms = lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/foldingathome/client.nix b/nixpkgs/pkgs/applications/science/misc/foldingathome/client.nix new file mode 100644 index 000000000000..c927df9a5491 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/foldingathome/client.nix @@ -0,0 +1,60 @@ +{ lib, stdenv +, autoPatchelfHook +, buildFHSEnv +, dpkg +, fetchurl +, gcc-unwrapped +, ocl-icd +, zlib +, extraPkgs ? [] +}: +let + majMin = lib.versions.majorMinor version; + version = "7.6.21"; + + fahclient = stdenv.mkDerivation rec { + inherit version; + pname = "fahclient"; + + src = fetchurl { + url = "https://download.foldingathome.org/releases/public/release/fahclient/debian-stable-64bit/v${majMin}/fahclient_${version}_amd64.deb"; + sha256 = "2827f05f1c311ee6c7eca294e4ffb856c81957e8f5bfc3113a0ed27bb463b094"; + }; + + nativeBuildInputs = [ + autoPatchelfHook + dpkg + ]; + + buildInputs = [ + gcc-unwrapped.lib + zlib + ]; + + unpackPhase = "dpkg-deb -x ${src} ./"; + installPhase = "cp -ar usr $out"; + }; +in +buildFHSEnv { + name = fahclient.name; + + targetPkgs = pkgs': [ + fahclient + ocl-icd + ] ++ extraPkgs; + + runScript = "/bin/FAHClient"; + + extraInstallCommands = '' + mv $out/bin/$name $out/bin/FAHClient + ''; + + meta = { + description = "Folding@home client"; + homepage = "https://foldingathome.org/"; + sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; + license = lib.licenses.unfree; + maintainers = [ lib.maintainers.zimbatm ]; + platforms = [ "x86_64-linux" ]; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/foldingathome/control.nix b/nixpkgs/pkgs/applications/science/misc/foldingathome/control.nix new file mode 100644 index 000000000000..a64c973914c6 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/foldingathome/control.nix @@ -0,0 +1,57 @@ +{ lib, stdenv +, dpkg +, fahviewer +, fetchurl +, makeWrapper +, python2 +}: +let + majMin = lib.versions.majorMinor version; + version = "7.6.21"; + + python = python2.withPackages + ( + ps: [ + ps.pycairo + ps.pygobject2 + ps.pygtk + ] + ); +in +stdenv.mkDerivation rec { + inherit version; + pname = "fahcontrol"; + + src = fetchurl { + url = "https://download.foldingathome.org/releases/public/release/fahcontrol/debian-stable-64bit/v${majMin}/fahcontrol_${version}-1_all.deb"; + sha256 = "1vfrdqkrvdlyxaw3f6z92w5dllrv6810lmf8yhcmjcwmphipvf71"; + }; + + nativeBuildInputs = [ + dpkg + makeWrapper + ]; + + buildInputs = [ fahviewer python ]; + + unpackPhase = '' + dpkg-deb -x ${src} ./ + ''; + + installPhase = "cp -ar usr $out"; + + postFixup = '' + sed -e "s|/usr/bin|$out/bin|g" -i $out/share/applications/FAHControl.desktop + wrapProgram "$out/bin/FAHControl" \ + --suffix PATH : "${fahviewer.outPath}/bin" \ + --set PYTHONPATH "$out/lib/python2.7/dist-packages" + ''; + + meta = { + description = "Folding@home control"; + homepage = "https://foldingathome.org/"; + license = lib.licenses.unfree; + maintainers = [ lib.maintainers.zimbatm ]; + platforms = [ "x86_64-linux" ]; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/foldingathome/viewer.nix b/nixpkgs/pkgs/applications/science/misc/foldingathome/viewer.nix new file mode 100644 index 000000000000..7f28c8d1b146 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/foldingathome/viewer.nix @@ -0,0 +1,56 @@ +{ lib, stdenv +, autoPatchelfHook +, dpkg +, fetchurl +, freeglut +, gcc-unwrapped +, libGL +, libGLU +, makeWrapper +, zlib +}: +let + majMin = lib.versions.majorMinor version; + version = "7.6.21"; +in +stdenv.mkDerivation rec { + inherit version; + pname = "fahviewer"; + + src = fetchurl { + url = "https://download.foldingathome.org/releases/public/release/fahviewer/debian-stable-64bit/v${majMin}/fahviewer_${version}_amd64.deb"; + sha256 = "00fd00pf6fcpplcaahvy9ir60mk69d9rcmwsyq3jrv9mxqm9aq7p"; + }; + + nativeBuildInputs = [ + autoPatchelfHook + dpkg + makeWrapper + ]; + + buildInputs = [ + freeglut + gcc-unwrapped.lib + libGL + libGLU + zlib + ]; + + unpackPhase = '' + dpkg-deb -x ${src} ./ + sed -e "s|/usr/bin|$out/bin|g" -i usr/share/applications/FAHViewer.desktop + ''; + + installPhase = '' + cp -ar usr $out + ''; + + meta = { + description = "Folding@home viewer"; + homepage = "https://foldingathome.org/"; + sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; + license = lib.licenses.unfree; + maintainers = [ lib.maintainers.zimbatm ]; + platforms = [ "x86_64-linux" ]; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/gephi/default.nix b/nixpkgs/pkgs/applications/science/misc/gephi/default.nix new file mode 100644 index 000000000000..a08f5da441fc --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/gephi/default.nix @@ -0,0 +1,48 @@ +{ lib, fetchFromGitHub, jdk11, maven, javaPackages }: + +let + mavenJdk11 = maven.override { + jdk = jdk11; + }; +in +mavenJdk11.buildMavenPackage rec { + pname = "gephi"; + version = "0.10.1"; + + src = fetchFromGitHub { + owner = "gephi"; + repo = "gephi"; + rev = "v${version}"; + hash = "sha256-ZNSEaiD32zFfF2ISKa1CmcT9Nq6r5i2rNHooQAcVbn4="; + }; + + mvnHash = "sha256-/2/Yb26Ry0NHQQ3j0LXnjwC0wQqJiztvTgWixyMJqvg="; + + nativeBuildInputs = [ jdk11 ]; + + installPhase = '' + cp -r modules/application/target/gephi $out + + # remove garbage + find $out -type f -name .lastModified -delete + find $out -type f -regex '.+\.exe' -delete + + # use self-compiled JOGL to avoid patchelf'ing .so inside jars + rm $out/gephi/modules/ext/org.gephi.visualization/org-jogamp-{jogl,gluegen}/*.jar + cp ${javaPackages.jogl_2_4_0}/share/java/jogl*.jar $out/gephi/modules/ext/org.gephi.visualization/org-jogamp-jogl/ + cp ${javaPackages.jogl_2_4_0}/share/java/glue*.jar $out/gephi/modules/ext/org.gephi.visualization/org-jogamp-gluegen/ + + printf "\n\njdkhome=${jdk11}\n" >> $out/etc/gephi.conf + ''; + + meta = with lib; { + description = "A platform for visualizing and manipulating large graphs"; + homepage = "https://gephi.org"; + sourceProvenance = with sourceTypes; [ + fromSource + binaryBytecode # deps + ]; + license = licenses.gpl3; + maintainers = [ maintainers.taeer ]; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/golly/default.nix b/nixpkgs/pkgs/applications/science/misc/golly/default.nix new file mode 100644 index 000000000000..7d91c76579f9 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/golly/default.nix @@ -0,0 +1,54 @@ +{lib, stdenv, fetchurl, wxGTK, perl, python3, zlib, libGLU, libGL, libX11, SDL2}: +stdenv.mkDerivation rec { + pname = "golly"; + version = "4.1"; + + src = fetchurl { + sha256 = "1j30dpzy6wh8fv1j2750hzc6wb0nhk83knl9fapccxgxw9n5lrbc"; + url="mirror://sourceforge/project/golly/golly/golly-${version}/golly-${version}-src.tar.gz"; + }; + + buildInputs = [ + wxGTK perl python3 zlib libGLU libGL libX11 SDL2 + ]; + + setSourceRoot = '' + sourceRoot=$(echo */gui-wx/) + ''; + + postPatch = '' + sed -e '/gollydir =/agollydir += "/../share/golly/";' -i wxgolly.cpp + grep share/golly wxgolly.cpp + + sed -e 's@PYTHON_SHLIB@${python3}/lib/libpython3.so@' -i wxprefs.cpp + sed -e 's@PERL_SHLIB@'"$(find "${perl}/lib/" -name libperl.so)"'@' -i wxprefs.cpp + ! grep _SHLIB *.cpp + + grep /lib/libpython wxprefs.cpp + grep /libperl wxprefs.cpp + ''; + + makeFlags=[ + "-f" "makefile-gtk" + "ENABLE_SOUND=1" "ENABLE_PERL=1" + ]; + + installPhase = '' + mkdir -p "$out/bin" + cp ../golly ../bgolly "$out/bin" + + mkdir -p "$out/share/doc/golly/" + cp ../docs/* "$out/share/doc/golly/" + + mkdir -p "$out/share/golly" + cp -r ../{Help,Patterns,Scripts,Rules} "$out/share/golly" + ''; + + meta = { + description = "Cellular automata simulation program"; + license = lib.licenses.gpl2; + maintainers = [lib.maintainers.raskin]; + platforms = lib.platforms.linux; + downloadPage = "https://sourceforge.net/projects/golly/files/golly"; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/gplates/boost-placeholders.patch b/nixpkgs/pkgs/applications/science/misc/gplates/boost-placeholders.patch new file mode 100644 index 000000000000..7166b92f646a --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/gplates/boost-placeholders.patch @@ -0,0 +1,75 @@ +diff --unified --recursive a/src/gui/TopologyTools.cc b/src/gui/TopologyTools.cc +--- a/src/gui/TopologyTools.cc 2021-07-05 05:11:47.000000000 +0200 ++++ b/src/gui/TopologyTools.cc 2022-12-07 22:35:20.444054124 +0100 +@@ -3448,7 +3448,7 @@ + std::find_if( + d_visible_boundary_section_seq.begin(), + d_visible_boundary_section_seq.end(), +- boost::bind(&VisibleSection::d_section_info_index, _1) == ++ boost::bind(&VisibleSection::d_section_info_index, boost::placeholders::_1) == + boost::cref(section_index)); + + if (visible_section_iter == d_visible_boundary_section_seq.end()) +@@ -3467,7 +3467,7 @@ + std::find_if( + d_visible_interior_section_seq.begin(), + d_visible_interior_section_seq.end(), +- boost::bind(&VisibleSection::d_section_info_index, _1) == ++ boost::bind(&VisibleSection::d_section_info_index, boost::placeholders::_1) == + boost::cref(section_index)); + + if (visible_section_iter == d_visible_interior_section_seq.end()) +diff --unified --recursive a/src/presentation/ReconstructionGeometryRenderer.cc b/src/presentation/ReconstructionGeometryRenderer.cc +--- a/src/presentation/ReconstructionGeometryRenderer.cc 2021-07-05 05:11:50.000000000 +0200 ++++ b/src/presentation/ReconstructionGeometryRenderer.cc 2022-12-07 22:36:11.117884262 +0100 +@@ -274,7 +274,7 @@ + GPlatesPresentation::ReconstructionGeometryRenderer::RenderParamsPopulator::visit_reconstruct_visual_layer_params( + const ReconstructVisualLayerParams ¶ms) + { +- d_render_params.show_vgp = boost::bind(&ReconstructVisualLayerParams::show_vgp, ¶ms, _1, _2); ++ d_render_params.show_vgp = boost::bind(&ReconstructVisualLayerParams::show_vgp, ¶ms, boost::placeholders::_1, boost::placeholders::_2); + d_render_params.vgp_draw_circular_error = params.get_vgp_draw_circular_error(); + d_render_params.fill_polygons = params.get_fill_polygons(); + d_render_params.fill_polylines = params.get_fill_polylines(); +diff --unified --recursive a/src/presentation/VisualLayerRegistry.cc b/src/presentation/VisualLayerRegistry.cc +--- a/src/presentation/VisualLayerRegistry.cc 2021-07-05 05:11:50.000000000 +0200 ++++ b/src/presentation/VisualLayerRegistry.cc 2022-12-07 22:38:12.950877614 +0100 +@@ -448,7 +448,7 @@ + &GPlatesQtWidgets::ReconstructScalarCoverageLayerOptionsWidget::create, + boost::bind( + &ReconstructScalarCoverageVisualLayerParams::create, +- _1), ++ boost::placeholders::_1), + true); + + registry.register_visual_layer_type( +@@ -498,7 +498,7 @@ + // NOTE: We pass in ViewState and not the GlobeAndMapWidget, obtained from + // ViewportWindow, because ViewportWindow is not yet available (a reference to + // it not yet been initialised inside ViewState) so accessing it would crash... +- _1, boost::ref(view_state)), ++ boost::placeholders::_1, boost::ref(view_state)), + true); + + // DERIVED_DATA group. +@@ -549,7 +549,7 @@ + &GPlatesQtWidgets::VelocityFieldCalculatorLayerOptionsWidget::create, + boost::bind( + &VelocityFieldCalculatorVisualLayerParams::create, +- _1, boost::cref(view_state.get_rendered_geometry_parameters())), ++ boost::placeholders::_1, boost::cref(view_state.get_rendered_geometry_parameters())), + true); + + using namespace GPlatesUtils; +diff --unified --recursive a/src/qt-widgets/ViewportWindow.cc b/src/qt-widgets/ViewportWindow.cc +--- a/src/qt-widgets/ViewportWindow.cc 2021-08-05 05:44:01.000000000 +0200 ++++ b/src/qt-widgets/ViewportWindow.cc 2022-12-07 22:39:20.487981302 +0100 +@@ -326,7 +326,7 @@ + *d_geometry_operation_state_ptr, + *d_modify_geometry_state, + *d_measure_distance_state_ptr, +- boost::bind(&canvas_tool_status_message, boost::ref(*this), _1), ++ boost::bind(&canvas_tool_status_message, boost::ref(*this), boost::placeholders::_1), + get_view_state(), + *this); + diff --git a/nixpkgs/pkgs/applications/science/misc/gplates/default.nix b/nixpkgs/pkgs/applications/science/misc/gplates/default.nix new file mode 100644 index 000000000000..e6cebbc53b73 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/gplates/default.nix @@ -0,0 +1,75 @@ +{ lib +, stdenv +, mkDerivation +, fetchurl +, cmake +, doxygen +, graphviz +, boost +, cgal_5 +, gdal +, glew +, gmp +, libGL +, libGLU +, mpfr +, proj +, python3 +, qtxmlpatterns +, qwt +}: + +let + python = python3.withPackages (ps: with ps; [ + numpy + ]); + boost' = boost.override { + enablePython = true; + inherit python; + }; + cgal = cgal_5.override { + boost = boost'; + }; +in mkDerivation rec { + pname = "gplates"; + version = "2.3.0"; + + src = fetchurl { + name = "gplates_${version}_src.tar.bz2"; + url = "https://www.earthbyte.org/download/8421/?uid=b89bb31428"; + sha256 = "0lrcmcxc924ixddii8cyglqlwwxvk7f00g4yzbss5i3fgcbh8n96"; + }; + + patches = [ + ./boost-placeholders.patch + ]; + + nativeBuildInputs = [ + cmake + doxygen + graphviz + ]; + + buildInputs = [ + boost' + cgal + gdal + glew + gmp + libGL + libGLU + mpfr + proj + python + qtxmlpatterns + qwt + ]; + + meta = with lib; { + description = "Desktop software for the interactive visualisation of plate-tectonics"; + homepage = "https://www.gplates.org"; + license = licenses.gpl2Only; + platforms = platforms.all; + broken = stdenv.isDarwin; # never built on Hydra https://hydra.nixos.org/job/nixpkgs/trunk/gplates.x86_64-darwin + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/graphia/breakpad-sigstksz.patch b/nixpkgs/pkgs/applications/science/misc/graphia/breakpad-sigstksz.patch new file mode 100644 index 000000000000..6e90faf9f037 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/graphia/breakpad-sigstksz.patch @@ -0,0 +1,13 @@ +diff --git a/source/thirdparty/breakpad/src/client/linux/handler/exception_handler.cc b/source/thirdparty/breakpad/src/client/linux/handler/exception_handler.cc +index ca353c4099..499be0a986 100644 +--- a/source/thirdparty/breakpad/src/client/linux/handler/exception_handler.cc ++++ b/source/thirdparty/breakpad/src/client/linux/handler/exception_handler.cc +@@ -138,7 +138,7 @@ void InstallAlternateStackLocked() { + // SIGSTKSZ may be too small to prevent the signal handlers from overrunning + // the alternative stack. Ensure that the size of the alternative stack is + // large enough. +- static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ); ++ const unsigned kSigStackSize = std::max<unsigned>(16384, SIGSTKSZ); + + // Only set an alternative stack if there isn't already one, or if the current + // one is too small. diff --git a/nixpkgs/pkgs/applications/science/misc/graphia/default.nix b/nixpkgs/pkgs/applications/science/misc/graphia/default.nix new file mode 100644 index 000000000000..b06cfaae66b5 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/graphia/default.nix @@ -0,0 +1,56 @@ +{ stdenv +, lib +, cmake +, fetchFromGitHub +, fetchpatch +, wrapQtAppsHook +, qtbase +, qtquickcontrols2 +, qtgraphicaleffects +}: + +stdenv.mkDerivation rec { + pname = "graphia"; + version = "3.2"; + + src = fetchFromGitHub { + owner = "graphia-app"; + repo = "graphia"; + rev = version; + sha256 = "sha256-9kohXLXF4F/qoHm8qmvPM1y9ak0Thb4xvgKJlVuOPTg="; + }; + + patches = [ + # Fix for a breakpad incompatibility with glibc>2.33 + # https://github.com/pytorch/pytorch/issues/70297 + # https://github.com/google/breakpad/commit/605c51ed96ad44b34c457bbca320e74e194c317e + ./breakpad-sigstksz.patch + + # FIXME: backport patch fixing build with Qt 5.15, remove for next release + (fetchpatch { + url = "https://github.com/graphia-app/graphia/commit/4b51bb8d465afa7ed0b2b30cb1c5e1c6af95976f.patch"; + hash = "sha256-GDJAFLxQlRWKvcOgqqPYV/aVTRM7+KDjW7Zp9l7SuyM="; + }) + ]; + + nativeBuildInputs = [ + cmake + wrapQtAppsHook + ]; + + buildInputs = [ + qtbase + qtquickcontrols2 + qtgraphicaleffects + ]; + + meta = with lib; { + # never built on Hydra https://hydra.nixos.org/job/nixpkgs/trunk/graphia.x86_64-darwin + broken = (stdenv.isLinux && stdenv.isAarch64) || stdenv.isDarwin; + description = "A visualisation tool for the creation and analysis of graphs."; + homepage = "https://graphia.app"; + license = licenses.gpl3Only; + maintainers = [ maintainers.bgamari ]; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/megam/default.nix b/nixpkgs/pkgs/applications/science/misc/megam/default.nix new file mode 100644 index 000000000000..cae0fe9b26fd --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/megam/default.nix @@ -0,0 +1,65 @@ +{ lib +, stdenv +, fetchurl +, ocaml +, ncurses +}: + +stdenv.mkDerivation { + pname = "megam"; + version = "0.92"; + + src = fetchurl { + url = "http://hal3.name/megam/megam_src.tgz"; + sha256 = "dc0e9f59ff8513449fe3bd40b260141f89c88a4edf6ddc8b8a394c758e49724e"; + }; + + patches = [ ./ocaml-includes.patch ./ocaml-3.12.patch ]; + + postPatch = '' + # Deprecated in ocaml 3.10 https://github.com/ocaml/ocaml/commit/f6190f3d0c49c5220d443ee8d03ca5072d68aa87 + # Deprecated in ocaml 3.08 https://github.com/ocaml/ocaml/commit/0c7aecb88dc696f66f49f3bed54a037361a26b8d + substituteInPlace fastdot_c.c --replace copy_double caml_copy_double --replace Bigarray_val Caml_ba_array_val --replace caml_bigarray caml_ba_array + # They were already deprecated in 3.12 https://v2.ocaml.org/releases/3.12/htmlman/libref/Array.html + substituteInPlace abffs.ml main.ml --replace create_matrix make_matrix + substituteInPlace intHashtbl.ml --replace Array.create Array.make + ''; + strictDeps = true; + + nativeBuildInputs = [ ocaml ]; + + buildInputs = [ ncurses ]; + + makeFlags = [ + "CAML_INCLUDES=${ocaml}/lib/ocaml/caml" + ("WITHBIGARRAY=" + lib.optionalString (lib.versionOlder ocaml.version "4.08.0") "bigarray.cma") + "all" + "opt" + ]; + + # see https://bugzilla.redhat.com/show_bug.cgi?id=435559 + dontStrip = true; + + installPhase = '' + runHook preInstall + + install -Dm755 megam $out/bin/megam + install -Dm755 megam.opt $out/bin/megam.opt + + runHook postInstall + ''; + + meta = with lib; { + description = "MEGA Model Optimization Package"; + longDescription = '' + The software here is an implementation of maximum likelihood and maximum a + posterior optimization of the parameters of these models. The algorithms + used are much more efficient than the iterative scaling techniques used in + almost every other maxent package out there. + ''; + homepage = "http://www.umiacs.umd.edu/~hal/megam"; + license = "non-commercial"; + maintainers = with maintainers; [ leixb ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/megam/ocaml-3.12.patch b/nixpkgs/pkgs/applications/science/misc/megam/ocaml-3.12.patch new file mode 100644 index 000000000000..8265acf6e4a7 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/megam/ocaml-3.12.patch @@ -0,0 +1,12 @@ +diff -ru megam_0.92/Makefile megam_0.92-b/Makefile +--- megam_0.92/Makefile 2007-10-08 18:06:04.000000000 +0100 ++++ megam_0.92-b/Makefile 2013-11-25 10:14:20.000000000 +0000 +@@ -59,7 +59,7 @@ + + WITHUNIX =unix.cma -cclib -lunix + +-WITHSTR =str.cma -cclib -lstr ++WITHSTR =str.cma -cclib -lcamlstr + + WITHBIGARRAY =bigarray.cma -cclib -lbigarray + diff --git a/nixpkgs/pkgs/applications/science/misc/megam/ocaml-includes.patch b/nixpkgs/pkgs/applications/science/misc/megam/ocaml-includes.patch new file mode 100644 index 000000000000..d4f38949b4d3 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/megam/ocaml-includes.patch @@ -0,0 +1,21 @@ +diff -ru megam_0.92/Makefile megam_0.92-b/Makefile +--- megam_0.92/Makefile 2007-10-08 18:06:04.000000000 +0100 ++++ megam_0.92-b/Makefile 2013-11-25 10:14:20.000000000 +0000 +@@ -41,7 +41,7 @@ + # + # The Caml compilers. # + # You may fix here the path to access the Caml compiler on your machine +-CAMLC = ocamlc -g ++CAMLC = ocamlc -g $(WITHCLIBS) + CAMLOPT = ocamlopt -unsafe -ccopt -O4 -ccopt -ffast-math -inline 99999 + CAMLDEP = ocamldep + CAMLLEX = ocamllex +@@ -70,7 +70,7 @@ + WITHDBM =dbm.cma -cclib -lmldbm -cclib -lndbm + + #WITHCLIBS =-I /usr/lib/ocaml/3.09.2/caml +-WITHCLIBS =-I /usr/lib/ocaml/caml ++WITHCLIBS =-I $(CAML_INCLUDES) -I +unix -I +str + + ################ End of user's variables ##################### + diff --git a/nixpkgs/pkgs/applications/science/misc/netlogo/default.nix b/nixpkgs/pkgs/applications/science/misc/netlogo/default.nix new file mode 100644 index 000000000000..db8f0a717aa1 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/netlogo/default.nix @@ -0,0 +1,59 @@ +{ jre, lib, stdenv, fetchurl, makeWrapper, makeDesktopItem }: + +let + + desktopItem = makeDesktopItem rec { + name = "netlogo"; + exec = name; + icon = name; + comment = "A multi-agent programmable modeling environment"; + desktopName = "NetLogo"; + categories = [ "Science" ]; + }; + +in + +stdenv.mkDerivation rec { + pname = "netlogo"; + version = "6.1.1"; + + src = fetchurl { + url = "https://ccl.northwestern.edu/netlogo/${version}/NetLogo-${version}-64.tgz"; + sha256 = "1j08df68pgggxqkmpzd369w4h97q0pivmmljdb48hjghx7hacblp"; + }; + + src1 = fetchurl { + name = "netlogo.png"; + url = "https://netlogoweb.org/assets/images/desktopicon.png"; + sha256 = "1i43lhr31lzva8d2r0dxpcgr58x496gb5vmb0h2da137ayvifar8"; + }; + + nativeBuildInputs = [ makeWrapper ]; + + installPhase = '' + mkdir -pv $out/share/netlogo $out/share/icons/hicolor/256x256/apps $out/share/applications $out/share/doc + cp -rv app $out/share/netlogo + cp -v readme.md $out/share/doc/ + + # launcher with `cd` is required b/c otherwise the model library isn't usable + makeWrapper "${jre}/bin/java" "$out/bin/netlogo" \ + --chdir "$out/share/netlogo/app" \ + --add-flags "-jar netlogo-${version}.jar" + + cp $src1 $out/share/icons/hicolor/256x256/apps/netlogo.png + cp ${desktopItem}/share/applications/* $out/share/applications + ''; + + meta = with lib; { + description = "A multi-agent programmable modeling environment"; + longDescription = '' + NetLogo is a multi-agent programmable modeling environment. It is used by + many tens of thousands of students, teachers and researchers worldwide. + ''; + homepage = "https://ccl.northwestern.edu/netlogo/index.shtml"; + sourceProvenance = with sourceTypes; [ binaryBytecode ]; + license = licenses.gpl2; + maintainers = [ maintainers.dpaetzel ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/nextinspace/default.nix b/nixpkgs/pkgs/applications/science/misc/nextinspace/default.nix new file mode 100644 index 000000000000..78e21dcd8788 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/nextinspace/default.nix @@ -0,0 +1,44 @@ +{ lib +, fetchFromGitHub +, python3 +}: + +python3.pkgs.buildPythonApplication rec { + pname = "nextinspace"; + version = "2.0.5"; + format = "pyproject"; + + src = fetchFromGitHub { + owner = "not-stirred"; + repo = pname; + rev = "refs/tags/v${version}"; + hash = "sha256-CrhzCvIA3YAFsWvdemvK1RLMacsM5RtgMjLeiqz5MwY="; + }; + + nativeBuildInputs = with python3.pkgs; [ + poetry-core + ]; + + pythonPath = with python3.pkgs; [ + requests + tzlocal + colorama + ]; + + nativeCheckInputs = with python3.pkgs; [ + pytest-lazy-fixture + pytestCheckHook + requests-mock + ]; + + pythonImportsCheck = [ + "nextinspace" + ]; + + meta = with lib; { + description = "Print upcoming space-related events in your terminal"; + homepage = "https://github.com/The-Kid-Gid/nextinspace"; + license = licenses.gpl3Only; + maintainers = with maintainers; [ penguwin ]; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/combined/default.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/combined/default.nix new file mode 100644 index 000000000000..bc6bc9620215 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/combined/default.nix @@ -0,0 +1,30 @@ +{ stdenv, lib, openmodelica, symlinkJoin, gnumake, blas, lapack, makeWrapper }: +symlinkJoin { + name = "openmodelica-combined"; + paths = with openmodelica; [ + omcompiler + omsimulator + omplot + omparser + omedit + omlibrary + omshell + ]; + + nativeBuildInputs = [ makeWrapper ]; + + postBuild = '' + wrapProgram $out/bin/OMEdit \ + --prefix PATH : ${lib.makeBinPath [ gnumake stdenv.cc ]} \ + --prefix LIBRARY_PATH : "${lib.makeLibraryPath [ blas lapack ]}" \ + --set-default OPENMODELICALIBRARY "${openmodelica.omlibrary}/lib/omlibrary" + ''; + + meta = with lib; { + description = "An open-source Modelica-based modeling and simulation environment intended for industrial and academic usage"; + homepage = "https://openmodelica.org"; + license = licenses.gpl3Only; + maintainers = with maintainers; [ balodja smironov ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/default.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/default.nix new file mode 100644 index 000000000000..10fccfdf6da8 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/default.nix @@ -0,0 +1,17 @@ +{ 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 { }; + }) diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/mkderivation/default.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/mkderivation/default.nix new file mode 100644 index 000000000000..ffa0a158ac95 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/mkderivation/default.nix @@ -0,0 +1,101 @@ +# mkOpenModelicaDerivation is an mkDerivation function for packages +# from OpenModelica suite. + +{ stdenv, lib, fetchgit, autoconf, automake, libtool, cmake, autoreconfHook, symlinkJoin }: +pkg: +let + inherit (builtins) hasAttr getAttr length elemAt; + inherit (lib) attrByPath concatStringsSep; + + + # A few helpers functions: + + # getAttrDef is just a getAttr with default fallback + getAttrDef = attr: default: x: attrByPath [ attr ] default x; + + # getAttr-like helper for optional append to string: + # "Hello" + appendByAttr "a" " " {a = "world";} = "Hello world" + # "Hello" + appendByAttr "a" " " {} = "Hello" + appendByAttr = attr: sep: x: lib.optionalString (hasAttr attr x) (sep + (getAttr attr x)); + + # Are there any OM dependencies at all? + ifDeps = length pkg.omdeps != 0; + + # Dependencies of current OpenModelica-target joined in one file tree. + # Return the dep itself in case it is a single one. + joinedDeps = + if length pkg.omdeps == 1 + then elemAt pkg.omdeps 0 + else + symlinkJoin { + name = pkg.pname + "-omhome"; + paths = pkg.omdeps; + }; + + # Should we run ./configure for the target pkg? + omautoconf = getAttrDef "omautoconf" false pkg; + + # Name of the make target + omtarget = getAttrDef "omtarget" pkg.pname pkg; + + # Directory of target sources + omdir = getAttrDef "omdir" pkg.pname pkg; + + # Simple to to m4 configuration scripts + postPatch = lib.optionalString ifDeps '' + sed -i ''$(find -name omhome.m4) -e 's|if test ! -z "$USINGPRESETBUILDDIR"|if test ! -z "$USINGPRESETBUILDDIR" -a -z "$OMHOME"|' + '' + + appendByAttr "postPatch" "\n" pkg; + + # Update shebangs in the scripts before running configuration. + preAutoreconf = "patchShebangs --build common" + + appendByAttr "preAutoreconf" "\n" pkg; + + # Tell OpenModelica where built dependencies are located. + configureFlags = lib.optional ifDeps "--with-openmodelicahome=${joinedDeps}" ++ + getAttrDef "configureFlags" [ ] pkg; + + # Our own configurePhase that accounts for omautoconf + configurePhase = '' + runHook preConfigure + export configureFlags="''${configureFlags} --with-ombuilddir=$PWD/build --prefix=$prefix" + ./configure --no-recursion $configureFlags + ${lib.optionalString omautoconf "(cd ${omdir}; ./configure $configureFlags)"} + runHook postConfigure + ''; + + # Targets that we want to build ourselves: + deptargets = lib.forEach pkg.omdeps (dep: dep.omtarget); + + # ... so we ask openmodelica makefile to skip those targets. + preBuild = '' + for target in ${concatStringsSep " " deptargets}; do + touch ''${target}.skip; + done + '' + + appendByAttr "preBuild" "\n" pkg; + + makeFlags = "${omtarget}" + + appendByAttr "makeFlags" " " pkg; + + installFlags = "-i " + + appendByAttr "installFlags" " " pkg; + + +in +stdenv.mkDerivation (pkg // { + inherit omtarget postPatch preAutoreconf configureFlags configurePhase preBuild makeFlags installFlags; + + src = fetchgit (import ./src-main.nix); + version = "1.18.0"; + + nativeBuildInputs = getAttrDef "nativeBuildInputs" [ ] pkg + ++ [ autoconf automake libtool cmake autoreconfHook ]; + + buildInputs = getAttrDef "buildInputs" [ ] pkg + ++ lib.optional ifDeps joinedDeps; + + dontUseCmakeConfigure = true; + + hardeningDisable = [ "format" ]; +}) diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/mkderivation/src-main.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/mkderivation/src-main.nix new file mode 100644 index 000000000000..1ab8d9390db3 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/mkderivation/src-main.nix @@ -0,0 +1,7 @@ +{ + url = "https://github.com/OpenModelica/OpenModelica/"; + rev = "49be4faa5a625a18efbbd74cc2f5be86aeea37bb"; + sha256 = "0klqiy4sdizl1djb9hb0arcvfcjz2mmnakrjx81mmxcbr8yq2016"; + fetchSubmodules = true; +} +# Update with: nix run -f ./nixpkgs/default.nix nix-prefetch-git -c nix-prefetch-git 'https://github.com/OpenModelica/OpenModelica/' 'v1.18.0' --fetch-submodules diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omcompiler/default.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/omcompiler/default.nix new file mode 100644 index 000000000000..360fea56fedf --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omcompiler/default.nix @@ -0,0 +1,63 @@ +{ stdenv +, lib +, gfortran +, flex +, bison +, jre8 +, blas +, lapack +, curl +, readline +, expat +, pkg-config +, buildPackages +, targetPackages +, libffi +, binutils +, mkOpenModelicaDerivation +}: +let + isCross = stdenv.buildPlatform != stdenv.hostPlatform; + nativeOMCompiler = buildPackages.openmodelica.omcompiler; +in +mkOpenModelicaDerivation ({ + pname = "omcompiler"; + omtarget = "omc"; + omdir = "OMCompiler"; + omdeps = [ ]; + omautoconf = true; + + nativeBuildInputs = [ + jre8 + gfortran + flex + bison + pkg-config + ] ++ lib.optional isCross nativeOMCompiler; + + buildInputs = [ targetPackages.stdenv.cc.cc blas lapack curl readline expat libffi binutils ]; + + postPatch = '' + sed -i -e '/^\s*AR=ar$/ s/ar/${stdenv.cc.targetPrefix}ar/ + /^\s*ar / s/ar /${stdenv.cc.targetPrefix}ar / + /^\s*ranlib/ s/ranlib /${stdenv.cc.targetPrefix}ranlib /' \ + $(find ./OMCompiler -name 'Makefile*') + ''; + + preFixup = '' + for entry in $(find $out -name libipopt.so); do + patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" "$entry" + patchelf --set-rpath '$ORIGIN':"$(patchelf --print-rpath $entry)" "$entry" + done + ''; + + meta = with lib; { + description = "Modelica compiler from OpenModelica suite"; + homepage = "https://openmodelica.org"; + license = licenses.gpl3Only; + maintainers = with maintainers; [ balodja smironov ]; + platforms = platforms.linux; + }; +} // lib.optionalAttrs isCross { + configureFlags = [ "--with-omc=${nativeOMCompiler}/bin/omc" ]; +}) diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omedit/default.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/omedit/default.nix new file mode 100644 index 000000000000..57863482fef6 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omedit/default.nix @@ -0,0 +1,39 @@ +{ lib +, jre8 +, qmake +, qtbase +, qttools +, qtwebkit +, qtxmlpatterns +, binutils +, wrapQtAppsHook +, openmodelica +, openscenegraph +, mkOpenModelicaDerivation +}: +with openmodelica; +mkOpenModelicaDerivation rec { + pname = "omedit"; + omdir = "OMEdit"; + omdeps = [ omcompiler omplot omparser omsimulator ]; + omautoconf = true; + + nativeBuildInputs = [ jre8 qmake qtbase qttools wrapQtAppsHook ]; + + buildInputs = [ qtwebkit openscenegraph qtxmlpatterns binutils ]; + + postPatch = '' + sed -i ''$(find -name qmake.m4) -e '/^\s*LRELEASE=/ s|LRELEASE=.*$|LRELEASE=${lib.getDev qttools}/bin/lrelease|' + ''; + + dontUseQmakeConfigure = true; + QMAKESPEC = "linux-clang"; + + meta = with lib; { + description = "A Modelica connection editor for OpenModelica"; + homepage = "https://openmodelica.org"; + license = licenses.gpl3Only; + maintainers = with maintainers; [ balodja smironov ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/default.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/default.nix new file mode 100644 index 000000000000..6821e33d1a62 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/default.nix @@ -0,0 +1,34 @@ +{ lib +, stdenv +, fetchgit +, bash +, openmodelica +, mkOpenModelicaDerivation +}: +let + fakegit = import ./fakegit.nix { inherit lib stdenv fetchgit bash; }; +in +mkOpenModelicaDerivation { + pname = "omlibrary"; + omdir = "libraries"; + omtarget = "omlibrary-all"; + omdeps = [ openmodelica.omcompiler ]; + + postPatch = '' + patchShebangs --build libraries + cp -fv ${fakegit}/bin/checkout-git.sh libraries/checkout-git.sh + + # The EMOTH library is broken in OpenModelica 1.17.0 + # Let's remove it from targets. + sed -i -e '/^OTHER_LIBS=/ s/EMOTH //' libraries/Makefile.libs + ''; + + meta = with lib; { + description = "A collection of Modelica libraries to use with OpenModelica, +including Modelica Standard Library"; + homepage = "https://openmodelica.org"; + license = licenses.gpl3Only; + maintainers = with maintainers; [ balodja smironov ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/fakegit.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/fakegit.nix new file mode 100644 index 000000000000..cad21c2a6e44 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/fakegit.nix @@ -0,0 +1,49 @@ +{ lib, stdenv, fetchgit, bash }: +let + mkscript = path: text: '' + mkdir -pv `dirname ${path}` + cat > ${path} <<"EOF" + #!${bash}/bin/bash + ME=$(basename ${path}) + ${text} + EOF + sed -i "s@%out@$out@g" ${path} + chmod +x ${path} + ''; + + hashname = r: + let + rpl = lib.replaceStrings [ ":" "/" ] [ "_" "_" ]; + in + (rpl r.url) + "-" + (rpl r.rev); + +in +stdenv.mkDerivation { + name = "fakegit"; + + buildCommand = '' + mkdir -pv $out/repos + ${lib.concatMapStrings + (r: "cp -r ${fetchgit r} $out/repos/${hashname r}\n") + (import ./src-libs.nix)} + + ${mkscript "$out/bin/checkout-git.sh" '' + if test "$#" -ne 4; then + echo "Usage: $0 DESTINATION URL GITBRANCH HASH" + exit 1 + fi + DEST=$1 + URL=`echo $2 | tr :/ __` + GITBRANCH=$3 + REVISION=$4 + + REVISION=`echo $REVISION | tr :/ __` + + rm -rf $DEST + mkdir -pv $DEST + echo "FAKEGIT cp -r %out/repos/$URL-$REVISION $DEST" >&2 + cp -r %out/repos/$URL-$REVISION/* $DEST + chmod u+w -R $DEST + ''} + ''; +} diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/src-libs.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/src-libs.nix new file mode 100644 index 000000000000..dff5ee78936a --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/src-libs.nix @@ -0,0 +1,81 @@ +[ +{ url = "https://github.com/modelica-3rdparty/AdvancedNoise.git"; rev = "5ce57acd279dadd0d25b76a6b02d3f9e9d061246"; sha256 = "07jjbj0y6bak269md3xniqb5lgc33m92ar5qixqxj5yxdjaahfs2"; fetchSubmodules = true; } +{ url = "https://github.com/RWTH-EBC/AixLib.git"; rev = "65e49ddf5c935846888a61aa303e52c909619079"; sha256 = "18xn8j3x3j4x9bpjgqnq0b6p3yzzsg5n62fv1ldqbbjcmi0vimd5"; fetchSubmodules = true; } +{ url = "https://github.com/RWTH-EBC/AixLib.git"; rev = "v0.4.0"; sha256 = "0dw34mjq29n55xh51g1c9a9d0d8gbpn16gj309dfxn4v2hbnfvzx"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/AlgebraTestSuite.git"; rev = "b937e1a7f447138c59abec9b2092f84f16bf02e8"; sha256 = "0406inasx61dk7vcnziiyhxkna7g61a5hn0znnbxj817hz6q11zn"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/ApproxSpline.git"; rev = "28420f5c1a88c9cd069defbd8c05e4a78a090675"; sha256 = "07gpyi2brj5zpvrlsnflqjnhbrgxvpqbdshp8lp4lh9mnj5jv95d"; fetchSubmodules = true; } +{ url = "https://github.com/OpenModelica/BioChem.git"; rev = "v1.0.2"; sha256 = "037bvj2lqrslg8k5r0rjgdzccslj9bj25b55k4g440vabm5p05qm"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/BondGraph.git"; rev = "20c23e60d12989bd4668ccac47659d82d39d29cc"; sha256 = "0yrkk708v4bvf423xb4zgpmnaj8qhq5primdg758ayddgli23wa9"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/BrineProp.git"; rev = "834fb3519ca8f89efe268582d39d00a7c3991150"; sha256 = "1iwqh4kr36wgxc0gci63gdgbqln2sap1w4bkydk1vkss2s302lg4"; fetchSubmodules = true; } +{ url = "https://github.com/EDF-TREE/BuildSysPro.git"; rev = "v3.3.0"; sha256 = "1cvcany3q9p1xndarxa2d8mmqxdnqk22476q8l61nayz5qy25x61"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/BuildingControlLib.git"; rev = "v1.0.0"; sha256 = "0ckdxway0m755mbrl94k4458sijzgknlzsrf7xs5bjymxchm8r2m"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/BuildingSystems.git"; rev = "c3070d48015ee75c1577f349cb388a498bef7270"; sha256 = "0r876wm6f1xx4cli1lqlylpl3zgaddmy06hcafbnzry9j38vbz4y"; fetchSubmodules = true; } +{ url = "https://github.com/lbl-srg/modelica-buildings.git"; rev = "v6.0.0"; sha256 = "0rnnk1clji0myzr7adggki6knbl6v8381vwnqgiz8mkxbmzdwm4f"; fetchSubmodules = true; } +{ url = "https://github.com/lbl-srg/modelica-buildings.git"; rev = "v7.0.0"; sha256 = "04n04pp4zvyg8n8h7h79c3wyk7lmn940mh7qzs0lv76g1ybypnlz"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/Chemical.git"; rev = "5645573fced862430b7b598b4d7ec1a39c7aa0fa"; sha256 = "1kh7kpmjfz55pb8553srlnrh8l00nw21xf5mjzh7nx9b1rndnmyg"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/DeployStructLib.git"; rev = "v1.0"; sha256 = "1k4zw9lnd0javw4zigxc15l58yf7xdz36b7808g65qxy89w6ksr2"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/DisHeatLib.git"; rev = "b11f53379c122870a52f2da9b1705d2c911cd21d"; sha256 = "1vm96a4z0b40r0nisxrrzyvan4yphjdkx4ad655phva2636xb5rr"; fetchSubmodules = true; } +{ url = "https://github.com/AHaumer/DriveControl.git"; rev = "b7233fd97a92867bb4ec2c3647c7f7e888398644"; sha256 = "0nyp1n8wrkjzfypsmjjzac0g9p4wbc1cxxr040fj20bqdg9l3h1b"; fetchSubmodules = true; } +{ url = "https://github.com/christiankral/ElectroMechanicalDrives.git"; rev = "v2.2.0"; sha256 = "0012phmn1y9fgpph45lwbjk0yhm5czidf2z6khm8lddvk93wf31b"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/ExternData.git"; rev = "v2.5.0"; sha256 = "19dsyq1mk5vl54fqaffzqafm5w94l011cy7pg16c7i933dbqnkki"; fetchSubmodules = true; } +{ url = "https://github.com/modelica/ExternalMedia.git"; rev = "6138312c96142ff3c01190147e6277991bfa2fca"; sha256 = "1d9g2hbdvgz13j7kdi1kglkkllj9f00x3dwdp5piyypvs464jsn5"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/ExternalMemoryLib.git"; rev = "6488d5815bda23c665123baa916789e283e16d2c"; sha256 = "06y1i5w690b3b9x23nzls8y67fl7yd7bn4xl5j0dmyi4qx33aqda"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/FMITest.git"; rev = "a67a276083f4010b249802ad8fc70dc30c09adfd"; sha256 = "0mg8jlvlwql2nsjiy7c3rdibv73bkfk149ac0450d5pc0hfn9mln"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/FailureModes.git"; rev = "v1.2.1"; sha256 = "1z8bwrld1rkydgssab5gnrd76frrbky8qxi1lvlaf2jidj6bzn1l"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/FaultTriggering.git"; rev = "v0.6.6"; sha256 = "0a08yyrbg4a49s0bgqgyds6pidx9xr47yspvl9bdak1mq34qibip"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/FeedDriveLibrary.git"; rev = "1.0.1"; sha256 = "15fi9dj6zgl0fr90cwxqjbpphj0dwrrmk74hf25j6zd85w2ycqdz"; fetchSubmodules = true; } +{ url = "https://github.com/DLR-SR/FractionalOrder.git"; rev = "99918820e346c362c3ad52d782c8215e5deeac4c"; sha256 = "1pycss6fqh86frfdbdfffjhaz09fz1558f9azgckhf8drx6ry1qs"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/Greenhouses-Library.git"; rev = "89ae0e8097eb0751abce2013d304fa5f9c09b885"; sha256 = "1q77xj6aysqsn3d7kjmcq7dihbw18iqm35ifzdi75xgf3cgwla4f"; fetchSubmodules = true; } +{ url = "https://github.com/christiankral/HanserModelica.git"; rev = "v1.1.0"; sha256 = "0zwkrhg2y42m18p4z51izrickiv1vikgz0z7fpjia4dbppckav8i"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/HelmholtzMedia.git"; rev = "3b4a4bca94d388744b2d045344ea2f9b0b4d405b"; sha256 = "17fzpan89075vb5vbhw5ylgxcdsmj2vjnmmka7cgzh06izb69nvh"; fetchSubmodules = true; } +{ url = "https://github.com/ibpsa/modelica-ibpsa.git"; rev = "v3.0.0"; sha256 = "0xwgfndlw76zfmiiqadl85l9na9igsqlmfcawx526sdw2lhhgics"; fetchSubmodules = true; } +{ url = "https://github.com/open-ideas/IDEAS.git"; rev = "v2.1.0"; sha256 = "0xp0zg6ib5536d5vl361lsn5w5faqdf6djhcmfxns629wjima8rn"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/IndustrialControlSystems.git"; rev = "v1.1.0"; sha256 = "1nvgx94iy1pws0768anrl7ssjlzslb5mbp21j7xvf6wpqfmj0npc"; fetchSubmodules = true; } +{ url = "https://github.com/christiankral/KeyWordIO.git"; rev = "v0.9.0"; sha256 = "10kvj6zn2r6m3403ja8nkkxbfcchkz0pfk3g70ibr76zivxb5nim"; fetchSubmodules = true; } +{ url = "https://github.com/FishSim/LibRAS.git"; rev = "fca9de50a484a2213f3ca1b39e275c237c471688"; sha256 = "0w1c87sifq8klq0f2l70qxjrlvahyxy1cx9rln80rni4d427yc1k"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/LinearMPC.git"; rev = "v1.0"; sha256 = "1crj60i5f33l9pgip0xbv6ankcga7px0644cj7c2wnzn1fjmn2k8"; fetchSubmodules = true; } +{ url = "https://github.com/looms-polimi/MEV.git"; rev = "v1.0.1"; sha256 = "1a7ih9lc01wzaq8a8aznggpi4aqnczyzq49q5hc4fqvmfwl7l0j3"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/ModPowerSystems.git"; rev = "df3afce27d5e935c4111f392275744a655abe216"; sha256 = "1b1fikm92lv6gj82imka3hxbjwv04i4h33y69yhcxdpqa6z6hm4z"; fetchSubmodules = true; } +{ url = "https://github.com/OpenModelica/OpenModelica-ModelicaStandardLibrary.git"; rev = "4a91d52248b0f17415bba1d58881fc730bd94215"; sha256 = "19caxz6hvlrsls3b2387a24zwwnykbb138jpb42gwpy8jlh93yzi"; fetchSubmodules = true; } +{ url = "https://github.com/OpenModelica/OpenModelica-ModelicaStandardLibrary.git"; rev = "cab27240a4a3ed4ea137226f056bbc0d79543f7a"; sha256 = "06y911i2hs7hg4ykhb8wngvxhwnaww8rsakwa7ssd047a7glzsb0"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/Modelica-Arduino.git"; rev = "v0.1.0"; sha256 = "1n34dksqhrn1synv2mp2ifk4dxyhp15f5v1jb1b3dbw9n19951qb"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/Modelica-GNU_ScientificLibrary.git"; rev = "9235ab28bdd7f0fe3e7abba48af53d73332858ec"; sha256 = "168g9gg12lfa863ifs41bnx6yd0yyjnal6986dgpm51dj5arw6id"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/Modelica-MVEM.git"; rev = "v1.0.1"; sha256 = "1p68691dnl06lgwm4bl9g036brn4vl7m5x3gq4rxc291339frixk"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/ModelicaADS.git"; rev = "v1.0.1"; sha256 = "0fhxrl07d7v3wa79d30psm1gxydc0p7s2akfirdx6dai0633skp9"; fetchSubmodules = true; } +{ url = "https://github.com/xogeny/ModelicaBook.git"; rev = "v0.6.0"; sha256 = "0yqbll6p738yvpi1x11cjngpz2glda07mljrkjlm23p7l53x63dc"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-compliance/compliance.git"; rev = "8a91e75d8a26acc4de30fc0e5d5e9db83c970bd6"; sha256 = "1cym1wlgsvfrryq8zqzzrgs4wam1l7pc20q07hk3d615nhq21lg6"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/ModelicaDFR.git"; rev = "37a441934d05330cf3d13e9ec551954d27eca84c"; sha256 = "13rpcs8cl9x15vi655150zmhmg1iaxpzvxrl3rqif46zpl5dhlj2"; fetchSubmodules = true; } +{ url = "https://github.com/modelica/Modelica_DeviceDrivers.git"; rev = "v1.8.2"; sha256 = "16c0p9zn0qrraz59ivinibmikdd251plm1vqngznzhksjwvz6bja"; fetchSubmodules = true; } +{ url = "https://github.com/modelica/Modelica_LinearSystems2.git"; rev = "v2.3.5"; sha256 = "0rzicynqgayydxqynnairxk7ybg4alv1xnfz8cgkrpicl2g9bacg"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/Modelica_Requirements.git"; rev = "a427b5cb7997e9036c577d219e6b8a5d0c28389a"; sha256 = "1ihx46kifnfi9kw1g8nmd9sarl766whbzdk6a44alczsya4gg45k"; fetchSubmodules = true; } +{ url = "https://github.com/modelica/Modelica_Synchronous.git"; rev = "c8350276bfd945086962cf4150ba941b9c57ed13"; sha256 = "12ad7fpjy50ky3lvl65r9d5xvlzvw5yqdnbp4rsgl3qw7s3wrmja"; fetchSubmodules = true; } +{ url = "https://github.com/jwindahlModelon/MultiPhaseMixtureMedia.git"; rev = "0bda0c58af6384f8e0edf7aa7520afb369af3e38"; sha256 = "11bqm69504bh4h05dxlwdmjfxwls06mr49cz47kl8jmrygkfi4i2"; fetchSubmodules = true; } +{ url = "https://github.com/OpenIPSL/OpenIPSL.git"; rev = "v1.5.0"; sha256 = "09xrcz0rdxdy220ki5zyl7920y0a4lg24p0aibna4ad15vszhhwj"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/Optimisers.git"; rev = "e33c69edaad6dad8029167b0ca00533964a6fe37"; sha256 = "0hcxsrr2n4fzaxdjvgvqayz38kpfk86cclvg5pzcfmjc5bznb8bs"; fetchSubmodules = true; } +{ url = "https://github.com/lochel/PNlib.git"; rev = "059545d48dd9ceeccfa3b4e47689ec8dd334dcd8"; sha256 = "1a0hxkgsi4klw9c8zav1dy2p1c85ald29gx82hfacwv55xl9f127"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/PVSystems.git"; rev = "v0.6.2"; sha256 = "0vcgvdaqfbn46lpzk0kvsif3d55wf8yzhkbdpf5zv04kv7zw25w9"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/PhotoVoltaics.git"; rev = "v1.6.0"; sha256 = "0zqx77z217iln3vfxn2v3c2jl0jz5kgcd96ylvimjnwr30mxr09n"; fetchSubmodules = true; } +{ url = "https://github.com/MarekMatejak/Physiolibrary.git"; rev = "v2.3.1"; sha256 = "0nxfw63m278gaff18zz29n2s1vk4kwdbv2qvbjmcq86fl1i5b3bg"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/Physiomodel.git"; rev = "v1.0.0"; sha256 = "1sdhv5qgjqv3zdq57pkkrh04ainwv9n5zqd8mb9a3ybjmwdjf6f9"; fetchSubmodules = true; } +{ url = "https://github.com/dzimmer/PlanarMechanics.git"; rev = "55224a9e76de8aa7f708236bd4d7dee624ecba50"; sha256 = "0hf7vi44adss86x5ahk5if7bdjgw773d8mb3d8ianq12g8azycyd"; fetchSubmodules = true; } +{ url = "https://github.com/PowerGrids/PowerGrids.git"; rev = "v1.0.0"; sha256 = "06bx8mqvmizhfwg99djdfgh2mblc4wzmg0zq4ilrp586jwfninmz"; fetchSubmodules = true; } +{ url = "https://github.com/modelica/PowerSystems.git"; rev = "v1.0.0"; sha256 = "1xwhwich7gi6vl33zl2r78xdjklchgkjcnvww6390j20l1wjznkn"; fetchSubmodules = true; } +{ url = "https://github.com/modelica/PowerSystems.git"; rev = "f0721333f4875143565147a7d043bee1c300873b"; sha256 = "0gbvx0gzf3akb0w7yvdxfq2y4ps91cy5b93iwnvnw7652x716813"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/RealTimeCoordinationLibrary.git"; rev = "v1.0.2"; sha256 = "0ch4la04hm059ii5wzph9gsbvqhnfqrvvpqi57qn27bm10c4la0m"; fetchSubmodules = true; } +{ url = "https://github.com/casella/ScalableTestSuite.git"; rev = "v1.11.5"; sha256 = "0bhj1q9b8d29nrbr253zszy1w1yvyizvyr3law1pqjj6mhbqmg4i"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/Servomechanisms.git"; rev = "3bf82ba5d3f31b4a0ae05f99ae690037358e153e"; sha256 = "1swka7d58wkg5pqv59lqgfi7gv6rg5vra4j6r76pn9czx9ddal8w"; fetchSubmodules = true; } +{ url = "https://github.com/SolarTherm/SolarTherm.git"; rev = "203fb5af3b95c731c7fcbe2833d51fd420e80796"; sha256 = "1bh4y4igzd0k59xm8j14p52gnlbwkiwwy6bhhyarpr361yrchn33"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/Soltermica.git"; rev = "9f7224bd89335f95dffe1ccdaa094df5a3279fdf"; sha256 = "1bif3cnwjas6x7b8ahwkm7dbrqrfdqwwa26zmdc6zrpfncl3kqd0"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/SystemDynamics.git"; rev = "2f6bd9382c5aac2aff9148cd9113a418767734b6"; sha256 = "0ii2mj6ngwjir3gzyad8wsj86pvd6wzal91nz2y7gzwj1djchb3x"; fetchSubmodules = true; } +{ url = "https://github.com/thom-marx/ThermalSeparation.git"; rev = "ffa0495ba829ecab105be4bfb3b7652625ec9c03"; sha256 = "1czm97bcrpp2jv0a0kd31a929wqlrlzdhdxvyy4w499dn20jzv1l"; fetchSubmodules = true; } +{ url = "https://github.com/casella/ThermoPower.git"; rev = "650be2c8cbd5abc3535e92b865e509073afc8aeb"; sha256 = "08ijrx8xw43dadz5s3kiwa17ax9faq2wyq9gm0vlz9ddbkj0hcaq"; fetchSubmodules = true; } +{ url = "https://openmodelica.org/git/ThermoSysPro.git"; rev = "db81ae1b5a6a85f6c6c7693244cafa6087e18ff5"; sha256 = "12fsf0xxxc1ja6vmm9ff85f8j5sg1lb7w4g57s2w3fkf4d3a7d0c"; fetchSubmodules = true; } +{ url = "https://openmodelica.org/git/ThermoSysPro.git"; rev = "5cef9acb4dedf8af6f4638a4448f08a544ebd30b"; sha256 = "0ihnz1s4rs42yis9zym9nw29ia2lqz2yx2wblc50p6f221w7q78s"; fetchSubmodules = true; } +{ url = "https://github.com/lenaRB/VVDRlib.git"; rev = "eae4981674642eddffc7f2aa3690320fcaddee0e"; sha256 = "0qxxk2xlas5mqyc1h8ndic208qj1sm5mr5y8664kv3py7i8jdqi4"; fetchSubmodules = true; } +{ url = "https://github.com/modelica/VehicleInterfaces.git"; rev = "v1.2.5"; sha256 = "044k17cpc88wprrvw03p6crm6dy6x9a6xj5104d5nln71lqz5sdq"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/WasteWater.git"; rev = "v2.1.0"; sha256 = "1dxr4m9j7b5266daj4klbrhvnkqr73sximdw9bk9v5qf0s28li99"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/WindPowerPlants.git"; rev = "v1.2.0"; sha256 = "1lyrqwsb6sm1wc7vlj72zk5cpjhhzh27fviiqayddqy2b903xish"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/ipsl.git"; rev = "v1.1.1"; sha256 = "1w2iah8c5d8n01wmxydjk0rrcxh88g8yjy2zmv403azcccq7byzp"; fetchSubmodules = true; } +{ url = "https://github.com/modelica-3rdparty/netCDF-DataReader.git"; rev = "v2.5.0"; sha256 = "1pd5xf5bgz010lryv8bj6lvlfqn9p184csiffwj8icx7rycnlcqb"; fetchSubmodules = true; } +{ url = "https://github.com/joewa/open-bldc-modelica.git"; rev = "58a83b5b36f267613de4676c95163489b1ddc2e7"; sha256 = "0wf6dn64d2psv9b3xg5227vzpk109r3dqzi4m2wwhrilaxs3v004"; fetchSubmodules = true; } +] diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/update-src-libs.sh b/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/update-src-libs.sh new file mode 100755 index 000000000000..b8f2e95923b5 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/update-src-libs.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env nix-shell +#! nix-shell -i bash -p bash + +CWD=$PWD + +chko() { + ( + T=`mktemp -d` + trap "rm -rf $T" EXIT INT PIPE + cd $T + cat >check.nix <<EOF +with import <nixpkgs> {}; +fetchgit `cat $CWD/../mkderivation/src-main.nix` +EOF + nix-build check.nix + cat result/libraries/Makefile.libs + ) +} + +getsha256() { + URL=$(echo "$1" | sed 's/^"\(.*\)"$/\1/') + REV=$(echo "$2" | sed 's/^"\(.*\)"$/\1/') + SHA=$(nix run nixpkgs.nix-prefetch-git -c nix-prefetch-git --fetch-submodules "$URL" "$REV" 2>/dev/null | sed -n 's/.*"sha256": "\(.*\)",/\1/g p') + echo "{ url = $1; rev = $2; sha256 = \"$SHA\"; fetchSubmodules = true; }" +} + +OUT=src-libs.nix + +echo '[' > $OUT + +chko | +grep checkout-git.sh | +tr \' \" | +while read NM TGT URL BR REV ; do + echo Trying $TGT $URL $REV >&2 + getsha256 $URL $REV >> $OUT || exit 1 +done + +echo ']' >> $OUT diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omparser/Makefile.in.patch b/nixpkgs/pkgs/applications/science/misc/openmodelica/omparser/Makefile.in.patch new file mode 100644 index 000000000000..a8f04203a8c9 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omparser/Makefile.in.patch @@ -0,0 +1,22 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -23,7 +23,7 @@ + omedit-testsuite: omedit-testsuite.skip + omedit-testsuite.skip: omedit.skip testsuite-depends + $(MAKE) -f $(defaultMakefileTarget) -C OMEdit/Testsuite +-omparser: omparser.skip ++omparser: build-dirs omparser.skip + omparser.skip: + test -f $@ || $(MAKE) -C OMParser OMBUILDDIR=@OMBUILDDIR@ "host_short=@host_short@" CC="@CC@" CXX="@CXX@" CFLAGS="@CFLAGS@" CPPFLAGS="@CPPFLAGS@" CXXFLAGS="@CXXFLAGS@" + omsimulator: omsimulator.skip +@@ -134,6 +134,10 @@ + INSTALL_JAVADIR = ${DESTDIR}${datadir}/omc/java + INSTALL_LOCALEDIR = ${DESTDIR}${datadir}/locale + ++build-dirs: ++ mkdir -p "@OMBUILDDIR@"/lib/@host_short@/omc ++ mkdir -p "@OMBUILDDIR@"/include/omc ++ + install-dirs: + @test ! "${DESTDIR}/@prefix@" -ef "@OMBUILDDIR@" || (echo Error: Install and build dirs are the same && false) + if [ "@APP@" = ".app" ]; then mkdir -p ${INSTALL_APPDIR}; fi diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omparser/default.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/omparser/default.nix new file mode 100644 index 000000000000..cbf8f2255e76 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omparser/default.nix @@ -0,0 +1,28 @@ +{ lib +, pkg-config +, jre8 +, libuuid +, openmodelica +, mkOpenModelicaDerivation +}: + +mkOpenModelicaDerivation rec { + pname = "omparser"; + omdir = "OMParser"; + omdeps = [ openmodelica.omcompiler ]; + + nativeBuildInputs = [ pkg-config ]; + + buildInputs = [ jre8 libuuid ]; + + patches = [ ./Makefile.in.patch ]; + + meta = with lib; { + description = "An antlr4-based parser of Modelica files from OpenModelica +suite"; + homepage = "https://openmodelica.org"; + license = licenses.gpl3Only; + maintainers = with maintainers; [ balodja smironov ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omplot/default.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/omplot/default.nix new file mode 100644 index 000000000000..51ab89407f4c --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omplot/default.nix @@ -0,0 +1,34 @@ +{ lib +, qtbase +, qttools +, qmake +, wrapQtAppsHook +, openmodelica +, mkOpenModelicaDerivation +}: + +mkOpenModelicaDerivation rec { + pname = "omplot"; + omdir = "OMPlot"; + omdeps = [ openmodelica.omcompiler ]; + omautoconf = true; + + nativeBuildInputs = [ qtbase qttools qmake wrapQtAppsHook ]; + + postPatch = '' + sed -i OMPlot/Makefile.in -e 's|bindir = @includedir@|includedir = @includedir@|' + sed -i OMPlot/OMPlot/OMPlotGUI/*.pro -e '/INCLUDEPATH +=/s|$| ../../qwt/src|' + sed -i ''$(find -name qmake.m4) -e '/^\s*LRELEASE=/ s|LRELEASE=.*$|LRELEASE=${lib.getDev qttools}/bin/lrelease|' + ''; + + dontUseQmakeConfigure = true; + QMAKESPEC = "linux-clang"; + + meta = with lib; { + description = "Plotting tool for OpenModelica-generated results files"; + homepage = "https://openmodelica.org"; + license = licenses.gpl3Only; + maintainers = with maintainers; [ balodja smironov ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omshell/default.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/omshell/default.nix new file mode 100644 index 000000000000..3c39d62f92d6 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omshell/default.nix @@ -0,0 +1,40 @@ +{ lib, qttools, qmake, qtwebkit, wrapQtAppsHook, readline, openmodelica, mkOpenModelicaDerivation }: + +mkOpenModelicaDerivation rec { + pname = "omshell"; + omdir = "OMShell"; + omdeps = [ openmodelica.omcompiler ]; + omautoconf = true; + + nativeBuildInputs = [ qmake wrapQtAppsHook ]; + + buildInputs = [ readline qtwebkit ]; + + postPatch = with openmodelica; '' + sed -i ''$(find -name qmake.m4) -e '/^\s*LRELEASE=/ s|LRELEASE=.*$|LRELEASE=${lib.getDev qttools}/bin/lrelease|' + sed -i OMShell/OMShell/OMShellGUI/*.pro -e ' + s|\$\$\[QT_INSTALL_BINS\]/lrelease|${lib.getDev qttools}/bin/lrelease| + /^\s*OMCLIBS =/ s|\$\$(OMBUILDDIR)|${omcompiler}| + /^\s*OMCINC =/ s|\$\$(OMBUILDDIR)|${omcompiler}| + ' + sed -i OMShell/OMShell/OMShellGUI/OMShell.config.in -e ' + s|@OMBUILDDIR@|${omcompiler}| + s|@OPENMODELICAHOME@|${omcompiler}| + ' + sed -i OMShell/mosh/src/Makefile.in -e ' + /^CFLAGS =/ s|-I../../../build|-I${omcompiler}| + /^LIBS =/ s|-L@OMBUILDDIR@|-L${omcompiler}| + ' + ''; + + dontUseQmakeConfigure = true; + QMAKESPEC = "linux-clang"; + + meta = with lib; { + description = "Interactive OpenModelica session shell"; + homepage = "https://openmodelica.org"; + license = licenses.gpl3Only; + maintainers = with maintainers; [ balodja smironov ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omsimulator/default.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/omsimulator/default.nix new file mode 100644 index 000000000000..d91d427a0770 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omsimulator/default.nix @@ -0,0 +1,26 @@ +{ lib +, pkg-config +, boost +, readline +, libxml2 +, openmodelica +, mkOpenModelicaDerivation +}: + +mkOpenModelicaDerivation rec { + pname = "omsimulator"; + omdir = "OMSimulator"; + omdeps = [ openmodelica.omcompiler ]; + + nativeBuildInputs = [ pkg-config ]; + + buildInputs = [ readline libxml2 boost ]; + + meta = with lib; { + description = "The OpenModelica FMI & SSP-based co-simulation environment"; + homepage = "https://openmodelica.org"; + license = licenses.gpl3Only; + maintainers = with maintainers; [ balodja smironov ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/openmvg/default.nix b/nixpkgs/pkgs/applications/science/misc/openmvg/default.nix new file mode 100644 index 000000000000..c5434c869909 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/openmvg/default.nix @@ -0,0 +1,52 @@ +{ lib, stdenv, fetchFromGitHub, pkg-config, cmake, cereal, openmp +, libjpeg ? null +, zlib ? null +, libpng ? null +, eigen ? null +, libtiff ? null +, ceres-solver +, enableShared ? !stdenv.hostPlatform.isStatic +, enableExamples ? false +, enableDocs ? false }: + +stdenv.mkDerivation rec { + version = "unstable-2022-12-30"; + pname = "openmvg"; + + src = fetchFromGitHub { + owner = "openmvg"; + repo = "openmvg"; + rev = "e1bbfe801986cd7171f36443a1573b0f69f3702d"; + sha256 = "sha256-DngfmejNFw5pogTo7Ec5aUey2LUQIojvJybLmtCfvVY="; + fetchSubmodules = true; + }; + + buildInputs = [ libjpeg zlib libpng eigen libtiff cereal openmp ceres-solver ]; + + nativeBuildInputs = [ cmake pkg-config ]; + + cmakeFlags = [ + "-DOpenMVG_BUILD_EXAMPLES=${if enableExamples then "ON" else "OFF"}" + "-DOpenMVG_BUILD_DOC=${if enableDocs then "ON" else "OFF"}" + "-DTARGET_ARCHITECTURE=generic" + ] ++ lib.optional enableShared "-DOpenMVG_BUILD_SHARED=ON"; + + cmakeDir = "./src"; + + dontUseCmakeBuildDir = true; + + # This can be enabled, but it will exhause virtual memory on most machines. + enableParallelBuilding = false; + + # Without hardeningDisable, certain flags are passed to the compile that break the build (primarily string format errors) + hardeningDisable = [ "all" ]; + + meta = { + broken = stdenv.isDarwin && stdenv.isx86_64; + description = "A library for computer-vision scientists and targeted for the Multiple View Geometry community"; + homepage = "https://openmvg.readthedocs.io/en/latest/"; + license = lib.licenses.mpl20; + platforms = lib.platforms.unix; + maintainers = with lib.maintainers; [ mdaiter bouk ]; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/openmvs/default.nix b/nixpkgs/pkgs/applications/science/misc/openmvs/default.nix new file mode 100644 index 000000000000..fde756181cca --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/openmvs/default.nix @@ -0,0 +1,82 @@ +{ lib +, boost +, breakpad +, ceres-solver +, cgal +, cmake +, eigen +, fetchFromGitHub +, glfw +, gmp +, libjpeg +, libpng +, libtiff +, mpfr +, opencv +, openmp +, pkg-config +, stdenv +, vcg +, zstd +}: + +let + boostWithZstd = boost.overrideAttrs (old: { + buildInputs = old.buildInputs ++ [ zstd ]; + }); +in +stdenv.mkDerivation rec { + version = "2.1.0"; + pname = "openmvs"; + + src = fetchFromGitHub { + owner = "cdcseacave"; + repo = "openmvs"; + rev = "v${version}"; + sha256 = "sha256-eqNprBgR0hZnbLKLZLJqjemKxHhDtGblmaSxYlmegsc="; + fetchSubmodules = true; + }; + + # SSE is enabled by default + cmakeFlags = lib.optional (!stdenv.isx86_64) "-DOpenMVS_USE_SSE=OFF"; + + buildInputs = [ + boostWithZstd + breakpad + ceres-solver + cgal + eigen + glfw + gmp + libjpeg + libpng + libtiff + mpfr + opencv + openmp + vcg + ]; + + nativeBuildInputs = [ cmake pkg-config ]; + + postInstall = '' + mv $out/bin/OpenMVS/* $out/bin + rmdir $out/bin/OpenMVS + rm $out/bin/Tests + ''; + + doCheck = true; + checkPhase = '' + runHook preCheck + ctest + runHook postCheck + ''; + + meta = { + description = "Open Multi-View Stereo reconstruction library"; + homepage = "https://github.com/cdcseacave/openMVS"; + license = lib.licenses.agpl3Only; + platforms = lib.platforms.unix; + maintainers = with lib.maintainers; [ bouk ]; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/reason-shell/default.nix b/nixpkgs/pkgs/applications/science/misc/reason-shell/default.nix new file mode 100644 index 000000000000..aa1544669ed8 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/reason-shell/default.nix @@ -0,0 +1,40 @@ +{ lib +, rustPlatform +, fetchFromGitHub +, pkg-config +, openssl +, stdenv +, darwin +}: + +rustPlatform.buildRustPackage rec { + pname = "reason"; + version = "0.3.10"; + + src = fetchFromGitHub { + owner = "jaywonchung"; + repo = "reason"; + rev = "v${version}"; + hash = "sha256-oytRquZJgb1sfpZil1bSGwIIvm+5N4mkVmIMzWyzDco="; + }; + + cargoHash = "sha256-4AEuFSM2dY6UjjIFRU8ipkRMoEb2LjnOr3H6rZrLokE="; + + nativeBuildInputs = [ + pkg-config + ]; + + buildInputs = [ + openssl + ] ++ lib.optionals stdenv.isDarwin [ + darwin.apple_sdk.frameworks.CoreServices + ]; + + meta = with lib; { + description = "A shell for research papers"; + homepage = "https://github.com/jaywonchung/reason"; + changelog = "https://github.com/jaywonchung/reason/releases/tag/${src.rev}"; + license = licenses.mit; + maintainers = with maintainers; [ figsoda ]; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/rink/default.nix b/nixpkgs/pkgs/applications/science/misc/rink/default.nix new file mode 100644 index 000000000000..18b1e46fde2e --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/rink/default.nix @@ -0,0 +1,30 @@ +{ lib, stdenv, fetchFromGitHub, rustPlatform, openssl, pkg-config, ncurses +, libiconv, Security }: + +rustPlatform.buildRustPackage rec { + version = "0.6.3"; + pname = "rink"; + + src = fetchFromGitHub { + owner = "tiffany352"; + repo = "rink-rs"; + rev = "v${version}"; + sha256 = "sha256-AhC3c6CpV0tlD6d/hFWt7hGj2UsXsOCeujkRSDlpvCM="; + }; + + cargoSha256 = "sha256-Xo5iYwL4Db+GWMl5UXbPmj0Y0PJYR4Q0aUGnYCd+NB8="; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ ncurses ] + ++ (if stdenv.isDarwin then [ libiconv Security ] else [ openssl ]); + + # Some tests fail and/or attempt to use internet servers. + doCheck = false; + + meta = with lib; { + description = "Unit-aware calculator"; + homepage = "https://rinkcalc.app"; + license = with licenses; [ mpl20 gpl3Plus ]; + maintainers = with maintainers; [ sb0 Br1ght0ne ]; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/root/5.nix b/nixpkgs/pkgs/applications/science/misc/root/5.nix new file mode 100644 index 000000000000..4a8411cd34f9 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/root/5.nix @@ -0,0 +1,159 @@ +{ lib +, stdenv +, fetchurl +, fetchpatch +, cmake +, pcre +, pkg-config +, python3 +, libX11 +, libXpm +, libXft +, libXext +, libGLU +, libGL +, zlib +, libxml2 +, libxcrypt +, lz4 +, xz +, gsl +, xxHash +, Cocoa +, OpenGL +, noSplash ? false +}: + +stdenv.mkDerivation rec { + pname = "root"; + version = "5.34.38"; + + src = fetchurl { + url = "https://root.cern.ch/download/root_v${version}.source.tar.gz"; + sha256 = "1ln448lszw4d6jmbdphkr2plwxxlhmjkla48vmmq750xc1lxlfrc"; + }; + + nativeBuildInputs = [ cmake pkg-config ]; + buildInputs = [ pcre python3 zlib libxml2 lz4 xz gsl xxHash libxcrypt ] + ++ lib.optionals (!stdenv.isDarwin) [ libX11 libXpm libXft libXext libGLU libGL ] + ++ lib.optionals (stdenv.isDarwin) [ Cocoa OpenGL ] + ; + + patches = [ + ./sw_vers_root5.patch + + # prevents rootcint from looking in /usr/includes and such + ./purify_include_paths_root5.patch + + # disable dictionary generation for stuff that includes libc headers + # our glibc requires a modern compiler + ./disable_libc_dicts_root5.patch + + (fetchpatch { + name = "root5-gcc9-fix.patch"; + url = "https://github.com/root-project/root/commit/348f30a6a3b5905ef734a7bd318bc0ee8bca6dc9.diff"; + sha256 = "0dvrsrkpacyn5z87374swpy7aciv9a8s6m61b4iqd7a956r67rn3"; + }) + (fetchpatch { + name = "root5-gcc10-fix.patch"; + url = "https://github.com/root-project/root/commit/3c243b18768d3c3501faf3ca4e4acfc071021350.diff"; + sha256 = "1hjmgnp4zx6im8ps78673x0rrhmfyy1nffhgxjlfl1r2z8cq210z"; + }) + (fetchpatch { + name = "root5-python37-fix.patch"; + url = "https://github.com/root-project/root/commit/c75458024082de0cc35b45505c652b8460a9e71b.patch"; + sha256 = "sha256-A5zEjQE9OGPFp/L1HUs4NIdxQMRiwbwCRNWOLN2ENrM="; + }) + ]; + + # https://github.com/root-project/root/issues/13216 + hardeningDisable = [ "fortify3" ]; + + preConfigure = '' + # binutils 2.37 fixes + fixupList=( + cint/demo/gl/make0 + cint/demo/exception/Makefile + cint/demo/makecint/KRcc/Makefile + cint/demo/makecint/Stub2/Make2 + cint/demo/makecint/Array/Makefile + cint/demo/makecint/DArray/Makefile + cint/demo/makecint/ReadFile/Makefile + cint/demo/makecint/stl/Makefile + cint/demo/makecint/Stub2/Make1 + cint/cint/include/makemat + cint/cint/lib/WildCard/Makefile + cint/cint/include/make.arc + cint/cint/lib/qt/Makefile + cint/cint/lib/pthread/Makefile + graf2d/asimage/src/libAfterImage/Makefile.in + ) + for toFix in "''${fixupList[@]}"; do + substituteInPlace "$toFix" --replace "clq" "cq" + done + + patchShebangs build/unix/ + ln -s ${lib.getDev stdenv.cc.libc}/include/AvailabilityMacros.h cint/cint/include/ + + # __malloc_hook is deprecated + substituteInPlace misc/memstat/src/TMemStatHook.cxx \ + --replace "defined(R__GNU) && (defined(R__LINUX) || defined(__APPLE__))" \ + "defined(R__GNU) && (defined(__APPLE__))" + '' + # Fix CINTSYSDIR for "build" version of rootcint + # This is probably a bug that breaks out-of-source builds + + '' + substituteInPlace cint/cint/src/loadfile.cxx\ + --replace 'env = "cint";' 'env = "'`pwd`'/cint";' + '' + lib.optionalString noSplash '' + substituteInPlace rootx/src/rootx.cxx --replace "gNoLogo = false" "gNoLogo = true" + ''; + + cmakeFlags = [ + "-Drpath=ON" + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DCMAKE_INSTALL_INCLUDEDIR=include" + "-DCMAKE_CXX_FLAGS=-std=c++11" + "-Dalien=OFF" + "-Dbonjour=OFF" + "-Dcastor=OFF" + "-Dchirp=OFF" + "-Ddavix=OFF" + "-Ddcache=OFF" + "-Dfftw3=OFF" + "-Dfitsio=OFF" + "-Dfortran=OFF" + "-Dgfal=OFF" + "-Dgsl_shared=ON" + "-Dgviz=OFF" + "-Dhdfs=OFF" + "-Dkrb5=OFF" + "-Dldap=OFF" + "-Dmathmore=ON" + "-Dmonalisa=OFF" + "-Dmysql=OFF" + "-Dodbc=OFF" + "-Dopengl=ON" + "-Doracle=OFF" + "-Dpgsql=OFF" + "-Dpythia6=OFF" + "-Dpythia8=OFF" + "-Drfio=OFF" + "-Dsqlite=OFF" + "-Dssl=OFF" + "-Dxml=ON" + "-Dxrootd=OFF" + ] + ++ lib.optional stdenv.isDarwin "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks"; + + setupHook = ./setup-hook.sh; + + meta = with lib; { + homepage = "https://root.cern.ch/"; + description = "A data analysis framework"; + platforms = platforms.unix; + broken = !stdenv.isx86_64; + maintainers = with maintainers; [ veprbl ]; + license = licenses.lgpl21; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/root/default.nix b/nixpkgs/pkgs/applications/science/misc/root/default.nix new file mode 100644 index 000000000000..1f8a2d3b8d54 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/root/default.nix @@ -0,0 +1,288 @@ +{ stdenv +, lib +, callPackage +, fetchurl +, fetchpatch +, makeWrapper +, cmake +, coreutils +, git +, davix +, ftgl +, gl2ps +, glew +, gnugrep +, gnused +, gsl +, lapack +, libX11 +, libXpm +, libXft +, libXext +, libGLU +, libGL +, libxcrypt +, libxml2 +, llvm_9 +, lsof +, lz4 +, xz +, man +, openblas +, openssl +, pcre +, nlohmann_json +, pkg-config +, procps +, python +, which +, xxHash +, zlib +, zstd +, libAfterImage +, giflib +, libjpeg +, libtiff +, libpng +, patchRcPathCsh +, patchRcPathFish +, patchRcPathPosix +, tbb +, xrootd +, Cocoa +, CoreSymbolication +, OpenGL +, noSplash ? false +}: + +let + + _llvm_9 = llvm_9.overrideAttrs (prev: { + patches = (prev.patches or [ ]) ++ [ + (fetchpatch { + url = "https://github.com/root-project/root/commit/a9c961cf4613ff1f0ea50f188e4a4b0eb749b17d.diff"; + stripLen = 3; + hash = "sha256-LH2RipJICEDWOr7JzX5s0QiUhEwXNMFEJihYKy9qWpo="; + }) + ]; + }); + +in + +stdenv.mkDerivation rec { + pname = "root"; + version = "6.26.10"; + + passthru = { + tests = import ./tests { inherit callPackage; }; + }; + + src = fetchurl { + url = "https://root.cern.ch/download/root_v${version}.source.tar.gz"; + hash = "sha256-jla+w5cQQBeqVPnrVU3noaE0R0/gs7sPQ6cPxPq9Yl8="; + }; + + nativeBuildInputs = [ makeWrapper cmake pkg-config git ]; + propagatedBuildInputs = [ + nlohmann_json + ]; + buildInputs = [ + davix + ftgl + gl2ps + glew + pcre + zlib + zstd + lapack + libxcrypt + libxml2 + _llvm_9 + lz4 + xz + gsl + openblas + openssl + xxHash + libAfterImage + giflib + libjpeg + libtiff + libpng + patchRcPathCsh + patchRcPathFish + patchRcPathPosix + python.pkgs.numpy + tbb + xrootd + ] + ++ lib.optionals (!stdenv.isDarwin) [ libX11 libXpm libXft libXext libGLU libGL ] + ++ lib.optionals (stdenv.isDarwin) [ Cocoa CoreSymbolication OpenGL ] + ; + + patches = [ + ./sw_vers.patch + ] ++ lib.optionals (python.pkgs.pythonAtLeast "3.11") [ + # Fix build against Python 3.11 + (fetchpatch { + url = "https://github.com/root-project/root/commit/484deb056dacf768aba4954073b41105c431bffc.patch"; + hash = "sha256-4qur2e3SxMIPgOg4IjlvuULR2BObuP7xdvs+LmNT2/s="; + }) + ]; + + # Fix build against vanilla LLVM 9 + postPatch = '' + sed \ + -e '/#include "llvm.*RTDyldObjectLinkingLayer.h"/i#define private protected' \ + -e '/#include "llvm.*RTDyldObjectLinkingLayer.h"/a#undef private' \ + -i interpreter/cling/lib/Interpreter/IncrementalJIT.h + ''; + + preConfigure = '' + rm -rf builtins/* + substituteInPlace cmake/modules/SearchInstalledSoftware.cmake \ + --replace 'set(lcgpackages ' '#set(lcgpackages ' + + # Don't require textutil on macOS + : > cmake/modules/RootCPack.cmake + + # Hardcode path to fix use with cmake + sed -i cmake/scripts/ROOTConfig.cmake.in \ + -e '1iset(nlohmann_json_DIR "${nlohmann_json}/lib/cmake/nlohmann_json/")' + + patchShebangs build/unix/ + '' + lib.optionalString noSplash '' + substituteInPlace rootx/src/rootx.cxx --replace "gNoLogo = false" "gNoLogo = true" + '' + lib.optionalString stdenv.isDarwin '' + # Eliminate impure reference to /System/Library/PrivateFrameworks + substituteInPlace core/CMakeLists.txt \ + --replace "-F/System/Library/PrivateFrameworks" "" + '' + lib.optionalString (stdenv.isDarwin && lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11") '' + MACOSX_DEPLOYMENT_TARGET=10.16 + ''; + + cmakeFlags = [ + "-Drpath=ON" + "-DCMAKE_INSTALL_BINDIR=bin" + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DCMAKE_INSTALL_INCLUDEDIR=include" + "-Dbuiltin_llvm=OFF" + "-Dbuiltin_nlohmannjson=OFF" + "-Dbuiltin_openui5=OFF" + "-Dalien=OFF" + "-Dbonjour=OFF" + "-Dcastor=OFF" + "-Dchirp=OFF" + "-Dclad=OFF" + "-Ddavix=ON" + "-Ddcache=OFF" + "-Dfail-on-missing=ON" + "-Dfftw3=OFF" + "-Dfitsio=OFF" + "-Dfortran=OFF" + "-Dgnuinstall=ON" + "-Dimt=ON" + "-Dgfal=OFF" + "-Dgviz=OFF" + "-Dhdfs=OFF" + "-Dhttp=ON" + "-Dkrb5=OFF" + "-Dldap=OFF" + "-Dmonalisa=OFF" + "-Dmysql=OFF" + "-Dodbc=OFF" + "-Dopengl=ON" + "-Doracle=OFF" + "-Dpgsql=OFF" + "-Dpythia6=OFF" + "-Dpythia8=OFF" + "-Drfio=OFF" + "-Droot7=OFF" + "-Dsqlite=OFF" + "-Dssl=ON" + "-Dtmva=ON" + "-Dvdt=OFF" + "-Dwebgui=OFF" + "-Dxml=ON" + "-Dxrootd=ON" + ] + ++ lib.optional (stdenv.cc.libc != null) "-DC_INCLUDE_DIRS=${lib.getDev stdenv.cc.libc}/include" + ++ lib.optionals stdenv.isDarwin [ + "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks" + "-DCMAKE_DISABLE_FIND_PACKAGE_Python2=TRUE" + + # fatal error: module map file '/nix/store/<hash>-Libsystem-osx-10.12.6/include/module.modulemap' not found + # fatal error: could not build module '_Builtin_intrinsics' + "-Druntime_cxxmodules=OFF" + ]; + + # Workaround the xrootd runpath bug #169677 by prefixing [DY]LD_LIBRARY_PATH with ${lib.makeLibraryPath xrootd}. + # TODO: Remove the [DY]LDLIBRARY_PATH prefix for xrootd when #200830 get merged. + postInstall = '' + for prog in rootbrowse rootcp rooteventselector rootls rootmkdir rootmv rootprint rootrm rootslimtree; do + wrapProgram "$out/bin/$prog" \ + --set PYTHONPATH "$out/lib" \ + --set ${lib.optionalString stdenv.isDarwin "DY"}LD_LIBRARY_PATH "$out/lib:${lib.makeLibraryPath [ xrootd ]}" + done + + # Make ldd and sed available to the ROOT executable by prefixing PATH. + wrapProgram "$out/bin/root" \ + --prefix PATH : "${lib.makeBinPath [ + gnused # sed + stdenv.cc # c++ ld etc. + stdenv.cc.libc # ldd + ]}" \ + --prefix ${lib.optionalString stdenv.hostPlatform.isDarwin "DY"}LD_LIBRARY_PATH : "${lib.makeLibraryPath [ xrootd ]}" + + # Patch thisroot.{sh,csh,fish} + + # The main target of `thisroot.sh` is "bash-like shells", + # but it also need to support Bash-less POSIX shell like dash, + # as they are mentioned in `thisroot.sh`. + + # `thisroot.sh` would include commands `lsof` and `procps` since ROOT 6.28. + # See https://github.com/root-project/root/pull/10332 + + patchRcPathPosix "$out/bin/thisroot.sh" "${lib.makeBinPath [ + coreutils # dirname tail + gnugrep # grep + gnused # sed + lsof # lsof # for ROOT (>=6.28) + man # manpath + procps # ps # for ROOT (>=6.28) + which # which + ]}" + patchRcPathCsh "$out/bin/thisroot.csh" "${lib.makeBinPath [ + coreutils + gnugrep + gnused + lsof # lsof # for ROOT (>=6.28) + man + which + ]}" + patchRcPathFish "$out/bin/thisroot.fish" "${lib.makeBinPath [ + coreutils + man + which + ]}" + ''; + + # To use the debug information on the fly (without installation) + # add the outPath of root.debug into NIX_DEBUG_INFO_DIRS (in PATH-like format) + # and make sure that gdb from Nixpkgs can be found in PATH. + # + # Darwin currently fails to support it (#203380) + # we set it to true hoping to benefit from the future fix. + # Before that, please make sure if root.debug exists before using it. + separateDebugInfo = true; + + setupHook = ./setup-hook.sh; + + meta = with lib; { + homepage = "https://root.cern.ch/"; + description = "A data analysis framework"; + platforms = platforms.unix; + maintainers = [ maintainers.veprbl ]; + license = licenses.lgpl21; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/root/disable_libc_dicts_root5.patch b/nixpkgs/pkgs/applications/science/misc/root/disable_libc_dicts_root5.patch new file mode 100644 index 000000000000..abd6222847ef --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/root/disable_libc_dicts_root5.patch @@ -0,0 +1,27 @@ +diff --git a/cint/ROOT/CMakeLists.txt b/cint/ROOT/CMakeLists.txt +--- a/cint/ROOT/CMakeLists.txt ++++ b/cint/ROOT/CMakeLists.txt +@@ -47,21 +47,13 @@ set(CINTSTLDLLHEADERS + ${CMAKE_SOURCE_DIR}/cint/cint/lib/stdstrct/stdcxxfunc.h + ) + set(CINTINCDLLNAMES +- stdfunc ++# stdfunc + # stdcxxfunc + ) + set(CINTINCDLLHEADERS +- ${CMAKE_SOURCE_DIR}/cint/cint/lib/stdstrct/stdfunc.h ++# ${CMAKE_SOURCE_DIR}/cint/cint/lib/stdstrct/stdfunc.h + # ${CMAKE_SOURCE_DIR}/cint/cint/lib/stdstrct/stdcxxfunc.h + ) +-if(NOT WIN32) +- set(CINTSTLDLLNAMES ${CINTSTLDLLNAMES} valarray) +- set(CINTSTLDLLHEADERS ${CINTSTLDLLHEADERS} ${CINTDLLDIR}/vary.h) +- set(CINTINCDLLNAMES ${CINTINCDLLNAMES} posix ipc) +- set(CINTINCDLLHEADERS ${CINTINCDLLHEADERS} +- ${CMAKE_SOURCE_DIR}/cint/cint/lib/posix/exten.h +- ${CMAKE_SOURCE_DIR}/cint/cint/lib/ipc/ipcif.h) +-endif() + + set(CINTBUILDLOADER + vector diff --git a/nixpkgs/pkgs/applications/science/misc/root/purify_include_paths_root5.patch b/nixpkgs/pkgs/applications/science/misc/root/purify_include_paths_root5.patch new file mode 100644 index 000000000000..6773603b8ad3 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/root/purify_include_paths_root5.patch @@ -0,0 +1,204 @@ +diff --git a/cint/cint/src/loadfile.cxx b/cint/cint/src/loadfile.cxx +--- a/cint/cint/src/loadfile.cxx ++++ b/cint/cint/src/loadfile.cxx +@@ -1365,92 +1365,6 @@ int G__statfilename(const char *filenamein, struct stat *statBuf, + } + } + #endif /* G__EDU_VERSION */ +- +-#ifdef G__VISUAL +- /********************************************** +- * try /msdev/include +- **********************************************/ +- if('\0'!=G__cintsysdir[0]) { +- workname.Format("/msdev/include/%s%s",filename(),addpost[i2]); +- res = stat( workname, statBuf ); +- if (res==0) { +- if (fullPath) fullPath->Swap(workname); +- return res; +- } +- } +-#endif /* G__VISUAL */ +- +-#ifdef G__SYMANTEC +- /********************************************** +- * try /sc/include +- **********************************************/ +- if('\0'!=G__cintsysdir[0]) { +- workname.Format("/sc/include/%s%s",filename(),addpost[i2]); +- res = stat( workname, statBuf ); +- if (res==0) { +- if (fullPath) fullPath->Swap(workname); +- return res; +- } +- } +-#endif // G__SYMANTEC +- +-#ifndef G__WIN32 +- /********************************************** +- * try /usr/include/filename +- **********************************************/ +- if('\0'!=G__cintsysdir[0]) { +- workname.Format("/usr/include/%s%s",filename(),addpost[i2]); +- res = stat( workname, statBuf ); +- if (res==0) { +- if (fullPath) fullPath->Swap(workname); +- return res; +- } +- } +-#endif +- +-#ifdef __GNUC__ +- /********************************************** +- * try /usr/include/g++/filename +- **********************************************/ +- if('\0'!=G__cintsysdir[0]) { +- workname.Format("/usr/include/g++/%s%s",filename(),addpost[i2]); +- res = stat( workname, statBuf ); +- if (res==0) { +- if (fullPath) fullPath->Swap(workname); +- return res; +- } +- } +-#endif /* __GNUC__ */ +- +-#ifndef G__WIN32 +- /* #ifdef __hpux */ +- /********************************************** +- * try /usr/include/CC/filename +- **********************************************/ +- if('\0'!=G__cintsysdir[0]) { +- workname.Format("/usr/include/CC/%s%s",filename(),addpost[i2]); +- res = stat( workname, statBuf ); +- if (res==0) { +- if (fullPath) fullPath->Swap(workname); +- return res; +- } +- } +-#endif +- +-#ifndef G__WIN32 +- /********************************************** +- * try /usr/include/codelibs/filename +- **********************************************/ +- if('\0'!=G__cintsysdir[0]) { +- workname.Format("/usr/include/codelibs/%s%s" +- ,filename(),addpost[i2]); +- res = stat( workname, statBuf ); +- if (res==0) { +- if (fullPath) fullPath->Swap(workname); +- return res; +- } +- } +-#endif + } + return -1; + } +@@ -1960,107 +1874,6 @@ int G__loadfile(const char *filenamein) + } + if(G__ifile.fp) break; + #endif /* G__EDU_VERSION */ +- +-#ifdef G__VISUAL +- /********************************************** +- * try /msdev/include +- **********************************************/ +- if('\0'!=G__cintsysdir[0]) { +- G__snprintf(G__ifile.name,G__MAXFILENAME,"/msdev/include/%s%s",filename(),addpost[i2]); +-#ifndef G__WIN32 +- G__ifile.fp = fopen(G__ifile.name,"r"); +-#else +- G__ifile.fp = fopen(G__ifile.name,"rb"); +-#endif +- G__globalcomp=G__store_globalcomp; +- } +- if(G__ifile.fp) break; +-#endif /* G__VISUAL */ +- +-#ifdef G__SYMANTEC +- /********************************************** +- * try /sc/include +- **********************************************/ +- if('\0'!=G__cintsysdir[0]) { +- G__snprintf(G__ifile.name,G__MAXFILENAME,"/sc/include/%s%s",filename(),addpost[i2]); +-#ifndef G__WIN32 +- G__ifile.fp = fopen(G__ifile.name,"r"); +-#else +- G__ifile.fp = fopen(G__ifile.name,"rb"); +-#endif +- G__globalcomp=G__store_globalcomp; +- } +- if(G__ifile.fp) break; +-#endif /* G__SYMANTEC */ +- +-#ifndef G__WIN32 +- /********************************************** +- * try /usr/include/filename +- **********************************************/ +- if('\0'!=G__cintsysdir[0]) { +- G__snprintf(G__ifile.name,G__MAXFILENAME,"/usr/include/%s%s",filename(),addpost[i2]); +-#ifndef G__WIN32 +- G__ifile.fp = fopen(G__ifile.name,"r"); +-#else +- G__ifile.fp = fopen(G__ifile.name,"rb"); +-#endif +- G__globalcomp=G__store_globalcomp; +- } +- if(G__ifile.fp) break; +-#endif +- +-#ifdef __GNUC__ +- /********************************************** +- * try /usr/include/g++/filename +- **********************************************/ +- if('\0'!=G__cintsysdir[0]) { +- G__snprintf(G__ifile.name,G__MAXFILENAME,"/usr/include/g++/%s%s",filename(),addpost[i2]); +-#ifndef G__WIN32 +- G__ifile.fp = fopen(G__ifile.name,"r"); +-#else +- G__ifile.fp = fopen(G__ifile.name,"rb"); +-#endif +- G__globalcomp=G__store_globalcomp; +- } +- if(G__ifile.fp) break; +-#endif /* __GNUC__ */ +- +-#ifndef G__WIN32 +-/* #ifdef __hpux */ +- /********************************************** +- * try /usr/include/CC/filename +- **********************************************/ +- if('\0'!=G__cintsysdir[0]) { +- G__snprintf(G__ifile.name,G__MAXFILENAME,"/usr/include/CC/%s%s",filename(),addpost[i2]); +-#ifndef G__WIN32 +- G__ifile.fp = fopen(G__ifile.name,"r"); +-#else +- G__ifile.fp = fopen(G__ifile.name,"rb"); +-#endif +- G__globalcomp=G__store_globalcomp; +- } +- if(G__ifile.fp) break; +-/* #endif __hpux */ +-#endif +- +-#ifndef G__WIN32 +-/* #ifdef __hpux */ +- /********************************************** +- * try /usr/include/codelibs/filename +- **********************************************/ +- if('\0'!=G__cintsysdir[0]) { +- G__snprintf(G__ifile.name,G__MAXFILENAME,"/usr/include/codelibs/%s%s" +- ,filename(),addpost[i2]); +-#ifndef G__WIN32 +- G__ifile.fp = fopen(G__ifile.name,"r"); +-#else +- G__ifile.fp = fopen(G__ifile.name,"rb"); +-#endif +- G__globalcomp=G__store_globalcomp; +- } +- if(G__ifile.fp) break; +-/* #endif __hpux */ +-#endif + } + } + diff --git a/nixpkgs/pkgs/applications/science/misc/root/setup-hook.sh b/nixpkgs/pkgs/applications/science/misc/root/setup-hook.sh new file mode 100644 index 000000000000..34c9bfdcebbd --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/root/setup-hook.sh @@ -0,0 +1,19 @@ +thisroot () { + # Workaround thisroot.sh dependency on man + if [ -z "${MANPATH-}" ]; then + MANPATH=: + fi + local oldOpts="-u" + shopt -qo nounset || oldOpts="+u" + set +u + source @out@/bin/thisroot.sh + set "$oldOpts" +} + +postHooks+=(thisroot) + +addRootInludePath() { + addToSearchPath ROOT_INCLUDE_PATH $1/include +} + +addEnvHooks "$targetOffset" addRootInludePath diff --git a/nixpkgs/pkgs/applications/science/misc/root/sw_vers.patch b/nixpkgs/pkgs/applications/science/misc/root/sw_vers.patch new file mode 100644 index 000000000000..836bbb5b17a4 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/root/sw_vers.patch @@ -0,0 +1,87 @@ +diff a/cmake/modules/SetUpMacOS.cmake b/cmake/modules/SetUpMacOS.cmake +--- a/cmake/modules/SetUpMacOS.cmake ++++ b/cmake/modules/SetUpMacOS.cmake +@@ -28,17 +28,10 @@ if(CMAKE_VERSION VERSION_LESS 3.14.4) + endif() + + if (CMAKE_SYSTEM_NAME MATCHES Darwin) +- EXECUTE_PROCESS(COMMAND sw_vers "-productVersion" +- COMMAND cut -d . -f 1-2 +- OUTPUT_VARIABLE MACOSX_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) +- + MESSAGE(STATUS "Found a macOS system ${MACOSX_VERSION}") + +- if(MACOSX_VERSION VERSION_GREATER 10.7 AND ${CMAKE_CXX_COMPILER_ID} MATCHES Clang) + set(libcxx ON CACHE BOOL "Build using libc++" FORCE) +- endif() + +- if(MACOSX_VERSION VERSION_GREATER 10.4) + #TODO: check haveconfig and rpath -> set rpath true + #TODO: check Thread, define link command + #TODO: more stuff check configure script +@@ -57,22 +50,7 @@ if (CMAKE_SYSTEM_NAME MATCHES Darwin) + SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS} -m64") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64") +- else() +- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32") +- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32") +- SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -m32") + endif() +- endif() +- +- if(MACOSX_VERSION VERSION_GREATER 10.6) +- set(MACOSX_SSL_DEPRECATED ON) +- endif() +- if(MACOSX_VERSION VERSION_GREATER 10.7) +- set(MACOSX_ODBC_DEPRECATED ON) +- endif() +- if(MACOSX_VERSION VERSION_GREATER 10.8) +- set(MACOSX_GLU_DEPRECATED ON) +- endif() + + if (CMAKE_COMPILER_IS_GNUCXX) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -W -Wshadow -Wall -Woverloaded-virtual -fsigned-char -fno-common") +@@ -130,7 +108,6 @@ if (CMAKE_SYSTEM_NAME MATCHES Darwin) + endif() + + #---Set Linker flags---------------------------------------------------------------------- +- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mmacosx-version-min=${MACOSX_VERSION}") + else (CMAKE_SYSTEM_NAME MATCHES Darwin) + MESSAGE(FATAL_ERROR "There is no setup for this this Apple system up to now. Don't know waht to do. Stop cmake at this point.") + endif (CMAKE_SYSTEM_NAME MATCHES Darwin) +diff a/config/root-config.in b/config/root-config.in +--- a/config/root-config.in ++++ b/config/root-config.in +@@ -312,12 +312,6 @@ macosxicc) + ;; + macosx64|macosxarm64) + # MacOS X with gcc (GNU cc v4.x) in 64 bit mode +- macosx_major=`sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 1 | sed -e 's/^[[:space:]]*//'` +- macosx_minor=`sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2` +- # cannot find the one linked to libGraf if relocated after built +- if [ $macosx_major -eq 10 -a $macosx_minor -le 4 ]; then +- rootlibs="$rootlibs -lfreetype" +- fi + auxcflags="${cxxversionflag} -m64" + auxldflags="-m64" + auxlibs="-lm -ldl" +@@ -378,18 +372,11 @@ freebsd* | openbsd* | linux*) + done + ;; + macosx*) +- if [ \( $macosx_major -eq 10 -a $macosx_minor -ge 5 \) -o $macosx_major -gt 10 ]; then + auxcflags="-pthread $auxcflags" + auxlibs="-lpthread $auxlibs" +- else +- auxcflags="-D_REENTRANT $auxcflags" +- auxlibs="-lpthread $auxlibs" +- fi + for f in $features ; do + if test "x$f" = "xrpath" ; then +- if [ \( $macosx_major -eq 10 -a $macosx_minor -ge 5 \) -o $macosx_major -gt 10 ]; then + auxlibs="-Wl,-rpath,$libdir $auxlibs" +- fi + fi + if test "x$f" = "xlibcxx" ; then + auxcflags="-stdlib=libc++ $auxcflags" diff --git a/nixpkgs/pkgs/applications/science/misc/root/sw_vers_root5.patch b/nixpkgs/pkgs/applications/science/misc/root/sw_vers_root5.patch new file mode 100644 index 000000000000..f044bed91f3d --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/root/sw_vers_root5.patch @@ -0,0 +1,104 @@ +diff --git a/build/unix/compiledata.sh b/build/unix/compiledata.sh +--- a/build/unix/compiledata.sh ++++ b/build/unix/compiledata.sh +@@ -49,7 +49,7 @@ fi + + if [ "$ARCH" = "macosx" ] || [ "$ARCH" = "macosx64" ] || \ + [ "$ARCH" = "macosxicc" ]; then +- macosx_minor=`sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2` ++ macosx_minor=7 + SOEXT="so" + if [ $macosx_minor -ge 5 ]; then + if [ "x`echo $SOFLAGS | grep -- '-install_name'`" != "x" ]; then +diff --git a/cmake/modules/SetUpMacOS.cmake b/cmake/modules/SetUpMacOS.cmake +--- a/cmake/modules/SetUpMacOS.cmake ++++ b/cmake/modules/SetUpMacOS.cmake +@@ -12,25 +12,11 @@ set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} /usr/X11R6) + #--------------------------------------------------------------------------------------------------------- + + if (CMAKE_SYSTEM_NAME MATCHES Darwin) +- EXECUTE_PROCESS(COMMAND sw_vers "-productVersion" +- COMMAND cut -d . -f 1-2 +- OUTPUT_VARIABLE MACOSX_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) +- MESSAGE(STATUS "Found a Mac OS X System ${MACOSX_VERSION}") +- EXECUTE_PROCESS(COMMAND sw_vers "-productVersion" +- COMMAND cut -d . -f 2 +- OUTPUT_VARIABLE MACOSX_MINOR OUTPUT_STRIP_TRAILING_WHITESPACE) +- +- if(MACOSX_VERSION VERSION_GREATER 10.7 AND ${CMAKE_CXX_COMPILER_ID} STREQUAL Clang) + set(libcxx ON CACHE BOOL "Build using libc++" FORCE) +- endif() + +- if(${MACOSX_MINOR} GREATER 4) + #TODO: check haveconfig and rpath -> set rpath true + #TODO: check Thread, define link command + #TODO: more stuff check configure script +- execute_process(COMMAND /usr/sbin/sysctl machdep.cpu.extfeatures OUTPUT_VARIABLE SYSCTL_OUTPUT) +- if(${SYSCTL_OUTPUT} MATCHES 64) +- MESSAGE(STATUS "Found a 64bit system") + set(ROOT_ARCHITECTURE macosx64) + SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}") + SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS} -m64") +@@ -38,28 +24,6 @@ if (CMAKE_SYSTEM_NAME MATCHES Darwin) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64") + SET(CMAKE_FORTRAN_FLAGS "${CMAKE_FORTRAN_FLAGS} -m64") +- else(${SYSCTL_OUTPUT} MATCHES 64) +- MESSAGE(STATUS "Found a 32bit system") +- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32") +- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32") +- SET(CMAKE_FORTRAN_FLAGS "${CMAKE_FORTRAN_FLAGS} -m32") +- endif(${SYSCTL_OUTPUT} MATCHES 64) +- endif() +- +- if(MACOSX_VERSION VERSION_GREATER 10.6) +- set(MACOSX_SSL_DEPRECATED ON) +- endif() +- if(MACOSX_VERSION VERSION_GREATER 10.7) +- set(MACOSX_ODBC_DEPRECATED ON) +- endif() +- if(MACOSX_VERSION VERSION_GREATER 10.8) +- set(MACOSX_GLU_DEPRECATED ON) +- set(MACOSX_KRB5_DEPRECATED ON) +- set(MACOSX_TMPNAM_DEPRECATED ON) +- endif() +- if(MACOSX_VERSION VERSION_GREATER 10.9) +- set(MACOSX_LDAP_DEPRECATED ON) +- endif() + + if (CMAKE_COMPILER_IS_GNUCXX) + message(STATUS "Found GNU compiler collection") +@@ -132,7 +96,7 @@ if (CMAKE_SYSTEM_NAME MATCHES Darwin) + endif() + + #---Set Linker flags---------------------------------------------------------------------- +- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mmacosx-version-min=${MACOSX_VERSION} -Wl,-rpath,@loader_path/../lib") ++ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,@loader_path/../lib") + + + else (CMAKE_SYSTEM_NAME MATCHES Darwin) +diff --git a/config/root-config.in b/config/root-config.in +--- a/config/root-config.in ++++ b/config/root-config.in +@@ -391,7 +391,7 @@ macosxicc) + ;; + macosx64) + # MacOS X with gcc (GNU cc v4.x) in 64 bit mode +- macosx_minor=`sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2` ++ macosx_minor=7 + # cannot find the one linked to libGraf if relocated after built + if [ $macosx_minor -le 4 ]; then + rootlibs="$rootlibs -lfreetype" +diff --git a/cint/ROOT/CMakeLists.txt b/cint/ROOT/CMakeLists.txt +--- a/cint/ROOT/CMakeLists.txt ++++ b/cint/ROOT/CMakeLists.txt +@@ -232,9 +232,7 @@ foreach(_name ${CINTINCDLLNAMES}) + DEPENDS ${HEADER_OUTPUT_PATH}/systypes.h + ) + +- if(MACOSX_MINOR GREATER 4) + set(_ExtraFlag "-D__DARWIN_UNIX03") +- endif() + + add_custom_command(OUTPUT ${OutFileName} + COMMAND cint_tmp -K -w1 -z${_name} -n${OutFileName} -D__MAKECINT__ -DG__MAKECINT ${_ExtraFlag} -c-2 -Z0 ${InFileName} ${AdditionalHeaderFiles} ${CMAKE_BINARY_DIR}/cint/cint/include/sys/types.h ${CMAKE_SOURCE_DIR}/cint/cint/lib/posix/posix.h \ No newline at end of file diff --git a/nixpkgs/pkgs/applications/science/misc/root/tests/default.nix b/nixpkgs/pkgs/applications/science/misc/root/tests/default.nix new file mode 100644 index 000000000000..9d2da2533f7f --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/root/tests/default.nix @@ -0,0 +1,4 @@ +{ callPackage }: +{ + test-thisroot = callPackage ./test-thisroot.nix { }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/root/tests/test-thisroot.nix b/nixpkgs/pkgs/applications/science/misc/root/tests/test-thisroot.nix new file mode 100644 index 000000000000..3540dde8c913 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/root/tests/test-thisroot.nix @@ -0,0 +1,49 @@ +{ lib +, runCommand +, root +, bash +, fish +, ksh +, tcsh +, zsh +}: runCommand "test-thisroot" +{ + meta = with lib; { + description = "Test for root thisroot.* sourcing"; + maintainers = unique ((with maintainers; [ ShamrockLee ]) ++ root.meta.maintainers); + }; +} + '' + set -eu -o pipefail + declare -a shellNameArray shellOutpathArray sourcefileNameArray sourceCommandArray + shellNameArray=( bash zsh tcsh fish ) + shellOutpathArray=( "${bash}" "${zsh}" "${tcsh}" "${fish}") + sourcefileNameArray=( thisroot.sh thisroot.sh thisroot.csh thisroot.fish ) + sourceCommandArray=( "source" "source" "source" "source" ) + debugFlagstrArray=( "-e" "-e" "-e" "" ) + nShellToTest="''${#shellNameArray[@]}" + if [[ "''${#shellOutpathArray[@]}" -ne "$nShellToTest" ]] \ + || [[ "''${#sourcefileNameArray[@]}" -ne "$nShellToTest" ]] \ + || [[ "''${#sourceCommandArray[@]}" -ne "$nShellToTest" ]] \ + || [[ "''${#debugFlagstrArray[@]}" -ne "$nShellToTest" ]] + then + echo "error: Lengths of test parameter arrays doesn't match." >&2 + exit 1 + fi + typePExpect="${root}/bin/root" + for ((i=0; i<$nShellToTest; ++i)); do + tryCommand="''${sourceCommandArray[$i]} \"${root}/bin/''${sourcefileNameArray[$i]}\"" + echo "Testing ''${shellNameArray[$i]} $tryCommand" + # Home directory for Fish + HOME_TEMP="$(mktemp -d temporary_home_XXXXXX)" + binPATHGot="$(PATH="''${shellOutpathArray[$i]}/bin" HOME=$HOME_TEMP "''${shellNameArray[$i]}" ''${debugFlagstrArray[$i]} -c "$tryCommand && echo \"\$PATH\"")" + rm -r "$HOME_TEMP" + typePGot="$(PATH="$binPATHGot" type -p root)" + if [[ "$typePGot" != "$typePExpect" ]]; then + echo "error: Got PATH \"$binPATHGot\", in which the root executable path is \"$typePGot\". Expect root executable path \"$typePExpect\"." >&2 + exit 1 + fi + done + echo "test-thisroot pass!" + touch "$out" + '' diff --git a/nixpkgs/pkgs/applications/science/misc/sasview/default.nix b/nixpkgs/pkgs/applications/science/misc/sasview/default.nix new file mode 100644 index 000000000000..ddc0cdfa4e5b --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/sasview/default.nix @@ -0,0 +1,77 @@ +{ lib +, python3 +, fetchFromGitHub +, fetchpatch +, wrapQtAppsHook +}: + +python3.pkgs.buildPythonApplication rec { + pname = "sasview"; + version = "5.0.4"; + + src = fetchFromGitHub { + owner = "SasView"; + repo = "sasview"; + rev = "v${version}"; + hash = "sha256-TjcchqA6GCvkr59ZgDuGglan2RxLp+aMjJk28XhvoiY="; + }; + + patches = [ + # Fix `asscalar` numpy API removal. + # See https://github.com/SasView/sasview/pull/2178 + (fetchpatch { + url = "https://github.com/SasView/sasview/commit/b1ab08c2a4e8fdade7f3e4cfecf3dfec38b8f3c5.patch"; + hash = "sha256-IH8g4XPziVAnkmBdzLH1ii8vN6kyCmOgrQlH2HEbm5o="; + }) + ]; + + # AttributeError: module 'numpy' has no attribute 'float'. + postPatch = '' + substituteInPlace src/sas/sascalc/pr/p_invertor.py \ + --replace "dtype=np.float)" "dtype=float)" + ''; + + nativeBuildInputs = [ + python3.pkgs.pyqt5 + wrapQtAppsHook + ]; + + propagatedBuildInputs = with python3.pkgs; [ + bumps + h5py + lxml + periodictable + pillow + pyparsing + pyqt5 + qt5reactor + sasmodels + scipy + setuptools + xhtml2pdf + ]; + + postBuild = '' + ${python3.interpreter} src/sas/qtgui/convertUI.py + ''; + + dontWrapQtApps = true; + + makeWrapperArgs = [ + "\${qtWrapperArgs[@]}" + ]; + + nativeCheckInputs = with python3.pkgs; [ + pytestCheckHook + unittest-xml-reporting + ]; + + pytestFlagsArray = [ "test" ]; + + meta = with lib; { + homepage = "https://www.sasview.org"; + description = "Fitting and data analysis for small angle scattering data"; + maintainers = with maintainers; [ rprospero ]; + license = licenses.bsd3; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/sasview/xhtml2pdf.nix b/nixpkgs/pkgs/applications/science/misc/sasview/xhtml2pdf.nix new file mode 100644 index 000000000000..41d15e2f1bab --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/sasview/xhtml2pdf.nix @@ -0,0 +1,33 @@ +{lib, fetchPypi, buildPythonPackage, html5lib, httplib2, nose, pillow, pypdf2, reportlab}: + +let + #xhtml2pdf specifically requires version "1.0b10" of html5lib + html5 = html5lib.overrideAttrs( oldAttrs: rec { + name = "${oldAttrs.pname}-${version}"; + version = "1.0b10"; + src = oldAttrs.src.override { + inherit version; + sha256 = "1yd068a5c00wd0ajq0hqimv7fd82lhrw0w3s01vbhy9bbd6xapqd"; + }; + }); +in + +buildPythonPackage rec { + pname = "xhtml2pdf"; + version = "0.2.1"; + + buildInputs = [html5]; + propagatedBuildInputs = [httplib2 nose pillow pypdf2 reportlab html5]; + + src = fetchPypi { + inherit pname version; + sha256 = "1n9r8zdk9gc2x539fq60bhszmd421ipj8g78zmsn3njvma1az9k1"; + }; + + meta = { + description = "A pdf converter for the ReportLab Toolkit"; + homepage = "https://github.com/xhtml2pdf/xhtml2pdf"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ rprospero ]; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/simgrid/default.nix b/nixpkgs/pkgs/applications/science/misc/simgrid/default.nix new file mode 100644 index 000000000000..2df4ce414dcf --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/simgrid/default.nix @@ -0,0 +1,125 @@ +{ stdenv, lib, fetchFromGitLab, cmake, perl, python3, boost +, fortranSupport ? false, gfortran +, buildDocumentation ? false, fig2dev, ghostscript, doxygen +, buildJavaBindings ? false, openjdk +, buildPythonBindings ? true, python3Packages +, modelCheckingSupport ? false, libunwind, libevent, elfutils # Inside elfutils: libelf and libdw +, bmfSupport ? true, eigen +, minimalBindings ? false +, debug ? false +, optimize ? (!debug) +, moreTests ? false +, withoutBin ? false +}: + +with lib; + +let + optionOnOff = option: if option then "on" else "off"; +in + +stdenv.mkDerivation rec { + pname = "simgrid"; + version = "3.34"; + + src = fetchFromGitLab { + domain = "framagit.org"; + owner = pname; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-EVTpW9jD1h8T2KRlDIqptKS6Wv1dVDfyJbXxrpsgmoo="; + }; + + propagatedBuildInputs = [ boost ]; + nativeBuildInputs = [ cmake perl python3 ] + ++ optionals fortranSupport [ gfortran ] + ++ optionals buildJavaBindings [ openjdk ] + ++ optionals buildPythonBindings [ python3Packages.pybind11 ] + ++ optionals buildDocumentation [ fig2dev ghostscript doxygen ] + ++ optionals bmfSupport [ eigen ] + ++ optionals modelCheckingSupport [ libunwind libevent elfutils ]; + + outputs = [ "out" ] + ++ optionals buildPythonBindings [ "python" ]; + + # "Release" does not work. non-debug mode is Debug compiled with optimization + cmakeBuildType = "Debug"; + cmakeFlags = [ + "-Denable_documentation=${optionOnOff buildDocumentation}" + "-Denable_java=${optionOnOff buildJavaBindings}" + "-Denable_python=${optionOnOff buildPythonBindings}" + "-DSIMGRID_PYTHON_LIBDIR=./" # prevents CMake to install in ${python3} dir + "-Denable_msg=${optionOnOff buildJavaBindings}" + "-Denable_fortran=${optionOnOff fortranSupport}" + "-Denable_model-checking=${optionOnOff modelCheckingSupport}" + "-Denable_ns3=off" + "-Denable_lua=off" + "-Denable_lib_in_jar=off" + "-Denable_maintainer_mode=off" + "-Denable_mallocators=on" + "-Denable_debug=on" + "-Denable_smpi=on" + "-Dminimal-bindings=${optionOnOff minimalBindings}" + "-Denable_smpi_ISP_testsuite=${optionOnOff moreTests}" + "-Denable_smpi_MPICH3_testsuite=${optionOnOff moreTests}" + "-Denable_compile_warnings=off" + "-Denable_compile_optimizations=${optionOnOff optimize}" + "-Denable_lto=${optionOnOff optimize}" + + # RPATH of binary /nix/store/.../bin/... contains a forbidden reference to /build/ + "-DCMAKE_SKIP_BUILD_RPATH=ON" + ]; + makeFlags = optional debug "VERBOSE=1"; + + # needed to run tests and to ensure correct shabangs in output scripts + preBuild = '' + patchShebangs .. + ''; + + # needed by tests (so libsimgrid.so is found) + preConfigure = '' + export LD_LIBRARY_PATH="$PWD/build/lib" + ''; + + doCheck = true; + preCheck = '' + # prevent the execution of tests known to fail + cat <<EOW >CTestCustom.cmake + SET(CTEST_CUSTOM_TESTS_IGNORE smpi-replay-multiple) + EOW + + # make sure tests are built in parallel (this can be long otherwise) + make tests -j $NIX_BUILD_CORES + ''; + + postInstall = lib.optionalString withoutBin '' + # remove bin from output if requested. + # having a specific bin output would be cleaner but it does not work currently (circular references) + rm -rf $out/bin + '' + lib.optionalString buildPythonBindings '' + # manually install the python binding if requested. + mkdir -p $python/lib/python${lib.versions.majorMinor python3.version}/site-packages/ + cp ./lib/simgrid.cpython*.so $python/lib/python${lib.versions.majorMinor python3.version}/site-packages/ + ''; + + # improve debuggability if requested + hardeningDisable = lib.optionals debug [ "fortify" ]; + dontStrip = debug; + + meta = { + description = "Framework for the simulation of distributed applications"; + longDescription = '' + SimGrid is a toolkit that provides core functionalities for the + simulation of distributed applications in heterogeneous distributed + environments. The specific goal of the project is to facilitate + research in the area of distributed and parallel application + scheduling on distributed computing platforms ranging from simple + network of workstations to Computational Grids. + ''; + homepage = "https://simgrid.org/"; + license = licenses.lgpl2Plus; + maintainers = with maintainers; [ mickours mpoquet ]; + platforms = platforms.all; + broken = stdenv.isDarwin; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/snakemake/default.nix b/nixpkgs/pkgs/applications/science/misc/snakemake/default.nix new file mode 100644 index 000000000000..1eded1e419c4 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/snakemake/default.nix @@ -0,0 +1,84 @@ +{ lib +, fetchFromGitHub +, python3 +}: + +python3.pkgs.buildPythonApplication rec { + pname = "snakemake"; + version = "7.29.0"; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "snakemake"; + repo = pname; + rev = "refs/tags/v${version}"; + hash = "sha256-UfUzvDo5OE1LGCBBGoDpxG96RKOaShbqu5TOOILG3AY="; + }; + + propagatedBuildInputs = with python3.pkgs; [ + appdirs + configargparse + connection-pool + datrie + docutils + gitpython + humanfriendly + jinja2 + jsonschema + nbformat + psutil + pulp + pyyaml + requests + reretry + smart-open + stopit + tabulate + throttler + toposort + wrapt + yte + ]; + + # See + # https://github.com/snakemake/snakemake/blob/main/.github/workflows/main.yml#L99 + # for the current basic test suite. Slurm, Tibanna and Tes require extra + # setup. + + nativeCheckInputs = with python3.pkgs; [ + pandas + pytestCheckHook + requests-mock + ]; + + disabledTestPaths = [ + "tests/test_slurm.py" + "tests/test_tes.py" + "tests/test_tibanna.py" + "tests/test_linting.py" + ]; + + disabledTests = [ + # Tests require network access + "test_github_issue1396" + "test_github_issue1460" + ]; + + pythonImportsCheck = [ + "snakemake" + ]; + + meta = with lib; { + homepage = "https://snakemake.github.io"; + license = licenses.mit; + description = "Python-based execution environment for make-like workflows"; + longDescription = '' + Snakemake is a workflow management system that aims to reduce the complexity of + creating workflows by providing a fast and comfortable execution environment, + together with a clean and readable specification language in Python style. Snakemake + workflows are essentially Python scripts extended by declarative code to define + rules. Rules describe how to create output files from input files. + ''; + maintainers = with maintainers; [ helkafen renatoGarcia veprbl ]; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/toil/default.nix b/nixpkgs/pkgs/applications/science/misc/toil/default.nix new file mode 100644 index 000000000000..7fc070f4f9f7 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/toil/default.nix @@ -0,0 +1,92 @@ +{ lib +, fetchFromGitHub +, python3 +, rsync +}: + +python3.pkgs.buildPythonApplication rec { + pname = "toil"; + version = "5.7.1"; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "DataBiosphere"; + repo = pname; + rev = "refs/tags/releases/${version}"; + hash = "sha256-m+XvNyzd0ly2YqKhgxezgGaCXLs3CmupJMnp5RIZqNI="; + }; + + postPatch = '' + substituteInPlace requirements.txt \ + --replace "docker>=3.7.2, <6" "docker" + ''; + + propagatedBuildInputs = with python3.pkgs; [ + addict + dill + docker + enlighten + psutil + py-tes + pypubsub + python-dateutil + pytz + pyyaml + requests + typing-extensions + ]; + + nativeCheckInputs = [ + rsync + ] ++ (with python3.pkgs; [ + boto + botocore + flask + mypy-boto3-s3 + pytestCheckHook + stubserver + ]); + + pytestFlagsArray = [ + "src/toil/test" + ]; + + pythonImportsCheck = [ + "toil" + ]; + + disabledTestPaths = [ + # Tests are reaching their timeout + "src/toil/test/docs/scriptsTest.py" + "src/toil/test/jobStores/jobStoreTest.py" + "src/toil/test/provisioners/aws/awsProvisionerTest.py" + "src/toil/test/src" + "src/toil/test/wdl" + "src/toil/test/utils/utilsTest.py" + ]; + + disabledTests = [ + # Tests fail starting with 5.7.1 + "testServices" + "testConcurrencyWithDisk" + "testJobConcurrency" + "testNestedResourcesDoNotBlock" + "test_omp_threads" + "testFileSingle" + "testFileSingle10000" + "testFileSingleCheckpoints" + "testFileSingleNonCaching" + "testFetchJobStoreFiles" + "testFetchJobStoreFilesWSymlinks" + "testJobStoreContents" + "test_cwl_on_arm" + "test_cwl_toil_kill" + ]; + + meta = with lib; { + description = "Workflow engine written in pure Python"; + homepage = "https://toil.ucsc-cgl.org/"; + license = with licenses; [ asl20 ]; + maintainers = with maintainers; [ veprbl ]; + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/tulip/default.nix b/nixpkgs/pkgs/applications/science/misc/tulip/default.nix new file mode 100644 index 000000000000..a2d3f3d9a2aa --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/tulip/default.nix @@ -0,0 +1,41 @@ +{ fetchurl, lib, stdenv, libxml2, freetype, libGLU, libGL, glew +, qtbase, wrapQtAppsHook, python3 +, cmake, libjpeg }: + +stdenv.mkDerivation rec { + pname = "tulip"; + version = "5.6.1"; + + src = fetchurl { + url = "mirror://sourceforge/auber/${pname}-${version}_src.tar.gz"; + sha256 = "1fy3nvgxv3igwc1d23zailcgigj1d0f2kkh7a5j24c0dyqz5zxmw"; + }; + + buildInputs = [ libxml2 freetype glew libGLU libGL libjpeg qtbase python3 ]; + nativeBuildInputs = [ cmake wrapQtAppsHook ]; + + qtWrapperArgs = [ ''--prefix PATH : ${lib.makeBinPath [ python3 ]}'' ]; + + # FIXME: "make check" needs Docbook's DTD 4.4, among other things. + doCheck = false; + + meta = { + broken = (stdenv.isLinux && stdenv.isAarch64); + description = "A visualization framework for the analysis and visualization of relational data"; + + longDescription = + '' Tulip is an information visualization framework dedicated to the + analysis and visualization of relational data. Tulip aims to + provide the developer with a complete library, supporting the design + of interactive information visualization applications for relational + data that can be tailored to the problems he or she is addressing. + ''; + + homepage = "http://tulip.labri.fr/"; + + license = lib.licenses.gpl3Plus; + + maintainers = [ ]; + platforms = lib.platforms.gnu ++ lib.platforms.linux; # arbitrary choice + }; +} diff --git a/nixpkgs/pkgs/applications/science/misc/vite/default.nix b/nixpkgs/pkgs/applications/science/misc/vite/default.nix new file mode 100644 index 000000000000..7d284d5eebb7 --- /dev/null +++ b/nixpkgs/pkgs/applications/science/misc/vite/default.nix @@ -0,0 +1,46 @@ +{ fetchsvn, lib, stdenv, cmake, qt4, libGLU, libGL }: + +# ViTE 1.1 has several bugs, so use the SVN version. +let + rev = "1543"; + externals = fetchsvn { + url = "svn://scm.gforge.inria.fr/svn/vite/externals"; + sha256 = "1a422n3dp72v4visq5b1i21cf8sj12903sgg5v2hah3sgk02dnyz"; + inherit rev; + }; +in +stdenv.mkDerivation { + pname = "vite"; + version = "1.2pre${rev}"; + + src = fetchsvn { + url = "svn://scm.gforge.inria.fr/svn/vite/trunk"; + sha256 = "02479dv96h29d0w0svp42mjjrxhmv8lkkqp30w7mlx5gr2g0v7lf"; + inherit rev; + }; + + preConfigure = '' + rm -rv externals + ln -sv "${externals}" externals + ''; + + nativeBuildInputs = [ cmake ]; + buildInputs = [ qt4 libGLU libGL ]; + + NIX_LDFLAGS = "-lGLU"; + + meta = { + description = "Visual Trace Explorer (ViTE), a tool to visualize execution traces"; + + longDescription = '' + ViTE is a trace explorer. It is a tool to visualize execution + traces in Pajé or OTF format for debugging and profiling + parallel or distributed applications. + ''; + + homepage = "http://vite.gforge.inria.fr/"; + license = lib.licenses.cecill20; + maintainers = with lib.maintainers; [ ]; + platforms = lib.platforms.linux; + }; +} |