ahupp / python-magic

A python wrapper for libmagic
Other
2.66k stars 283 forks source link

Add support for NixOS #242

Closed sweh closed 2 years ago

sweh commented 3 years ago

Add support for loading libmagic dll under NixOS.

ahupp commented 3 years ago

Can this lib directory be in LD_LIBRARY_PATH? That would be a more consistent way of handling it IMO. I believe find_library already looks there.

Artturin commented 2 years ago

this pr can be closed, we have already made a nixos specific patch to hardcore the library path. https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/python-modules/python-magic/libmagic-path.patch

ahupp commented 2 years ago

will do. I wish there was a better solution that didn't require patches for every single different distribution out there.

Artturin commented 2 years ago

This is a nixos only issue due to us not adding libraries to the global LD_LIBRARY_PATH or to the standard library locations

Instead we manually patch libraries or in the case of binaries automatically add libraries to LD_LIBRARY_PATH in a wrapper

Nix builds packages in isolation from each other. This ensures that they are reproducible and don't have undeclared dependencies, so if a package works on one machine, it will also work on another. https://nixos.org