From 7311f0f2944a1657c98d46ac0571ed7c18a65f28 Mon Sep 17 00:00:00 2001 From: Sebastien Perreault Date: Wed, 22 Mar 2017 08:34:56 -0400 Subject: [PATCH] initial smartos support --- README.md | 5 +++++ magic.py | 1 + 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index e223f73..7728f2a 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,11 @@ On OSX: - When using Homebrew: `brew install libmagic` - When using macports: `port install file` +On SmartOS: +- Install libmagic for source https://github.com/threatstack/libmagic/ +- Depending on your ./configure --prefix settings set your LD_LIBRARY_PATH to /lib + + ### Troubleshooting - 'MagicException: could not find any magic files!': some diff --git a/magic.py b/magic.py index a97e929..fbeca2e 100644 --- a/magic.py +++ b/magic.py @@ -162,6 +162,7 @@ def from_buffer(buffer, mime=False): 'win32': windows_dlls, 'cygwin': windows_dlls, 'linux': ['libmagic.so.1'], # fallback for some Linuxes (e.g. Alpine) where library search does not work + 'sunos5': ['libmagic.so.1'], # quick fix for smartos } platform = 'linux' if sys.platform.startswith('linux') else sys.platform for dll in platform_to_lib.get(platform, []):