diff --git a/pkgs/applications/science/math/mathmod/default.nix b/pkgs/applications/science/math/mathmod/default.nix new file mode 100644 index 000000000000..01dab1dedea2 --- /dev/null +++ b/pkgs/applications/science/math/mathmod/default.nix @@ -0,0 +1,34 @@ +{ lib +, mkDerivation +, fetchFromGitHub +, qmake +}: + +mkDerivation { + pname = "mathmod"; + version = "11.1-unstable-2024-01-26"; + + src = fetchFromGitHub { + owner = "parisolab"; + repo = "mathmod"; + rev = "24d03a04c17363520ae7cf077e72a7b8684eb6fd"; + hash = "sha256-HiqHssPGqYEVZWchZRj4rFPc+xNVZk1ryl5qvFC2BmQ="; + }; + + patches = [ ./fix-paths.patch ]; + + postPatch = '' + substituteInPlace MathMod.pro --subst-var out + ''; + + nativeBuildInputs = [ qmake ]; + + meta = { + description = "A mathematical modelling software"; + homepage = "https://github.com/parisolab/mathmod"; + license = lib.licenses.gpl2Plus; + mainProgram = "MathMod"; + maintainers = with lib.maintainers; [ tomasajt ]; + platforms = lib.platforms.unix; + }; +} diff --git a/pkgs/applications/science/math/mathmod/fix-paths.patch b/pkgs/applications/science/math/mathmod/fix-paths.patch new file mode 100644 index 000000000000..b65b107882ee --- /dev/null +++ b/pkgs/applications/science/math/mathmod/fix-paths.patch @@ -0,0 +1,14 @@ +diff --git a/MathMod.pro b/MathMod.pro +index 2e2fbf1..bb8f8bd 100644 +--- a/MathMod.pro ++++ b/MathMod.pro +@@ -63,7 +63,5 @@ OTHER_FILES += \ + mathmodcollection.js \ + mathmodconfig.js + # install +-target.path = $TARGET +-sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS mathmod.pro +-sources.path = $TARGET +-INSTALLS += target sources ++target.path = @out@/bin ++INSTALLS += target diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1ad8d6d20c1c..0e11c7fa34f5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -38187,6 +38187,8 @@ with pkgs; version = "11"; }; + mathmod = libsForQt5.callPackage ../applications/science/math/mathmod { }; + metis = callPackage ../development/libraries/science/math/metis { }; nauty = callPackage ../applications/science/math/nauty { };