Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mathmod: new port in math #24794

Merged
merged 1 commit into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions math/mathmod/Portfile
Original file line number Diff line number Diff line change
@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In US English we always write "modeling".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but both spellings are correct.

long_description ${name} is a mathematical modelling software that \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above.

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}/
}
11 changes: 11 additions & 0 deletions math/mathmod/files/patch-ParisoMathObject.cpp.diff
Original file line number Diff line number Diff line change
@@ -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 <qmessagebox.h>
-
+#include <QJsonParseError.h>

//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
ParisoMathObject::ParisoMathObject()
15 changes: 15 additions & 0 deletions math/mathmod/files/patch-ParisoMathObject.h.diff
Original file line number Diff line number Diff line change
@@ -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 <qfile.h>
#include <QTextStream>
#include <QStringList>
-#include <QJsonObject>
-#include <QJsonDocument>
-#include <QJsonArray>
+#include <QJsonObject.h>
+#include <QJsonDocument.h>
+#include <QJsonArray.h>
#include <QFileDialog>
#include <QDialog>
#include <QTranslator>
28 changes: 28 additions & 0 deletions math/mathmod/files/patch-commun.cpp.diff
Original file line number Diff line number Diff line change
@@ -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)
10 changes: 10 additions & 0 deletions math/mathmod/files/patch-drawingoptions.cpp.diff
Original file line number Diff line number Diff line change
@@ -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 <qmessagebox.h>
+#include <QJsonParseError.h>

static int indexcurrentFormula=-1;
static int indexcurrentSet=0;
32 changes: 32 additions & 0 deletions math/mathmod/files/patch-drawingoptions.ui.diff
Original file line number Diff line number Diff line change
@@ -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 @@
<property name="movable">
<bool>true</bool>
</property>
- <property name="tabBarAutoHide">
- <bool>true</bool>
- </property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Model details</string>
@@ -6088,9 +6085,6 @@
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
- <property name="currentText">
- <string>Predefined Sets</string>
- </property>
<item>
<property name="text">
<string>Predefined Sets</string>
@@ -6219,9 +6213,6 @@
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
- <property name="currentText">
- <string>Parameters List</string>
- </property>
<item>
<property name="text">
<string>Parameters List</string>
13 changes: 13 additions & 0 deletions math/mathmod/files/patch-jiso.h.diff
Original file line number Diff line number Diff line change
@@ -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 <string>
#include <iostream>
#include <QStringList>
-#include <QJsonArray>
-#include <QJsonObject>
+#include <QJsonArray.h>
+#include <QJsonObject.h>

class jiso
{
13 changes: 13 additions & 0 deletions math/mathmod/files/patch-jpar.h.diff
Original file line number Diff line number Diff line change
@@ -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 <string>
#include <iostream>
#include <QStringList>
-#include <QJsonArray>
-#include <QJsonObject>
+#include <QJsonArray.h>
+#include <QJsonObject.h>
#include <qthread.h>

class jpar
14 changes: 14 additions & 0 deletions math/mathmod/files/patch-mathmodconfig.js.diff
Original file line number Diff line number Diff line change
@@ -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,
69 changes: 69 additions & 0 deletions math/mathmod/files/patch-parametersoptions.cpp.diff
Original file line number Diff line number Diff line change
@@ -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 <QtGui>
#include <math.h>
#include "parametersoptions.h"
+#include <QJsonParseError.h>
+#include <QJsonDocument.h>

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()
11 changes: 11 additions & 0 deletions math/mathmod/files/patch-parametersoptions.h.diff
Original file line number Diff line number Diff line change
@@ -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 <QFileDialog>
#include <QMessageBox>
-#include <QJsonObject>
+#include <QJsonObject.h>
#include <QStyleFactory>

struct ListeModelTexture