pkgsrc-WIP-changes archive

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

subread: Patch out libsysinfo for NetBSD



Module Name:	pkgsrc-wip
Committed By:	Jason Bacon <bacon%NetBSD.org@localhost>
Pushed By:	outpaddling
Date:		Wed Mar 31 17:40:53 2021 -0500
Changeset:	236b4c2820535c0a0521c97e3fb3c64893d2eb68

Modified Files:
	subread/Makefile
	subread/distinfo
	subread/patches/patch-HelperFunctions.c
	subread/patches/patch-gene-algorithms.c
	subread/patches/patch-longread-one_longread-mapping.c

Log Message:
subread: Patch out libsysinfo for NetBSD

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

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

diffstat:
 subread/Makefile                                   | 11 +----
 subread/distinfo                                   |  6 +--
 subread/patches/patch-HelperFunctions.c            | 54 ++++++++++++++++++----
 subread/patches/patch-gene-algorithms.c            |  4 +-
 .../patches/patch-longread-one_longread-mapping.c  |  8 ++--
 5 files changed, 54 insertions(+), 29 deletions(-)

diffs:
diff --git a/subread/Makefile b/subread/Makefile
index a5220f8ec5..1e2f70c856 100644
--- a/subread/Makefile
+++ b/subread/Makefile
@@ -1,16 +1,11 @@
 # $NetBSD$
-#
-###########################################################
-#                  Generated by fbsd2pkg                  #
-#              Tue Mar 30 11:06:45 CDT 2021               #
-###########################################################
 
+# Currently only for SunOS in pkgsrc
 # LIB_DEPENDS=	libsysinfo.so:devel/libsysinfo
 
 DISTNAME=	subread-2.0.2-source
 PKGNAME=	subread-2.0.2
 CATEGORIES=	biology
-# FreeBSD MASTER_SITES: SF/${PORTNAME}/${PORTNAME}-${PV}
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE:=subread/}
 
 MAINTAINER=	bacon%NetBSD.org@localhost
@@ -18,8 +13,6 @@ HOMEPAGE=	http://bioinf.wehi.edu.au/subread-package/
 COMMENT=	High-performance read alignment, quantification and mutation discovery
 LICENSE=	gnu-gpl-v3
 
-NOT_FOR_PLATFORM=	NetBSD-*-*	# Needs sysinfo
-
 USE_TOOLS+=	gmake
 
 WRKSRC=		${WRKDIR}/subread-2.0.2-source/src
@@ -28,7 +21,5 @@ CFLAGS+=	-fcommon
 MAKE_FILE=	${FILESDIR}/Makefile.pkg
 INSTALL_TARGET=	install-strip
 
-# Convert any _DEPENDS above that have a buildlink3.mk
-# .include "../..///buildlink3.mk"
 .include "../../devel/zlib/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/subread/distinfo b/subread/distinfo
index 8603943953..969a65dfc8 100644
--- a/subread/distinfo
+++ b/subread/distinfo
@@ -4,14 +4,14 @@ 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) = 88242fbc972f69b4dbdae10c6262f6f196c27784
+SHA1 (patch-HelperFunctions.c) = 8a5bc2d6b6cb33421d245feca217c114a29da8ff
 SHA1 (patch-core-junction.c) = 481cd069aa42d673bbc10c80bb9548547e808b0c
-SHA1 (patch-gene-algorithms.c) = 155434af7585db0bd70da6e38bafdd1ecc8348a3
+SHA1 (patch-gene-algorithms.c) = 27f8c0314ac2afcd676aa104a47e342ad74e0e0b
 SHA1 (patch-input-files.c) = 0e79ba9453dd150e7f4aac3be6beb8555880e082
 SHA1 (patch-long-hashtable.c) = 4d0d1a04e4306517151a5081aca507a822db4f8a
 SHA1 (patch-longread-one_LRMsorted-hashtable.c) = f08066fab9cb83da77a289b269395693ab80393a
 SHA1 (patch-longread-one_Makefile) = 48e06a0d3987aa47aefa17fcfdb395f647bc4141
-SHA1 (patch-longread-one_longread-mapping.c) = c82876cdb1186eba2afd9b684a58c8013d0143bb
+SHA1 (patch-longread-one_longread-mapping.c) = cd164a8268d73e78c3760529ec475172a8ea54ec
 SHA1 (patch-read-repair.c) = 4d7085ec8558647c7d92f5d0697b04b526496a75
 SHA1 (patch-sambam-file.c) = 007489e7140c8e22116a0748b734c636adc40896
 SHA1 (patch-sorted-hashtable.c) = 691dc605c2c5451eb7857366df4386de9813bace
