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

feat: Add support for building and installing sqlcipher3 with OpenSSL on macOS #134

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Bide-UK
Copy link

@Bide-UK Bide-UK commented May 27, 2024

  • Added function to set SQLCipher paths, including OpenSSL paths, to ensure headers and libraries are correctly located.
  • Updated environment variables.
  • Modified the install_pysqlcipher function to use pypa/build and pypa/installer for building and installing sqlcipher3.
  • Implemented checks for existing symlinks before creating them to avoid FileExistsError.
  • Ensured compatibility with both Intel and M1 Mac architectures by adjusting symlink creation logic.

Bide-UK and others added 2 commits May 27, 2024 11:13
… on macOS

- Added function to set SQLCipher paths, including OpenSSL paths, to ensure headers and libraries are correctly located.
- Updated environment variables.
- Modified the `install_pysqlcipher` function to use `pypa/build` and `pypa/installer` for building and installing sqlcipher3.
- Implemented checks for existing symlinks before creating them to avoid FileExistsError.
- Ensured compatibility with both Intel and M1 Mac architectures by adjusting symlink creation logic.
@dylanljones
Copy link
Owner

Hey @Bide-UK , sorry for the super late response.

Awesome work, really wanted to add Mac supported for this. Did you check if the install process is still compatible with Windows?
Otherwise, we can merge:)

If you can't test on Windows give me a little time and i will make sure it works!

@cvdub
Copy link
Contributor

cvdub commented Feb 7, 2025

Using this fork of sqlcipher3 could also be a solution. It has fully built wheels with included sqlcipher binaries for macOS, windows, and Linux.

https://github.com/laggykiller/sqlcipher3

Haven't tested it out myself though.

@dylanljones
Copy link
Owner

dylanljones commented Feb 10, 2025

Man, thank you so much for sharing @cvdub! I tested it on Windows, and it works perfectly!! I've been looking for wheels for ages, even tried making my own GitHub actions to build them but never managed to do so successfully...
This will make the installation process so much easier. Will add it to the next version ASAP!

@Bide-UK, will still check out your PR, would be a nice fallback option:)

Edit: Added the sqlcipher-wheels package as dependency, works like a charm, also in the CI tests!!

Copy link
Owner

@dylanljones dylanljones left a comment

Choose a reason for hiding this comment

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

This looks pretty nice, although i think in the current state this will break the Windows install (see comment). A simple platform check should resolve this, as most of the install process on Windows is unaffected by your PR!

@@ -104,6 +170,10 @@ def install_pysqlcipher(
print("No OPENSSL_LIBNAME environment variable found, updating `setup.py`!")
patch_pysqlcipher_setup(pysqlcipher_dir, crypto_lib)

# Set environment paths and create symlinks
Copy link
Owner

Choose a reason for hiding this comment

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

Should this be done on all platforms? It seems like at least the create_symlinks method won't work on Windows. Maybe we can just add a platform check before calling it?

dylanljones added a commit that referenced this pull request Feb 11, 2025
The sqlcipher dependency can now be installed using pre-built wheels with included sqlcipher binaries. This makes the whole library installable via pip!
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.

3 participants