forked from conda-forge/pysoundfile-feedstock
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pysoundfile 0.12.1 ❄️ #1
Open
psteyer
wants to merge
8
commits into
main
Choose a base branch
from
PKG-5718_pysoundfile_0.12.1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
3ede200
pysoundfile 0.12.1
psteyer 488e47e
adding about info
psteyer 207d826
adding flags to script line
psteyer e4f7dea
skipping win and s390x
psteyer feeb0d8
removing win specific script line
psteyer f29e09b
adding unvendoring patch
psteyer 7be0197
updating patch
psteyer effecc1
adding staging channel
psteyer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
upload_channels: | ||
- sfe1ed40 | ||
channels: | ||
- https://staging.continuum.io/prefect/fs/libsndfile-feedstock/pr2/ea7b20f | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
From 67185b5da578ed5db010e3fd4f4e3972c0c7548d Mon Sep 17 00:00:00 2001 | ||
From: Udo-Peter Steyer <[email protected]> | ||
Date: Fri, 27 Sep 2024 15:04:50 -0500 | ||
Subject: [PATCH] unvendoring libsndfile | ||
|
||
--- | ||
soundfile.py | 49 ++++--------------------------------------------- | ||
1 file changed, 4 insertions(+), 45 deletions(-) | ||
|
||
diff --git a/soundfile.py b/soundfile.py | ||
index cc13192..11b9245 100644 | ||
--- a/soundfile.py | ||
+++ b/soundfile.py | ||
@@ -145,51 +145,10 @@ _ffi_types = { | ||
'int16': 'short' | ||
} | ||
|
||
-try: # packaged lib (in _soundfile_data which should be on python path) | ||
- if _sys.platform == 'darwin': | ||
- from platform import machine as _machine | ||
- _packaged_libname = 'libsndfile_' + _machine() + '.dylib' | ||
- elif _sys.platform == 'win32': | ||
- from platform import architecture as _architecture | ||
- _packaged_libname = 'libsndfile_' + _architecture()[0] + '.dll' | ||
- elif _sys.platform == 'linux': | ||
- from platform import machine as _machine | ||
- _packaged_libname = 'libsndfile_' + _machine() + '.so' | ||
- else: | ||
- raise OSError('no packaged library for this platform') | ||
- | ||
- import _soundfile_data # ImportError if this doesn't exist | ||
- _path = _os.path.dirname(_soundfile_data.__file__) # TypeError if __file__ is None | ||
- _full_path = _os.path.join(_path, _packaged_libname) | ||
- _snd = _ffi.dlopen(_full_path) # OSError if file doesn't exist or can't be loaded | ||
- | ||
-except (OSError, ImportError, TypeError): | ||
- try: # system-wide libsndfile: | ||
- _libname = _find_library('sndfile') | ||
- if _libname is None: | ||
- raise OSError('sndfile library not found using ctypes.util.find_library') | ||
- _snd = _ffi.dlopen(_libname) | ||
- | ||
- except OSError: | ||
- # Try explicit file name, if the general does not work (e.g. on nixos) | ||
- if _sys.platform == 'darwin': | ||
- _explicit_libname = 'libsndfile.dylib' | ||
- elif _sys.platform == 'win32': | ||
- _explicit_libname = 'libsndfile.dll' | ||
- elif _sys.platform == 'linux': | ||
- _explicit_libname = 'libsndfile.so' | ||
- else: | ||
- raise | ||
- | ||
- # Homebrew on Apple M1 uses a `/opt/homebrew/lib` instead of | ||
- # `/usr/local/lib`. We are making sure we pick that up. | ||
- from platform import machine as _machine | ||
- if _sys.platform == 'darwin' and _machine() == 'arm64': | ||
- _hbrew_path = '/opt/homebrew/lib/' if _os.path.isdir('/opt/homebrew/lib/') \ | ||
- else '/usr/local/lib/' | ||
- _snd = _ffi.dlopen(_os.path.join(_hbrew_path, _explicit_libname)) | ||
- else: | ||
- _snd = _ffi.dlopen(_explicit_libname) | ||
+_libname = _find_library('sndfile') | ||
+if _libname is None: | ||
+ raise OSError('sndfile library not found using ctypes.util.find_library') | ||
+_snd = _ffi.dlopen(_libname) | ||
|
||
__libsndfile_version__ = _ffi.string(_snd.sf_version_string()).decode('utf-8', 'replace') | ||
if __libsndfile_version__.startswith('libsndfile-'): | ||
-- | ||
2.39.3 (Apple Git-146) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what should be the correct libname? It might be nicer to fail if not correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This came in when forked from conda-forge. I can remove it and see if it's necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could pipe the output from this into something that checks that the text output from
print(soundfile._libname)
is correct