git: c9f9c37a4655 - main - science/opensph: Update g20190519 -> 0.3.4
Yuri Victorovich
yuri at FreeBSD.org
Sun May 30 05:38:13 UTC 2021
The branch main has been updated by yuri:
URL: https://cgit.FreeBSD.org/ports/commit/?id=c9f9c37a46558306459ec272e2c4106a0e81cc09
commit c9f9c37a46558306459ec272e2c4106a0e81cc09
Author: Yuri Victorovich <yuri at FreeBSD.org>
AuthorDate: 2021-05-30 05:14:19 +0000
Commit: Yuri Victorovich <yuri at FreeBSD.org>
CommitDate: 2021-05-30 05:38:08 +0000
science/opensph: Update g20190519 -> 0.3.4
---
science/opensph/Makefile | 43 +++++++++++++++++-----
science/opensph/distinfo | 6 +--
.../opensph/files/patch-gui_objects_Palette.cpp | 42 ---------------------
science/opensph/files/patch-lib_math_MathUtils.h | 10 -----
.../files/patch-lib_objects_geometry_Generic.h | 10 -----
.../opensph/files/patch-lib_system_Platform.cpp | 25 +++++--------
6 files changed, 46 insertions(+), 90 deletions(-)
diff --git a/science/opensph/Makefile b/science/opensph/Makefile
index ef70b3067641..489551ead559 100644
--- a/science/opensph/Makefile
+++ b/science/opensph/Makefile
@@ -1,7 +1,5 @@
PORTNAME= OpenSPH
-DISTVERSIONPREFIX= v
-DISTVERSION= g20190519
-PORTREVISION= 4
+DISTVERSION= 0.3.4
CATEGORIES= science
MAINTAINER= yuri at FreeBSD.org
@@ -10,22 +8,47 @@ COMMENT= Library and graphical tools for running SPH and N-body simulations
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
+LIB_DEPENDS= libtbb.so:devel/tbb
+TEST_DEPENDS= catch>0:devel/catch
+
USES= compiler:c++14-lang eigen:3 qmake qt:5
USE_GITLAB= yes
+USE_WX= 3.1
+
GL_SITE= https://gitlab.com
GL_ACCOUNT= sevecekp
GL_PROJECT= sph
-GL_COMMIT= 06686fa7f7307bdf8c9261e55b9875aafa278a13
-USE_WX= 3.1
+GL_COMMIT= 3939227cdcbf4e965cfb880b2e5fa3931878317d
QMAKE_SOURCE_PATH= ${WRKSRC}/sph.pro
+QMAKE_ARGS= CONFIG+=release CONFIG+=use_tbb
+#QMAKE_ARGS+= CONFIG+=use_vdb # broken, see https://gitlab.com/sevecekp/sph/-/issues/25
-BINARY_ALIAS= wx-config=${LOCALBASE}/bin/wxgtk3u-3.1-config
+CXXFLAGS+= -DSPH_CONFIG_SET
+
+TEST_WRKSRC= ${WRKDIR}/test
-PLIST_FILES= bin/opensph-cli bin/opensph
+BINARY_ALIAS= wx-config=${LOCALBASE}/bin/wxgtk3u-3.1-config
-do-install: # https://gitlab.com/sevecekp/sph/issues/2
- ${INSTALL_PROGRAM} ${BUILD_WRKSRC}/cli/launcher/launcher ${STAGEDIR}${PREFIX}/bin/opensph-cli
- ${INSTALL_PROGRAM} ${BUILD_WRKSRC}/gui/launcherGui/launcherGui ${STAGEDIR}${PREFIX}/bin/opensph
+PLIST_FILES= bin/opensph bin/opensph-cli bin/opensph-info
+
+post-patch:
+ @${FIND} ${WRKSRC} -name "*.pro" | ${XARGS} ${REINPLACE_CMD} -e ' \
+ s|^target\.path =.*|target\.path = $$$$PREFIX/bin|; \
+ s|/usr/include|$$$$PREFIX/include|; \
+ s|/usr/lib|$$$$PREFIX/lib| \
+ '
+
+do-test:
+ @${REINPLACE_CMD} -e 's|Path(.*|Path("${TEST_WRKSRC}");|' ${WRKSRC}/test/utils/Config.h
+ @${MKDIR} ${TEST_WRKSRC}
+ @cd ${_QMAKE_WRKSRC} && \
+ ${SETENV} ${QMAKE_ENV} ${_QMAKE} ${QMAKE_ARGS} \
+ ${WRKSRC}/test.pro \
+ ${QMAKE_CONFIGURE_ARGS:?--:} ${QMAKE_CONFIGURE_ARGS}
+ @cd ${BUILD_WRKSRC} && \
+ ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${_MAKE_JOBS} ${MAKE_ARGS}
+ @cd ${TEST_WRKSRC} && \
+ ${WRKSRC}/test/test
.include <bsd.port.mk>
diff --git a/science/opensph/distinfo b/science/opensph/distinfo
index 6fe9070a903e..973efc21d14f 100644
--- a/science/opensph/distinfo
+++ b/science/opensph/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1617891984
-SHA256 (sevecekp-sph-06686fa7f7307bdf8c9261e55b9875aafa278a13_GL0.tar.gz) = 61b24e739abb5004a9f400ac19944ec9df95d23a58eadb9401283dd4dcfbadf1
-SIZE (sevecekp-sph-06686fa7f7307bdf8c9261e55b9875aafa278a13_GL0.tar.gz) = 21945976
+TIMESTAMP = 1622327846
+SHA256 (sevecekp-sph-3939227cdcbf4e965cfb880b2e5fa3931878317d_GL0.tar.gz) = 2748cfdf7f4bf5679be47d0e3aa1c702dd47bc79260d2b877177309e9371a400
+SIZE (sevecekp-sph-3939227cdcbf4e965cfb880b2e5fa3931878317d_GL0.tar.gz) = 26537034
diff --git a/science/opensph/files/patch-gui_objects_Palette.cpp b/science/opensph/files/patch-gui_objects_Palette.cpp
deleted file mode 100644
index 6ecabe9f54f3..000000000000
--- a/science/opensph/files/patch-gui_objects_Palette.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
---- gui/objects/Palette.cpp.orig 2019-05-26 03:22:37 UTC
-+++ gui/objects/Palette.cpp
-@@ -2,6 +2,7 @@
- #include "io/Path.h"
- #include "objects/utility/StringUtils.h"
- #include <fstream>
-+#include <cmath>
-
- NAMESPACE_SPH_BEGIN
-
-@@ -41,12 +42,12 @@ float Palette::paletteToLinear(const float value) cons
- case PaletteScale::LINEAR:
- return value;
- case PaletteScale::LOGARITHMIC:
-- return exp10(value);
-+ return std::pow(10.,value);
- case PaletteScale::HYBRID:
- if (value > 1.f) {
-- return exp10(value - 1.f);
-+ return std::pow(10.,value - 1.f);
- } else if (value < -1.f) {
-- return -exp10(-value - 1.f);
-+ return -std::pow(10.,-value - 1.f);
- } else {
- return value;
- }
-@@ -142,12 +143,12 @@ float Palette::relativeToPalette(const float value) co
- case PaletteScale::LINEAR:
- return interpol;
- case PaletteScale::LOGARITHMIC:
-- return exp10(interpol);
-+ return std::pow(10.,interpol);
- case PaletteScale::HYBRID:
- if (interpol > 1.f) {
-- return exp10(interpol - 1.f);
-+ return std::pow(10.,interpol - 1.f);
- } else if (interpol < -1.f) {
-- return -exp10(-interpol - 1.f);
-+ return -std::pow(10.,-interpol - 1.f);
- } else {
- return interpol;
- }
diff --git a/science/opensph/files/patch-lib_math_MathUtils.h b/science/opensph/files/patch-lib_math_MathUtils.h
deleted file mode 100644
index dd2147e2431f..000000000000
--- a/science/opensph/files/patch-lib_math_MathUtils.h
+++ /dev/null
@@ -1,10 +0,0 @@
---- lib/math/MathUtils.h.orig 2019-05-26 03:08:36 UTC
-+++ lib/math/MathUtils.h
-@@ -11,6 +11,7 @@
- #include <limits>
- #include <math.h>
- #include <utility>
-+#include <cmath>
-
- NAMESPACE_SPH_BEGIN
-
diff --git a/science/opensph/files/patch-lib_objects_geometry_Generic.h b/science/opensph/files/patch-lib_objects_geometry_Generic.h
deleted file mode 100644
index 614a637a93bb..000000000000
--- a/science/opensph/files/patch-lib_objects_geometry_Generic.h
+++ /dev/null
@@ -1,10 +0,0 @@
---- lib/objects/geometry/Generic.h.orig 2019-05-26 03:09:40 UTC
-+++ lib/objects/geometry/Generic.h
-@@ -7,6 +7,7 @@
-
- #include "objects/containers/StaticArray.h"
- #include <math.h>
-+#include <cmath>
-
- NAMESPACE_SPH_BEGIN
-
diff --git a/science/opensph/files/patch-lib_system_Platform.cpp b/science/opensph/files/patch-lib_system_Platform.cpp
index ecc72a8068fc..cee58217b01e 100644
--- a/science/opensph/files/patch-lib_system_Platform.cpp
+++ b/science/opensph/files/patch-lib_system_Platform.cpp
@@ -1,23 +1,18 @@
---- lib/system/Platform.cpp.orig 2019-05-26 03:11:41 UTC
+--- lib/system/Platform.cpp.orig 2021-04-08 21:23:28 UTC
+++ lib/system/Platform.cpp
-@@ -8,14 +8,14 @@
- #include <string.h>
- #include <sys/stat.h>
- #include <sys/times.h>
--#include <sys/vtimes.h>
-+//#include <sys/vtimes.h>
- #include <unistd.h>
-
- NAMESPACE_SPH_BEGIN
+@@ -14,7 +14,11 @@ NAMESPACE_SPH_BEGIN
Expected<Path> getExecutablePath() {
char result[PATH_MAX];
-- ssize_t count = readlink("/proc/self/exe", result, PATH_MAX);
++#if defined(__FreeBSD__)
+ ssize_t count = readlink("/proc/curproc/file", result, PATH_MAX);
++#else
+ ssize_t count = readlink("/proc/self/exe", result, PATH_MAX);
++#endif
if (count != -1) {
- Path path(result);
+ Path path(std::string(result, count));
return path.parentPath();
-@@ -103,14 +103,18 @@ class CpuUsage { (private)
+@@ -102,14 +106,18 @@ class CpuUsage { (private)
public:
CpuUsage() {
@@ -37,7 +32,7 @@
file = fopen("/proc/cpuinfo", "r");
numProcessors = 0;
while (fgets(line, 128, file) != NULL) {
-@@ -118,6 +122,8 @@ class CpuUsage { (private)
+@@ -117,6 +125,8 @@ class CpuUsage { (private)
numProcessors++;
}
fclose(file);
@@ -46,7 +41,7 @@
}
Optional<Float> getUsage() {
-@@ -151,7 +157,7 @@ bool isDebuggerPresent() {
+@@ -150,7 +160,7 @@ bool isDebuggerPresent() {
char buf[1024];
bool debuggerPresent = false;
More information about the dev-commits-ports-all
mailing list