Created
October 2, 2024 20:21
-
-
Save dwt/26d939868315724999d5169d09297e11 to your computer and use it in GitHub Desktop.
Workaround to get closed source python ibm_db package working in nix environment
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
{ pkgs ? import <nixpkgs> {} }: | |
let | |
rosettaPkgs = | |
if pkgs.stdenv.isDarwin && pkgs.stdenv.isAarch64 | |
then pkgs.pkgsx86_64Darwin | |
else pkgs; | |
in | |
pkgs.mkShell { | |
buildInputs = [ | |
rosettaPkgs.stdenv.cc.cc.lib | |
rosettaPkgs.python312Full | |
rosettaPkgs.gcc14 | |
]; | |
shellHook = '' | |
# export DYLD_FALLBACK_LIBRARY_PATH="${rosettaPkgs.gcc14.cc.lib}/lib:$DYLD_FALLBACK_LIBRARY_PATH" | |
if test ! -d venv ; then | |
${rosettaPkgs.python312Full}/bin/python3 -m venv venv | |
source venv/bin/activate | |
pip install ibm_db | |
fi | |
source venv/bin/activate | |
python -c "import ibm_db" | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment