summaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2020-05-26 11:27:21 +0000
committerjoerg <joerg@pkgsrc.org>2020-05-26 11:27:21 +0000
commit1a60158ef4c4eef613d6740102e917742cc6b149 (patch)
treecd2bee9e229d246f737ff8e778aeab02cc18f0bd /graphics
parent26d25b2f59c65d3ec93ef8ad8145e646f9ed7ed8 (diff)
downloadpkgsrc-1a60158ef4c4eef613d6740102e917742cc6b149.tar.gz
Fix uvmexp use.
Diffstat (limited to 'graphics')
-rw-r--r--graphics/digikam/distinfo4
-rw-r--r--graphics/digikam/patches/patch-core_libs_kmemoryinfo_libstatgrab_kmemoryinfo_backend.cpp81
2 files changed, 81 insertions, 4 deletions
diff --git a/graphics/digikam/distinfo b/graphics/digikam/distinfo
index 2f26938d9b7..7fc12b0e2e3 100644
--- a/graphics/digikam/distinfo
+++ b/graphics/digikam/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.50 2020/05/24 06:09:39 markd Exp $
+$NetBSD: distinfo,v 1.51 2020/05/26 11:27:21 joerg Exp $
SHA1 (digikam-6.4.0-03/digikam-6.4.0.tar.xz) = 6f067b31a2109f82b2e78c89fc84bd03eab30674
RMD160 (digikam-6.4.0-03/digikam-6.4.0.tar.xz) = 818826ba0fd64785cb25297a1f4c11e0747e0eb2
@@ -6,4 +6,4 @@ SHA512 (digikam-6.4.0-03/digikam-6.4.0.tar.xz) = b3b5e9903538d110613aa872c9215f5
Size (digikam-6.4.0-03/digikam-6.4.0.tar.xz) = 340146992 bytes
SHA1 (patch-core_libs_facesengine_detection_opencvfacedetector.cpp) = e5c05583c31c4d0bfc9a2b7548a7131709a50f96
SHA1 (patch-core_libs_facesengine_recognition_dlib-dnn_dnnface_dnn__base_cv__image.h) = e3164ad2cc91232abc36b66e56806ad4a0715ee6
-SHA1 (patch-core_libs_kmemoryinfo_libstatgrab_kmemoryinfo_backend.cpp) = 2dda961ce33d535cef998a490eeb1969419cbc17
+SHA1 (patch-core_libs_kmemoryinfo_libstatgrab_kmemoryinfo_backend.cpp) = d4e4bee19424ef0af3d399822b428b274114ba46
diff --git a/graphics/digikam/patches/patch-core_libs_kmemoryinfo_libstatgrab_kmemoryinfo_backend.cpp b/graphics/digikam/patches/patch-core_libs_kmemoryinfo_libstatgrab_kmemoryinfo_backend.cpp
index 14333f671f9..16090a357a9 100644
--- a/graphics/digikam/patches/patch-core_libs_kmemoryinfo_libstatgrab_kmemoryinfo_backend.cpp
+++ b/graphics/digikam/patches/patch-core_libs_kmemoryinfo_libstatgrab_kmemoryinfo_backend.cpp
@@ -1,4 +1,4 @@
-$NetBSD: patch-core_libs_kmemoryinfo_libstatgrab_kmemoryinfo_backend.cpp,v 1.1 2019/11/17 09:11:21 markd Exp $
+$NetBSD: patch-core_libs_kmemoryinfo_libstatgrab_kmemoryinfo_backend.cpp,v 1.2 2020/05/26 11:27:21 joerg Exp $
Make memory info backend compile on NetBSD. Need to check
it actually returns the correct results.
@@ -15,7 +15,55 @@ it actually returns the correct results.
#endif
#if defined(Q_OS_OPENBSD)
#include <sys/param.h>
-@@ -430,7 +431,7 @@ int get_mem_stats(Digikam::KMemoryInfo::
+@@ -151,7 +152,28 @@ kvm_t* sg_get_kvm2()
+ }
+ #endif // (defined(Q_OS_FREEBSD) && !defined(FREEBSD5)) || defined(DFBSD)
+
+-#if defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD)
++#if defined(Q_OS_NETBSD)
++struct uvmexp_sysctl* sg_get_uvmexp()
++{
++ int mib[2];
++ static struct uvmexp_sysctl uvm;
++ size_t size = sizeof(uvm);
++// struct uvmexp* new;
++
++ mib[0] = CTL_VM;
++ mib[1] = VM_UVMEXP2;
++
++ if (sysctl(mib, 2, &uvm, &size, NULL, 0) < 0)
++ {
++ //sg_set_error_with_errno(SG_ERROR_SYSCTL, "CTL_VM.VM_UVMEXP");
++ return NULL;
++ }
++
++ return &uvm;
++}
++#endif // defined(Q_OS_NETBSD)
++
++#if defined(Q_OS_OPENBSD)
+ struct uvmexp* sg_get_uvmexp()
+ {
+ int mib[2];
+@@ -170,7 +192,7 @@ struct uvmexp* sg_get_uvmexp()
+
+ return &uvm;
+ }
+-#endif // defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD)
++#endif // defined(Q_OS_OPENBSD)
+
+ #ifdef Q_OS_HPUX
+ struct pst_KMemoryInfo::static* sg_get_pstat_static()
+@@ -229,7 +251,7 @@ int get_mem_stats(Digikam::KMemoryInfo::
+ #endif // defined(Q_OS_FREEBSD) || defined(Q_OS_DFBSD)
+
+ #if defined(Q_OS_NETBSD)
+- struct uvmexp* uvm = 0;
++ struct uvmexp_sysctl* uvm = 0;
+ #endif // defined(Q_OS_NETBSD)
+
+ #if defined(Q_OS_OPENBSD)
+@@ -430,7 +452,7 @@ int get_mem_stats(Digikam::KMemoryInfo::
data->totalRam = uvm->pagesize * uvm->npages;
data->cacheRam = uvm->pagesize * (uvm->filepages + uvm->execpages);
@@ -24,3 +72,32 @@ it actually returns the correct results.
data->usedRam = data->totalRam - data->freeRam;
return 1;
+@@ -540,7 +562,12 @@ int get_mem_stats(Digikam::KMemoryInfo::
+ #endif
+ #include <unistd.h>
+ #endif
+-#if defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD)
++#if defined(Q_OS_NETBSD)
++#include <sys/param.h>
++#include <sys/time.h>
++#include <uvm/uvm_extern.h>
++#include <unistd.h>
++#elif defined(Q_OS_OPENBSD)
+ #include <sys/param.h>
+ #include <sys/time.h>
+ #include <uvm/uvm.h>
+@@ -593,9 +620,12 @@ int get_swap_stats(Digikam::KMemoryInfo:
+
+ #endif // defined(Q_OS_FREEBSD)
+
+-#if defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD)
++#if defined(Q_OS_OPENBSD)
+ struct uvmexp* uvm = 0;
+-#endif // defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD)
++#endif // defined(Q_OS_OPENBSD)
++#if defined(Q_OS_NETBSD)
++ struct uvmexp_sysctl* uvm = 0;
++#endif // defined(Q_OS_NETBSD)
+
+ #ifdef Q_OS_WIN
+ MEMORYSTATUSEX memstats;