diff --git a/subread/patches/patch-HelperFunctions.c b/subread/patches/patch-HelperFunctions.c
index 69554099f7..9d42ea10b3 100644
--- a/subread/patches/patch-HelperFunctions.c
+++ b/subread/patches/patch-HelperFunctions.c
@@ -1,8 +1,8 @@
 $NetBSD$
 
-# Use predefined macros
+# Work around sysinfo on BSD
 
---- HelperFunctions.c.orig	2021-03-31 00:32:33.690802862 +0000
+--- HelperFunctions.c.orig	2021-03-27 07:38:08.000000000 +0000
 +++ HelperFunctions.c
 @@ -26,7 +26,7 @@
  #include <pthread.h>
@@ -13,7 +13,21 @@ $NetBSD$
  
  #include <sys/types.h>
  #include <sys/socket.h>
-@@ -846,10 +846,10 @@ int strcmp_number(char * s1, char * s2)
+@@ -47,8 +47,13 @@
+ #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
+ #include <sys/sysinfo.h>
+ #endif
++#endif
+ #include <sys/types.h>
+ #endif
+ 
+@@ -846,10 +851,10 @@ int strcmp_number(char * s1, char * s2)
  
  int mac_str(char * str_buff)
  {
@@ -26,21 +40,41 @@ $NetBSD$
      int         mib[6], x1, ret = 1;
  	size_t		len;
      char            *buf;
-@@ -2705,7 +2705,7 @@ void main(){
+@@ -2702,22 +2707,22 @@ void main(){
+ #include <windows.h>
+ #endif
  
+-
++/* FIXME: Should this always return 0, or send back -1 as an error code? */
  int get_free_total_mem(size_t * total, size_t * free_mem){
  
 -#ifdef FREEBSD
-+#ifdef __FreeBSD__
++#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
- 
-@@ -2717,7 +2717,7 @@ int get_free_total_mem(size_t * total, s
+-#endif
+-
+-#ifdef __MINGW32__
++#elif defined(__MINGW32__)
+ 	MEMORYSTATUSEX statex;
+ 	statex.dwLength = sizeof (statex);
+ 	GlobalMemoryStatusEx (&statex);
+ 	(*total) = statex.ullTotalPhys;
  	(*free_mem) = statex.ullAvailPhys;
  	return 0;
- #else
+-#else
 -#ifdef MACOS
-+#ifdef __APPLE__
++#elif defined(__APPLE__)
      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
+     *total = sinf.totalram;
+     return 0;
+ #endif
+-#endif
+ }
+ 
+ void worker_master_mutex_init(worker_master_mutex_t * wmt, int all_workers){
diff --git a/subread/patches/patch-gene-algorithms.c b/subread/patches/patch-gene-algorithms.c
index f49326cfa6..46310a1308 100644
--- a/subread/patches/patch-gene-algorithms.c
+++ b/subread/patches/patch-gene-algorithms.c
@@ -1,6 +1,6 @@
 $NetBSD$
 
-# Use prefefined macros
+# Use predefined macros, getttimeofday()
 
 --- gene-algorithms.c.orig	2021-03-27 07:38:08.000000000 +0000
 +++ gene-algorithms.c
@@ -54,7 +54,7 @@ $NetBSD$
  double miltime(){
  	double ret;
 -	#ifdef FREEBSD
-+	#ifdef __FreeBSD__
++	#if defined(__FreeBSD__) || defined(__NetBSD__)
  		struct timeval tp;
  		struct timezone tz;
  		tz.tz_minuteswest=0;
diff --git a/subread/patches/patch-longread-one_longread-mapping.c b/subread/patches/patch-longread-one_longread-mapping.c
index 49de12641e..c74f211dbf 100644
--- a/subread/patches/patch-longread-one_longread-mapping.c
+++ b/subread/patches/patch-longread-one_longread-mapping.c
@@ -1,8 +1,8 @@
 $NetBSD$
 
-# Use predefined macros and gettimeofday()
+# Use gettimeofday() on BSD
 
---- longread-one/longread-mapping.c.orig	2021-03-30 13:58:29 UTC
+--- longread-one/longread-mapping.c.orig	2021-03-25 01:56:09.000000000 +0000
 +++ longread-one/longread-mapping.c
 @@ -30,7 +30,9 @@
  #ifndef __MINGW32__
@@ -14,11 +14,11 @@ $NetBSD$
  #include <sys/stat.h>
  #include <locale.h>
  #include <ctype.h>
-@@ -225,6 +227,17 @@ int LRMvalidate_and_init_context(LRMcontext_t ** conte
+@@ -225,6 +227,17 @@ int LRMvalidate_and_init_context(LRMcont
  #endif
  double LRMmiltime(){
  	double ret;
-+#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__NetBSD__)
 +
 +	struct timeval tp;
 +	struct timezone tz;


Home | Main Index | Thread Index | Old Index