-
Notifications
You must be signed in to change notification settings - Fork 2
Add post-install.sh and VipsSaveable compatibility shim #17
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
Closed
Conversation
This file contains hidden or 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
Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
In libvips 8.17.0, VipsSaveable was removed and replaced with VipsForeignSaveable flags. This commit adds a compatibility shim in CvipsShim to provide the old VipsSaveable enum by mapping to the new VipsForeignSaveable flags, ensuring code depending on the old enum continues to function with libvips 8.17+. Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
Changed the shim detection from checking VIPS_TYPE_SAVEABLE (a GObject type macro that may not be reliable) to checking for VIPS_SAVEABLE_MONO constant directly. This ensures the shim is properly activated when VipsSaveable doesn't exist in libvips 8.17.x. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
libvips 8.17.0 removed VipsSaveable and replaced it with VipsForeignSaveable (a flags enum with different semantics). This creates a compatibility layer: - CvipsShim defines the old enum values for libvips 8.17+ by mapping to VipsForeignSaveable flags - Swift code uses a typealias to UInt32 that works with both the native enum (pre-8.17) and our shim constants (8.17+) - Provides convenient static properties for all VipsSaveable values This ensures the wrapper works across libvips versions 8.15 through 8.17+ without breaking changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Swift cannot import C macros that use bitwise OR operators. libvips 8.17.3 added backwards compatibility macros for VipsSaveable, but they use OR operations which Swift rejects with "structure not supported". Solution: CvipsShim now provides inline getter functions that: - Work across all libvips versions (8.15.x through 8.17.x+) - Return the native enum values for pre-8.17 - Use the backwards compat macros if available in 8.17.3+ - Fall back to VipsForeignSaveable flags for 8.17.0-8.17.2 Swift code simply calls these functions to get the constant values, avoiding any direct dependency on enums or macros. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
210616e to
b01505d
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Changes
New Files
Updated Files
Dependency Overview
CI/Local Setup
Test plan
🌿 Generated by Terry
ℹ️ Tag @terragon-labs to ask questions and address PR feedback
📎 Task: https://www.terragonlabs.com/task/aa771467-a569-4216-93c5-af2b1872c35a