diff --git a/math/mathmod/Portfile b/math/mathmod/Portfile new file mode 100644 index 0000000000000..89bf468c7189b --- /dev/null +++ b/math/mathmod/Portfile @@ -0,0 +1,66 @@ +# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 + +PortSystem 1.0 +PortGroup github 1.0 + +name mathmod + +categories math graphics +license GPL-2 +maintainers {@barracuda156 gmail.com:vital.had} openmaintainer +homepage https://www.facebook.com/parisolab + +description Mathematical modelling software +long_description ${name} is a mathematical modelling software that \ + visualizes and animates implicit and parametric surfaces. + +if {${os.platform} ne "darwin" || ${os.major} > 11} { + PortGroup qmake5 1.0 + + github.setup parisolab mathmod 11.1 + revision 0 + checksums rmd160 48a59ed6858a3c1543458be6ce4411746c5b0890 \ + sha256 b9d4c550d09a8ad307df90ffbb6f89e81846c5ea93d3f3e2616207a76227421a \ + size 7934535 + + compiler.cxx_standard \ + 2011 +} else { + # See: https://github.com/parisolab/mathmod/issues/243 + PortGroup qmake 1.0 + + github.setup parisolab mathmod 7.0 + revision 0 + checksums rmd160 3cd5480896ae051b7e6ff489419611aaf35e8b89 \ + sha256 5ae4d2536f1e1a2883c83b8aa2d77ab54795968aa0635133ba58ff916e7a8622 \ + size 947569 + + depends_lib-append \ + port:qjson4 + + patchfiles-append \ + patch-jiso.h.diff \ + patch-jpar.h.diff \ + patch-parametersoptions.h.diff \ + patch-ParisoMathObject.h.diff \ + patch-drawingoptions.cpp.diff \ + patch-parametersoptions.cpp.diff \ + patch-ParisoMathObject.cpp.diff \ + patch-drawingoptions.ui.diff \ + patch-commun.cpp.diff \ + patch-mathmodconfig.js.diff + + # Q_DECL_OVERRIDE is intended to be this way: + configure.cppflags-append \ + -I${prefix}/include/QJson4 \ + -DQ_DECL_OVERRIDE= + + configure.ldflags-append \ + -lQJson4 +} + +github.tarball_from archive + +destroot { + copy ${worksrcpath}/MathMod.app ${destroot}${applications_dir}/ +} diff --git a/math/mathmod/files/patch-ParisoMathObject.cpp.diff b/math/mathmod/files/patch-ParisoMathObject.cpp.diff new file mode 100644 index 0000000000000..7e05a258c0aae --- /dev/null +++ b/math/mathmod/files/patch-ParisoMathObject.cpp.diff @@ -0,0 +1,11 @@ +--- ui_modules/ParisoMathObject.cpp.orig 2018-12-19 02:50:32.000000000 +0800 ++++ ui_modules/ParisoMathObject.cpp 2024-07-03 05:23:14.000000000 +0800 +@@ -19,7 +19,7 @@ + ***************************************************************************/ + #include "ParisoMathObject.h" + #include +- ++#include + + //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// + ParisoMathObject::ParisoMathObject() diff --git a/math/mathmod/files/patch-ParisoMathObject.h.diff b/math/mathmod/files/patch-ParisoMathObject.h.diff new file mode 100644 index 0000000000000..61c80126b7d25 --- /dev/null +++ b/math/mathmod/files/patch-ParisoMathObject.h.diff @@ -0,0 +1,15 @@ +--- ui_modules/ParisoMathObject.h.orig 2018-12-19 02:50:32.000000000 +0800 ++++ ui_modules/ParisoMathObject.h 2024-07-03 05:06:52.000000000 +0800 +@@ -22,9 +22,9 @@ + #include + #include + #include +-#include +-#include +-#include ++#include ++#include ++#include + #include + #include + #include diff --git a/math/mathmod/files/patch-commun.cpp.diff b/math/mathmod/files/patch-commun.cpp.diff new file mode 100644 index 0000000000000..742f7d8bafff3 --- /dev/null +++ b/math/mathmod/files/patch-commun.cpp.diff @@ -0,0 +1,28 @@ +--- pariso/commun.cpp.orig 2018-04-02 13:49:18.000000000 +0800 ++++ pariso/commun.cpp 2024-07-03 10:52:59.000000000 +0800 +@@ -66,13 +66,13 @@ + for (uint l = 0; l < numberFeaturePoints; ++l) + { + lastRandom = lcgRandom(lastRandom); +- randomDiff[0] = (float)lastRandom / 0x100000000; ++ randomDiff[0] = (float)lastRandom / 0x100000000ll; + + lastRandom = lcgRandom(lastRandom); +- randomDiff[1] = (float)lastRandom / 0x100000000; ++ randomDiff[1] = (float)lastRandom / 0x100000000ll; + + lastRandom = lcgRandom(lastRandom); +- randomDiff[2] = (float)lastRandom / 0x100000000; ++ randomDiff[2] = (float)lastRandom / 0x100000000ll; + + featurePoint[0] = randomDiff[0] + (float)cubeX; + featurePoint[1] = randomDiff[1] + (float)cubeY; +@@ -151,7 +151,7 @@ + + int CellNoise::lcgRandom(int lastValue) + { +- return (int)((1103515245u * lastValue + 12345u) % 0x100000000u); ++ return (int)((1103515245u * lastValue + 12345u) % 0x100000000ull); + } + + int CellNoise::hash(int i, int j, int k) diff --git a/math/mathmod/files/patch-drawingoptions.cpp.diff b/math/mathmod/files/patch-drawingoptions.cpp.diff new file mode 100644 index 0000000000000..04ea576fdc61e --- /dev/null +++ b/math/mathmod/files/patch-drawingoptions.cpp.diff @@ -0,0 +1,10 @@ +--- ui_modules/drawingoptions.cpp.orig 2018-12-19 02:50:32.000000000 +0800 ++++ ui_modules/drawingoptions.cpp 2024-07-03 05:23:01.000000000 +0800 +@@ -20,6 +20,7 @@ + + #include "drawingoptions.h" + #include ++#include + + static int indexcurrentFormula=-1; + static int indexcurrentSet=0; diff --git a/math/mathmod/files/patch-drawingoptions.ui.diff b/math/mathmod/files/patch-drawingoptions.ui.diff new file mode 100644 index 0000000000000..890934ce5474e --- /dev/null +++ b/math/mathmod/files/patch-drawingoptions.ui.diff @@ -0,0 +1,32 @@ +--- ui_forms/drawingoptions.ui.orig 2018-12-19 02:50:32.000000000 +0800 ++++ ui_forms/drawingoptions.ui 2024-07-03 11:39:23.000000000 +0800 +@@ -606,9 +606,6 @@ + + true + +- +- true +- + + + Model details +@@ -6088,9 +6085,6 @@ + + Qt::LeftToRight + +- +- Predefined Sets +- + + + Predefined Sets +@@ -6219,9 +6213,6 @@ + + Qt::LeftToRight + +- +- Parameters List +- + + + Parameters List diff --git a/math/mathmod/files/patch-jiso.h.diff b/math/mathmod/files/patch-jiso.h.diff new file mode 100644 index 0000000000000..35b7fbdd7e0e4 --- /dev/null +++ b/math/mathmod/files/patch-jiso.h.diff @@ -0,0 +1,13 @@ +--- json_parser/jiso.h.orig 2018-12-19 02:50:32.000000000 +0800 ++++ json_parser/jiso.h 2024-07-03 05:06:09.000000000 +0800 +@@ -25,8 +25,8 @@ + #include + #include + #include +-#include +-#include ++#include ++#include + + class jiso + { diff --git a/math/mathmod/files/patch-jpar.h.diff b/math/mathmod/files/patch-jpar.h.diff new file mode 100644 index 0000000000000..8962a677d6b71 --- /dev/null +++ b/math/mathmod/files/patch-jpar.h.diff @@ -0,0 +1,13 @@ +--- json_parser/jpar.h.orig 2018-12-19 02:50:32.000000000 +0800 ++++ json_parser/jpar.h 2024-07-03 05:06:23.000000000 +0800 +@@ -25,8 +25,8 @@ + #include + #include + #include +-#include +-#include ++#include ++#include + #include + + class jpar diff --git a/math/mathmod/files/patch-mathmodconfig.js.diff b/math/mathmod/files/patch-mathmodconfig.js.diff new file mode 100644 index 0000000000000..2c645d0c99035 --- /dev/null +++ b/math/mathmod/files/patch-mathmodconfig.js.diff @@ -0,0 +1,14 @@ +--- mathmodconfig.js.orig 2018-04-02 13:49:18.000000000 +0800 ++++ mathmodconfig.js 2024-07-03 12:11:37.000000000 +0800 +@@ -1,8 +1,8 @@ + { + "IsoParam": { +- "MaxGrid": 250, +- "MaxPt": 4, +- "MaxTri": 6, ++ "MaxGrid": 200, ++ "MaxPt": 1, ++ "MaxTri": 2, + "NbComponent": 200, + "NbVariables": 30, + "NbConstantes": 40, diff --git a/math/mathmod/files/patch-parametersoptions.cpp.diff b/math/mathmod/files/patch-parametersoptions.cpp.diff new file mode 100644 index 0000000000000..d1a9d26dc3abe --- /dev/null +++ b/math/mathmod/files/patch-parametersoptions.cpp.diff @@ -0,0 +1,69 @@ +--- ui_modules/parametersoptions.cpp.orig 2018-12-19 02:50:32.000000000 +0800 ++++ ui_modules/parametersoptions.cpp 2024-07-03 11:51:07.000000000 +0800 +@@ -20,6 +20,8 @@ + #include + #include + #include "parametersoptions.h" ++#include ++#include + + bool MACOS = false; + +@@ -108,7 +110,7 @@ + } + + QFile file(JsonFile); +- //QFileDevice::Permissions p = file.permissions(); ++ //QFile::Permissions p = file.permissions(); + if (file.open( QIODevice::ReadOnly | QIODevice::Text ) ) + { + QJsonDocument doc = QJsonDocument::fromJson(((file.readAll()).trimmed()).replace("\n","").replace("\t","").replace("DOTSYMBOL",dotsymbol.toStdString().c_str()),&err); +@@ -157,7 +159,7 @@ + { + QFile file2(":/mathmodcollection_empty.js"); + file2.copy(JsonFileName); +- QFile::setPermissions(JsonFileName, QFileDevice::ReadOwner| QFileDevice::WriteOwner); ++ QFile::setPermissions(JsonFileName, QFile::ReadOwner| QFile::WriteOwner); + } + + QFile file(JsonFileName); +@@ -217,10 +219,10 @@ + ui.maxpt->setValue(mg); + //Styles: + QString Style = ((JConfig["Styles"].toObject())["UsedStyle"].toString()); +- ui.comboBox_2->setCurrentText(Style); ++ ui.comboBox_2->setItemText(0, Style); + //Theme: + QString theme = ((JConfig["Themes"].toObject())["UsedTheme"].toString()); +- ui.comboBox_3->setCurrentText(theme); ++ ui.comboBox_3->setItemText(0, theme); + if(theme == "MyTheme") + ui.groupBox->show(); + else +@@ -424,7 +426,7 @@ + { + QFile file3(":/mathmodconfig.js"); + file3.copy(fileconfig); +- QFile::setPermissions(fileconfig, QFileDevice::ReadOwner | QFileDevice::WriteOwner); ++ QFile::setPermissions(fileconfig, QFile::ReadOwner | QFile::WriteOwner); + } + + QFile fconf(fileconfig); +@@ -591,7 +593,7 @@ + out << str << endl; + file.close(); + file.copy(advancedmodels); +- QFile::setPermissions(advancedmodels, QFileDevice::ReadOwner | QFileDevice::WriteOwner); ++ QFile::setPermissions(advancedmodels, QFile::ReadOwner | QFile::WriteOwner); + } + + QFile mathmodfile(filecollection); +@@ -614,7 +616,7 @@ + out << str << endl; + file.close(); + file.copy(filecollection); +- QFile::setPermissions(filecollection, QFileDevice::ReadOwner | QFileDevice::WriteOwner); ++ QFile::setPermissions(filecollection, QFile::ReadOwner | QFile::WriteOwner); + } + } + void Parametersoptions::on_save_clicked() diff --git a/math/mathmod/files/patch-parametersoptions.h.diff b/math/mathmod/files/patch-parametersoptions.h.diff new file mode 100644 index 0000000000000..d80ecf24d4c07 --- /dev/null +++ b/math/mathmod/files/patch-parametersoptions.h.diff @@ -0,0 +1,11 @@ +--- ui_modules/parametersoptions.h.orig 2018-12-19 02:50:32.000000000 +0800 ++++ ui_modules/parametersoptions.h 2024-07-03 05:06:38.000000000 +0800 +@@ -25,7 +25,7 @@ + #include "../json_parser/parisodef.h" + #include + #include +-#include ++#include + #include + + struct ListeModelTexture