pkgsrc-WIP-changes archive

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

sra-tools: NetBSD patch



Module Name:	pkgsrc-wip
Committed By:	Jason W. Bacon <bacon%NetBSD.org@localhost>
Pushed By:	outpaddling
Date:		Mon Aug 14 08:52:50 2023 -0500
Changeset:	832e9dd8c1395e7b5b6a07343d8897f077d9f79e

Modified Files:
	sra-tools/distinfo
	sra-tools/patches/patch-ncbi-vdb_libs_kproc_bsd_sysmgr.c
	sra-tools/patches/patch-tools_external_driver-tool_sratools.cpp

Log Message:
sra-tools: NetBSD patch

Hack in a rudimentary pthread_main_np() implementation

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

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

diffstat:
 sra-tools/distinfo                                       |  4 ++--
 sra-tools/patches/patch-ncbi-vdb_libs_kproc_bsd_sysmgr.c | 14 +++++++++-----
 .../patch-tools_external_driver-tool_sratools.cpp        | 16 +++++++++++++---
 3 files changed, 24 insertions(+), 10 deletions(-)

diffs:
diff --git a/sra-tools/distinfo b/sra-tools/distinfo
index addd2bfaed..73f4b34527 100644
--- a/sra-tools/distinfo
+++ b/sra-tools/distinfo
@@ -9,8 +9,8 @@ Size (sra-tools-3.0.6-de3d50d111874171766fd017c8cbcf92a9009263.tar.gz) = 4496331
 SHA1 (patch-build_env.cmake) = 14add56e66e5578fd0d51ce55329285e0981ac4e
 SHA1 (patch-ncbi-vdb_interfaces_os_bsd_byteswap.h) = 2ecc80bca4dd3b0c28b20d1a82c2a315d29bb02c
 SHA1 (patch-ncbi-vdb_interfaces_os_bsd_endian.h) = fa522758b0a122f5da8b3ddc2b98fff1c1d82e33
-SHA1 (patch-ncbi-vdb_libs_kproc_bsd_sysmgr.c) = 00fc8af348db6a6fe213c4023fc6e8e46c34cf2c
+SHA1 (patch-ncbi-vdb_libs_kproc_bsd_sysmgr.c) = 8f592d6b4131eba45de98cf516b940df90f550f2
 SHA1 (patch-ngs_ngs-java_CMakeLists.txt) = 44b822381fd564d045406cc926f807adae9fbe59
 SHA1 (patch-tools_external_driver-tool_build-version.cpp) = ec194aad65c86035c1fee0fe42722faf06af17fe
 SHA1 (patch-tools_external_driver-tool_build-version.hpp) = 0d50aba6b3fe1086cf0562c935f114bb117ac195
-SHA1 (patch-tools_external_driver-tool_sratools.cpp) = 2d097a61b01dca48dbefdf51369252b2f8a2ca10
+SHA1 (patch-tools_external_driver-tool_sratools.cpp) = 1f4062ebe1536ce4350db5d5c2ebaf58ad2b374d
diff --git a/sra-tools/patches/patch-ncbi-vdb_libs_kproc_bsd_sysmgr.c b/sra-tools/patches/patch-ncbi-vdb_libs_kproc_bsd_sysmgr.c
index affb65576c..337bb446f6 100644
--- a/sra-tools/patches/patch-ncbi-vdb_libs_kproc_bsd_sysmgr.c
+++ b/sra-tools/patches/patch-ncbi-vdb_libs_kproc_bsd_sysmgr.c
@@ -1,10 +1,10 @@
 $NetBSD$
 
-# Stand-in for pthread_main_np()
+# NetBSD: Add pthread_main_np() implementation
 
---- ncbi-vdb/libs/kproc/bsd/sysmgr.c.orig	2023-08-13 20:43:27.391870168 +0000
+--- ncbi-vdb/libs/kproc/bsd/sysmgr.c.orig	2023-08-12 23:35:46.000000000 +0000
 +++ ncbi-vdb/libs/kproc/bsd/sysmgr.c
-@@ -30,6 +30,19 @@
+@@ -30,6 +30,23 @@
  #include <pthread.h>
  #include <unistd.h>
  
@@ -13,11 +13,15 @@ $NetBSD$
 + */
 +
 +#ifdef __NetBSD__
++
++// This should be initialized to pthread_self() at the start of main()
++// If the thread ID of this thread is the same, then this is the main thread
++extern pthread_t _thr_main;
++
 +int	pthread_main_np(void)
 +
 +{
-+    // FIXME: Return a real value
-+    return 0;
++    return pthread_equal(pthread_self(), _thr_main);
 +}
 +#endif
 +
diff --git a/sra-tools/patches/patch-tools_external_driver-tool_sratools.cpp b/sra-tools/patches/patch-tools_external_driver-tool_sratools.cpp
index e5cdfeb1de..8440f034ac 100644
--- a/sra-tools/patches/patch-tools_external_driver-tool_sratools.cpp
+++ b/sra-tools/patches/patch-tools_external_driver-tool_sratools.cpp
@@ -1,15 +1,25 @@
 $NetBSD$
 
-# Resolve conflict
+# NetBSD: Add support for pthread_main_np()
 
---- tools/external/driver-tool/sratools.cpp.orig	2023-08-13 21:49:06.139091507 +0000
+--- tools/external/driver-tool/sratools.cpp.orig	2023-08-12 23:35:22.000000000 +0000
 +++ tools/external/driver-tool/sratools.cpp
-@@ -578,7 +578,7 @@ static int main(CommandLine const &argv)
+@@ -578,9 +578,17 @@ static int main(CommandLine const &argv)
  
  } // namespace sratools
  
 -#if BSD
++#ifdef __NetBSD__
++pthread_t	_thr_main = 0;
++#endif
++
 +#if BSD && ! MAC
  int main(int argc, char *argv[], char *envp[])
  {
++#ifdef __NetBSD__
++    _thr_main = pthread_self();
++#endif
++    
      auto const invocation = CommandLine(argc, argv, envp, nullptr);
+     return sratools::main(invocation);
+ }


Home | Main Index | Thread Index | Old Index