Skip to content
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

Convert script to Swift Package Manager library #5

Merged
merged 6 commits into from
Dec 25, 2024

Conversation

Samasaur1
Copy link

This PR converts the standalone script to a Swift Package Manager library. This is primarily so that I can add this module to Nixpkgs, because the tooling is better for SPM packages than standalone scripts. This change also allowed me to remove the manual parsing of the SDK, which both makes the build similar and also makes it easier to package

Copy link
Owner

@Logicer16 Logicer16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pr. Sorry it's taken a bit for me to get around to responding.

I love the premise of Nix and am thankful you've taken the time to help get this working.

The Swift Package Manager aspects look great. Just have some concerns around the SDK version compatibility. If anything is needed in order to get it working with Nix, please let me know.

I'll investigate why CI is failing...

Makefile Outdated Show resolved Hide resolved
Sources/pam-watchid/pam_watchid.swift Outdated Show resolved Hide resolved
This also avoids the incredibly cursed SDK parsing
The check for the Swift 6.0 compiler was trying to do the same thing
(ensure that the 15.0 SDK or newer was in use before compiling code that
would error on earlier SDKs), but there were niche situations where it
would not work.

Thanks to <https://marcoeidinger.github.io/appleframeworks/>, I have
found a framework (CoreHID) that only exists in the 15.0 SDK or newer,
so I have switched to checking if that module can be imported.
@Samasaur1
Copy link
Author

I believe I've addressed both your concerns (and I also rebased)

Makefile Show resolved Hide resolved
@Samasaur1
Copy link
Author

Done. I restored TARGET as equal to apple-macosx10.15, which is still slightly different than the previous value of apple-darwin$(shell uname -r), but both values worked with swiftc in my testing (building on aarch64 for both arm64 and x86_64)

@Logicer16 Logicer16 merged commit bb9c6ea into Logicer16:main Dec 25, 2024
6 checks passed
@Logicer16
Copy link
Owner

Perfect! Thanks again for the pr!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants