File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 3232 name = "writable-python" ;
3333 buildCommand = ''
3434 mkdir -p $out/bin
35- mkdir -p $out/lib/python3.12/site-packages
35+ mkdir -p $out/lib/python3.12
3636
3737 # Copy Python executable from Nix store
3838 cp ${ pythonWithPackages } /bin/python3.12 $out/bin/python3.12
3939 cp ${ pythonWithPackages } /bin/python3 $out/bin/python3
4040 cp ${ pythonWithPackages } /bin/python $out/bin/python
4141
42- # Create symlinks for Python libraries
43- ln -sf ${ pythonWithPackages } /lib/python3.12/* $out/lib/python3.12/
42+ # Create symlinks for Python libraries, excluding site-packages
43+ for item in ${ pythonWithPackages } /lib/python3.12/*; do
44+ if [ "$(basename "$item")" != "site-packages" ]; then
45+ ln -sf "$item" $out/lib/python3.12/
46+ fi
47+ done
4448
45- # Make the site-packages directory writable
49+ # Create a writable site-packages directory
50+ mkdir -p $out/lib/python3.12/site-packages
4651 chmod -R 755 $out/lib/python3.12/site-packages
4752 '' ;
4853 } ;
You can’t perform that action at this time.
0 commit comments