pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

subread: Clean up and document sysinfo limitations



Module Name:	pkgsrc-wip
Committed By:	Jason Bacon <bacon%NetBSD.org@localhost>
Pushed By:	outpaddling
Date:		Wed Mar 31 19:42:17 2021 -0500
Changeset:	59adc18de35d53c6519266693a686fc850a661cb

Modified Files:
	subread/Makefile
	subread/distinfo
	subread/patches/patch-HelperFunctions.c

Log Message:
subread: Clean up and document sysinfo limitations

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=59adc18de35d53c6519266693a686fc850a661cb

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 subread/Makefile                        |  8 ++++++--
 subread/distinfo                        |  2 +-
 subread/patches/patch-HelperFunctions.c | 20 ++++++++------------
 3 files changed, 15 insertions(+), 15 deletions(-)

diffs:
diff --git a/subread/Makefile b/subread/Makefile
index 1e2f70c856..73f07895ab 100644
--- a/subread/Makefile
+++ b/subread/Makefile
@@ -1,7 +1,11 @@
 # $NetBSD$
 
-# Currently only for SunOS in pkgsrc
-# LIB_DEPENDS=	libsysinfo.so:devel/libsysinfo
+# Subread is designed to issue a warning if free memory is below 3 GiB.
+# It currently does not check free memory on NetBSD due to the lack of
+# libsysinfo.  We could add NetBSD-specific code, but it would be a better use
+# of time to port libsysinfo to NetBSD since it's useful for other apps.
+# The libsysinfo package is only for SunOS at the time of this writing.
+# FreeBSD has a libsysinfo port that may serve as a model for NetBSD.
 
 DISTNAME=	subread-2.0.2-source
 PKGNAME=	subread-2.0.2
diff --git a/subread/distinfo b/subread/distinfo
index 969a65dfc8..a12a8f6141 100644
--- a/subread/distinfo
+++ b/subread/distinfo
@@ -4,7 +4,7 @@ SHA1 (subread-2.0.2-source.tar.gz) = 1f5eb1ffa0184e21321fb9e40a9f02dd94bb19ff
 RMD160 (subread-2.0.2-source.tar.gz) = 2cfa127a7bea963d67330edee2ca226f9d6dde49
 SHA512 (subread-2.0.2-source.tar.gz) = 549164aadcd1e05cd1f941a4c10d6e19f904d2d75dae8391bbf3003a26e13f6a14cc22618662c2baf804b4d020a58e7ba0b0be9b4ff1181ad981a24270ffb64e
 Size (subread-2.0.2-source.tar.gz) = 23295764 bytes
-SHA1 (patch-HelperFunctions.c) = 8a5bc2d6b6cb33421d245feca217c114a29da8ff
+SHA1 (patch-HelperFunctions.c) = 88d0bc9955d14d62551aa7eed277f3742eb7f4b9
 SHA1 (patch-core-junction.c) = 481cd069aa42d673bbc10c80bb9548547e808b0c
 SHA1 (patch-gene-algorithms.c) = 27f8c0314ac2afcd676aa104a47e342ad74e0e0b
 SHA1 (patch-input-files.c) = 0e79ba9453dd150e7f4aac3be6beb8555880e082
diff --git a/subread/patches/patch-HelperFunctions.c b/subread/patches/patch-HelperFunctions.c
index 9d42ea10b3..62671bb7d3 100644
--- a/subread/patches/patch-HelperFunctions.c
+++ b/subread/patches/patch-HelperFunctions.c
@@ -1,6 +1,6 @@
 $NetBSD$
 
-# Work around sysinfo on BSD
+# Use predefined macros, guard sysinfo
 
 --- HelperFunctions.c.orig	2021-03-27 07:38:08.000000000 +0000
 +++ HelperFunctions.c
@@ -13,21 +13,19 @@ $NetBSD$
  
  #include <sys/types.h>
  #include <sys/socket.h>
-@@ -47,8 +47,13 @@
+@@ -47,8 +47,11 @@
  #include <sys/ioctl.h>
  #include <netinet/in.h>
  #include <net/if.h>
-+#if defined(__FreeBSD__) || defined(__NetBSD__)
-+#include <sys/param.h>
-+#include <sys/sysctl.h>
-+#else
++// Add other platforms that lack native or pkgsrc libsysinfo
++#if !defined(__FreeBSD__) && !defined(__NetBSD__)
  #include <sys/sysinfo.h>
  #endif
 +#endif
  #include <sys/types.h>
  #endif
  
-@@ -846,10 +851,10 @@ int strcmp_number(char * s1, char * s2)
+@@ -846,10 +849,10 @@ int strcmp_number(char * s1, char * s2)
  
  int mac_str(char * str_buff)
  {
@@ -40,7 +38,7 @@ $NetBSD$
      int         mib[6], x1, ret = 1;
  	size_t		len;
      char            *buf;
-@@ -2702,22 +2707,22 @@ void main(){
+@@ -2702,22 +2705,20 @@ void main(){
  #include <windows.h>
  #endif
  
@@ -49,10 +47,8 @@ $NetBSD$
  int get_free_total_mem(size_t * total, size_t * free_mem){
  
 -#ifdef FREEBSD
++// Add other platforms that lack native or pkgsrc libsysinfo
 +#if defined(__FreeBSD__) || defined(__NetBSD__)
-+    size_t	buff_size = sizeof(size_t);
-+    sysctlbyname("hw.physmem", total, &buff_size, NULL, 0);
-+    // FIXME: Still need free memory.  Return 0 once we have that.
      return -1;
 -#endif
 -
@@ -70,7 +66,7 @@ $NetBSD$
      mach_msg_type_number_t count = HOST_VM_INFO_COUNT;
      vm_statistics_data_t vmstat;
      int page_size = getpagesize();
-@@ -2737,7 +2742,6 @@ int get_free_total_mem(size_t * total, s
+@@ -2737,7 +2738,6 @@ int get_free_total_mem(size_t * total, s
      *total = sinf.totalram;
      return 0;
  #endif


Home | Main Index | Thread Index | Old Index