Skip to content

Commit

Permalink
fix(wavpack)
Browse files Browse the repository at this point in the history
 closes #8518
  • Loading branch information
jhheider committed Jan 28, 2025
1 parent 083bab1 commit e3da130
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
25 changes: 25 additions & 0 deletions projects/wavpack.com/5.8.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
diff --git a/cli/utils.c b/cli/utils.c
index c0d75de2..b3a0c34a 100644
--- a/cli/utils.c
+++ b/cli/utils.c
@@ -671,7 +671,9 @@ int check_break (void)

#ifdef ENABLE_THREADS

-#if defined(__GNUC__) && !defined(_WIN32)
+#if defined(__APPLE__) || defined(__NetBSD__)
+#include <sys/sysctl.h>
+#elif defined(__GNUC__) && !defined(_WIN32)
#include <sys/sysinfo.h>
#endif

@@ -683,6 +685,9 @@ int get_default_worker_threads (void)
SYSTEM_INFO sysinfo;
GetSystemInfo (&sysinfo);
num_processors = sysinfo.dwNumberOfProcessors;
+#elif defined(__APPLE__) || defined(__NetBSD__)
+ size_t len = sizeof (num_processors);
+ sysctlbyname ("hw.ncpu", &num_processors, &len, NULL, 0);
#elif defined (__GNUC__)
num_processors = get_nprocs ();
#endif
5 changes: 5 additions & 0 deletions projects/wavpack.com/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ versions:
github: dbry/WavPack/tags

build:
dependencies:
gnu.org/patch: '*' # patch v5.8.0
script:
# Patch to fix build on macOS for v5.8.0
- run: patch -p1 < props/5.8.0.patch
if: =5.8.0
- ./configure $ARGS
- make --jobs {{ hw.concurrency }} install
env:
Expand Down

0 comments on commit e3da130

Please sign in to comment.