summaryrefslogtreecommitdiff
path: root/biology/ugene/files/patch-src-ugenem-src-SendReportDialog.cpp
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2014-01-16 17:17:15 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2014-01-16 17:17:15 +0000
commit9dc680d0e8a2ff2a2bc6f286afbcd752ad9b22cd (patch)
tree2667c705417cc324b38836cf8c9dc0dc6b6fc635 /biology/ugene/files/patch-src-ugenem-src-SendReportDialog.cpp
parentUpdate to 2.11 (diff)
- Update to version 1.13.0 and improve FreeBSD support; it also builds
pretty cleanly with GCC v4.2, v4.6, and Clang (modulo a few warnings) - Sadly, do not use PORTDOCS: since DOCSDIR is set to be inside DATADIR, and will get appended to PLIST after @dirrm %%DATADIR%%, which upsets sanity checking tools; instead, list the docs explicitly in DISTFILES and add them to pkg-plist (guarded by %%PORTDOCS%%) Tested on: i386 (only)
Notes
Notes: svn path=/head/; revision=339938
Diffstat (limited to 'biology/ugene/files/patch-src-ugenem-src-SendReportDialog.cpp')
-rw-r--r--biology/ugene/files/patch-src-ugenem-src-SendReportDialog.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/biology/ugene/files/patch-src-ugenem-src-SendReportDialog.cpp b/biology/ugene/files/patch-src-ugenem-src-SendReportDialog.cpp
new file mode 100644
index 000000000000..7f75a92202e3
--- /dev/null
+++ b/biology/ugene/files/patch-src-ugenem-src-SendReportDialog.cpp
@@ -0,0 +1,49 @@
+--- src/ugenem/src/SendReportDialog.cpp.orig
++++ src/ugenem/src/SendReportDialog.cpp
+@@ -44,6 +44,10 @@
+ #include <Winbase.h> //for IsProcessorFeaturePresent
+ #endif
+
++#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
++#include <unistd.h> // for sysconf(3)
++#endif
++
+ #define HOST_URL "http://ugene.unipro.ru"
+ //#define HOST_URL "http://127.0.0.1"
+ #define DESTINATION_URL_KEEPER_PAGE "/crash_reports_dest.html"
+@@ -241,6 +245,8 @@ QString ReportSender::getOSVersion() {
+
+ #elif defined(Q_OS_LINUX)
+ result = "Linux";
++#elif defined(Q_OS_FREEBSD)
++ result = "FreeBSD";
+ #elif defined(Q_OS_MAC)
+ result = "Mac ";
+ switch (QSysInfo::MacintoshVersion){
+@@ -304,17 +310,15 @@ int ReportSender::getTotalPhysicalMemory
+ totalPhysicalMemory = memory_status.ullTotalPhys / (1024 * 1024);
+ }
+
+-#elif defined(Q_OS_LINUX)
+- QProcess p;
+- p.start("awk", QStringList() << "/MemTotal/ {print $2}" << "/proc/meminfo");
+- p.waitForFinished();
+- QString memory = p.readAllStandardOutput();
+- p.close();
+- bool ok = false;
+- qlonglong output_mem = memory.toLongLong(&ok);
+- if (ok) {
+- totalPhysicalMemory = output_mem / 1024;
+- }
++#elif defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
++ long pagesize = sysconf(_SC_PAGESIZE);
++ long numpages = sysconf(_SC_PHYS_PAGES);
++
++ // Assume that page size is always a multiple of 1024, so it can be
++ // divided without losing any precision. On the other hand, number
++ // of pages would hardly overflow `long' when multiplied by a small
++ // number (number of pages / 1024), so we should be safe here.
++ totalPhysicalMemory = (int)(numpages * (pagesize / 1024) / 1024);
+
+ #elif defined(Q_OS_MAC)
+ // TODO