From 7d662b06701f6573fb9fb2a095fd1faf709e46c7 Mon Sep 17 00:00:00 2001 From: Hans Dijkema Date: Wed, 6 May 2026 17:19:56 +0200 Subject: [PATCH] adjust for macosx with "brewed" libraries --- play-test.rkt | 13 +++---------- private/utils.rkt | 13 ++++++++----- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/play-test.rkt b/play-test.rkt index b33b830..2b382e8 100644 --- a/play-test.rkt +++ b/play-test.rkt @@ -15,16 +15,9 @@ (define test-file4 #f) (define test-file3-id 3) (define test-file4-id 4) -(let ((os (system-type 'os))) - (when (eq? os 'unix) - (set! test-file3 (build-path tests "idyll.mp3")) - (set! test-file4 (build-path tests "idyll.flac")) - ) - (when (eq? os 'windows) - (set! test-file3 (build-path tests "idyll.mp3")) - (set! test-file4 (build-path tests "idyll.flac")) - ) - ) + +(set! test-file3 (build-path tests "idyll.mp3")) +(set! test-file4 (build-path tests "idyll.flac")) ;(define fmt (ao-mk-format 24 48000 2 'big-endian)) ;(define ao-h (ao-open-live #f fmt)) diff --git a/private/utils.rkt b/private/utils.rkt index 113bd0e..9f616ef 100644 --- a/private/utils.rkt +++ b/private/utils.rkt @@ -67,13 +67,16 @@ (do-for-f)))))) - (define (build-lib-path) - (soundlibs-directory)) + (define (build-lib-path p) + (if (eq? (system-type 'os) 'macosx) + (let ((brew-lib "/opt/homebrew/lib")) + (cons (soundlibs-directory) (cons brew-lib p))) + (cons (soundlibs-directory) p))) (define (get-lib* libs-to-try orig-libs versions) - (let ((libs-path (cons (build-lib-path) (get-lib-search-dirs)))) - (unless (soundlibs-available?) - (download-soundlibs)) + (unless (soundlibs-available?) + (download-soundlibs)) + (let ((libs-path (build-lib-path (get-lib-search-dirs)))) (if (null? libs-to-try) (begin (displayln (format "Warning: Cannot find library, tried ~a in ~a" orig-libs libs-path))